Numerical Metrics for Complete Intersection and Kreuzer-Skarke Calabi-Yau
Manifolds
Magdalena<EMAIL_ADDRESS>Andre
<EMAIL_ADDRESS>Fabian
<EMAIL_ADDRESS>Robin
<EMAIL_ADDRESS>

a Department of Mathematical Sciences, Durham University,
Upper Mountjoy Campus, Stockton Rd, Durham DH1 3LE, UK
b Department of Physics and Astronomy, Uppsala University
SE-751 20 Uppsala, Sweden
c Rudolf Peierls Centre for Theoretical Physics, University of Oxford
Parks Road, Oxford OX1 3PU, UK
d Department of Physics & Department of Mathematics, Northeastern University
360 Huntington Avenue, Boston MA 02115 United States
e The NSF AI Institute for Artificial Intelligence and Fundamental
Interactions

###### Abstract

We introduce neural networks to compute numerical Ricci-flat CY metrics for
complete intersection and Kreuzer-Skarke Calabi-Yau manifolds at any point in
Kähler and complex structure moduli space, and introduce the package cymetric
which provides computation realizations of these techniques. In particular, we
develop and computationally realize methods for point-sampling on these
manifolds. The training for the neural networks is carried out subject to a
custom loss function. The Kähler class is fixed by adding to the loss a
component which enforces the slopes of certain line bundles to match with
topological computations. Our methods are applied to various manifolds,
including the quintic manifold, the bi-cubic manifold and a Kreuzer-Skarke
manifold with Picard number two. We show that volumes and line bundle slopes
can be reliably computed from the resulting Ricci-flat metrics. We also apply
our results to compute an approximate Hermitian-Yang-Mills connection on a
specific line bundle on the bi-cubic.

###### Contents

  1. 1 Introduction
  2. 2 Mathematical background
    1. 2.1 Kähler forms and volumes
    2. 2.2 Line bundle slopes
    3. 2.3 Constructing the holomorphic top form
    4. 2.4 Transition functions
    5. 2.5 Constructing Kähler forms
    6. 2.6 Numeric integration
    7. 2.7 Sampling points on toric varieties
  3. 3 Hermitian Yang-Mills equations
    1. 3.1 Mathematical background
    2. 3.2 Computing HYM connections
  4. 4 Computational background
    1. 4.1 Introduction to neural networks
    2. 4.2 Network architectures
  5. 5 Results
    1. 5.1 Quintic
    2. 5.2 Bi-cubic
    3. 5.3 Toric hypersurface CY with Picard rank 2
  6. 6 Conclusions
  7. A Some toric geometry
    1. A.1 Fan and cones
    2. A.2 Affine patches
    3. A.3 Divisors and Stanley-Reisner ideal
    4. A.4 Line bundles and sections

##  1 Introduction

Calabi-Yau (CY) manifolds arise naturally in the context of string theory [1].
Since the 80’s mathematicians and physicists alike have invested a
considerable amount of effort in constructing and studying these spaces. By
now there are different popular constructions, such as complete intersection
hypersurfaces in products of complex projective spaces [2, 3] (CICYs) or more
generally in toric varieties [4]. CY three-folds constructed as hypersurfaces
in toric four-folds are described by about half a billion reflexive polytopes
(giving rise to many more topologically inequivalent manifolds) which we refer
to as the Kreuzer-Skarke (KS) list. Much is known about their topological
properties [5], such as their Chern classes, intersection numbers or Hodge
numbers. However, objects related to their differential geometry are much less
accessible. Crucially, the unique Ricci-flat metric on CY manifolds,
established by theorems of Calabi and Yau [6, 7], is not known in analytic
form on any compact CY three-folds, although there is recent progress for K3
[8, 9].

The Ricci-flat CY metric is of great importance to string theorists, as it
plays a role in many computations connecting string theory with observable
physics. For example, the CY metric is required to compute the physical Yukawa
couplings from string theory [10] or it can be used to study the physics which
arises along geodesics in moduli space, in order to probe the swampland
distance conjecture [11]. There are also mathematical problems which benefit
from knowledge of the CY metric, including the SYZ-conjecture [12], which aims
to formalize mirror symmetry [13]. Given the importance of the Ricci-flat CY
metric and the lack of analytic expressions it is only natural that several
numerical approximation schemes have been advanced.

The first work in this direction relies on an algorithm set up by Donaldson
[14]. This algorithm starts with an approximation for the Kähler potential
underlying the Ricci-flat metric which is of the form
$K=\ln(s^{i}h_{ij}\bar{s}^{j})$, where $s^{i}$ is a basis of sections for the
$k^{\rm th}$ power, $L^{k}$, of a line bundle $L\rightarrow X$ on the CY
manifold $X$ and $h_{ij}$ is a hermitian matrix. For each power $k$ an optimal
$K$ for a balanced metric can be found by a fix point method which computes
the matrix $h_{ij}$. In the limit $k\rightarrow\infty$ these balanced metrics
converge to the Ricci-flat CY metric with Kähler class proportional to
$c_{1}(L)$. However, the scaling of this method with $k$ makes it unsuitable
for cases without a high degree of symmetry or with many Kähler parameters. In
particular the algorithm requires a factorial increase in training data for a
sub-linear increase in accuracy [15]. Another practical problem is the link
between the Kähler class of the Ricci-flat metric and the lattice-valued
quantity $c_{1}(L)$ which makes it difficult to determine the metric as a
function of the Kähler parameters. Nevertheless this method has been used to
construct metrics on the Fermat Quintic and other selected examples [16, 17,
18, 15, 19] and it has been generalized to compute the solution to the
Hermitian Yang-Mills equation for vector bundles [20, 21].

Scaling of the computation can be improved by a method which relies on energy
functionals [22]. This method also uses a polynomial Ansatz for the (Kähler
potential of the) metric and optimizes polynomial coefficients by minimizing
the deviation from the Monge-Ampere equation. In this way solutions with
exponential accuracy are found. The
code111https://people.brandeis.edu/~headrick/Mathematica/index.html published
alongside [22] for CY hypersurfaces of Fermat type has been used in more
recent studies [23] to investigate the curvature near conifold points and to
accurately predict the Kähler potential [24].

The rise of neural networks as universal function approximators has renewed
the interest in finding numerical approximations of the Ricci-flat CY metric.
They have been introduced into the string community in 2017 [25, 26, 27, 28]
(see [29] for a review) and by now several directions to use techniques from
machine learning for CY metrics have emerged. Decision trees and curve fitting
have been used to bootstrap from low order Donaldson algorithms to more
accurate solutions [30]. Holomorphic neural networks are shown to learn much
better and more efficient approximations of the Kähler potential [31].
Finally, the metric has been learned directly with neural networks in [32, 33,
34]. These new numerical methods allowed for direct application to test the
swampland distance conjecture [11] and construct solutions to the Hermitian
Yang-Mills equation of line bundles [35].

While there has been progress on methods to compute the Ricci-flat CY metric,
there are also still considerable gaps, particularly in view of providing
systematic tools, for example in the context of string model building.
Computations have been carried out for select manifolds but a tool which
covers large classes of CY manifolds is still missing. This requires an
understanding of some theoretical problems, including methods for point
sampling on more general CY manifolds. A critical issue for applications is
the ability to compute the CY metric at a given point in moduli space. This
tends to be straightforward for the complex structure moduli which are usually
fixed by the equations defining the CY manifold. For a single Kähler modulus,
$h^{1,1}(X)=1$, such as for the quintic, things are simple as every Kähler
class can be obtained by a simple re-scaling of the metric. For $h^{1,1}(X)>1$
this is no longer the case and care has to be taken in order to fix the
desired Kähler class. While this is possible in principle by Donaldson’s
algorithm, computations are limited by inefficiency and the limitation to
integral Kähler classes. On the other hand, neural network approaches which
solely rely on minimizing the Ricci curvature or deviations form the Monge-
Ampere equation produce a metric with an unspecified Kähler class.

The point of the present paper is to address and resolve these issues and
provide both the theoretical background and practical methods for machine-
learning Ricci-flat CY metrics at a prescribed point in moduli space, for any
manifold from both the CICY and KS lists. This is extending and detailing
recent work by the authors in Ref. [34]. In particular, we explain how the
problem of point sampling on CY manifolds can be solved for both CICY and KS
manifolds. We fix the Kähler class by matching line bundles slopes, which can
be computed using topological data only, to their numeric evaluation using the
approximate CY metric. For a given Kähler class $J$, we consider a basis
$L_{i}$ of line bundles and determine the slopes $\mu_{J}(L_{i})$ using a
topological formula for the slope. During training, a numerical version of
these slopes, $\mu^{\rm num}_{J}(L_{i})$, is computed by numerical integration
and a loss proportional to $\sum_{i}||\mu_{J}(L_{i})-\mu^{\rm
num}_{J}(L_{i})||_{n}$ is added to the loss function. As we will demonstrate,
this does indeed lead to an approximately Ricci-flat metric with the
prescribed Kähler class $J$.

These methods are realized in the cymetric package which provides machine
learning tools to find the Ricci-flat CY metric for both CICY and KS
manifolds. The package is written in Python and Mathematica [36]. The point
generation relies on routines from NumPy [37] and SciPy [38]. For KS manifolds
we employ routines implemented in SageMath [39] and Mathematica [36]. The
neural networks are implemented and optimized with TensorFlow [40], which has
efficient tracing for several nested gradient operations using automatic
differentiation. The code is available at:

https://github.com/pythoncymetric/cymetric

Open source software has led to rapid progress in machine learning. Our goal
is to achieve similarly remarkable results by open sourcing our code and we
welcome contributions. There are several other open source packages developed
by the string theory community. For example the toric geometry routines of
SageMath [41] are an integral part of the workflow for many geometers. They
rely on the PALP package [42] and are a necessary component in our toric point
generator. The functionality of these routines have recently been expanded by
the CYTools package [43]. Other open source packages include Stringvacua [44]
for studying potentials from string theory and cohomcalc [45] and pyCICY [46]
for studying line bundle cohomologies over CY manifolds.

The outline of this paper is as follows. In Section 2 we will introduce the
necessary mathematical background for the computation of the Ricci-flat
metric, including the construction of the required Kähler forms and a
discussion of the point sampling method. Section 3 reviews some basic
mathematics related to Hermitian Yang-Mills (HYM) connections on line bundles
and the numerical method for computing such connections. A brief review of
neural networks and an overview of our network architecture follows in Section
4. Results for the quintic and bi-cubic CY manifolds as well as a Picard
number two manifold from the KS list are presented in Section 5 and we
conclude in Section 6. Some useful details on toric geometry are collection in
Appendix A.

##  2 Mathematical background

In this section we introduce the mathematical background necessary for
sampling points and calculating the CY metric. For our procedure we require
three pieces of data for the CY manifold: Its holomorphic top form $\Omega$, a
Kähler form $J$, and the affine patches plus their transition functions. We
collect here only the important formulas and provide an introduction to the
necessary concepts in toric geometry in Appendix A. We adopt a convention
where we add subscripts FS and CY to quantities related to the ambient Fubini-
Study metric (such as the metric itself or its associated Kähler potential)
and the Ricci-flat Calabi-Yau metric, respectively. We do not distinguish
between ambient space quantities and their restriction to not clutter the
notation further and it should be clear from the context which one we are
referring to. Our formulae will be written for CY three-folds, but they
generalize straight-forwardly to CY $n$-folds222The code supports CY manifolds
up to complex dimension 6.. We denote real CY coordinates on a patch by
$y^{m}$, where $m=1,\ldots,6$ and their complex counterparts by

$z^{a}=\frac{1}{\sqrt{2}}(y^{a}+iy^{a+3})\;,\qquad\bar{z}^{\bar{a}}=\frac{1}{\sqrt{2}}(y^{\bar{a}}-iy^{\bar{a}+3})\;,$
(2.1)

where $a,b=1,2,3$ and $\bar{a},\bar{b}=1,2,3$.

###  2.1 Kähler forms and volumes

To start, let us recall that the Calabi-Yau theorem [6, 7] states that any
Kähler $n$-fold $X$ with $c_{1}(TX)=0$ and given Kähler form $J^{\prime}$
admits a unique Ricci-flat metric $g_{\text{CY}}$ (simple called CY metric, in
the following) whose associated Kähler form $J_{\text{CY}}$ (where
$J_{\text{CY},a\bar{b}}=ig_{\text{CY},a\bar{b}}$) is in the same cohomology
class as $J^{\prime}$. For three-folds, the Kähler form $J_{\text{CY}}$ can be
determined from the Monge-Ampère equation

$\displaystyle J_{\text{CY}}\wedge J_{\text{CY}}\wedge
J_{\text{CY}}=\kappa\;\Omega\wedge\bar{\Omega}\qquad\text{ with }\qquad
J_{\text{CY}}=J^{\prime}+\partial\bar{\partial}\phi$ (2.2)

where $\phi$ is a real function on $X$ and $\kappa$ is a complex constant
(which may depend on moduli). The Kähler form $J^{\prime}$ can be any
reference Kähler form in the given Kähler class but for our purposes we will
take this to be the obvious Kähler form induced from the toric ambient space,
that is the (generalized) Fubini-Study Kähler form denoted by
$J^{\prime}=J_{\text{FS}}$. It is usually written as a linear combination

$J_{\text{FS}}=t^{\alpha}J_{\alpha}$ (2.3)

relative to a basis $J_{\alpha}$ of $(1,1)$ forms (where
$\alpha=1,\ldots,h^{1,1}(X)$), also obtained by restriction from the ambient
space. Here $t^{\alpha}$ are the Kähler parameters. Associated to these Kähler
forms are volume forms

$\text{d}\text{Vol}_{\text{CY}}=\frac{1}{3!}J_{\text{CY}}^{3}\;,\qquad\text{d}\text{Vol}_{\text{FS}}=\frac{1}{3!}J_{\text{FS}}^{3}$
(2.4)

and a typical problem is to compute integrals of the type

$\int_{X}\text{d}\text{Vol}_{\text{CY}}\,f=\int_{X}d^{6}y\sqrt{g_{\text{CY}}}\,f\;,\qquad\int_{X}\text{d}\text{Vol}_{\text{FS}}\,f=\int_{X}d^{6}y\sqrt{g_{\text{FS}}}\,f\;,$
(2.5)

for some function $f$ on $X$. We will see later how numerical results for
$J_{\text{CY}}$ (and, indeed, $J_{\text{FS}}$) can be used the evaluate such
integrals numerically. For the constant function $f=1$ this computes the CY
volume

${\rm
Vol}_{\text{CY}}=\int_{X}\text{d}\text{Vol}_{\text{CY}}=\int_{X}\text{d}\text{Vol}_{\text{FS}}=\frac{1}{3!}d_{\alpha\beta\gamma}t^{\alpha}t^{\beta}t^{\gamma}$
(2.6)

which coincides for the CY and FS measure (provided, as we assume,
$J_{\text{CY}}$ and $J_{\text{FS}}$ are in the same cohomology class) and
which can be computed from the topological formula on the RHS of Eq. (2.6).
Here

$d_{\alpha\beta\gamma}=\int_{X}J_{\alpha}\wedge J_{\beta}\wedge J_{\gamma}\;.$
(2.7)

are the intersection numbers which are known or can be computed for CICY and
KS manifolds (our package does this automatically in the background).

###  2.2 Line bundle slopes

Another interesting set of quantities which can be used for the same purpose
(and we will, in fact, use it to enforce the correct Kähler class during
training) is the slope of line bundles. The line bundle $L\rightarrow X$ with
first Chern class $c_{1}(L)=[k^{\alpha}J_{\alpha}]$ is denoted by ${\cal
O}_{X}(k)$ and its slope $\mu_{t}({\cal O}_{X}(k))$ is defined by

