A physics-informed search for metric solutions to Ricci
flow, their embeddings, and visualisation

A JainDept. of Physics
Cambridge University
aj562@cam.ac.uk

C Mishra
Dept. of Computer Science
Cambridge University
cm2099@@cam.ac.uk

P Lio
Dept. of Computer Science
Cambridge University
pl219@cam.ac.uk

Abstract
Neural networks with PDEs embedded in their loss functions (physics-informed
neural networks) are employed as a function approximators to find solutions to
the Ricci flow (a curvature based evolution) of Riemannian metrics. A general
method is developed and applied to the real torus. The validity of the solution
is verified by comparing the time evolution of scalar curvature with that foundusing a standard PDE solver, which decreases to a constant value of 0 on the whole
manifold. We also consider certain solitonic solutions to the Ricci flow equation in
two real dimensions. We create visualisations of the flow by utilising an embedding
into R3 . Snapshots of highly accurate numerical evolution of the toroidal metricover time are reported. We provide guidelines on applications of this methodology
to the problem of determining Ricci flat Calabi–Yau metrics in the context of String
theory, a long standing problem in complex geometry.

1

Introduction

Ricci flow is a powerful tool for geometric analysis [1]. Formulated by Hamilton in the 80’s, Grigori
Perelman employed Ricci flow to resolve the Poincaré conjecture in 2002, proving that every simply
connected, closed manifold in three dimensions is homeomorphic to the 3-sphere [2]. Intuitively,
Ricci flow is a geometric flow of a metric on a smooth Riemannian manifold, which uniformizes
curvature of the metric. Given a smooth Riemannian manifold M, Ricci flow assigns a metric g toeach time t, dictated by the Ricci tensor of the metric, Ric(g) [3]. Mathematically put,∂t gab (x, t) = −2Ricab (g(x, t)), where a, b ∈ {1, 2, . . . , dim(M)}.

(1)

Ricci flow has deep connections to renormalization group flow, the latter appearing in the context ofbeta functions in quantum field theories, which formulate the dependency of coupling constants onenergy scales [4, 5]. The flow parameter t in Equation 1 is reminiscent of such scales. Following
decades of further advances, Ricci flow has found connections with training in neural networks, aswell as in community learning [6] and studying robustness under gradient descent perturbations [7].
Our interest in Ricci flow concerns complex geometries which appear as extra dimensions in certain
superstring theories. A class of geometries of particular interest is Calabi–Yau manifolds. One
problem of particular interest is related to the Calabi conjecture, which postulated the existence of
metrics over such geometries that have a vanishing Ricci tensor, that is, ‘Ricci flat’. This amounts
to finding the fixed point of the PDE in Equation 1- an analytic form of which remains elusive
till date. Further work in the interim resulted in numerical treatments leading to approximation
techniques [8] including the celebrated Donaldson’s algorithm [9]. Recently, machine learning wasdemonstrated to be a powerful tool in the context of approximating Ricci flat Calabi–Yau metrics forcomplex geometries with special holonomy [10, 11, 12]. These approaches rely on neural network
approximations of the metric of interest. This is reminiscent of physics inspired neural networks
36th Conference on Neural Information Processing Systems (NeurIPS 2022).

(PINNS)[13]; albeit the only data in the machine learning pipeline involves points sampled from suchgeometries. Hinted by [10], in this work we propose to formulate Ricci flow on real geometries using
PINNs. We focus on the real torus, and consider cigar solitonic solutions to the Ricci flow equation 1.

2

Using neural networks to learn Ricci flow

The flow described in 1, is the ‘unnormalised’ Ricci flow. As such the volume of the given Riemannian
manifold can evolve with time. The action of the flow is to uniformize curvature over the surface,in a way analogous to the heat equation spreading heat evenly over space. The action of Ricci
flow on the round metric of a sphere can be shown to shrink the sphere to a point [3]. We utilise
the Nash–Kuiper theorem to embed the geometries in R3 . We propose to use Physics-informed
neural networks (PINNs) to solve the Ricci flow PDE for two-dimensional real manifolds. PINNs
incorporate the PDEs, and the key symmetry/initial conditions of the system into the loss function,
meaning that once trained, the neural network will output a solution to the PDE ([14]). The metricg(x, t), on the manifold M, is approximated by the neural network gθ (x, t), where θ denotes theparameters of the neural network. The PDE residual is calculated from the Ricci flow equation 2
using the neural network approximation. From this, we define a residual loss function, Lres (θ) in
Equation 2. Similarly, residual losses associated with the required initial and symmetry conditions
are constructed. These are Linit (θ) and Lsym (θ) respectively, and they are combined to make the
PINN loss function in Equation 3. The Lsym (θ) loss can include terms which mandate a desired
symmetry. If we know the initial metric has rotational symmetry, we could enforce this by inclusing
a rotational symmetry loss function. More on this in Section 3.
N