$\mu_{t}({\cal O}_{X}(k))=\int_{X}J_{\text{CY}}^{2}\wedge c_{1}({\cal
O}_{X}(k))=\int_{X}J_{\text{FS}}^{2}\wedge c_{1}({\cal
O}_{X}(k))=d_{\alpha\beta\gamma}\,t^{\alpha}t^{\beta}k^{\gamma}\;.$ (2.8)

Note, since the intersection numbers are known, this can be computed from the
Kähler parameters $t^{\alpha}$ and the line bundle integers $k^{\alpha}$. On
the other hand, introducing the curvature $F_{\text{FS}}$ and corresponding
sources $\rho_{\text{FS}}$ and $\rho_{\text{CY}}$ on ${\cal O}_{X}(k)$ by

$F_{\text{FS}}=2\pi
ik^{\alpha}J_{\alpha}\;,\quad\rho_{\text{FS}}=\frac{1}{2}g_{\text{FS}}^{a\bar{b}}F_{\text{FS},a\bar{b}}\;,\quad\rho_{\text{CY}}=\frac{1}{2}g_{\text{CY}}^{a\bar{b}}F_{\text{FS},a\bar{b}}$
(2.9)

the slope can also be computed from

$\mu_{t}({\cal
O}_{X}(k))=\frac{2}{\pi}\int_{X}\text{d}\text{Vol}_{\text{CY}}\;\rho_{\text{CY}}=\frac{2}{\pi}\int_{X}\text{d}\text{Vol}_{\text{FS}}\;\rho_{\text{FS}}\;.$
(2.10)

The numerical version of this equation will be used to compute line bundle
slopes during training and compute the slope loss, in order to enforce the
correct Kähler class.

###  2.3 Constructing the holomorphic top form

For our purposes we need to construct the holomorphic top form $\Omega$
explicitly and we follow a method described, for example, in Ref. [47]. For a
KS manifold, defined as a hypersurface in a toric four-fold ${\cal A}$ there
are always four affine ambient space coordinates $z^{\mu}$, where
$\mu=1,\ldots,4$, on a given patch, explicitly given in Eq. (A.5). Then we can
write the holomorphic $(3,0)$ form as

$\displaystyle\Omega=\frac{dz_{1}\wedge dz_{2}\wedge dz_{3}}{\partial
p/\partial z_{4}}\,,$ (2.11)

where the coordinate $z_{4}$ in the denominator should be replaced by a
solution $z_{4}=z_{4}(z_{a})$, where $a=1,2,3$, of the defining equation
$p(z_{\mu})=0$. More details on the underlying toric geometry can be found in
Appendix A.

For the case of CICYs, defined in an ambient space ${\cal
A}=\mathbb{P}^{n_{1}}\times\cdots\times\mathbb{P}^{n_{h}}$ with total
dimension $d=\sum_{\alpha=1}^{h}n_{\alpha}$, we have affine coordinates
$z^{\mu}$, where $\mu=1,\ldots,d$ on each patch. From these we can choose
three coordinates, $z^{a}$, where $a=1,2,3$, to parameterize the CY patch
while the remaining $K=d-3$ coordinates $z^{q}$ can be written as functions
$z^{q}=z^{q}(z^{a})$ by using the $K$ defining polynomials $p_{r}$ of the
CICY. The holomorphic $(3,0)$-form can then be written in terms of the
determinant of the $K\times K$ matrix $\partial p_{r}/\partial z^{q}$, and is
explicitly given by

$\displaystyle\Omega=\frac{dz_{1}\wedge dz_{2}\wedge dz_{3}}{\det(\partial
p_{r}/\partial z^{q})}\,,$ (2.12)

where the coordinates $z^{q}$ in the denominator have to be replaced by the
solutions $z^{q}=z^{q}(z^{a})$.

Given $\Omega$, it is useful to introduce the associated volume form

$\text{d}\text{Vol}_{\Omega}=\Omega\wedge\bar{\Omega}\qquad\Rightarrow\qquad\text{d}\text{Vol}_{\text{CY}}=\frac{\kappa}{3!}\text{d}\text{Vol}_{\Omega}$
(2.13)

which, by virtue of the Monge-Ampere equation (2.2) and Eq. (2.4), is
proportional to the CY volume form. This means, while the Ricci-flat CY metric
is not known in analytic form, its associated volume form can be constructed
explicitly (up to a constant) from the expression for $\Omega$.

###  2.4 Transition functions

The affine coordinates on each patch of the (toric) ambient space patch can be
written as functions of the homogeneous coordinates $x^{i}$ (see Appendix
A.2). More explicitly, for two ambient space patches $\mathcal{U}$ and
$\mathcal{V}$ with affine coordinates $u^{\mu}$ and $v^{\nu}$,333We caution
the reader not to confuse these affine coordinates $u^{\mu}$ and $v^{\nu}$
with e.g. the toric vertices discussed in other sections of this paper.
respectively, we can write $u^{\mu}=u^{\mu}(x)$ and $v^{\nu}=v^{\nu}(x)$,
where the functional dependence on $x^{i}$ is determined by Eq. (A.5). The
transition function $v^{\nu}=v^{\nu}(u)$ can then be determined by matching
the functional dependence on the homogeneous coordinates $x^{i}$. The
transition matrix is then simply the Jacobian of this coordinate change,

$\displaystyle(T_{\mathcal{U}\mathcal{V}})^{\nu}_{\mu}=\frac{\partial
v^{\nu}}{\partial u^{\mu}}\,.$ (2.14)

###  2.5 Constructing Kähler forms

A further ingredient which we require explicitly is a basis $J_{\alpha}$,
where $\alpha=1,2,\ldots,h^{1,1}(X)$, of the second cohomology. This basis is
used to expand the Kähler form $J_{\text{FS}}$, as in Eq. (2.3), and the
Kähler parameters $t^{\alpha}$ are defined relative to it. For simplicity, we
focus on simplicial Kähler cones so that the $J_{\alpha}$ can be chosen as
generators of the Kähler cone. Since these forms can be written in terms of
Kähler potentials

$J_{\alpha}=\frac{i}{2\pi}\partial\bar{\partial}\ln({\mathcal{K}}_{\alpha})$
(2.15)

our task is to construct the ${\mathcal{K}}_{\alpha}$.

Recall that for our purpose of machine learning Ricci-flat metrics on Calabi-
Yau manifold, we need to generate a random sample of points on the CY. We will
discuss the method we employ for this task in section 2.7. A crucial point of
this method is that it relies on properties of Fubini-Study Kähler metrics on
projective spaces. Our objective in this section will therefore be to
construct Kähler potentials ${\mathcal{K}}_{\alpha}$ that are ’inherited’ from
ambient space FS potentials on $\mathbbm{P}^{r_{\alpha}}$, both for CICY and
KS CY manifolds. For CICYs, this is a standard procedure. For KS CYs, the
construction is less well known, so we will explain it in some detail.

As already mentioned above (and as explained in detail in Appendix A), toric
ambient spaces have homogeneous coordinates $x_{i}$. The vanishing locus of
each $x_{i}$ defines a toric divisor, $D_{i}=\\{x_{i}=0\\}$, and the Kähler
cone generators $J_{\alpha}$ may be expanded in terms of these divisors:
$J_{\alpha}=\sum_{i}c_{i}^{\alpha}D_{i}$. Denoting the space of sections of
the (nef) line bundle dual to the Kähler cone divisors by $H^{0}(J_{\alpha})$,
we can find a monomial basis $\\{s_{j}^{(\alpha)}\\}$,
$j=0,1,\ldots,h^{0}(J_{\alpha})-1:=r_{\alpha}$, of this space following the
methods outlined in appendix A.4. In particular, we have

$s_{j}^{(\alpha)}=\prod_{i=1}^{n}x_{i}^{\langle
v_{i},w_{j}\rangle+c_{i}^{\alpha}}$ (2.16)

which expresses the monomial basis in terms of the toric coordinates. Here
$v_{i}$ are the vectors (1d cones) in the fan associated to the toric variety,
and subsets of these span the top-dimensional cones of the lattice. The
$w_{j}$ are vectors in the dual top-dimensional cones of the dual lattice (see
Appendix A for the precise definition). In general, the dimension of the space
of sections will be larger than the number of homogeneous coordinates $x_{i}$,
implying that (2.16) is a non-invertible relation.

By the theorem quoted in Section A.4 below (A.8), nef divisors are basepoint
free, which means that the sections of the nef line bundles cannot all vanish
at any given point in the CY. This means that the section monomials
$s_{j}^{(\alpha)}$ can serve as homogeneous coordinates of a projective space
$\mathbbm{P}^{r_{\alpha}}$. The relations given in eq. 2.16 thus correspond to
maps $\Phi_{\alpha}$ mapping the toric coordinates onto the coordinates of
these projective spaces

$\displaystyle\Phi_{\alpha}:~{}~{}~{}[x_{0}:x_{1}:\ldots]\quad\to\quad[s_{0}^{(\alpha)}:s_{1}^{(\alpha)}:\ldots:s_{r_{\alpha}}^{(\alpha)}]\,.$
(2.17)

Note that in the case where the ambient space is just a projective space
$\mathbbm{P}^{n}$ with homogeneous coordinates $[x_{0}:x_{1}:\ldots:x_{n}]$,
the sections of the Kähler cone generator are simply the monomials
$s_{i}=x_{i}$, and the morphism $\Phi$ would be the identity map
$\Phi:\mathbbm{P}^{n}\to\mathbbm{P}^{n}$. In the toric case, the map is non-
trivial, and there are typically more sections than toric coordinates, leading
to relations among the sections.

We can express the Kähler potentials ${\mathcal{K}}_{\alpha}$ via inner
products of sections,

$\displaystyle{\mathcal{K}}_{\alpha}=s^{(\alpha)\,\dagger}\cdot\mathbbm{1}\cdot
s^{(\alpha)}\,,$ (2.18)

where $s^{(\alpha)}$ is a vector containing the section monomials
$s_{i}^{(\alpha)}$ and $\mathbbm{1}$ is the identity matrix (or, as a
straightforward generalization, any hermitian, non-degenerate matrix) and the
inner product induces a notion of orthogonality (with respect to this matrix)
as will become important later when sampling points. Since not all
$s_{\alpha}$ can vanish simultaneously, ${\cal K}$ is positive and is, hence,
a sensible argument of the logarithm in Eq. (2.15). In the case of a
projective ambient space $\mathbbm{P}^{n}$, this Kähler potential is the
standard FS Kähler potential

$\displaystyle{\mathcal{K}}_{\text{FS}}=\sum_{i=0}^{n}|s_{i}|^{2}=\sum_{i=0}^{n}|x_{i}|^{2}\,.$
(2.19)

More generally, inserting the monomial basis (2.16) in (2.18), one obtains a
Kähler potential for each Kähler cone generator of a toric variety

$\displaystyle{\mathcal{K}}_{\alpha}=\sum_{j}|s_{j}^{(\alpha)}|^{2}=\sum_{\stackrel{{\scriptstyle
w_{j}\in M}}{{\langle v_{i},w_{j}\rangle+c_{i}^{\alpha}\geq 0~{}\forall
i}}}\left|\prod_{i}x_{i}^{\langle
v_{i},w_{j}\rangle+c_{i}^{\alpha}}\right|^{2}\,,$ (2.20)

expressed in terms of homogeneous coordinates. Clearly, this is the standard
Fubini-Study metric on the projectivized section space
$\mathbb{P}H^{0}(J_{\alpha})\cong\mathbbm{P}^{r_{\alpha}}$, pulled back to the
toric variety using the map (2.17).

The above results for ${\mathcal{K}}_{\alpha}$ are written in terms of the
toric coordinates $x_{i}$. However, for subsequent applications we would like
to re-write these in terms of affine coordinates on a patch. This can be
accomplished by dividing ${\mathcal{K}}_{\alpha}$ in (2.20) by a monomial that
is nowhere-vanishing in a chosen patch and that has the same toric scaling as
${\mathcal{K}}_{\alpha}$. It turns out, there is a unique choice
$s_{*}^{(\alpha)}$ for this non-vanishing monomial, specified by a vector
$w_{*}$ in the dual lattice. Let us denote the affine patches by
$\mathcal{U}_{r}$, with associated dual cones $\sigma_{r}^{*}$ and affine
coordinates $z_{\mu}$. Then, as discussed in Appendix A.2, the toric and
affine coordinates are related by

$\displaystyle z_{\mu}=\prod_{i=1}^{n}x_{i}^{\langle v_{i},w_{\mu}\rangle}\,.$
(2.21)

We introduce the index set $\mathcal{I}_{r}$ of indices whose associated
coordinates generate the corresponding cone $\sigma_{r}$. Then, the affine
version of ${\mathcal{K}}_{\alpha}$ in (2.20) in a patch $\mathcal{U}_{r}$ can
be written as

$\displaystyle{\mathcal{K}}_{\alpha,\;r}=1+\sum_{\stackrel{{\scriptstyle
w_{j}\in\sigma_{r}^{*}}}{{\langle v_{i},w_{j}+w_{*}\rangle+c_{i}^{\alpha}\geq
0~{}\forall
i\not\in\mathcal{I}_{r}}}}\left|\prod_{\mu\in\mathcal{I}_{r}}z_{\mu}^{\langle
v_{\mu},w_{j}\rangle}\right|^{2}\,,$ (2.22)

where the dependence on the patch $r$ has been made explicit. For the case
where the ambient space is simply a projective space, this reduces to the
standard (affine version of the) Fubini-Study Kähler potential,
${\mathcal{K}}_{\text{FS}}=1+\sum_{\mu}|z_{\mu}|^{2}$.

###  2.6 Numeric integration

Numeric integration can be performed using Monte-Carlo methods (for a method
developed recently based on rejection sampling from tropical densities see
[48]). The basic goal is to be able to numerically evaluate integrals of the
form

$\displaystyle\int_{X}\text{d}\text{Vol}_{\text{CY}}\;f\,.$ (2.23)

for a function $f$ on a CY manifold $X$ (of CICY or KS type). To do this, we
require a sample of points $p_{i}\in X$, where $i=1,\ldots,N$, which are
distributed according to a known measure, denoted by $dA$, which we discuss in
detail below. In terms of the so-called weights (or masses), customarily
defined as

$\displaystyle
w_{i}=\left.\frac{\text{d}\text{Vol}_{\Omega}}{dA}\right|_{p_{i}}\;.$ (2.24)

and the function values $f(p_{i})$, the integral (2.23) can be approximated by

$\displaystyle\int_{X}\text{d}\text{Vol}_{\text{CY}}\;f=\int_{X}dA\,\frac{\text{d}\text{Vol}_{\text{CY}}}{dA}\;f\simeq\frac{\kappa}{6N}\sum_{i=1}^{N}w_{i}f(p_{i})\;,$
(2.25)

where (2.13) has been used. On the other hand, since the Ricci-flat CY metric
is calculated numerically, there is no real need to rely on the measure
$\text{d}\text{Vol}_{\Omega}$ and the integral (2.23) can alternatively be
approximated by

$\displaystyle\int_{X}\text{d}\text{Vol}_{\text{CY}}\;f\simeq\frac{1}{N}\sum_{i=1}^{N}\tilde{w}_{i}\,{\rm
det}(g_{\text{CY}}(p_{i}))\,f(p_{i})\;,\qquad\tilde{w}_{i}=\left.\frac{d^{6}y}{dA}\right|_{p_{i}}\;.$
(2.26)

In the following we refer to the quantities $\tilde{w}_{i}$ as the auxiliary
weights. The approximation (2.26) has a certain advantage in that it does not
contain any unknown coefficient, such as $\kappa$ in Eq. (2.25), which need to
be fixed by a reference calculation.

###  2.7 Sampling points on toric varieties

We now discuss a method for generating the sample points $p_{i}$ with a known
distribution $dA$ on the CY $X$. In principle, this could be done by a Markov
chain Monte-Carlo method using, for example, the Fubini-Study measure for
$dA$, so $dA=\text{d}\text{Vol}_{\text{FS}}$. Here, we pursue a different
approach based on a theorem by Shiffman and Zelditch [49], further generalized
and explained in [16, 17]. This provides us with a viable method for ambient
spaces which are products of projective spaces, and hence applies
straightforwardly to CICYs. Importantly, using the techniques introduced in
section 2.5, which allow us to write the toric Kähler potential in terms of a
FS potential in the projectivized section space
$\mathbb{P}H^{0}(J_{\alpha})\cong\mathbbm{P}^{r_{\alpha}}$ of the Kähler cone
generators $J_{\alpha}$, we can apply the same method to the toric case, as we
will now explain.

To construct $dA$, we first compute the sections (2.16) and construct the
associated FS Kähler potentials ${\mathcal{K}}_{\alpha}$ as in Eq. (2.18).
Shiffman and Zelditch now state that the zeros of random sections are
distributed w.r.t. to the (known) FS measure constructed from
$\log({\mathcal{K}}_{\text{FS}})=\log\sum_{i=0}^{n}|s_{i}|^{2}$. Hence, we
need to find zeros of random sections that are also lying on the CY and
express these in terms of the homogeneous toric coordinates $x_{i}$.

First, we need to clarify what random section actually means in this context.
As mentioned in section 2.5, the scalar product induces a notion of
orthogonality (and hence independence) of sections. Since we chose the
standard scalar product, the monomial sections are mutually orthogonal, and a
random section $S_{\alpha}$ of the Kähler cone generator $J_{\alpha}$ is
constructed from this orthogonal basis $s_{j}^{\alpha}$ with i.i.d. Gaussian
coefficients $a_{j}^{(\alpha)}\sim\mathcal{N}(0,1)$

$\displaystyle
S_{\alpha}=\sum_{j=0}^{r_{\alpha}}a_{j}^{(\alpha)}s_{j}^{\alpha}\;.$ (2.27)

Since we want points on a CY $n$-fold, we need to construct $n$ random
sections $S_{\alpha,p}$, $p=1,\ldots,n$, and intersect their zero locus with
the CY hypersurface, specified by its defining equation. We are relatively
free in choosing the Kähler cone generators (that is, the indices $\alpha$ for
each $p=1,\ldots,n$) for which we construct the random sections, as long as we
are imposing not more than $r_{\alpha}$ equations for any given $\alpha$.

We can use this to construct a point sample with known distribution and
measure $dA$. Since we want to work with the toric coordinates $x_{i}$ instead
of the sections $s_{j}^{\alpha}$, we need to express the sections in terms of
the $x_{i}$. As mentioned around (2.17), the problem is that the maps
$\Phi_{\alpha}$ from $x_{i}$ to $s_{j}^{\alpha}$ are not invertible. Indeed,
there are non-linear relations (higher syzygies) among the $s_{j}^{\alpha}$.
Mathematically, this means that we have to construct a polynomial ring in
$x_{i}$ and $s_{j}^{\alpha}$ and add the ideals that describe the maps
$\Phi_{\alpha}$, the hypersurface equations for the CY, and $n$ random
sections $S_{\alpha,p}$. Then, one finds the elimination ideal in the quotient
ring modulo the relations among the sections to express the $s_{j}^{\alpha}$
in terms of the $x_{i}$. We carry this out in a two-step procedure. We solve
the $n$ equations $S_{\alpha,p}=0$ subject to the relations among the sections
(we will discuss how to find these relations in the next paragraph). We then
express the remaining $s_{j}^{\alpha}$ in terms of the $x_{i}$ as in (2.16)
and impose the hypersurface equations (which are equations in the $x_{i}$).
Solving this system of equations then gives a collection of homogeneous
coordinates of points on the CY for each choice of $n$ random sections.
Moreover, these points are distributed with respect to the auxiliary measure
$dA$. For a CY three-fold,

$\displaystyle
dA=\Phi_{\alpha}^{*}(J_{\alpha})\wedge\Phi_{\beta}^{*}(J_{\beta})\wedge\Phi_{\gamma}^{*}(J_{\gamma})\,,$
(2.28)

where the indices $\alpha$, $\beta$, $\gamma$ correspond to the indices of the
random sections $S_{\alpha,p}$, $p=1,2,3$, that have been chosen above.
Repeating this process for many random sections gives us the point sample we
are after. While we appreciate that this is somewhat involved, it is
absolutely crucial for our purposes. Any meaningful numerical integration
relies on being able to generate points efficiently and distributed according
to a known measure, $dA$. This is precisely what the above method allows us to
do.

Finally, we need to explain how to derive the relations among the sections.
One way to do this is to perform a primary decomposition of the defining ideal
of the aforementioned quotient ring and use the elimination ideal to express
the ideal generators, as obtained from the primary decomposition, in terms of
the sections. This method is general, and we implemented it in Sage (via
Singular). However, it requires computing Groebner bases, which can be
computationally costly.

Alternatively, we can do the following: We are interested in relations of the
form444In principle, we are free to use any coefficients, but a different
choice would modify the parameterization of the complex structure as
coefficients of the section monomials of the anti-canonical bundle that appear
in the hypersurface that defines the CY.

$\displaystyle\prod_{I}s_{I}^{f_{I}}=\prod_{J}s_{J}^{g_{J}}\quad\Leftrightarrow\quad\prod_{I}s_{I}^{h_{I}}=1\,,$
(2.29)

where we have introduced the multi-index $I=(i,\alpha)$, and likewise for $J$,
and $f_{I},g_{J}$ are non-negative integers. At a generic point in section
space, we can divide by the right-hand side and write the equation as done in
the final step, where the $h_{I}$ are integers (positive or negative) which
encode the relations between the sections. Now recall from (A.8) or (2.16)
that the sections are given in terms of the toric coordinates as

$\displaystyle s_{J}=\prod_{a}x_{a}^{\langle
v_{a},w_{j}^{(\alpha)}\rangle+c_{i}^{(\alpha)}}=:\prod_{a}x_{a}^{M_{a,J}}\,,$
(2.30)

where the last step defines the matrix of exponents $M_{a,J}$. Inserting this
into (2.29), we get

$\displaystyle\sum_{I}M_{a,I}h_{I}=0\;.$ (2.31)

This means the vectors $h_{\alpha}$ can be found as the (primitive integer)
basis of the kernel of $M_{a,I}$. This approach based on lattice methods
avoids potentially time-consuming Groebner basis calculations and is the
default method used by the code.

Finally, we want to point out the following: At first, one might think that
the system of equations comprising the CY hypersurface equation plus the
equations that determine the sections in terms of the toric coordinates is
simply a CICY in a product of projective ambient spaces
$\otimes_{\alpha=1}^{h^{1,1}(X)}\mathbbm{P}^{r_{\alpha}}$. However, if we
naively count the dimensions of the resulting variety, we would find that it
is in general smaller than $n$. Moreover, the degrees of the equations do not
add up to the toric scalings plus one, so the hypersurface also seems to not
be the anti-canonical one. However, the point is that the CY is _not_ a
complete intersection, precisely because of the relations of the sections
(2.30). So another way of summarizing the procedure is that we have found an
expression for the original CY $n$-fold $X$ as a non-complete intersection CY
in a product of projective ambient spaces
$\otimes_{\alpha=1}^{h^{1,1}(X)}\mathbbm{P}^{r_{\alpha}}$, which allows us to
generate point samples with known distribution on $X$.

##  3 Hermitian Yang-Mills equations

Line bundles $L\rightarrow X$ over CY manifolds $X$ and their Hermitian Yang-
Mills (HYM) connections provide an interesting application of numerical CY
metrics. A vanishing slope is a necessary (and sufficient) condition for the
existence of a HYM connection on a line bundle. Hence, meaningful numerical
calculation of the HYM connection rely on being able to determine the Ricci-
flat metric at prescribed points in Kähler moduli space - precisely one of the
capabilities we are developing in the present work. In this section, we
briefly review the underlying mathematics and set up the relevant formalism
for our purposes. Numerical results for HYM connections will be presented in
Section 5.

###  3.1 Mathematical background

Line bundles ${\cal O}_{X}(k)$ over CY three-folds $X$ and their slope have
already been introduced in Section 2.2. If $H$ is a hermitian bundle metric on
${\cal O}_{X}(k)$ we have an associated (Chern) connection with gauge field
and curvature given by

$A=\partial\ln(H)\;,\qquad F=\bar{\partial}A=\bar{\partial}\partial\ln(H)\;.$
(3.1)

The above connection is said to be a HYM connection if its field strength
satisfies the HYM equation

$g_{\text{CY}}^{a\bar{b}}F_{a\bar{b}}=0\quad\Leftrightarrow\quad
J_{\text{CY}}\wedge J_{\text{CY}}\wedge F=0\;,$ (3.2)

where $g_{\text{CY}}$ is the (Ricci-flat) CY metric and $J_{\text{CY}}$ the
associated Kähler form. A necessary and sufficient condition for the existence
for a HYM connection on ${\cal O}_{X}(k)$ is that its slope, as defined in Eq.
(2.10), vanishes, that is, $\mu_{t}({\cal O}_{X}(k))=0$. Checking this
condition numerically is, therefore, the first step in a numerical calculation
of the HYM connection.

###  3.2 Computing HYM connections

Provided the slope $\mu_{t}({\cal O}_{X}(k))$ vanishes so that a HYM
connection exists, how can this connection be computed explicitly? The first
step is to start with a “Fubini-Study” reference bundle metric on ${\cal
O}_{X}(k)$ defined by

$H_{\text{FS}}=\prod_{\alpha}{\mathcal{K}}_{\alpha}^{-k_{\alpha}}\;,\qquad
F_{\text{FS}}=\bar{\partial}\partial\ln(H_{\text{FS}})\;,$ (3.3)

with the quantities ${\mathcal{K}}_{\alpha}$ constructed in Section 2.5. This
reference metric can be modified to

$H=e^{\beta}H_{\text{FS}}\;,\qquad
F=\bar{\partial}\partial\ln(H)=F_{\text{FS}}+\bar{\partial}\partial\beta$
(3.4)

where $\beta$ is a function on $X$ to be determined. Noting that the scalar
Laplacian $\Delta_{\text{CY}}$ associated to the Ricci-flat metric
$g_{\text{CY}}$ on $X$ can be written as
$\Delta_{\text{CY}}=2g^{a\bar{b}}_{\text{CY}}\partial_{a}\bar{\partial}_{\bar{b}}$,
the HYM equation (3.2) for the field strength $F$ from Eq. (3.4) turns into

$\Delta_{\text{CY}}\beta=\rho_{\text{CY}}$ (3.5)

where the source $\rho_{\text{CY}}$ has been defined in Eq. (2.9). We note
that the integrability condition for this equation amounts to
$\rho_{\text{CY}}$ integrating to zero over the CY manifold which, from Eq.
(2.10), is equivalent to the slope vanishing. Provided this is the case, Eq.
(3.5) has a solution $\beta$ (unique up to an additive constant) which,
inserted into Eq. (3.4), leads to the Hermitian bundle metric underlying the
HYM connection.

In order to solve Eq. (3.5) numerically we introduce the usual scalar product

$\langle
f|h\rangle:=\int_{X}\bar{f}\wedge\star_{g}h=\int_{X}d^{6}y\sqrt{g}\,\bar{f}\,h$
(3.6)

on the space $L^{2}(X)$ and consider a (not necessarily ortho-normal) basis of
functions denoted by $f_{I}$ or simply by $|I\rangle$. If we define the scalar
products

$G_{IJ}=\langle I|J\rangle\;,\quad\Delta_{IJ}=\langle
I|\Delta_{\text{CY}}|J\rangle\;,\quad\tilde{\beta}_{I}=\langle
I|\beta\rangle\;,\quad\rho_{I}=\langle I|\rho\rangle\;,$ (3.7)

it follows that

$|\beta\rangle=\sum_{I}\beta_{I}|I\rangle\quad\mbox{where}\quad\beta_{I}=\sum_{J}(G^{-1})_{IJ}\,\tilde{\beta}_{J}$
(3.8)

and the Laplace equation (3.5) can be re-written as

$\Delta{\boldsymbol{\beta}}={\boldsymbol{\rho}}\;.$ (3.9)

Here, $\Delta$ is the matrix with entries $\Delta_{IJ}$ and we have introduced
the vectors ${\boldsymbol{\beta}}=(\beta_{I})$ and
${\boldsymbol{\rho}}=(\rho_{I})$. The kernel of $\Delta$ is non-trivial and
consists of the vectors ${\boldsymbol{\beta}}$ which correspond to constant
functions on $X$. This means $\Delta$ is not surjective and for a solution to
exist it is necessary that ${\boldsymbol{\rho}}\in{\rm Im}(\Delta)$. This
condition is of course nothing else but the integrability condition for the
Laplace equation (3.5) which amounts to the vanishing of the slope. So as long
as the slope vanishes, Eq. (3.9) has a solution.

In practice, we have to work with a suitably chosen finite set of functions
$f_{I}$ and things are not quite so straightforward. For a finite function set
we should expect errors and we cannot expect that ${\boldsymbol{\rho}}\in{\rm
Im}(\Delta)$. This means the finite-dimensional version of Eq. (3.9) typically
does not have a solution and a naive attempt of solving the equation with
standard methods of linear algebra fails. To remedy this problem we decompose
${\boldsymbol{\rho}}$ as
${\boldsymbol{\rho}}={\boldsymbol{\rho}}^{\parallel}+{\boldsymbol{\rho}}^{\perp}$
into the projection ${\boldsymbol{\rho}}^{\parallel}$ onto ${\rm Im}(\Delta)$
and the orthogonal complement ${\boldsymbol{\rho}}^{\perp}$. Another way of
stating the problem is that ${\boldsymbol{\rho}}^{\perp}$ is typically non-
zero in the finite-dimensional approximation. However, provided the slope
vanishes and the finite-dimensional approximation is sufficiently accurate, we
expect that
$|{\boldsymbol{\rho}}^{\perp}|/|{\boldsymbol{\rho}}^{\parallel}|\ll 1$.
Assuming this is indeed satisfied we can safely replace Eq. (3.9) by

$\Delta{\boldsymbol{\beta}}={\boldsymbol{\rho}}^{\parallel}\;,$ (3.10)

which does have a solution.

In summary, our procedure involves computing the quantities $\Delta_{IJ}$ and
$\rho_{I}$ in Eq. (3.7) by numerical integration over $X$ for a finite set of
function $f_{I}$ and then solving the linear algebra problem (3.10). Given a
solution ${\boldsymbol{\beta}}=(\beta_{I})$, the function $\beta$ is then
approximated by $\beta=\sum_{I}\beta_{I}f_{I}$.

A suitable set of function $f_{I}$ can be constructed by starting with a
positive line bundle ${\cal O}_{X}(l)$. If we denote by $s_{p}$, where
$p=1,\ldots,h^{0}({\cal O}_{X}(l))$, a basis of its sections we can define the
functions