Lres (θ) :=∂1 X
2|rθ (ti , xi )| , with rθ (t, x) := gθ (t, x) + 2Ric(gθ (t, x)) , xi ∈ M.
N i=1∂t
L(θ) = Lres (θ) + λ0 Linit (θ) + λ1 Lsym (θ).

3

(2)
(3)

Experiments

We apply the PINN approach to Ricci flow of a metric on the real 2-dimensional torus. We also
consider cigar solitonic solutions of Ricci flow as an additional study, since this has analytic solutions
to Ricci flow, hence allows the benchmarking of PINN generated solutions.
Real Torus: The torus is spanned by toroidal and poloidal angles, denoted by u and v respectively,
with u ∈ [0, 2π) and v ∈ [0, 2π). An illustration of this parameterisation is in the Figure 5 in the
Appendix A. A natural metric tensor on the real torus is,(c + a cos v)2 0g(t, u, v) =, with symmetry conditions,(4)0a2
g(t, u, v) = g(t, u + δ, v) = g(t, u, 2π − v), where δ ∈ [0, 2π),(5)which follow from the symmetries of the torus. Training is done using the Adam optimiser [15] on a
fully connected feed-forward network with three hidden layers of 16, 32 and 16 units, and Softplus
activation. We use 1000 randomly generated training points in the domain. Our implementation is in
JAX which supports efficient gradient computations, through auto differentiation. This is particularly
important in light of the fact that the Ricci tensor, Ric(g), is dependent on the derivatives of themetric function. In Figures 1 and 2, we show the evolution of the scalar curvature (which is the traceof the Ric(g)) with the flow parameter. We compare the PINN generated solution with numericalsimulations using a standard PDE solver in Mathematica. We choose c = 2 and a = 1. The solutions
bear significant resemblance to each other. The initial Ricci scalar curve matches the exact result
which can be found by taking derivatives of the initial torus metric shown in Equation 4- a useful
sanity check. The PINN and exact results have an MSE of ∼ 1.8 × 10−3 . The computation tookaround 4 hours on an i5 laptop. An additional visualisation is provided in Figure 2, where the torus
base geometry is kept the same, but the decay of curvature with time under Ricci flow is depictedwith colour representing scalar curvature. Curvature decays to a zero with time, as expected.
Cigar Soliton: An example of a two dimensional metric with an analytic solution to the Ricci flowis the cigar soliton [16]. It has metric g(x) = (1 + x2 + y 2 )−1 I2 , with its Ricci flow solution givenby:g(t, x) = (e4t + x2 + y 2 )−1 I2 , where, (x, y) ∈ R2 .
(6)2

Figure 1: Evolution of the scalar curvature under Ricci flow. A Mathematica PDE solver generated
the left figure; the right corresponds to our PINN solution. It captures the initial conditions, andshows accurate long time behaviour of vanishing scalar curvature, the fixed point of Ricci flow.

Figure 2: Colour plot of Ricci scalar of a torus evolving under Ricci flow. Here, unlike the embedding
case, the base geometry is kept the same, showcasing the decay of curvature with Ricci flow.
The PINN solution approximates the analytic metric for all values of the flow parameter, t. A three
dimensional plot of the g11 = g22 component as a function of x and y is shown on the left of Figure
4. The behaviour of the PINN generated solution bears close resemblance to the analytic solution,although over time, the MSE gradually grows. We expect high accuracies at lower times since theresiduals from the metric at t = 0 is minimised by choice of loss function (Equation 3). The minima
occurs since, as time increases, the metric values themselves decrease, and this is overcome at higher
time.

4

Metric plotting