$f_{pq}=\frac{s_{p}\bar{s}_{q}}{\prod_{\alpha}{\mathcal{S}}_{\alpha}^{l_{\alpha}}}\;,$
(3.11)

where ${\mathcal{S}}_{\alpha}$ is the homogeneous version of
${\mathcal{K}}_{\alpha}$. Of course, the higher the degree $l$, the larger the
space spanned by the $f_{pq}$ and the more accurate we expect the
approximation to be. As a measure of the accuracy with which the HYM equation
(3.5) is solved we define

$\sigma_{H}=\frac{\int_{X}d^{6}y\sqrt{g_{\text{CY}}}\,|\Delta_{\text{CY}}\beta-\rho_{\text{CY}}|}{\int_{X}d^{6}y\,\sqrt{g_{\text{CY}}}\,|\rho_{\text{CY}}|}\;.$
(3.12)

which we will refer to as the ’HYM measure’ in the future.

##  4 Computational background

The open source library cymetric consists of point generators for CICY and KS
Calabi-Yau manifolds and five metric models that learn the Ricci-flat CY
metrics using the generated points as input. In this section, we describe
these networks and their training in more detail. After a brief general
introduction to neural networks, we describe how the networks of cymetric are
constructed and how their learning is controlled by custom loss functions that
encode the mathematical constraints CY metrics must satisfy.

###  4.1 Introduction to neural networks

This section provides a quick review of the building blocks of neural
networks. The literature on machine learning and neural networks is vast, and
includes many good introductory texts. For the reader with a background in
(theoretical) high-energy physics, Ref. [50] provides a very good introduction
to the topic, and Ref. [29] gives a topical discussion on the applications of
modern data science techniques to string theory.

A neural network (NN) is a collection of nodes, which are organized in several
layers. Two of these layers, the input and output layers, are visible to the
user, the others are hidden. NNs with many nodes in each layer are referred to
as wide, and NNs with many (more than one) hidden layers are called deep.
Given an input vector $v_{0}\in\mathbb{R}^{n_{0}}$, the NN processes the data
by transmitting it from one layer to the next, in a sequence of mappings
$v_{0}\mapsto v_{1}\mapsto v_{2}\mapsto\cdots\mapsto v_{N}$, where
$v_{k}\in\mathbb{R}^{n_{k}}$. In more detail, for a fully-connected NN, the
output $v_{k}$ of layer $k$ is related to its input $v_{k-1}$ by

$v_{k}=\sigma_{k}(W_{k}v_{k-1}+b_{k})\;,$ (4.1)

where the $n_{k}\times n_{k-1}$ matrix $W_{k}$ contains the weights and the
vector $b_{k}\in\mathbb{R}^{n_{k}}$ the biases of the $k^{\rm th}$ layer. The
functions $\sigma_{k}$ acts on each component of their vectorial arguments and
are called the _activation functions_. Altogether, the neural network
represents a family
$f_{\theta}:\mathbb{R}^{n_{0}}\rightarrow\mathbb{R}^{n_{N}}$ of functions
which is given by iterating Eq. (4.1). Here, $\theta$ collectively denotes the
weights and biases in all layers.

Training of the neural network is based on a set of input vectors
$\\{v_{0}\\}$. The first step of any machine learning experiment is to
randomly split this data into a training and a validation set (typical
training-to-validation ratios are around 9:1, or validation split 0.1). The
training set is used to train the NN by adjusting the weights and biases
$\theta$, a process that is guided either by certain loss functions or a
reward system provided by the user (see below for the loss functions relevant
to our setting). The training data may also be further subdivided into (mini-)
batches to improve training. The division of data into batches reduces the
risk of the NN getting trapped in local minima of the loss function, thus
increasing the chance of finding solutions that generalize well. This is also
sometimes necessary, especially for networks that perform memory-intensive
operations (such as differentiation with respect to the input data in our
case) in order to compute loss functions. Such networks operate in epochs,
where each epoch constitutes one run over all batches.

In machine learning, one typically distinguishes different setups such as
supervised, unsupervised, or reinforcement learning. We are dealing with a
version of supervised machine learning. While in classical supervised ML, the
input and output is known for the training set, we only have inputs (the
points on the CY at which to compute the metric), together with a set of
constraints that the neural network output (that is, the metric) has to
satisfy. Hence, the task is more akin to physics informed learning or
optimization than classical ’supervision’ with given input-output pairs. We
check how well the output meets these constraints by constructing error
measures that encode them. Importantly, given the split of the initial data,
the quality of the output can be assessed on both the training and validation
sets. For the validation set, this check is performed by applying the trained
network to the validation data.

From this brief summary, it is clear that designing a NN to perform a certain
task involves choosing a number of hyperparameters, that specify the network’s
properties. For fully connected NNs, this amounts to specifying the width and
depth of the network, which activation functions to use, and the number of
batches and epochs. More advanced network components, such as convolutional or
dropout layers (see, for example, Ref. [29] for a recent discussion), require
additional hyperparameters. For our task, previous studies [32, 33, 34] have
shown that a simple fully connected NN exhibits good performance.
Consequently, we focus on this setting, leaving studies involving more
advanced NN architectures for the future. We build the networks using
TensorFlow [40], an ML library with functionalities that suit our needs. In
particular, TensorFlow allows to construct the NNs in a sequential manner, and
has differentiation functions that allow us to compute derivatives with
respect to the input data.

###  4.2 Network architectures

The basic idea underlying machine learning of CY metrics is to use a NN whose
associated functions $f_{\theta}$ represent metrics on the manifold. In other
words, the NN input consists of a point $p\in X$ on the CY manifold and its
output represents a metric $g(p)$ at this point. There are a number of
concrete realizations of this idea. Since CY three-folds $X$ are complex
manifolds, their metrics $g(p)$ at each point $p\in X$ can be written,
relative to a local choice of complex coordinates, as a Hermitian $3\times 3$
matrix. The first, and most obvious, approach is then to let the NN predict
the nine independent entries (three real entries on the diagonal, and three
complex entries on the off-diagonal) of this matrix. While this is possible,
it does not take advantage of the mathematical knowledge we have about CY
manifolds. For example, equation (2.2) shows that the CY metric is given by an
exact correction to some reference Kähler metric $g_{\text{FS}}$. Moreover, by
constructing CY manifolds as a hypersurfaces or complete intersection in an
ambient space, one can construct the metric $g_{\text{FS}}$ explicitly by
pullback from the ambient space $\mathcal{A}$.

The cymetric package realizes five choices for how the metric $g_{\text{pr}}$
predicted by the NN is related to the function $g_{\text{NN}}$ that the NN
actually represents. These possibilities are summarized in Table 1.

Name | Ansatz
---|---
Free | $g_{\text{pr}}=g_{\text{NN}}$
Additive | $g_{\text{pr}}=g_{\text{FS}}+g_{\text{NN}}$
Multiplicative, element-wise | $g_{\text{pr}}=g_{\text{FS}}+g_{\text{FS}}\odot g_{\text{NN}}$
Multiplicative, matrix | $g_{\text{pr}}=g_{\text{FS}}+g_{\text{FS}}\cdot g_{\text{NN}}$
$\phi$-model | $g_{\text{pr}}=g_{\text{FS}}+\partial\bar{\partial}\phi$
Table 1: Different Ansätze for the neural network prediction of the Ricci-flat
metric.

The first and most obvious choice, $g_{\text{pr}}=g_{\text{NN}}$, has been
included for reference but is by no means the optimal one. A metric is
required to be non-singular and this condition can easily be violated for a
randomly initialized or stochastically trained NN. A NN which ’accidentally’
represents a singular or near-singular metric can lead to numerical problems.
Also, for this choice, the NN has to cope with the entire numerical variation
of the metric $g_{\text{pr}}$. Both problems can be solved, or at least
alleviated, by writing $g_{\text{pr}}=g_{\text{FS}}+\text{correction}$, and
the four other possibilities in Table 1 are of this form. Indeed, using the
non-singular metric $g_{\text{FS}}$ as a background makes accidentally
generating singular metrics less likely (and, if there is an actual
singularity in the space, the reference FS metric will already have this
feature). Furthermore, under the plausible assumption that the entries of
${g_{\text{CY}}}-g_{\text{FS}}$ are typically smaller than the ones in
${g_{\text{CY}}}$, a NN dealing with a metric correction involves smaller
numbers, likely leading to enhanced numerical stability. As Table 1 shows,
$g_{\text{pr}}$ may be defined additively,
$g_{\text{pr}}=g_{\text{FS}}+g_{\text{NN}}$, via element-wise multiplication,
$g_{\text{pr}}=g_{\text{FS}}+g_{\text{FS}}\odot g_{\text{NN}}$, or via matrix
multiplication, $g_{\text{pr}}=g_{\text{FS}}+g_{\text{FS}}\cdot
g_{\text{NN}}$. Finally, using the full information contained in Eq. (2.2), we
may set $g_{\text{pr}}=g_{\text{FS}}+\partial\bar{\partial}\phi$, where the NN
represents the real function $\phi$.

While we have already argued that the free NN is likely inefficient, there is
no telling which of the other four Ansätze in Table 1 will be most efficient
in learning the Ricci-flat metric on a given CY manifold. For example, while
the $\phi$-model automatically gives a Kähler metric, it requires two
additional derivatives on the input, which come at a computational cost. For
this reason, the cymetric package makes all these options available for the
user to explore. In the ensuing section, we will compare the performance of
the different NNs on the quintic.

In each experiment the NN is trained on input data which consists of a set
$\\{p_{i}\\}$ of points on the CY manifold. These points are generated using
the method described in section 2.7. They are, by the theorem of Shiffman and
Zelditch, distributed with respect to a measure $dA$, which is inherited from
the ambient space. This allows to compute any integrals used in the training
and validation processes as weighted sums, following Eqs. (2.25) and (2.26).

As discussed above, the learning of NNs is governed by the minimization of
loss functions. A CY metric must satisfy a number of mathematical constraints,
listed in section 2. We encode these restrictions in a custom loss function

$\displaystyle\mathcal{L}$
$\displaystyle=\alpha_{1}\mathcal{L}_{\text{MA}}+\alpha_{2}\mathcal{L}_{\text{dJ}}+\alpha_{3}\mathcal{L}_{\text{transition}}+\alpha_{4}\mathcal{L}_{\text{Ricci}}+\alpha_{5}\mathcal{L}_{\text{Kclass}}$
(4.2)

where $\alpha_{i}$ are hyperparameters of the NN with default value
$\alpha_{i}=1.0$, and the individual loss contributions are defined as
follows:

  * •

Monge-Ampère loss $\mathcal{L}_{\text{MA}}$
The Monge-Ampère loss is defined as

$\mathcal{L}_{\text{MA}}=\left|\left|1-\frac{1}{\kappa}\frac{\det
g_{\text{pr}}}{\Omega\wedge\bar{\Omega}}\right|\right|_{n}\;,$ (4.3)

and it ensures that the metric satisfies the Monge-Ampère equation (2.2), as
required by the Calabi–Yau theorem. This loss may be computed with any $L_{n}$
norm, as indicated by the subscript $n$ (default is $n=1$).555The choice of
$L_{n}$ norm will affect the training of the network. A high $n$ pushes the
network to reduce outliers, that is, large loss function contributions that
are localized at a few points. With a low $n$, the NN will instead strive to
reduce the loss function of all points with equal weight. From our
experiments, the default values chosen in cymetric lead to good performance on
the manifolds we have studied.

  * •

Ricci loss $\mathcal{L}_{\text{Ricci}}$
The Ricci loss is defined by

$\mathcal{L}_{\text{Ricci}}=||R||_{n}=\left|\left|\partial\bar{\partial}\ln{\det
g_{\text{pr}}}\right|\right|_{n}\;,$ (4.4)

and it ensures that the metric has vanishing Ricci scalar.666Recall that for
Kähler metrics, the Ricci scalar simplifies to
$R=g^{i\bar{j}}\partial_{i}\bar{\partial}_{\bar{j}}\log\det(g)$. This is a
necessary condition for the metric to satisfy the stronger CY requirement of
having vanishing Ricci tensor. Again, this loss function may be computed with
different $L_{n}$ norms, with default $n=1$.

  * •

Kähler loss $\mathcal{L}_{\text{dJ}}$
The Kähler loss, defined by

$\mathcal{L}_{\text{dJ}}=\sum_{ijk}\left|\left|{\rm
Re}\;{c_{ijk}}\right|\right|_{n}+\left|\left|{\rm
Im}\;{c_{ijk}}\right|\right|_{n}\;,$ (4.5)

where $c_{ijk}=g_{i\bar{j},k}-g_{k\bar{j},i}$ and
$g_{i\bar{j},k}=\partial_{k}g_{i\bar{j}}$ ensures that $dJ=0$, so that the
metric is Kähler. The default for the $L_{n}$ norm is $n=2$.

  * •

Transition loss $\mathcal{L}_{\text{transition}}$
The transition loss function ensures that $g_{i\bar{j}}$ transforms as a
complex tensor under coordinate transformations. For the additive and
multiplicative networks, this is implemented as

$\mathcal{L}_{\text{transition}}=\frac{1}{d}\sum_{\mathcal{U},\mathcal{V}}\left|\left|g_{\text{pr}}^{\mathcal{V}}-T_{\mathcal{U}\mathcal{V}}\cdot
g_{\text{pr}}^{\mathcal{U}}\cdot\left(T_{\mathcal{U}\mathcal{V}}\right)^{\dagger}\right|\right|_{n}\;,\;$
(4.6)

where $(T_{\mathcal{U}\mathcal{V}})_{\mu}^{\nu}=\partial v^{\nu}/\partial
u^{\mu}$ are the transition matrices between patches $\mathcal{U}$ and
$\mathcal{V}$, with local coordinates $u$ and $v$, respectively. Moreover, $d$
is the number of patch transitions, and the default for the norm is $n=1$.

  * •

Kähler class loss $\mathcal{L}_{\text{Kclass}}$
Finally, since we would like to compute the Ricci-flat metric for given Kähler
parameters $t_{\alpha}$, we require a loss contribution which enforces the
correct Kähler class777This is not essential for manifolds with $h^{1,1}(X)=1$
(such as the quintic), since all Kähler classes are obtained by simple metric
rescaling. However, it is critical in order to generate metrics with a well-
defined Kähler class for $h^{1,1}(X)>1$.. It may appear this is not necessary
for the $\phi$-model — provided $g_{\text{FS}}$ is set up with the correct
Kähler class, the addition $\partial\bar{\partial}\phi$ is exact and, hence,
does not change the class. While this is true mathematically, it depends on
$\phi$ being a function (rather than a section), a condition which is
difficult to enforce on a NN. For the other models in Table 1 there is no
mathematical reason for the Kähler class to remain unchanged. In order to fix
the Kähler class we define the Kähler class loss function as

$\mathcal{L}_{\text{Kclass}}=\frac{1}{h^{1,1}(X)}\sum_{\alpha=1}^{h^{1,1}(X)}\left|\left|\mu_{t}({\cal
O}_{X}(e_{\alpha}))-\int_{X}J_{\text{pr}}^{2}\wedge
F_{\text{FS},\alpha}\right|\right|_{n}\;.$ (4.7)