We aim to plot the surface corresponding to the learned neural network solution to Ricci flow,gθ (t, u, v). That is, we wish to create an embedding of the manifold into R3 , and plot this for anumber of randomly generated points to give a three dimensional plot of the manifold for multiple
time durations under Ricci flow. A smooth embedding of the geometries we have considered into
Euclidean space exists ala the Nash-Kuiper embedding theorem. We denote this by f : M → Rn .
The embedding is given by a system of first-order PDEs:nX∂f α ∂f α
gij (x) =, α ∈ 1, 2, . . . , n(7)∂xi ∂xj
α=1
where index α runs over the number of dimensions for the target embedding (3 in this case). Embedding into R3 leaves a system of the three PDEs (An explicit unpacking is detailed in Appendix A), thesolution of which give f i (u, v), where i = dim(M). This embedding PDE is solved using PINNs.
The architecture, epochs and training splits are identical to Section 3. The training data consists of1000 data points with random angles on the torus at a fixed time point, with the output being thecorresponding points in R3 (embedding). We proceed by sampling random points on the base metric(ui , vi ) and applying the embedding functions f i to each of these, as(xi , yi , zi ) = (f x (ui , vi ), f y (ui , vi ), f z (ui , vi )).
3(8)These points in R can be plotted to give a visualisation of the manifold at different times during
Ricci flow. Ricci flow is diffeomorphism invariant, so the symmetries of the initial metric should
3

Figure 3: Left is a plot of the initial torus metric. Its geodesics are plotted in colours. Right is aplot of the torus Ricci flow (t = 2). Note the scale in the z direction. It does not have the required
rotational symmetry, but has been severely flattened in the z direction, as expected.

Figure 4: The figure on the left is the g11 = g22 component of the Cigar soliton solution generated by
PINN under Ricci flow. This compares favourably with the analytic solution in Equation 6. On theright we show the MSE. It is O(10−2 ) at small times, and grows under Ricci flow.
be preserved. Hence, symmetries in Equation 5 are included in the loss function through Lsym inEquation 2. By embedding 1000 random points on the torus into R3 and plotting them we get plots
for initial torus, and torus after 2 seconds of Ricci flow, seen in Figure 3. The geodesic equation issolved for trivial initial directions using this embedding, and the curves are plotted on the surface of
the initial torus, giving the expected equatorial paths. Training took 8 hours on an i5 laptop. After
two seconds, the manifold is much flatter, which is expected (notice the scale in z-direction). In the
figure on the right, the expected rotational symmetry is not seen. It was found that this plot depended
heavily on the regularisation terms applied to various loss terms (see Equation 2). In this experiment,
fixed scalars were used for these terms, but if an adaptive scheme is used (such as [17]), then a term
corresponding to rotational symmetry could be enhanced when necessary during training.

5

Discussion and Limitations

We applied a PINN technique to solve the Ricci Flow PDE for real, two-dimensional geometries.
The solution for a torus matched well to that found by a PDE solver, and had an MSE of O(10−3 )compared with the exact solution for the toroidal initial metric. The cigar soliton geometry matched
the analytic solution, with an MSE of O(10−2 ). The learned PINN metric for torus Ricci flow wasused to solve PDEs derived from the Nash–Kuiper Embedding theorem using PINNs. This allows
visualisations of manifolds under Ricci Flow, where the geodesics of the metric are considered as
spanning the base geometry. These showed elements of correctness; a toroidal figure was seen before
Ricci Flow, and a flatter manifold after Ricci Flow. Full rotational symmetry was not perfectly
replicated in either case, which are potentially due to compounding numerical errors during thecourse of Ricci flow, although the growth shows signs of stabilising. Instead of demanding rotational
symmetry from the loss function, one may embed it directly with an appropriate coordinate system.
4

This was avoided here, since choosing one can become difficult when working with larger dimensional
and/or complex manifolds. Although deliberate in our choice of architecture, the approach would
benefit from the use of equivariant architectures. Further, the magnitudes of various loss terms being
important to the final embedding, an adaptive technique such as [17] could be employed. The PINN
approach allowed simple differentiation of the neural network solution, to find relevant quantities of
Ricci tensor and curvature, as well as being beneficial in the context of Nash–Kuiper embedding. The
results presented show the promise of using PINN techniques in Ricci flow of higher dimensional
manifolds and complex manifolds, and could aid in their visualisation. The tool we have created iscompletely general, and allows adaptation to the setting of real manifolds by simply changing theinitial metric loss function.
Embeddings of complex analogue of the real torus, K3 surfaces, and Calabi–Yau manifolds are
possible, when technical aspects related to sampling and constructing meaningful loss functions [11,12, 10] are considered. See A for further details. Solutions to Ricci flow have substantial applications
in superstring theory wherein extra dimensional geometries play a crucial role in determining fourdimensional physics, enabling predictions of particle masses and coupling constants from string
theory for the first time, which rely on an accurate computation of the Ricci flat metric.

6

Broader Impact

Ricci flow is mathematically rich and a powerful tool for geometric analysis We develop and demonstrate a framework for learning solutions to Riemannian metrics, and provide special cases for real
2D geometries. This framework can be extended to complex geometries with increasing dimension,
such as the complex torus, K3 surfaces, and Calabi–Yau manifolds, which have applications insuperstring theory: enabling prdiction of particle masses. We also presenet an embedding frameworkof geometries through PINNS and this idea can aid visualisation of higher dimensional manifolds.

References[1] Bennett Chow, Peng Lu, and Lei Ni. Hamilton’s Ricci flow, volume 77. American Mathematical
Soc., 2006.
[2] Grisha Perelman. The entropy formula for the ricci flow and its geometric applications. arXiv
preprint math/0211159, 2002.
[3] Nick Sheridan, Craig Hodgson, and J. Hyam Rubinstein. Hamilton’s ricci flow. 2006.
[4] Ioannis Bakas. Renormalization group equations and geometric flows. arXiv preprint hepth/0702034, 2007.
[5] Mauro Carfora. Renormalization group and the ricci flow. Milan journal of mathematics,
78(1):319–353, 2010.
[6] Samuel Glass, Simeon Spasov, and Pietro Liò. Riccinets: Curvature-guided pruning of highperformance neural networks using ricci flow. arXiv preprint arXiv:2007.04216, 2020.
[7] Jun Chen, Tianxin Huang, Wenzhou Chen, and Yong Liu. Thoughts on the consistency between
ricci flow and neural network behavior. arXiv preprint arXiv:2111.08410, 2021.
[8] Matthew Headrick and Toby Wiseman. Numerical ricci-flat metrics on k3. Classical andQuantum Gravity, 22(23):4931, 2005.
[9] S. K. Donaldson. Some numerical results in complex differential geometry, 2005.
[10] Vishnu Jejjala, Damian Kaloni Mayorga Pena, and Challenger Mishra. Neural network approximations for calabi-yau metrics. Journal of High Energy Physics, 2022(8):1–37, 2022.
[11] Michael Douglas, Subramanian Lakshminarasimhan, and Yidi Qi. Numerical calabi-yau metrics
from holomorphic networks. In Mathematical and Scientific Machine Learning, pages 223–252.
PMLR, 2022.
5

[12] Lara B Anderson, Mathis Gerdes, James Gray, Sven Krippendorf, Nikhil Raghuram, and Fabian
Ruehle. Moduli-dependent calabi-yau and su (3)-structure metrics from machine learning.
Journal of High Energy Physics, 2021(5):1–45, 2021.
[13] Maziar Raissi, Paris Perdikaris, and George Em Karniadakis. Physics informed deep learning (part i): Data-driven solutions of nonlinear partial differential equations. arXiv preprint
arXiv:1711.10561, 2017.
[14] Salvatore Cuomo, Vincenzo Schiano di Cola, Fabio Giampaolo, Gianluigi Rozza, Maziar Raissi,
and Francesco Piccialli. Scientific machine learning through physics-informed neural networks:
Where we are and what’s next, 2022.
[15] Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International
Conference on Learning Representations, 12 2014.
[16] Peter Topping. Lectures on the Ricci Flow. London Mathematical Society Lecture Note Series.
Cambridge University Press, 2006.
[17] Zixue Xiang, Wei Peng, Xu Liu, and Wen Yao. Self-adaptive loss balanced physics-informed
neural networks. Neurocomputing, 496:11–34, 2022.
[18] Philip Candelas, Anders Martin Dale, CA Lütken, and Rolf Schimmrigk. Complete intersection
calabi-yau manifolds. Nuclear Physics B, 298(3):493–525, 1988.
[19] Tristan Hubsch. Calabi-Yau manifolds: A Bestiary for physicists. World scientific, 1992.
[20] P. Candelas, C. A. Lutken, and R. Schimmrigk. COMPLETE INTERSECTION CALABI-YAUMANIFOLDS. 2. THREE GENERATION MANIFOLDS. Nucl. Phys. B, 306:113, 1988.
[21] Philip Candelas and Rhys Davies. New Calabi-Yau Manifolds with Small Hodge Numbers.
Fortsch.Phys., 58:383–466, 2010.
[22] Philip Candelas and Andrei Constantin. Completing the Web of Z3 - Quotients of Complete
Intersection Calabi-Yau Manifolds. Fortsch.Phys., 60:345–369, 2012.
[23] Volker Braun. On Free Quotients of Complete Intersection Calabi-Yau Manifolds. JHEP,
1104:005, 2011.
[24] Andre Lukas and Challenger Mishra. Discrete symmetries of complete intersection calabi–yau
manifolds. Communications in Mathematical Physics, 379(3):847–865, 2020.
[25] Challenger Mishra. Calabi-Yau manifolds, discrete symmetries and string theory. PhD thesis,
University of Oxford, 2017.
[26] Philip Candelas and Challenger Mishra. Highly symmetric quintic quotients. Fortschritte derPhysik, 66(4):1800017, 2018.