Here, ${\cal O}_{X}(e_{\alpha})$ are the line bundles specified by integers
$(e_{\alpha})^{\beta}=\delta_{\alpha}^{\beta}$,
$F_{\text{FS},\alpha}=-iJ_{\alpha}/(2\pi)$ are their associated field
strengths and $\mu_{t}({\cal O}_{X}(e_{\alpha})$ their slopes for the given
Kähler parameters $t_{\alpha}$, as computed from the topological formula, Eq.
(2.8). For the norm, the default is $n=1$. Conversely, these slope values on
the “line bundle basis” ${\cal O}_{X}(e_{\alpha})$,
$\alpha=1,\ldots,h^{1,1}(X)$, fix the Kähler parameters uniquely and this is
the basic idea behind Eq. (4.7): by enforcing the correct slopes we enforce
the correct Kähler class.

The slope integral in Eq. (4.7) is evaluated numerically using MC integration,
that is, integrals of the form (2.10) are computed using Eq. (2.26). Note that
this integral requires a large batch size to provide a good approximation to
the slope, while the other losses benefit from gradient descent with small
mini-batches. Hence, we break each training epoch of the NN into two
optimization steps with two different batch sizes (we do use the same
optimizer, to transfer some of the information, like momentum, between the two
batches). A small batch size (default is 64 points) is used for all above
contributions to the loss function while a large one (defaults to $10,000$
points or the entire data set, whichever is smaller) is used for the Kähler
class loss. We have observed that also keeping the sigma loss in the updates
with the large batch size further improves stability of the code.

For all these loss functions, the derivatives with respect to the input
coordinates are computed with TensorFlow’s automatic differentiation, which
works reliable for all NNs.

A few comments are in order. By virtue of the Calabi-Yau theorem, the Monge-
Ampère loss $\mathcal{L}_{\text{MA}}$ is sufficient to enforce Ricci-flatness
of the metric. The Ricci-loss $\mathcal{L}_{\text{Ricci}}$ has been included
as a potential additional check but, since its computation is costly (as it
involves taking two further derivatives), it is disabled by default. Moreover,
for the $\phi$-model which is Kähler by construction, the Kähler loss
$\mathcal{L}_{\text{dJ}}$ is disabled. Similarly, the transition loss is
disabled for this network (this is guaranteed as long as $\phi$ is a
function). Disabling these losses for the $\phi$-model shortens training time
and has had no ill effects on performance.

After the NN is trained, we require an error measure that tells us how well
the NN approximates the quantity we are learning, and how well it compares
with other approximation schemes. For our purposes, we consider error measures
derived from the Monge-Ampère equation and the requirement of Ricci-flatness.
There are two established benchmark measures in the literature [15, 20], the
sigma and Ricci measures, $(\sigma,\mathcal{R})$. The $\sigma$ measure is
obtained by integrating, using the MC approximation as a weighted sum, the
Monge-Ampère equation

$\sigma=\frac{1}{{\rm
Vol}_{\Omega}}\int_{X}\left|1-\kappa\;\frac{\Omega\wedge\overline{\Omega}}{(J_{\text{pr}})^{n}}\right|\;,$
(4.8)

where ${\rm Vol}_{\Omega}=\int\text{d}\text{Vol}_{\Omega}$. The Ricci measure
results from integrating the Ricci scalar

$\mathcal{R}=\frac{{\rm Vol}_{\text{CY}}^{1/3}}{{\rm
Vol}_{\Omega}}\int_{X}|R_{\text{pr}}|\;.$ (4.9)

It should be noted that a small Ricci measure is necessary, but not
sufficient, to guarantee that the entire Ricci tensor is small. One could
explore other (integrated) curvature measures, formed from other contractions
of the Ricci tensor, which, however, we have not done in this work. We also
provide measures to monitor the quality of the Kähler, transition, and volume
approximations.

##  5 Results

In this section, we report the results from experiments where CY metrics are
learned on CICY and KS manifolds. These runs illustrate that the ML routines
that we have developed perform well on CY manifolds from these lists. As we
will see, there is some variance in the performance of the different NNs. The
$\phi$ network emerges as the most efficient learner, and the small values
reported on the $\sigma$ and $R$ error measures corroborate the accuracy of
the obtained metrics. We furthermore find that the point-generating routines
are efficient with run-times ranging from seconds (for the quintic) to an hour
(for the KS CY example) on a CPU of a standard laptop. We expect this
efficiency will persist on CYs of similar complexity. For ease of notation, we
will henceforth refer to the approximate CY metric obtained at the end of
training as $g_{\text{CY}}$.

###  5.1 Quintic

The Quintic three-fold is specified as the vanishing locus of a quintic
polynomial in the projective ambient space $\mathcal{A}=\mathbb{P}^{4}$, and
appears in both the CICY and Kreuzer-Skarke lists. It has one Kähler modulus,
which measures the overall volume of the manifold, and 101 complex structure
moduli. A particular, simple instance of this family of manifolds is the
Fermat quintic, given by the vanishing locus of $Q=\sum_{i=0}^{4}z_{i}^{5}$.
The Fermat quintic is arguably the simplest CY three-fold, and is a benchmark
model for numerical computations of CY metrics, whose metric has been
approximated using a variety of approaches [14, 16, 17, 18, 15, 22, 32, 33,
19]. Given its simplicity, the Fermat quintic provides an excellent setting
for comparing the performance of the different metric Ansätze in Table 1, and
this is the main purpose of this subsection.

####  5.1.1 Comparison of Ansätze for CY metric predictions

For these experiments, we have generated a random point sample of $198,000$
points on the quintic using the CICY point generator of cymetric. For each
metric Ansatz in Table 1, we have constructed a fully connected feed-forward
network with three hidden layers, each containing 64 nodes, and GELU
activation functions.888Before these experiments, we have performed
hyperparameter tuning via box searches for some of the hyperparameters,
including for the number of hidden layers and the type of activation function.
These have been trained using an Adam optimizer on the point sample, with a
$0.1$ validation split of the data. The NNs were initialized with weights
sampled from a Gaussian distribution. For the networks that learn a correction
to the reference metric $g_{\text{FS}}$, we select a Gaussian distribution
$\mathcal{N}(0,\;0.01)$ with small variance, whereas the free NN is
initialized with $\mathcal{N}(0,\;1)$.

For each metric Ansatz, five experiments over 100 epochs were performed. The
results of these experiments are shown in Figure 1 (and were first published
in the 2021 NeurIPS conference, [34]). Note that for these quintic runs, the
volume of the manifold has been normalized to 1. As shown in subplot f), all
networks preserve this value of the volume.

Figure 1: Fermat Quintic experiments: a) Monge-Ampère loss on training data;
b)+c)+d) Monge-Ampère, transition and Kähler loss on validation data; e)
$\sigma$-measure f) volume and g) $\mathcal{R}$-measure on test data; h) the
linear relationship between improvement in $\sigma$-measure and
$\mathcal{R}$-measure. The plots show the averaged performance of five
separate experiments for each model, including 95% confidence intervals as
light-hue bands around each curve.

It is evident from Figure 1 that learning takes place for all network Ansätze.
It is also clear that the performance of the NNs differ: the multiplication
and $\phi$ models outperform the additive and free networks. In fact, the
plots show that the training does not complete for the latter models: even
after 100 epochs, most losses and error measures have not reached a stable
value. In contrast, the two multiplication models, and the $\phi$ network,
reduce the relevant losses and errors by approximately two orders of
magnitude, and obtain stable values after the 100 epoch experiments are
completed.

In more detail, we see that the Monge-Ampère loss, shown in subplots a) and b)
for training and validation data, respectively, is learned perfectly by the
best performing networks. The similarity in performance between training and
validation set implies that overfitting is not a problem. The transition loss
on validation data is presented in subplot c). Again, learning is evident for
all networks but for the additive NN the loss function only starts decreasing
after 80 epochs. The final plot on the first row of Figure 1 shows the Kähler
loss on validation data. The $\phi$ model does not appear in this plot, since
it provides a Kähler metric by default (as long as $\phi$ is a function, which
is guaranteed by the preservation of the Kähler class, which is automatic up
to a scale factor for the Quintic). Interestingly, the multiplicative models
perform worse than the additive model on this loss. This is to be expected:
multiplying the metric with a non-constant matrix will generically result in
an associated 2-form which fails to close. On the other hand, for the additive
network, while the addition to the metric will generically break the Kähler
constraint, the smallness of the addition implies that this breaking will be
small. One should expect the result to reflect this, and it is reassuring that
it does.

On the second row of Figure 1 it is checked that the volume of the manifold is
not changed during learning. We also compute the $\sigma$ and $\mathcal{R}$
error measures. These checks are performed on a separate test set of $22,000$
points. The $\sigma$ and $\mathcal{R}$ measures are benchmarks for the quality
of CY metric approximations, and their low values testify to the performance
of the NNs. The $\phi$-models with lowest validation loss reach, within an
hour on a single CPU of a standard laptop, a mean accuracy of $\sigma=0.0086$
and $\mathcal{R}=0.076$ and thus matches $k=20$ in Donaldson algorithm [20]
with a training time of 35 years on $4.6\cdot 10^{8}$ points [30]. On the
other hand, the energy functional methods obtain a similar accuracy already at
$k=4$ [22] and other machine learning methods report similar runtimes as
ours.999We recall that reducing runtime for ML experiments is not the primary
goal of the cymetric package; rather the benefit of the new package is that it
can be applied to a wider range of CY manifolds than previously possible and
that it computes the Ricci-flat metric for a given Kähler class.

To the best of our knowledge, we are the first to systematically study
$\mathcal{R}$, and to demonstrate, in subplot h), a linear relation,
$\sigma\approx 0.06\mathcal{R}$ for the $\phi$-model, between optimization of
the surrogate Monge-Ampère equation (2.2) and decrease in Ricci measure
$\mathcal{R}$. While this is to be expected from the CY theorem, a numerical
routine could in principle deviate from this result. It is reassuring that our
implementation does not and that there is no tension between these two
constraints.

Another conclusion from these experiments is that the $\phi$-model performs
better than the other models, at least for simple CY three-folds.101010This
conclusion is also corroborated by experiments reported on in Ref. [51]. While
this is a result that should be treated with some caution, we have reached
similar conclusions on other manifolds, and will thus focus on this model in
the following sections.

###  5.2 Bi-cubic

In this sub-section we describe our numerical results for the bi-cubic CY, a
manifold with Picard number two. Specifically, we calculate the numerical
Ricci-flat CY metrics at various specific points in the bi-cubic Kähler moduli
space. For these metrics we perform two basic checks to confirm that the
correct point in Kähler moduli space has indeed been reached: a numerical
calculation of the CY volume and a numerical calculation of various line
bundle slopes, each of which can be compared with the exact result obtained
from a topological formula. As an example application, we also compute the HYM
connection for a specific line bundle on the bi-cubic numerically.

####  5.2.1 Basic set-up

The bi-cubic CY is defined as a hypersurface in the ambient space ${\cal
A}=\mathbb{P}^{2}\times\mathbb{P}^{2}$ and it is contained in both the CICY
and the KS lists. Specifically, it is given as the zero locus in ${\cal A}$ of
a bi-degree $(3,3)$ polynomial. Its Hodge numbers are
$(h^{1,1}(X),h^{2,1}(X))=(2,83)$ and its non-zero intersection numbers are
$d_{112}=d_{122}=3$. Throughout our calculations, we fix a specific point in
complex structure moduli space by focusing on the defining polynomial

$\displaystyle p=$ $\displaystyle
0.96x_{0}^{3}y_{0}^{3}+0.79x_{0}^{3}y_{1}^{3}+0.49x_{0}^{3}y_{2}^{3}+0.51x_{0}^{3}y_{0}y_{1}y_{2}+0.05x_{1}x_{0}^{2}y_{0}y_{1}^{2}+0.99x_{2}x_{0}^{2}y_{0}y_{2}^{2}+0.81x_{1}x_{0}^{2}y_{1}y_{2}^{2}$
$\displaystyle+0.39x_{2}x_{0}^{2}y_{0}^{2}y_{1}+0.54x_{1}x_{0}^{2}y_{0}^{2}y_{2}+0.87x_{2}x_{0}^{2}y_{1}^{2}y_{2}+0.62x_{1}x_{2}x_{0}y_{0}^{3}+0.62x_{1}x_{2}x_{0}y_{1}^{3}+0.62x_{1}x_{2}x_{0}y_{2}^{3}$
$\displaystyle+0.81x_{2}^{2}x_{0}y_{0}y_{1}^{2}+0.87x_{1}^{2}x_{0}y_{0}y_{2}^{2}+0.54x_{2}^{2}x_{0}y_{1}y_{2}^{2}+0.99x_{1}^{2}x_{0}y_{0}^{2}y_{1}+0.05x_{2}^{2}x_{0}y_{0}^{2}y_{2}+0.39x_{1}^{2}x_{0}y_{1}^{2}y_{2}$
$\displaystyle+0.87x_{1}x_{2}x_{0}y_{0}y_{1}y_{2}+0.49x_{1}^{3}y_{0}^{3}+0.79x_{2}^{3}y_{0}^{3}+0.96x_{1}^{3}y_{1}^{3}+0.49x_{2}^{3}y_{1}^{3}+0.79x_{1}^{3}y_{2}^{3}+0.96x_{2}^{3}y_{2}^{3}$
$\displaystyle+0.54x_{1}^{2}x_{2}y_{0}y_{1}^{2}+0.39x_{1}x_{2}^{2}y_{0}y_{2}^{2}+0.05x_{1}^{2}x_{2}y_{1}y_{2}^{2}+0.87x_{1}x_{2}^{2}y_{0}^{2}y_{1}+0.81x_{1}^{2}x_{2}y_{0}^{2}y_{2}+0.99x_{1}x_{2}^{2}y_{1}^{2}y_{2}$
$\displaystyle+0.51x_{1}^{3}y_{0}y_{1}y_{2}+0.51x_{2}^{3}y_{0}y_{1}y_{2}\;,$
(5.1)

where $(x_{0},x_{1},x_{2})$ and $(y_{0},y_{1},y_{2})$ are homogeneous
coordinates on the two $\mathbb{P}^{2}$ factors. We will calculate the Ricci-
flat metric for the seven points in Kähler moduli space indicated in Table 2.

case | 1 | 2 | 3 | 4 | 5 | 6 | 7
---|---|---|---|---|---|---|---
$t_{(i)}$ | $\left(\begin{array}[]{c}1.414\\\ 1.414\\\ \end{array}\right)$ | $\left(\begin{array}[]{c}0.687\\\ 1.878\\\ \end{array}\right)$ | $\left(\begin{array}[]{c}0.421\\\ 1.955\\\ \end{array}\right)$ | $\left(\begin{array}[]{c}0.299\\\ 1.977\\\ \end{array}\right)$ | $\left(\begin{array}[]{c}0.962\\\ 1.753\\\ \end{array}\right)$ | $\left(\begin{array}[]{c}1.092\\\ 1.676\\\ \end{array}\right)$ | $\left(\begin{array}[]{c}0.853\\\ 1.809\\\ \end{array}\right)$
${\cal O}_{X}(k_{(i)})$ | ${\cal O}_{X}(1,-1)$ | ${\cal O}_{X}(1,-2)$ | ${\cal O}_{X}(1,-3)$ | ${\cal O}_{X}(1,-4)$ | ${\cal O}_{X}(2,-3)$ | ${\cal O}_{X}(3,-4)$ | ${\cal O}_{X}(3,-5)$
Table 2: Choices $t_{(i)}$, where $i=1,\ldots,7$, of the Kähler parameters for
the bi-cubic and corresponding slope zero line bundles with line bundle
integers $k_{(i)}$.

For each of these choices of $t$ there is a corresponding line bundle ${\cal
O}_{X}(k)$ with slope zero which is given in the last row of Table 2.

####  5.2.2 Point sampling and training with $\phi$-model

For each of the seven choices of Kähler parameters in Table 2, we have
generated $100,000$ points (with 0.1 validation split) on the bi-cubic, using
the Mathematica point generator of the cymetric package. For the $\phi$-model
and a neural network with width $64$, depth $3$, GELU activation functions and
initialization with $\mathcal{N}(0,\;0.01)$, training has been carried out for
$100$ epochs, using the Adam optimizer with a batch size of $64$ and a
learning rate of $1/1000$. Training has been completed on a CPU of a standard
laptop in about three hours, for each of the seven choices of Kähler
parameters.

The only two relevant contributions to the loss are the Monge-Ampère loss and
the Kähler class loss which are shown, together with the $\sigma$ error
measure in Fig. 2.

Figure 2: Bi-cubic training curves for the seven choices of Kähler parameters
in Table 2. The last plot represents the final loss, obtained by averaging
over the last $10$ epochs, as a function of $t^{2}/t^{1}$
(orange: $\mathcal{L}_{\text{Kclass}}$, blue:
$4\times\mathcal{L}_{\text{MA}}$, both on training data, light-blue:
$4\times\sigma$ measure on validation data).

Evidently, training is efficient and successful for all seven cases. The last
plot in Fig. 2 shows the final MA and Kclass loss, obtained by averaging over
the last $10$ epochs, as a function of the modulus ratio $t^{2}/t^{1}$, which
can be seen as a measure of the asymmetry of the manifold. There is a clear
tendency for the final loss to increase with increasing asymmetry, a behavior
which is intuitively expected.

####  5.2.3 Volume computations

From the runs described above we have obtained numerical results for the
Ricci-flat CY metric $g_{\text{CY}}(p_{i})$ at $100,000$ points $p_{i}$ on the
bi-cubic and for seven choices of Kähler parameters. In addition, the cymetric
package provides the weights $w_{i}$, the auxiliary weights $\tilde{w}_{i}$
and the Fubini-Study metric $g_{\text{FS}}(p_{i})$ at those points.

As a first check, we would like to compute the CY volume for all seven cases,
based on Eq. (2.6). The exact results are obtained from the intersection
formula on the RHS of Eq. (2.6). Alternatively, these volumes can be computed
by integrating over the CY or the FS measure, as in the middle of Eq. (2.6),
and we will evaluate these integrals numerically, as explained in Section 2.7.
Explicitly, we compute for all seven cases

$V_{\rm
int}=\frac{1}{6}d_{\alpha\beta\gamma}t^{\alpha}t^{\beta}t^{\gamma}\;,\;V_{\text{FS}}=\frac{1}{N}\sum_{i=1}^{N}\tilde{w}_{i}\,{\rm
det}(g_{\text{FS}}(p_{i}))\;,\;V_{\text{CY}}=\frac{1}{N}\sum_{i=1}^{N}\tilde{w}_{i}\,{\rm
det}(g_{\text{CY}}(p_{i}))\;,$ (5.2)

where we recall that $g_{\text{CY}}$ refers to the network’s prediction for
the CY metric after the training is completed. The results are given in Table
3.

case | 1 | 2 | 3 | 4 | 5 | 6 | 7
---|---|---|---|---|---|---|---
$V_{\rm int}$ | 8.49 | 4.97 | 2.93 | 2.02 | 6.87 | 7.59 | 6.16
$V_{\text{FS}}$ | 8.49 | 4.50 | 2.94 | 2.03 | 6.91 | 7.58 | 6.26
error | $<1\%$ | $<1\%$ | $<1\%$ | $<1\%$ | $<1\%$ | $<1\%$ | $\sim 2\%$
$V_{\text{CY}}$ | 8.56 | 5.03 | 2.96 | 2.03 | 6.86 | 7.58 | 6.28
error | $<1\%$ | $\sim 1\%$ | $<1\%$ | $<1\%$ | $<1\%$ | $<1\%$ | $\sim 2\%$
Table 3: Exact volume from intersection form (row 2), and volume from
numerical integration with $g_{\text{FS}}$ (row 3) and $g_{\text{CY}}$ (row
4), for the seven choices of Kähler parameters in Table 2.

The volumes computed with the Fubini-Study metric are in good agreement with
the exact results, with most errors at the level of $1\%$ or below. In this
case, the only uncertainty comes from point sampling (as the Fubini-Study
metric is known exactly) so these results confirm that our method for sampling
points works and that $100,000$ points are sufficient.

The more important results in Table 3 are the volumes computed with the Ricci-
flat CY metric, given in the last row. Again, the accuracy is impressive at
$1\%$ or less for most cases. Overall, these results confirm that the Ricci-
flat CY metrics obtained are indeed in the prescribed Kähler class – only then
can the volume be expected to come out correctly. We emphasize that obtaining
the correct volume has _not_ been built into the loss function. Rather, the
correct Kähler class has been enforced during training by imposing the Kähler
class loss (4.7). Table 3 provides strong evidence that this method does
indeed work.

####  5.2.4 Slope computations

While the correct slope has been imposed during training it is still worth
checking that our numerical metrics can be used for accurate slope
computations. For the seven values of Kähler parameters $t_{(i)}$ and the
seven line bundles ${\cal O}_{X}(k_{(j)})$ in Table 2 we can compute a
$7\times 7$ slope matrix with entries $\mu_{t_{(i)}}({\cal O}_{X}(k_{(j)}))$.
The accurate entries of this matrix are obtained from the topological formula
(2.8) and are given by

$\left[\begin{array}[]{rrrrrrr}0.00&-18.00&-36.00&-54.00&-18.00&-18.00&-36.00\\\
9.16&0.00&-9.16&-18.33&9.16&18.33&9.16\\\
10.94&5.47&0.00&-5.47&16.41&27.34&21.87\\\
11.46&7.64&3.82&0.00&19.1&30.57&26.75\\\
6.45&-6.45&-19.34&-32.24&0.00&6.45&-6.45\\\
4.85&-9.7&-24.25&-38.8&-4.85&0.00&-14.55\\\
7.63&-3.82&-15.26&-26.71&3.82&11.45&0.00\\\ \end{array}\right]$ (5.3)

where the rows are labeled by the values of the Kähler parameters and the
columns by the line bundles. The zeros along the diagonal indicate the
existence of HYM connections for these cases, that is, for the line bundles
${\cal O}_{X}(k_{(i)})$ and their associated Kähler parameters $t_{(i)}$.

Alternatively, we can work out the slope by carrying out the integrals in Eq.
(2.10) numerically. Doing this first for the FS metrics, that is, evaluating
$\frac{2}{N\pi}\sum_{i=1}^{N}\tilde{w}_{i}\,{\rm
det}(g_{\text{FS}}(p_{i}))\,\rho_{\text{FS}}(p_{i})$ gives

$\left[\begin{array}[]{rrrrrrr}0.11&-17.84&-35.78&-53.73&-17.73&-17.62&-35.57\\\
9.12&-0.13&-9.37&-18.62&8.99&18.11&8.86\\\
10.95&5.46&-0.03&-5.52&16.41&27.35&21.86\\\
11.47&7.65&3.82&-0.01&19.12&30.6&26.77\\\
6.27&-6.79&-19.84&-32.9&-0.52&5.75&-7.31\\\
4.95&-9.53&-24.01&-38.49&-4.58&0.37&-14.11\\\
7.34&-4.43&-16.19&-27.95&2.91&10.25&-1.51\\\ \end{array}\right]$ (5.4)

Agreement with the exact results in (5.3) is impressive, with an average error
of the non-zero slope of $\sim 3\%$, suggesting that the point sample size is
sufficient, at least for the purpose of computing slopes. Using the Ricci-flat
CY metrics and evaluating $\frac{2}{N\pi}\sum_{i=1}^{N}\tilde{w}_{i}\,{\rm
det}(g_{\text{CY}}(p_{i}))\,\rho_{\text{CY}}(p_{i})$, we find

$\left[\begin{array}[]{rrrrrrr}0.03&-17.97&-35.98&-53.98&-17.95&-17.92&-35.92\\\
8.86&-0.42&-9.70&-18.98&8.43&17.29&8.01\\\
10.11&4.52&-1.07&-6.65&14.63&24.74&19.15\\\
9.96&5.96&1.97&-2.02&15.92&25.87&21.88\\\
6.38&-6.45&-19.29&-32.12&-0.07&6.31&-6.53\\\
4.96&-9.41&-23.77&-38.13&-4.45&0.51&-13.86\\\
7.53&-4.12&-15.76&-27.4&3.41&10.93&-0.71\\\ \end{array}\right]$ (5.5)

Again, this is in good agreement with the exact results in (5.3), with an
average error of the non-zero slopes of $\sim 7\%$, and it confirms that we
have obtained Ricci-flat CY metrics with the correct, intended Kähler class.
We also note that, in most cases, the results are accurate enough to
distinguish zero slope cases (along the diagonal) which allow for a HYM
connection from cases with non-zero slope. For highly asymmetric manifolds,
this distinction is less clear, which is related to the fact that training
takes longer in these cases.

####  5.2.5 HYM connection

As a final application of our results we would like to compute an
approximation to the HYM connection on a line bundle over the bi-cubic,
following the procedure described in Section 3. To do this we focus on the
line bundle ${\cal O}_{X}(1,-1)$ and Kähler parameters $t_{1}=t_{2}\simeq
1.414$, corresponding to case 1 in Table 2. As the result in (5.3)
(specifically, the $(11)$ entry of this matrix) shows, the slope of ${\cal
O}_{X}(1,-1)$ vanishes for this choice of Kähler parameters, so that a HYM
connection does indeed exist.

Our method requires choosing a set of function (3.11) in which to expand the
various quantities. We do this using the sections $\Gamma({\cal O}_{X}(1,1))$,
a nine-dimensional space with basis $(x_{a}y_{b})$, where $a,b=0,1,2$. This
leads to $81$ functions of the form (3.11), explicitly given by

$f_{(ab)(cd)}=\frac{x_{a}y_{b}\bar{x}_{c}\bar{y}_{d}}{(|x_{0}|^{2}+|x_{1}|^{2}+|x_{2}|^{2})(|y_{0}|^{2}+|y_{1}|^{2}+|y_{2}|^{2})}\;.$
(5.6)

Note, these expressions are indeed of homogeneity degree zero in each set of
$\mathbb{P}^{2}$ coordinates and, therefore, constitute functions on the
ambient space and, by restriction, on the bi-cubic CY.

With these functions we compute the $81\times 81$ matrix $\Delta$ which
represents the Laplacian and the $81$-dimensional vector ${\boldsymbol{\rho}}$
which represents the inhomogeneity in Laplace’s equations, by evaluating the
matrix elements in Eq. (3.7) by numerical integration, using our point sample
and numerical Ricci-flat metric for case 1. We can check that the matrix
$\Delta$ obtained in this way has a one-dimensional kernel which corresponds
to constant functions on the bi-cubic, as can be verified by taking the linear
combination of the functions (5.6) with a vector in the kernel. As expected,
the source vector ${\boldsymbol{\rho}}$ is not contained in the image ${\rm
Im}(\Delta)$, but we can verify that
$|{\boldsymbol{\rho}}^{\perp}|/|{\boldsymbol{\rho}}^{\parallel}|\sim 0.03$, so
the component of ${\boldsymbol{\rho}}$ orthogonal to ${\rm Im}(\Delta)$ is
small. Then we solve Eq. (3.10) to find an $81$-dimensional solution vector
${\boldsymbol{\beta}}$ and the linear combination of the functions (5.6)
formed with this vector provides gives our approximation of the function
$\beta$. Via Eq. (3.4), this function $\beta$ then determines the
approximation to the HYM bundle metric. For this result we compute the
quantity (3.12) as a measure of the accuracy of the approximation. This comes
out at $\sim 3\%$, indicating a reasonably accurate HYM connection.

###  5.3 Toric hypersurface CY with Picard rank 2

To test the cymetric package’s ability to predict CY metrics on KS CY
manifolds, we select a CY manifold with Picard rank two from the KS list.
After specifying the Kähler moduli as $(t_{1},t_{2})=(1,1)$ and the complex
structure moduli by a random assignment of the coefficient of the defining
polynomial, we generate points on the manifold as specified in Section 2.7.
These points are then used in training the $\phi$-model to predict the CY
metric.

####  5.3.1 Geometric set-up and point sampling

The selected manifold has a toric ambient space with two Kähler moduli. The
vertices111111The reader unfamiliar with toric geometry may wish to consult
Appendix A.

$\displaystyle v_{0}=\left(\begin{array}[]{r}-1\\\ -1\\\ -1\\\ 0\\\
\end{array}\right),\quad v_{1}=\begin{pmatrix}0\\\ 0\\\ 0\\\
1\end{pmatrix},\quad v_{2}=\begin{pmatrix}0\\\ 0\\\ 1\\\ 0\end{pmatrix},\quad
v_{3}=\begin{pmatrix}0\\\ 1\\\ 0\\\ 0\end{pmatrix},\quad
v_{4}=\left(\begin{array}[]{r}2\\\ 0\\\ 0\\\ -1\end{array}\right),\quad
v_{5}=\begin{pmatrix}1\\\ 0\\\ 0\\\ 0\\\ \end{pmatrix}\,,$ (5.15)

span a fan in the lattice $N$ which defines a $\mathbb{P}^{1}$-fibered toric
ambient space over $\mathbb{P}^{3}$, ${\cal
A}=\mathbb{P}^{1}\rightarrow\mathbb{P}^{3}$, of Picard rank two. Each vertex
corresponds to a homogeneous coordinate $x^{i}\sim v_{i}$, and a divisor
$D_{i}=\\{x^{i}=0\\}$; indeed, the vertices $v_{0},v_{2},v_{3},v_{5}$ can be
seen to correspond to $\mathbbm{P}^{3}$ by projection onto the first three
entries, and vertices $v_{1},v_{4}$ give rise to a $\mathbbm{P}^{1}$ by
projection onto the last entry. There is a unique fine regular star
triangulation of the corresponding polytope, giving eight top-dimensional
cones spanned by four out of the six $v_{i}$. Thus, ${\cal A}$ can be covered
by eight patches, and in each such patch there are four affine coordinates.

We can use the methods detailed in Appendix A to compute the sections of the
anti-canonical bundle, whose linear combinations give a homogeneous polynomial
that specifies a CY hypersurface $X$ in $\cal A$. For this example, there are
80 sections, and we select random coefficients, corresponding to a generic
choice for the complex structure moduli of the CY. Rather than writing out
this lengthy expression, we note that a different random choice leads to
comparable performance for the metric model.

Following the method described in Section 2.7, we sample points on $X$ using
the toric point generator of cymetric. For this we note that the GLSM charges
are

$\left(\begin{array}[]{rrrrrr}1&0&1&1&0&1\\\
0&1&0&0&1&-2\end{array}\right)\;.$ (5.16)

The Stanley-Reisner ideal is given by

$\text{SRI}=\langle x^{1}x^{4},x^{0}x^{2}x^{3}x^{5}\rangle\,,$ (5.17)

from which we can of course also infer the fibration structure of
$\mathbb{P}^{1}$ over $\mathbb{P}^{3}$.

Using the GLSM charges we may read off the homogeneous scalings of the toric
coordinates, and deduce the relations between the divisors:

$D_{0}\sim D_{2}\sim D_{3}\;,\;D_{1}\sim D_{4}\;,\;D_{5}\sim D_{0}-2D_{1}\;.$
(5.18)

We may thus choose $J_{1}=D_{1}$ and $J_{2}=D_{3}$ as generators for the
Kähler cone, with non-vanishing triple intersection numbers given by

$d_{122}=d_{212}=d_{221}=4\;,\;d_{222}=8\;.$ (5.19)

Finally, the sections of the Kähler cone generators are, for this example,