A

Appendix

In this appendix we provide some further details on the parameterisation of the real torus, and an
explicit form of the partial differential equations that appear in the Nash-Kupier Embedding theorem.
A.1

Embeddings and Ricci flow

Torus Parametrisation
Torus curvature decay
During Ricci flow, the scalar curvature R of the torus is expected to reduce with time. Figure 2 shows
stills of an animation produced to showcase this. The animation can be found in the GitHub link.
6

Figure 5: A diagram depicting the the toroidal (u) direction, represented by the blue arrow, and thepoloidal (v) direction, represented by the red arrow

Nash-Kupier Embedding equationgij (x) =nX∂f α ∂f α
α=1A.2∂xi ∂xj, α ∈ 1, 2, . . . , n(9)Complete Intersection Calabi–Yau manifolds

Calabi–Yau manifolds are complex, Kähler manifolds with vanishing first Chern class, or equivalently,
with holonomy group SU (n), where n is the complex dimension of the manifold. A large class ofCalabi–Yau manifolds, is the Complete Intersection Calabi–Yau manifolds (CICYs) [18]. Compiledin the late 80’s, this is the first such dataset in algebraic-geometry. The ambient space for thesegeometries is a product of complex projective spaces (as opposed to Rn ). The embedding is givenby the zero locus of intersecting polynomials with degrees that satisfy certain constraints that ensure
the Calabi–Yau property [19]. The class of Complete Intersection Calabi–Yau manifolds (CICYs) inthree dimensions are a family of 7890 geometries. A CICY M is described by the vanishing locus ofa number of polynomials with co-ordinates in an ambient space A which is a product of complex
projective spaces of different dimensions. That is,
M ⊂ A = Pn1 × · · · × Pnm .
The deformation class of M is given by a configuration matrix which contains the multi-degrees
the defining polynomials. These geometries have an equivalent bipartite graph representation inwhich the polynomials and components of the projective spaces are represented as distinct types ofnodes. The multi-degrees are captured by the number of connections between a given space and apolynomial. A couple of examples follow.

The bipartite graph on the left, refers to a Calabi–Yau geometry, known as tetraquadric. The one to theright is a split of this [19], which is a geometric transition between the two manifolds. It is apparent
from these graphical representations that these geometries can admit discrete symmetries [20, 21, 22,
23, 24, 25, 26, 25] and as such are amenable to a treatment developed in this paper using equivariant
architectures.
7

Checklist
1. For all authors...
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s
contributions and scope? [Yes](b) Did you describe the limitations of your work? [Yes] See section 5, have spoken aboutlack of architecture experimentation, and a possible self-adaptive loss term multiplier.
(c) Did you discuss any potential negative societal impacts of your work? [N/A](d) Have you read the ethics review guidelines and ensured that your paper conforms tothem? [Yes]2. If you are including theoretical results...
(a) Did you state the full set of assumptions of all theoretical results? [N/A] The theoreticalresults presented are all standard results(b) Did you include complete proofs of all theoretical results? [No] Nash-Kupier embedding theorem (Equation 9) and the cigar soliton analytical equation (Equation 6) werestated and referenced. The initial Ricci scalar equation for the torus (Equation ??) is
not referenced, but this can be obtained through standard derivative manipulations, as
indicated in the text
3. If you ran experiments...
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Although I did
not find an option to send the supplementary information on the submission portal. I
am wondering if i can email this over?
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they
were chosen)? [Yes] They were included in the Experiments section.
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A](d) Did you include the total amount of compute and the type of resources used (e.g., typeof GPUs, internal cluster, or cloud provider)? [Yes]4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
(a) If your work uses existing assets, did you cite the creators? [N/A](b) Did you mention the license of the assets? [N/A](c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
Yes, there is an image of the torus angle parameterisation, as well as images of ananimation of curvature decay of the torus (a link to the animation is in the Github).
(d) Did you discuss whether and how consent was obtained from people whose data you’reusing/curating? [N/A](e) Did you discuss whether the data you are using/curating contains personally identifiable
information or offensive content? [N/A]
5. If you used crowdsourcing or conducted research with human subjects...
(a) Did you include the full text of instructions given to participants and screenshots, if
applicable? [N/A](b) Did you describe any potential participant risks, with links to Institutional Review
Board (IRB) approvals, if applicable? [N/A](c) Did you include the estimated hourly wage paid to participants and the total amountspent on participant compensation? [N/A]8