$\displaystyle H^{0}(J_{1})=(x_{1},x_{4})\,,\qquad
H^{0}(J_{2})=(x_{0},x_{2},x_{3},x_{1}^{2}x_{5},x_{4}^{2}x_{5},x_{1}x_{4}x_{5})\,,$
(5.20)

(which by (5.16) all have the appropriate scaling). This defines the morphisms
$\Phi_{1,2}$ into $\mathbbm{P}^{1}$ and $\mathbbm{P}^{5}$, respectively, and
allow us to construct points on the CY as discussed in Section 2.7.

####  5.3.2 Training with $\phi$-model

We have performed five experiments using the $\phi$-model and a neural network
with width $256$, $3$ hidden layers, GELU activation functions and
initialization with $\mathcal{N}(0,\;0.01)$. The network is trained for $100$
epochs with a training set of $200,000$ points, and error measures are
computed on a validation set of $20,000$ points. We chose default values for
$\alpha$ using a SGD optimizer with learning rate $5/10000$ and momentum
$0.95$, and the batch sizes for the optimization steps were $(128,\;10000)$.
It was observed in the design phase that the two updates with different batch
sizes required to minimize the Monge-Amère loss while staying in the reference
Kähler class, sometimes lead to the determinant of the predicted metric
turning negative in isolated points during training. To ameliorate the long
term effects of this behavior, training was conducted with lower learning rate
and a larger momentum compared to the bicubic runs. The training took a couple
of hours on a single GPU.

Figure 3: KS CY experiments: a) Monge-Ampère and Kähler class loss on training
data; b) volume c) $\sigma$ measure and d) $\mathcal{R}$ measure on validation
data. The plots show the averaged performance of five separate experiments for
the $\phi$ model, including 95% confidence intervals as light-hue bands around
each curve.

The results of the five experiments are shown in Figure 3. We observe that the
Monge-Ampère loss, $\mathcal{L}_{\text{MA}}$, decreases steadily over
training, totaling to a factor 4 decrease over 100 epochs. While this is
certainly less impressive than the improvement on the quintic, learning
clearly takes place. For the $\phi$ model, the transition and Kähler losses
are automatically zero, and hence are disabled. The decrease in the Kähler
class loss, $\mathcal{L}_{\text{Kclass}}$, is also a factor 4, and the volume
stays approximately constant around 20, which is the true value. The $\sigma$
measure, which is calculated on validation data, also decreases steadily over
training, showing that the NN provides a better and better solution to the
Monge-Ampère equation. The most interesting part of this experiment is the
evolution of the Ricci measure. During the initial 20 epochs, this goes
through sharp spikes, corresponding to occurrences of points where the
determinant of the predicted metric
$g_{\text{pr}}=g_{\text{FS}}+\partial\bar{\partial}\phi$ becomes negative.
This unphysical behavior is not lasting, and the training converges to a Ricci
measure of around 5. While this is clearly non-zero, training decreases $\cal
R$ by roughly $37\%$.

As for the bicubic, we can now compute the volume of the CY using the
intersection numbers, FS and CY metric. We find, for $t_{1}=t_{2}=1$,

$V_{\rm int}=20\;,\quad V_{\text{FS}}=19.98\;,\quad V_{\text{CY}}=19.89\;,$
(5.21)

using Eq. (5.2) and the intersection numbers given in (5.19), and
$V_{\text{CY}}$ refers to the network’s prediction for the CY volume after the
training is completed, and is here computed as the mean of the five
runs.121212For the five experiments, we find
$V_{\text{CY}}=\\{19.92\,,19.73\,,20.34\,,19.49\,,19.96\\}$, respectively. We
find that the volumes agree within 1 %, a result that testifies to the
accuracy of the point generating routine and metric prediction.

##  6 Conclusions

In this paper, we have presented methods and results for numerical CY metrics
in the context of machine learning algorithms. Broadly, we have made progress
in four directions. 1) The library cymetric presented here contains functions
which can be applied to the numerical computation of CY metrics on a wide
range of manifolds, namely to complete intersection CYs in products of
projective spaces (CICYs) and to CY manifolds obtained from the Kreuzer-Skarke
(KS) list. 2) In particular, we have realized point sampling for CY
hypersurfaces in general toric ambient spaces. 3) We have shown how line
bundle slopes can be used to obtain the numerical CY metric for given points
in Kähler moduli space. 4) We have used the cymetric library to obtain new
results on the bi-cubic CY, including the computation of volumes, slopes and
Hermitian Yang-Mills (HYM) connections on line bundles, and on a Picard number
two CY from the KS list.

The cymetric library consists of two main parts: the point generator and
neural networks which are used to predict the CY metric. For CICYs it is known
for some time how to generate point samples with a defined distribution,
following an algorithm explained in Refs. [16, 17] which is based on a theorem
by Shiffman and Zelditch [49]. For CY hypersurfaces in toric varieties we have
generalized this algorithm, making use of projective embeddings and the
Shiffman-Zelditch theorem. Both versions of this algorithm, covering CICYs and
KS manifolds, have been realized in the cymetric library.

The CY metric can be represented by a neural network in a number of ways and
the cymetric library contains five possible realizations, as summarized in
Table 1. To ensure that all NNs converge to the Ricci-flat CY metric for the
specified values of the moduli, we use a custom loss function with five
contributions. They encode the Monge-Ampère equation, the Ricci scalar, the
Kähler property of the metric, the correct transition functions between
coordinate patches, and the correct Kähler class. For the CY manifolds
considered in this papers, the so called $\phi$-network (the last entry in
Table 1), built from an exact correction to a reference Kähler metric,
performs the best. This is largely explained by the fact that this Ansatz
guarantees the Kähler and transition loss conditions are automatically
satisfied. However, other network Ansätze might well turn out to be useful for
different CY manifolds. They can also be adapted to non-Kähler situations, for
example in the context of special structure manifolds with torsion [32].

In addition to testing our library on the quintic CY we have also performed
runs on the bi-cubic CY, a manifold with Picard number two. On this manifold,
we have computed the numerical metric at seven specific points in Kähler
moduli space. The results have been used to compute, via numerical integration
with the CY metric, the CY volumes and some line bundle slopes at those seven
points in moduli space. These quantities can also be computed exactly by
intersection formulae and the good agreement of our numerical results,
typically at the level of $\sim 1\%$ or smaller for the volume and a few
percent for the slope, confirms that the numerical metrics have indeed been
computed at the correct points in moduli space. We have also considered a
Picard number two CY from the KS list and have carried out a computation of
the CY metric at a specific point in its Kähler moduli. Again, we were able to
reproduce the CY volume from numerical integration, indicating that the toric
point generator works correctly and that the metric is indeed computed at the
desired point in Kähler moduli space.

In a final step we have used the numerical CY metric to find numerical
solutions of the HYM equation for line bundles on the bicubic. A necessary and
sufficient condition for the existence of such solutions is that the line
bundle has vanishing slope, a condition which can, depending on the choice of
the bundle, be satisfied at some particular locus in Kähler moduli space.
Using the cymetric package, we have computed the numerical CY metric at such a
point in moduli space. At this point we have then numerically solved the HYM
equation for the line bundle metric, which can be cast in the form of an
inhomogeneous Laplace equation. In this way, we find a numerical HYM line
bundle metric at percent-level accuracy.

The goal is for cymetric to become an active open source community project
similar to popular projects in the machine learning community. To this end we
encourage researchers to include their own models and extensions. In the
future, we plan to expand its capabilities by adding new models and neural
network architectures based on more extensive ablation studies. It is
important to emphasize that algebraic metrics such as in Ref. [22] can be
implemented as special cases, by creating a custom network that just learns
the coefficients in the polynomial approximating the Kähler potential. The
same holds true for learning metrics, akin to the $h$-balanced metric from
Donaldson’s algorithm, on holomorphic sections of line bundles. The package
then allows the full power of the TensorFlow optimizer to be applied in this
context. We hope that the generality and flexibility of the package will help
to solve important physics problems, such as, for example, the calculation of
the physical Yukawa couplings from string theory.

There are a number of interesting additions, modifications and new directions
which should be mentioned. It may be interesting to try out different methods
for point sampling, for example a Markov Chain Monte Carlo sampling based on
the measure $dV_{\Omega}$, in order to complement (and check) the methods
based on the Shiffman and Zelditch theorem. The cymetric library allows
computing the CY metric at given, specified points in moduli space. It would
be interesting to use this feature and study the dependence of the CY metric
on the moduli in more detail. We should also point out that, while the present
paper has focused on CY three-folds, the cymetric library can be applied to CY
$n$-folds more generally. For example, it would be interesting to compute CY
metrics on K3 and compare with recent analytic solutions found in Ref. [9, 8],
or compute a CY metric on a four-fold. Another direction is to investigate
whether the present methods generalize to related settings, such as to
manifolds with SU(3)-structure [52] or manifolds with $G_{2}$ holonomy. Work
in this direction is in progress.

## Acknowledgments

We thank Callum Brodie for useful discussions. The work of FR is supported by
startup funding from Northeastern University. The work of ML and RS is funded
by Vetenskapsrådet, under grant 2020-03230. Computations were in part enabled
by resources provided by the Swedish National Infrastructure for Computing
(SNIC) at the HPC cluster _Tetralith_ , partially funded by the
Vetenskapsrådet through grant agreement no. 2018-05973, the hydra cluster of
the Physics Department at the University of Oxford, and the computing cluster
at CERN.

##  Appendix A Some toric geometry

We collect some results from toric geometry that are used in the main part of
the text. Toric varieties serve as ambient spaces for the CY manifolds we want
to study. We will restrict the discussion to the case where the CY manifold is
given as a hypersurface in a toric ambient space or as a complete intersection
in a direct product of projective ambient spaces. We will focus on the parts
relevant to this setup only, and use succinct and simple exposition, somewhat
at the expense of precise terminology (for example, we will be referring to
finitely generated strongly convex rational polyhedral cones simply as cones).
For an introduction to toric geometry see the excellent textbooks [47] and
[53].

Throughout the discussion, we focus on the more general toric case, and point
out how this simplifies for (products of) projective spaces along the way.

###  A.1 Fan and cones

A $d$-dimensional toric variety is described in terms of a fan, which is a
collection of $k$-dimensional cones, where $k=0,1,\ldots,d$. The one-
dimensional cones $v_{i}$ are called rays, and they generate a lattice
$N\subseteq\mathbbm{Z}^{d}$. Each vertex $v_{i}\in N$, $i=1,\ldots,n$
corresponds to one homogeneous coordinate $x_{i}$ of the toric ambient space.
Their toric scalings $q_{\alpha}$ are given by the kernel of the vertex
matrix:

$\displaystyle
q_{\alpha}^{i}v_{i}=0\qquad\Rightarrow\qquad(x_{1},x_{2},\ldots,x_{n})~{}\to~{}(\lambda_{\alpha}^{q_{\alpha}^{1}}x_{1},\lambda_{\alpha}^{q_{\alpha}^{2}}x_{2},\ldots,\lambda_{\alpha}^{q_{\alpha}^{n}}x_{n})\,.$
(A.1)

The matrix $q_{\alpha}^{i}$ is called the GLSM charge matrix or the Mori cone
matrix. Note that for a given set of charge vectors $\vec{q}_{\alpha}$, we can
form a new set $\vec{q}_{\beta}=R^{\alpha}_{\beta}\vec{q}_{\alpha}$ by
rotating the charges. One typically chooses the basis such that the GLSM
D-terms

$\displaystyle\sum_{i}q_{\alpha}^{i}|x_{i}|^{2}=t_{\alpha}$ (A.2)

have a solution for Kähler parameters $t_{\alpha}\geq 0$.

For a projective ambient space $\mathbbm{P}^{n_{\alpha}}$, the GLSM charge
matrix is simply $q_{\alpha}^{i}=(1,1,\ldots,1)$ with
$i=1,\ldots,n_{\alpha}+1$. Hence, for products of projective ambient spaces,
we obtain a block-diagonal charge matrix . In contrast to the toric case, this
does not encode any information beyond what is specified by just giving the
dimensions $n_{\alpha}$ of the projective ambient space factors.

The top-dimensional, that is, $d$-dimensional, cones are called facets. All
other cones are typically just referred to as faces. A $k$-dimensional cone
$\sigma_{i_{1},i_{2},\ldots,i_{k}}$ in $N_{\mathbbm{R}}=N\times\mathbbm{R}$ is
generated by vertices $v_{i_{1}},v_{i_{2}},\ldots,v_{i_{k}}$,

$\displaystyle\sigma_{i_{1},i_{2},\ldots,i_{k}}=\left\\{\left.\sum_{i=1}^{k}\lambda_{i}v_{i}\in
N_{\mathbbm{R}}~{}\right|~{}\lambda_{i}\geq 0\quad\forall k\right\\}\,.$ (A.3)

Associated to this, we can define a dual cone $\sigma^{*}$ in the dual lattice
$M_{\mathbbm{R}}\subseteq\mathbbm{Z}^{d}$,

$\displaystyle\sigma^{*}_{i_{1},i_{2},\ldots,i_{k}}=\left\\{\left.w\in
M~{}\right|~{}\langle v,w\rangle\geq 0\quad\forall
v\in\sigma_{i_{1},i_{2},\ldots,i_{k}}\right\\}\,.$ (A.4)

Note that the dual of a top-dimensional cone
$\sigma_{i_{1},i_{2},\ldots,i_{d}}$ is again $d$-dimensional.

###  A.2 Affine patches

Each top-dimensional cone $\sigma$ of a fan corresponds to an affine patch
$\mathbbm{C}^{d}$. The coordinates that are allowed to vanish in this patch
are the ones given by the generators of $\sigma$, while all others are non-
vanishing. We can construct the affine coordinates $z_{\mu}$ from the dual
cone $\sigma^{*}$ by taking the product of all coordinates $x_{i}$ with
exponents given by the inner product of the corresponding vertex $v_{i}$ with
the generators $w_{\mu}$ of the dual cone $\sigma^{*}$, so that

$\displaystyle z_{\mu}=\prod_{i=1}^{n}x_{i}^{\langle v_{i},w_{\mu}\rangle}\,.$
(A.5)

Note that in particular $\sigma^{*}$ is $d$-dimensional. Hence a toric variety
of complex dimension $d$ always has $d$ affine coordinates in any given patch.
For a projective ambient space $\mathbbm{P}^{n_{\alpha}}$, this construction
reduces to the standard patches $\mathcal{U}_{a}=\\{z_{a}\neq 0\\}$ with
affine coordinates $z_{\mu}=x_{i}/x_{a}$ for $i\neq a$.

###  A.3 Divisors and Stanley-Reisner ideal

Each vertex $v_{i}\in N$ corresponds to one homogeneous coordinate $x_{i}$ of
the toric ambient space. Hence, we can introduce a set of (in general linearly
dependent) divisors $D_{i}:=\\{x_{i}=0\\}$. Two ambient space divisors
$D=\sum_{i}c_{i}D_{i}$ and $D^{\prime}=\sum_{i}c_{i}^{\prime}D_{i}$ for some
$c_{i},c^{\prime}_{i}\in\mathbbm{Z}$ are linearly equivalent if all their GLSM
charges agree,

$\displaystyle D\sim
D^{\prime}\qquad\Leftrightarrow\qquad\sum_{i}c_{i}q_{\alpha}^{i}=\sum_{i}c_{i}^{\prime}q_{\alpha}^{j}\quad\forall\alpha\,.$
(A.6)

In particular, this means that favorable CYs (that is, CYs which inherit the
entire second cohomology from the ambient space) lead to the index range
$\alpha=1,2,\ldots,h^{1,1}(X)$.

If certain divisors are not contained in a common cone of the fan, they cannot
vanish simultaneously. We associate a monomial $s=\prod x_{i}$ to each such
combination. The collection of these monomials generates an ideal,

$\displaystyle\text{SRI}=\langle s_{i}\rangle\,,$ (A.7)

called the Stanley-Reisner ideal. A toric variety is specified by the GLSM
charges and the SRI, or, equivalently, by its vertices plus a chosen
triangulation.

For a projective space $\mathbbm{P}^{n_{\alpha}}$, the Stanley-Reisner ideal
is generated by a single monomial, $\text{SRI}=\langle x_{0}x_{1}\ldots
x_{n_{\alpha}}\rangle$, which corresponds to the familiar statement that not
all coordinates of $\mathbbm{P}^{n_{\alpha}}$ can vanish simultaneously.

###  A.4 Line bundles and sections

The sections of a line bundle $L$ associated to a divisor can be readily
computed from the vertices $v_{i}$ of $N$ and their dual vertices $w$ in the
dual lattice $M$:

$\displaystyle
D=\sum_{i=1}^{n}c_{i}D_{i}\quad\rightarrow\quad\Gamma(D)\sim\left\\{\left.\prod_{i=1}^{n}x_{i}^{\langle
v_{i},w\rangle+c_{i}}~{}\right|~{}\langle v_{i},w\rangle+c_{i}\geq 0\,,\quad
w\in M\right\\}\,.$ (A.8)

Note that for non-negative $c_{i}$, only finitely many $w\in M$ satisfy the
condition $\langle v_{i},w\rangle+c_{i}\geq 0$. For a divisor $D$ inside a
product of $n$ projective ambient spaces, this reduces to the statement that a
section basis for $D$ is given by the monomials of multi-degree
$(c_{1},c_{2},\ldots,c_{n})$.

One can prove a theorem which will be important for constructing Kähler forms
later. It states that for any nef divisor (or rather the sections of the
associated nef line bundle), precisely one of the monomials that form a basis
of the sections vanishes nowhere in a given patch. This means that the base-
point free divisors are given by sections of nef line bundles.

Since the anti-canonical divisor of a toric variety is given by the sum over
all divisors, $-K=\sum_{i=1}^{n}D_{i}$ where $n$ is the number of vertices,
this motivates defining a lattice polytope $P\in N$ given by the convex hull
of all vertices $v_{i}$, and its dual lattice polytope $P^{*}\in M$ in the
dual $M$-lattice via

$\displaystyle P^{*}:=\left.\left\\{w_{i}\in N~{}\right|~{}\langle
v_{i},w_{j}\rangle\geq-1\quad\forall v_{i}\in P\right\\}\,.$ (A.9)

For the purpose of CYs given as hypersurfaces in toric varieties, we only need
to look at reflexive polytopes, which are lattice polytopes whose dual are
again lattice polytopes. All reflexive polytopes have the origin as their
unique interior point. Their dual is also a reflexive polytope and satisfies
$(P^{*})^{*}=P$. With this, it is easy to find a basis of sections of the
anti-canonical bundle and which then allows writing down the most general CY
defining equation

$\displaystyle p=\sum_{w\in P^{*}}c_{w}\prod_{i=1}^{n}x_{i}^{\langle
v_{i},w\rangle}\,.$ (A.10)

Here, the coefficients $c_{w}\in\mathbbm{C}$ parameterize the complex
structure of the CY.

In the case of ambient spaces $\mathcal{A}$ that are a product of projective
spaces, $\mathcal{A}=\otimes_{\alpha=1}^{N}\mathbbm{P}^{n_{\alpha}}$, we are
considering complete intersections of $k$ hypersurfaces $H_{i}$,
$i=1,\ldots,k$ rather than just a single hypersurface. This requires
specifying the multi-degrees, $c^{\alpha}_{i}$, of the normal bundle sections
whose complete intersection defines the CY manifold. The CY condition amounts
to the constraints $\sum_{i}c^{\alpha}_{i}=n_{\alpha}+1$, where
$\alpha=1,\ldots,k$, on these multi-degrees. (In the toric case, this gives
rise to nef partitions of the reflexive polytope, but we will not consider
such cases here, even though our methods still apply.) Moreover, for a CY
$d$-fold, we require that $\sum_{\alpha}n_{\alpha}-k=d$. This means that we
can specify a complete intersection CY manifold inside an ambient space that
is given as a product of projective spaces purely by specifying the degrees
$c^{\alpha}_{i}$, which form a matrix referred to as the ’configuration
matrix’ of the CICY.

## References

  * [1] P. Candelas, G. T. Horowitz, A. Strominger, and E. Witten “Vacuum Configurations for Superstrings,” Nucl. Phys. B 258 (1985) 46–74.
  * [2] P. S. Green, T. Hubsch, and C. A. Lutken “All Hodge Numbers of All Complete Intersection Calabi-Yau Manifolds,” Class. Quant. Grav. 6 (1989) 105–124.
  * [3] P. Candelas, A. M. Dale, C. A. Lutken, and R. Schimmrigk “Complete Intersection Calabi-Yau Manifolds,” Nucl. Phys. B298 (1988) 493\.
  * [4] M. Kreuzer and H. Skarke “Complete classification of reflexive polyhedra in four-dimensions,” Adv. Theor. Math. Phys. 4 (2002) 1209–1230 [hep-th/0002240].
  * [5] T. Hubsch Calabi-Yau manifolds: A Bestiary for physicists.  World Scientific Singapore 1994\.
  * [6] E. Calabi On Kähler Manifolds with Vanishing Canonical Class: pp. 78–89.  Princeton University Press 2015.
  * [7] S.-T. Yau “On the ricci curvature of a compact kähler manifold and the complex monge-ampére equation, I,” Commun. Pure Appl. Math. 31 (1978) no. 3, 339–411.
  * [8] S. Kachru, A. Tripathy, and M. Zimet “K3 metrics,” [2006.02435].
  * [9] S. Kachru, A. Tripathy, and M. Zimet “K3 metrics from little string theory,” [1810.10540].
  * [10] M. B. Green, J. H. Schwarz, and E. Witten Superstring theory: volume 2, loop amplitudes, anomalies and phenomenology.  Cambridge university press 2012.
  * [11] A. Ashmore and F. Ruehle “Moduli-dependent KK towers and the swampland distance conjecture on the quintic Calabi-Yau manifold,” Phys. Rev. D 103 (2021) no. 10, 106028 [2103.07472].
  * [12] A. Strominger, S.-T. Yau, and E. Zaslow “Mirror symmetry is T duality,” Nucl. Phys. B 479 (1996) 243–259 [hep-th/9606040].
  * [13] K. Hori, S. Katz, R. Pandharipande, R. Vakil, and E. Zaslow Mirror symmetry vol. 1.  American Mathematical Soc. 2003.
  * [14] S. K. Donaldson “Some numerical results in complex differential geometry,” 2005\.
  * [15] M. R. Douglas, R. L. Karp, S. Lukic, and R. Reinbacher “Numerical solution to the hermitian Yang-Mills equation on the Fermat quintic,” JHEP 12 (2007) 083 [hep-th/0606261].
  * [16] M. R. Douglas, R. L. Karp, S. Lukic, and R. Reinbacher “Numerical Calabi-Yau metrics,” J. Math. Phys. 49 (2008) 032302 [hep-th/0612075].
  * [17] V. Braun, T. Brelidze, M. R. Douglas, and B. A. Ovrut “Calabi-Yau Metrics for Quotients and Complete Intersections,” JHEP 05 (2008) 080 [0712.3563].
  * [18] V. Braun, T. Brelidze, M. R. Douglas, and B. A. Ovrut “Eigenvalues and Eigenfunctions of the Scalar Laplace Operator on Calabi-Yau Manifolds,” JHEP 07 (2008) 120 [0805.3689].
  * [19] N. Afkhami-Jeddi, A. Ashmore, and C. Cordova “Calabi-Yau CFTs and random matrices,” JHEP 02 (2022) 021 [2107.11461].
  * [20] L. B. Anderson, V. Braun, R. L. Karp, and B. A. Ovrut “Numerical Hermitian Yang-Mills Connections and Vector Bundle Stability in Heterotic Theories,” JHEP 06 (2010) 107 [1004.4399].
  * [21] L. B. Anderson, V. Braun, and B. A. Ovrut “Numerical Hermitian Yang-Mills Connections and Kahler Cone Substructure,” JHEP 01 (2012) 014 [1103.3041].
  * [22] M. Headrick and A. Nassar “Energy functionals for Calabi-Yau metrics,” Adv. Theor. Math. Phys. 17 (2013) no. 5, 867–902 [0908.2635].
  * [23] W. Cui and J. Gray “Numerical Metrics, Curvature Expansions and Calabi-Yau Manifolds,” JHEP 05 (2020) 044 [1912.11068].
  * [24] A. Ashmore, L. Calmon, Y.-H. He, and B. A. Ovrut “Calabi-Yau Metrics, Energy Functionals and Machine-Learning,” [2112.10872].
  * [25] Y.-H. He “Deep-Learning the Landscape,” [1706.02714].
  * [26] F. Ruehle “Evolving neural networks with genetic algorithms to study the String Landscape,” JHEP 08 (2017) 038 [1706.07024].
  * [27] D. Krefl and R.-K. Seong “Machine Learning of Calabi-Yau Volumes,” Phys. Rev. D 96 (2017) no. 6, 066014 [1706.03346].
  * [28] J. Carifio, J. Halverson, D. Krioukov, and B. D. Nelson “Machine Learning in the String Landscape,” JHEP 09 (2017) 157 [1707.00655].
  * [29] F. Ruehle “Data science applications to string theory,” Phys. Rept. 839 (2020) 1–117.
  * [30] A. Ashmore, Y.-H. He, and B. A. Ovrut “Machine Learning Calabi–Yau Metrics,” Fortsch. Phys. 68 (2020) no. 9, 2000068 [1910.08605].
  * [31] M. R. Douglas, S. Lakshminarasimhan, and Y. Qi “Numerical Calabi-Yau metrics from holomorphic networks,” [2012.04797].
  * [32] L. B. Anderson, M. Gerdes, J. Gray, S. Krippendorf, N. Raghuram, and F. Ruehle “Moduli-dependent Calabi-Yau and SU(3)-structure metrics from Machine Learning,” JHEP 05 (2021) 013 [2012.04656].
  * [33] V. Jejjala, D. K. Mayorga Pena, and C. Mishra “Neural Network Approximations for Calabi-Yau Metrics,” [2012.15821].
  * [34] M. Larfors, A. Lukas, F. Ruehle, and R. Schneider “Learning Size and Shape of Calabi-Yau Spaces,” Machine Learning and the Physical Sciences, Workshop at 35th NeurIPS (2021) [2111.01436].
  * [35] A. Ashmore, R. Deen, Y.-H. He, and B. A. Ovrut “Machine Learning Line Bundle Connections,” [2110.12483].
  * [36] W. R. Inc. “Mathematica, Version 12.3.1.”  Champaign, IL, 2021.
  * [37] C. R. Harris, K. J. Millman, S. J. van der Walt, R. Gommers, P. Virtanen, D. Cournapeau, E. Wieser, J. Taylor, S. Berg, N. J. Smith, R. Kern, M. Picus, S. Hoyer, M. H. van Kerkwijk, M. Brett, A. Haldane, J. F. del Río, M. Wiebe, P. Peterson, P. Gérard-Marchant, K. Sheppard, T. Reddy, W. Weckesser, H. Abbasi, C. Gohlke, and T. E. Oliphant “Array programming with NumPy,” Nature 585 (2020) no. 7825, 357–362.
  * [38] Wes McKinney “Data Structures for Statistical Computing in Python,” in Proceedings of the 9th Python in Science Conference, Stéfan van der Walt and Jarrod Millman, eds. pp. 56 – 61.  2010\.
  * [39] The Sage Developers SageMath, the Sage Mathematics Software System (Version 9.4.0) 2021\.  https://www.sagemath.org.
  * [40] M. Abadi, A. Agarwal, P. Barham, E. Brevdo, Z. Chen, C. Citro, G. S. Corrado, A. Davis, J. Dean, M. Devin, S. Ghemawat, I. Goodfellow, A. Harp, G. Irving, M. Isard, Y. Jia, R. Jozefowicz, L. Kaiser, M. Kudlur, J. Levenberg, D. Mané, R. Monga, S. Moore, D. Murray, C. Olah, M. Schuster, J. Shlens, B. Steiner, I. Sutskever, K. Talwar, P. Tucker, V. Vanhoucke, V. Vasudevan, F. Viégas, O. Vinyals, P. Warden, M. Wattenberg, M. Wicke, Y. Yu, and X. Zheng “TensorFlow: Large-scale machine learning on heterogeneous systems,” 2015.  Software available from tensorflow.org.
  * [41] A. Novoseltsev and V. Braun SageMath, Toric varieties (Version 9.4.0) 2021\.  https://doc.sagemath.org/html/en/reference/schemes/sage/schemes/toric/variety.html.
  * [42] M. Kreuzer and H. Skarke “PALP: A Package for analyzing lattice polytopes with applications to toric geometry,” Comput. Phys. Commun. 157 (2004) 87–106 [math/0204356].
  * [43] M. Demirtas and A. Rios-Tascon CY Tools - A software package for analyzing Calabi-Yau hypersurfaces in toric varieties. 2021\.
  * [44] J. Gray, Y.-H. He, A. Ilderton, and A. Lukas “STRINGVACUA: A Mathematica Package for Studying Vacuum Configurations in String Phenomenology,” Comput. Phys. Commun. 180 (2009) 107–119 [0801.1508].
  * [45] “cohomcalg package.” https://github.com/BenjaminJurke/cohomCalg 2010\.  High-performance line bundle cohomology computation based on [54].
  * [46] M. Larfors and R. Schneider pyCICY - A python CICY toolkit 6, 2019.  Implemented for [55].
  * [47] D. Cox, J. Little, and H. Schenck Toric Varieties.  Graduate studies in mathematics. American Mathematical Soc. 2011.
  * [48] M. Borinsky, A.-L. Sattelberger, B. Sturmfels, and S. Telen “Bayesian Integrals on Toric Varieties,” Apr., 2022.
  * [49] B. Shiffman and S. Zelditch “Distribution of zeros of random and quantum chaotic sections of positive line bundles,” Communications in Mathematical Physics 200 (Feb, 1999) 661–683.
  * [50] P. Mehta, M. Bukov, C.-H. Wang, A. G. R. Day, C. Richardson, C. K. Fisher, and D. J. Schwab “A high-bias, low-variance introduction to Machine Learning for physicists,” Phys. Rept. 810 (2019) 1–124 [1803.08823].
  * [51] R. Schneider Heterotic Compactifications in the Era of Data Science.  PhD thesis Uppsala U. 2022.
  * [52] M. Larfors, A. Lukas, and F. Ruehle “Calabi-Yau Manifolds and SU(3) Structure,” JHEP 01 (2019) 171 [1805.08499].
  * [53] W. Fulton Introduction to toric varieties.  Annals of mathematics studies. Princeton Univ. Press Princeton, NJ 1993\.
  * [54] T. Rahn and H. Roschy “Cohomology of Line Bundles: Proof of the Algorithm,” J. Math. Phys. 51 (2010) 103520 [1006.2392].
  * [55] M. Larfors and R. Schneider “Line bundle cohomologies on CICYs with Picard number two,” Fortsch. Phys. 67 (2019) no. 12, 1900083 [1906.00392].