Introduction

Algebraic geometry describes shapes as the solution sets of systems of polynomial equations, and manipulates or analyses a shape X by manipulating or analysing the equations that define X. This interplay between algebra and geometry has applications across mathematics and science; see e.g., refs. 1,2,3,4. Shapes defined by polynomial equations are called algebraic varieties. Fano varieties are a key class of algebraic varieties. They are, in a precise sense, atomic pieces of mathematical shapes5,6. Fano varieties also play an essential role in string theory. They provide, through their ‘anticanonical sections’, the main construction of the Calabi–Yau manifolds which give geometric models of spacetime7,8,9.

The classification of Fano varieties is a long-standing open problem. The only one-dimensional example is a line; this is classical. The ten smooth two-dimensional Fano varieties were found by del Pezzo in the 1880s10. The classification of smooth Fano varieties in dimension three was a triumph of 20th century mathematics: it combines work by Fano in the 1930s, Iskovskikh in the 1970s, and Mori–Mukai in the 1980s11,12,13,14,15,16. Beyond this, little is known, particularly for the important case of Fano varieties that are not smooth.

A new approach to Fano classification centres around a set of ideas from string theory called Mirror Symmetry17,18,19,20. From this perspective, the key invariant of a Fano variety is its regularised quantum period21

$${\widehat{G}}_{X}(t)= \mathop{\sum }\limits_{d= 0}^{\infty }{c}_{d}{t}^{d}$$
(1)

This is a power series with coefficients c0 = 1, c1 = 0, and cd = rdd!, where rd is a certain Gromov–Witten invariant of X. Intuitively speaking, rd is the number of rational curves in X of degree d that pass through a fixed generic point and have a certain constraint on their complex structure. In general rd can be a rational number, because curves with a symmetry group of order k are counted with weight 1/k, but in all known cases the coefficients cd in (1) are integers.

It is expected that the regularised quantum period \({\widehat{G}}_{X}\) uniquely determines X. This is true (and proven) for smooth Fano varieties in low dimensions, but is unknown in dimensions four and higher, and for Fano varieties that are not smooth.

In this paper we will treat the regularised quantum period as a numerical signature for the Fano variety X, given by the sequence of integers (c0, c1, …). A priori this looks like an infinite amount of data, but in fact there is a differential operator L such that \(L{\widehat{G}}_{X}\equiv 0\); see e.g., [ref. 21, Theorem 4.3]. This gives a recurrence relation that determines all of the coefficients cd from the first few terms, so the regularised quantum period \({\widehat{G}}_{X}\) contains only a finite amount of information. Encoding a Fano variety X by a vector in \({{\mathbb{Z}}}^{m+1}\) given by finitely many coefficients (c0, c1, …, cm) of the regularised quantum period allows us to investigate questions about Fano varieties using machine learning.

In this paper, we ask whether the regularised quantum period of a Fano variety X knows the dimension of X. There is currently no viable theoretical approach to this question. Instead, we use machine learning methods applied to a large dataset to argue that the answer is probably yes, and then prove that the answer is yes for toric Fano varieties of low Picard rank. The use of machine learning was essential to the formulation of our rigorous results (Theorems 5 and 6 below). This work is, therefore, proof-of-concept for a larger programme, demonstrating that machine learning can uncover previously unknown structure in complex mathematical datasets. Thus, the Data Revolution, which has had such impact across the rest of science, also brings important new insights to pure mathematics22,23,24,25,26,27. This is particularly true for large-scale classification questions, e.g., refs. 28,29,30,31,32, where these methods can potentially reveal both the classification itself and structural relationships within it.

Results

Algebraic varieties can be smooth or have singularities

Depending on their equations, algebraic varieties can be smooth (as in Fig. 1a) or have singularities (as in Fig. 1b). In this paper, we consider algebraic varieties over the complex numbers. The equations in Fig. 1a, b, therefore, define complex surfaces; however, for ease of visualisation, we have plotted only the points on these surfaces with co-ordinates that are real numbers.

Fig. 1: Algebraic varieties and their equations.
figure 1

a A smooth example (x2 + y2 = z2 + 1); b An example with a singular point (x2 + y2 = z2).

Most of the algebraic varieties that we consider below will be singular, but they all have a class of singularities called terminal quotient singularities. This is the most natural class of singularities to allow from the point of view of Fano classification6. Terminal quotient singularities are very mild; indeed, in dimensions one and two, an algebraic variety has terminal quotient singularities if and only if it is smooth.

The Fano varieties that we consider

The fundamental example of a Fano variety is projective space \({{\mathbb{P}}}^{N-1}\). This is a quotient of \({{\mathbb{C}}}^{N}\setminus \{0\}\) by the group \({{\mathbb{C}}}^{\times }\), where the action of \(\lambda \in {{\mathbb{C}}}^{\times }\) identifies the points (x1, x2, …, xN) and (λx1, λx2, …, λxN). The resulting algebraic variety is smooth and has dimension N − 1. We will consider generalisations of projective spaces called weighted projective spaces and toric varieties of Picard rank two. A detailed introduction to these spaces is given in the Supplementary Notes.

To define a weighted projective space, choose positive integers a1, a2, …, aN such that any subset of size N − 1 has no common factor, and consider

$${\mathbb{P}}({a}_{1},{a}_{2},\ldots,{a}_{N})= ({{\mathbb{C}}}^{N}\setminus \{0\})/{{\mathbb{C}}}^{\times }$$

where the action of \(\lambda \in {{\mathbb{C}}}^{\times }\) identifies the points

$$({x}_{1},\,{x}_{2},\ldots,\,{x}_{N})\quad {{{{{{{\rm{and}}}}}}}}\quad ({\lambda }^{{a}_{1}}{x}_{1},\,{\lambda }^{{a}_{2}}{x}_{2},\ldots,\,{\lambda }^{{a}_{N}}{x}_{N})$$

in \({{\mathbb{C}}}^{N}\setminus \{0\}\). The quotient \({\mathbb{P}}({a}_{1},{a}_{2},\ldots,{a}_{N})\) is an algebraic variety of dimension N − 1. A general point of \({\mathbb{P}}({a}_{1},{a}_{2},\ldots,{a}_{N})\) is smooth, but there can be singular points. Indeed, a weighted projective space \({\mathbb{P}}({a}_{1},{a}_{2},\ldots,{a}_{N})\) is smooth if and only if ai = 1 for all i, that is, if and only if it is a projective space.

To define a toric variety of Picard rank two, choose a matrix

$$\left(\begin{array}{cccc}{a}_{1}&{a}_{2}&\cdots \,&{a}_{N}\\ {b}_{1}&{b}_{2}&\cdots \,&{b}_{N}\end{array}\right)$$
(2)

with non-negative integer entries and no zero columns. This defines an action of \({{\mathbb{C}}}^{\times }\times {{\mathbb{C}}}^{\times }\) on \({{\mathbb{C}}}^{N}\), where \((\lambda,\, \mu )\in {{\mathbb{C}}}^{\times }\times {{\mathbb{C}}}^{\times }\) identifies the points

$$({x}_{1},\,{x}_{2},\ldots,\,{x}_{N})\quad {{{{{{{\rm{and}}}}}}}}\quad ({\lambda }^{{a}_{1}}{\mu }^{{b}_{1}}{x}_{1},\,{\lambda }^{{a}_{2}}{\mu }^{{b}_{2}}{x}_{2},\ldots,\,{\lambda }^{{a}_{N}}{\mu }^{{b}_{N}}{x}_{N})$$

in \({{\mathbb{C}}}^{N}\). Set a = a1 + a2 +  + aN and b = b1 + b2 +  + bN, and suppose that (a, b) is not a scalar multiple of (ai, bi) for any i. This determines linear subspaces

$$\begin{array}{rcl}{S}_{+}&= &\left\{({x}_{1},\, {x}_{2},\ldots,\,{x}_{N})| {x}_{i}= 0\,{{{{{{{\rm{if}}}}}}}}\,{b}_{i}/{a}_{i}\, < \,b/a\right\}\\ {S}_{-}&= &\left\{({x}_{1},\, {x}_{2},\ldots,\,{x}_{N})| {x}_{i}= 0\,{{{{{{{\rm{if}}}}}}}}\,{b}_{i}/{a}_{i}\, > \,b/a\right\}\end{array}$$

of \({{\mathbb{C}}}^{N}\), and we consider the quotient

$$X= ({{\mathbb{C}}}^{N}\setminus S)/({{\mathbb{C}}}^{\times }\times {{\mathbb{C}}}^{\times })$$
(3)

where S = S+S. The quotient X is an algebraic variety of dimension N − 2 and second Betti number b2(X) ≤ 2. If, as we assume henceforth, the subspaces S+ and S both have dimension two or more then b2(X) = 2, and thus X has Picard rank two. In general X will have singular points, the precise form of which is determined by the weights in (2).

There are closed formulas for the regularised quantum period of weighted projective spaces and toric varieties33. We have

$${\widehat{G}}_{{\mathbb{P}}}(t)= \mathop{\sum }\limits_{k= 0}^{\infty }\frac{(ak)!}{({a}_{1}k)!({a}_{2}k)!\cdots ({a}_{N}k)!}{t}^{ak}$$
(4)

where \({\mathbb{P}}= {\mathbb{P}}({a}_{1},\ldots,{a}_{N})\) and a = a1 + a2 +  + aN, and

$${\widehat{G}}_{X}(t)= \mathop{\sum}\limits_{(k,l)\in {{\mathbb{Z}}}^{2}\cap C}\frac{(ak+bl)!}{({a}_{1}k+{b}_{1}l)!\cdots ({a}_{N}k+{b}_{N}l)!}{t}^{ak+bl}$$
(5)

where the weights for X are as in (2), and C is the cone in \({{\mathbb{R}}}^{2}\) defined by the equations aix + biy ≥ 0, i\(\in\) {1, 2, …, N}. Formula (4) implies that, for weighted projective spaces, the coefficient cd from (1) is zero unless d is divisible by a. Formula (5) implies that, for toric varieties of Picard rank two, cd = 0 unless d is divisible by gcd{a, b}.

Data generation: weighted projective spaces

The following result characterises weighted projective spaces with terminal quotient singularities; this is [ref. 34, Proposition 2.3].

Proposition 1

Let \(X= {\mathbb{P}}({a}_{1},\,{a}_{2},\ldots,\,{a}_{N})\) be a weighted projective space of dimension at least three. Then X has terminal quotient singularities if and only if

$$\mathop{\sum }\limits_{i= 1}^{N}\{k{a}_{i}/a\}\in \{2,\ldots,\,N-2\}$$

for each k\(\in\) {2, …, a − 2}. Here a = a1 + a2 +  + aN and {q} denotes the fractional part q − q of \(q\in {\mathbb{Q}}\).

A simpler necessary condition is given by [ref. 35, Theorem 3.5]:

Proposition 2

Let \(X= {\mathbb{P}}({a}_{1},\,{a}_{2},\ldots,\,{a}_{N})\) be a weighted projective space of dimension at least two, with weights ordered a1a2 ≤ … ≤ aN. If X has terminal quotient singularities then ai/a < 1/(N − i + 2) for each i\(\in\) {3, …, N}.

Weighted projective spaces with terminal quotient singularities have been classified in dimensions up to four34,36. Classifications in higher dimensions are hindered by the lack of an effective upper bound on a.

We randomly generated 150,000 distinct weighted projective spaces with terminal quotient singularities, and with dimension up to 10, as follows. We generated random sequences of weights a1 ≤ a2 ≤ … ≤ aN with aN ≤ 10N and discarded them if they failed to satisfy any one of the following:

  1. 1.

    for each i\(\in\) {1, …, N}, \(\gcd \{{a}_{1},\ldots,\,{\widehat{a}}_{i},\ldots,\,{a}_{N}\}= 1\), where \({\widehat{a}}_{i}\) indicates that ai is omitted;

  2. 2.

    ai/a < 1/(N − i + 2) for each i\(\in\) {3, …, N};

  3. 3.

    \(\mathop{\sum }\nolimits_{i= 1}^{N}\{k{a}_{i}/a\}\in \{2,\ldots,\,N-2\}\) for each k\(\in\) {2, …, a − 2}.

Condition 1 here was part of our definition of weighted projective spaces above; it ensures that the set of singular points in \({\mathbb{P}}({a}_{1},{a}_{2},\ldots,{a}_{N})\) has dimension at most N − 2, and also that weighted projective spaces are isomorphic as algebraic varieties if and only if they have the same weights. Condition 2 is from Proposition 2; it efficiently rules out many non-terminal examples. Condition 3 is the necessary and sufficient condition from Proposition 1. We then deduplicated the sequences. The resulting sample sizes are summarised in Table 1.

Table 1 The distribution by dimension in our datasets

Data generation: toric varieties

Deduplicating randomly-generated toric varieties of Picard rank two is harder than deduplicating randomly-generated weighted projective spaces, because different weight matrices in (2) can give rise to the same toric variety. Toric varieties are uniquely determined, up to isomorphism, by a combinatorial object called a fan37. A fan is a collection of cones, and one can determine the singularities of a toric variety X from the geometry of the cones in the corresponding fan.

We randomly generated 200,000 distinct toric varieties of Picard rank two with terminal quotient singularities, and with dimension up to 10, as follows. We randomly generated weight matrices, as in (2), such that 0 ≤ ai, bj ≤ 5. We then discarded the weight matrix if any column was zero, and otherwise formed the corresponding fan F. We discarded the weight matrix unless:

  1. 1.

    F had N rays;

  2. 2.

    each cone in F was simplicial (i.e., has number of rays equal to its dimension);

  3. 3.

    the convex hull of the primitive generators of the rays of F contained no lattice points other than the rays and the origin.

Conditions 1 and 2 together guarantee that X has Picard rank two, and are equivalent to the conditions on the weight matrix in (2) given in our definition. Conditions 2 and 3 guarantee that X has terminal quotient singularities. We then deduplicated the weight matrices according to the isomorphism type of F, by putting F in normal form38,39. See Table 1 for a summary of the dataset.

Data analysis: weighted projective spaces

We computed an initial segment (c0, c1, …, cm) of the regularised quantum period for all the examples in the sample of 150,000 terminal weighted projective spaces, with m ≈ 100,000. The non-zero coefficients cd appeared to grow exponentially with d, and so we considered \({\{\log {c}_{d}\}}_{d\in S}\) where \(S= \{d\in {{\mathbb{Z}}}_{\ge 0}| {c}_{d}\,\ne \,0\}\). To reduce dimension, we fitted a linear model to the set \(\{(d,\log {c}_{d})| d\in S\}\) and used the slope and intercept of this model as features; see Fig. 2a for a typical example. Plotting the slope against the y-intercept and colouring datapoints according to the dimension we obtain Fig. 3a: note the clear separation by dimension. A Support Vector Machine (SVM) trained on 10% of the slope and y-intercept data predicted the dimension of the weighted projective space with an accuracy of 99.99%. Full details are given in the Supplementary Methods.

Fig. 2: The logarithm of the non-zero period coefficients cd:
figure 2

a for a typical weighted projective space (\({\mathbb{P}}(5,5,11,23,28,29,33,44,66,76)\)); b for the toric variety of Picard rank two from Example 3.

Fig. 3: The slopes and y-intercepts from the linear models:
figure 3

a for weighted projective spaces with terminal quotient singularities. The colour records the dimension of the weighted projective space and the circled points indicate projective spaces. b for toric varieties of Picard rank two with terminal quotient singularities. The colour records the dimension of the toric variety.

Data analysis: toric varieties

As before, the non-zero coefficients cd appeared to grow exponentially with d, so we fitted a linear model to the set \(\{(d,\log {c}_{d})| d\in S\}\) where \(S= \{d\in {{\mathbb{Z}}}_{\ge 0}| {c}_{d}\,\ne \,0\}\). We used the slope and intercept of this linear model as features.

Example 3

In Fig. 2b, we plot a typical example: the logarithm of the regularised quantum period sequence for the nine-dimensional toric variety with weight matrix

$$\left(\begin{array}{lllllllllll}1&2&5&3&3&3&0&0&0&0&0\\ 0&0&0&3&4&4&1&2&2&3&4\end{array}\right)$$

along with the linear approximation. We see a periodic deviation from the linear approximation; the magnitude of this deviation decreases as d increases (not shown).

To reduce computational costs, we computed pairs \((d,\log {c}_{d})\) for 1000 ≤ d ≤ 20,000 by sampling every 100th term. We discarded the beginning of the period sequence because of the noise it introduces to the linear regression. In cases where the sampled coefficient cd is zero, we considered instead the next non-zero coefficient. The resulting plot of slope against y-intercept, with datapoints coloured according to dimension, is shown in Fig. 3b.

We analysed the standard errors for the slope and y-intercept of the linear model. The standard errors for the slope are small compared to the range of slopes but, in many cases, the standard error sint for the y-intercept is relatively large. As Fig. 4 illustrates, discarding data points where the standard error sint for the y-intercept exceeds some threshold reduces apparent noise. This suggests that the underlying structure is being obscured by inaccuracies in the linear regression caused by oscillatory behaviour in the initial terms of the quantum period sequence; these inaccuracies are concentrated in the y-intercept of the linear model. Note that restricting attention to those data points where sint is small also greatly decreases the range of y-intercepts that occur. As Example 4 and Fig. 5 suggest, this reflects both transient oscillatory behaviour and also the presence of a subleading term in the asymptotics of \(\log {c}_{d}\) which is missing from our feature set. We discuss this further below.

Fig. 4: The slopes and y-intercepts from the linear model.
figure 4

This is as in Fig. 3b, but plotting only data points for which the standard error sint for the y-intercept satisfies sint < 0.3. The colour records the dimension of the toric variety.

Fig. 5: Variation as we move deeper into the period sequence.
figure 5

The y-intercept and its standard error sint for the toric variety from Example 4, as computed from pairs \((k,\log {c}_{k})\) such that d − 20,000 ≤ k ≤ d by sampling every 100th term. We also show LOWESS-smoothed trend lines.

Example 4

Consider the toric variety with Picard rank two and weight matrix

$$\left(\begin{array}{ccccccc}1&10&5&13&8&12&0\\ 0&0&3&8&5&14&1\end{array}\right)$$

This is one of the outliers in Fig. 3b. The toric variety is five-dimensional, and has slope 1.637 and y-intercept −62.64. The standard errors are 4.246 × 10−4 for the slope and 5.021 for the y-intercept. We computed the first 40 000 coefficients cd in (1). As Fig. 5 shows, as d increases the y-intercept of the linear model increases to −28.96 and sint decreases to 0.7877. At the same time, the slope of the linear model remains more or less unchanged, decreasing to 1.635. This supports the idea that computing (many) more coefficients cd would significantly reduce noise in Fig. 3b. In this example, even 40,000 coefficients may not be enough.

Computing many more coefficients cd across the whole dataset would require impractical amounts of computation time. In the example above, which is typical in this regard, increasing the number of coefficients computed from 20,000 to 40,000 increased the computation time by a factor of more than 10. Instead we restrict to those toric varieties of Picard rank two such that the y-i,ntercept standard error sint is less than 0.3; this retains 67,443 of the 200,000 datapoints. We used 70% of the slope and y-intercept data in the restricted dataset for model training, and the rest for validation. An SVM model predicted the dimension of the toric variety with an accuracy of 87.7%, and a Random Forest Classifier (RFC) predicted the dimension with an accuracy of 88.6%.

Neural networks

Neural networks do not handle unbalanced datasets well. Therefore, we removed the toric varieties of dimensions 3, 4, and 5 from our data, leaving 61,164 toric varieties of Picard rank two with terminal quotient singularities and sint < 0.3. This dataset is approximately balanced by dimension.

A Multilayer Perceptron (MLP) with three hidden layers of sizes (10, 30, 10) using the slope and intercept as features predicted the dimension with 89.0% accuracy. Since the slope and intercept give good control over \(\log {c}_{d}\) for d 0, but not for small d, it is likely that the coefficients cd with d small contain extra information that the slope and intercept do not see. Supplementing the feature set by including the first 100 coefficients cd as well as the slope and intercept increased the accuracy of the prediction to 97.7%. Full details can be found in the Supplementary Methods.

From machine learning to rigorous analysis

Elementary “out of the box” models (SVM, RFC, and MLP) trained on the slope and intercept data alone already gave a highly accurate prediction for the dimension. Furthermore, even for the many-feature MLP, which was the most accurate, sensitivity analysis using SHAP values40 showed that the slope and intercept were substantially more important to the prediction than any of the coefficients cd: see Fig. 6. This suggested that the dimension of X might be visible from a rigorous estimate of the growth rate of \(\log {c}_{d}\).

Fig. 6: Model sensitivity analysis using SHAP values.
figure 6

The model is an MLP with three hidden layers of sizes (10,30,10) applied to toric varieties of Picard rank two with terminal quotient singularities. It is trained on the slope, y-intercept, and the first 100 coefficients cd as features, and predicts the dimension with 97.7% accuracy.

In the Methods section, we establish asymptotic results for the regularised quantum period of toric varieties with low Picard rank, as follows. These results apply to any weighted projective space or toric variety of Picard rank two: they do not require a terminality hypothesis. Note, in each case, the presence of a subleading logarithmic term in the asymptotics for \(\log {c}_{d}\).

Theorem 5

Let X denote the weighted projective space \({\mathbb{P}}({a}_{1},\ldots,\,{a}_{N})\), so that the dimension of X is N − 1. Let cd denote the coefficient of td in the regularised quantum period \({\widehat{G}}_{X}(t)\) given in (4). Let a = a1 +  + aN and pi = ai/a. Then cd = 0 unless d is divisible by a, and non-zero coefficients cd satisfy

$$\log {c}_{d} \sim Ad-\frac{\dim X}{2}\log d+B$$

as d → , where

$$A= -\mathop{\sum }\limits_{i=1}^{N}{p}_{i}\log {p}_{i}\\ B= -\frac{\dim X}{2}\log (2\pi )-\frac{1}{2}\mathop{\sum }\limits_{i= 1}^{N}\log {p}_{i}$$

Note, although it plays no role in what follows, that A is the Shannon entropy of the discrete random variable Z with distribution (p1, p2, …, pN), and that B is a constant plus half the total self-information of Z.

Theorem 6

Let X denote the toric variety of Picard rank two with weight matrix

$$\left(\begin{array}{ccccc}{a}_{1}&{a}_{2}&{a}_{3}&\cdots \,&{a}_{N}\\ {b}_{1}&{b}_{2}&{b}_{3}&\cdots \,&{b}_{N}\end{array}\right)$$

so that the dimension of X is N − 2. Let a = a1 +  + aN, b = b1 +  + bN, and  = gcd{a, b}. Let \([\mu :\nu ]\in {{\mathbb{P}}}^{1}\) be the unique root of the homogeneous polynomial

$$\mathop{\prod }\limits_{i= 1}^{N}{({a}_{i}\mu+{b}_{i}\nu )}^{{a}_{i}b}-\mathop{\prod }\limits_{i= 1}^{N}{({a}_{i}\mu+{b}_{i}\nu )}^{{b}_{i}a}$$

such that aiμ + biν ≥ 0 for all i\(\in\) {1, 2, …, N}, and set

$${p}_{i}=\frac{\mu {a}_{i}+\nu {b}_{i}}{\mu a+\nu b}$$

Let cd denote the coefficient of td in the regularised quantum period \({\widehat{G}}_{X}(t)\) given in (5). Then non-zero coefficients cd satisfy

$$\log {c}_{d} \sim Ad-\frac{\dim X}{2}\log d+B$$

as d → , where

$$A= -\mathop{\sum }\limits_{i=1}^{N}{p}_{i}\log {p}_{i}\\ B= -\frac{\dim X}{2}\log (2\pi )-\frac{1}{2}\mathop{\sum }\limits_{i= 1}^{N}\log {p}_{i}-\frac{1}{2}\log \left(\mathop{\sum }\limits_{i= 1}^{N}\frac{{({a}_{i}b-{b}_{i}a)}^{2}}{{\ell }^{2}{p}_{i}}\right)$$

Theorem 5 is a straightforward application of Stirling’s formula. Theorem 6 is more involved, and relies on a Central Limit-type theorem that generalises the De Moivre–Laplace theorem.

Theoretical analysis

The asymptotics in Theorems 5 and 6 imply that, for X a weighted projective space or toric variety of Picard rank two, the quantum period determines the dimension of X. Let us revisit the clustering analysis from this perspective. Recall the asymptotic expression \(\log {c}_{d} \sim Ad-\frac{\dim X}{2}\log d+B\) and the formulae for A and B from Theorem 5. Figure 7a shows the values of A and B for a sample of weighted projective spaces, coloured by dimension. Note the clusters, which overlap. Broadly speaking, the values of B increase as the dimension of the weighted projective space increases, whereas in Fig. 3a, the y-intercepts decrease as the dimension increases. This reflects the fact that we fitted a linear model to \(\log {c}_{d}\), omitting the subleading \(\log d\) term in the asymptotics. As Fig. 8 shows, the linear model assigns the omitted term to the y-intercept rather than the slope. The slope of the linear model is approximately equal to A. The y-intercept, however, differs from B by a dimension-dependent factor. The omitted \(\log\) term does not vary too much over the range of degrees (d < 100,000) that we considered, and has the effect of reducing the observed y-intercept from B to approximately \(B-\frac{9}{2}\dim X\), distorting the clusters slightly and translating them downwards by a dimension-dependent factor. This separates the clusters. We expect that the same mechanism applies in Picard rank two as well: see Fig. 7b.

Fig. 7: The values of the asymptotic coefficients A and B:
figure 7

a for all weighted projective spaces \({\mathbb{P}}({a}_{1},\ldots,\,{a}_{N})\) with terminal quotient singularities and ai ≤ 25 for all i. The colour records the dimension of the weighted projective space. b for toric varieties of Picard rank two in our dataset. The colour records the dimension of the toric variety.

Fig. 8: For weighted projective spaces, the asymptotic coefficients A and B are closely related to the slope and y-intercept.
figure 8

a Comparison between A and the slope from the linear model, for weighted projective spaces that occur in both Figs. 3a and 7, coloured by dimension. The line slope = A is indicated. b Comparison between B and the y-intercept from the linear model, for weighted projective spaces that occur in both Figs 3a and 7a, coloured by dimension. In each case, the line \(y\,{{\mbox{-intercept}}}\,=B-\frac{9}{2}\dim X\) is shown.

We can show that each cluster in Fig. 7a is linearly bounded using constrained optimisation techniques. Consider, for example, the cluster for weighted projective spaces of dimension five, as in Fig. 9.

Fig. 9: Linear bounds for the cluster of five-dimensional weighted projective spaces in Fig. 7a.
figure 9

The bounds are given by Proposition 7.

Proposition 7

Let X be the five-dimensional weighted projective space \({\mathbb{P}}({a}_{1},\ldots,\,{a}_{6})\), and let A, B be as in Theorem 5. Then \(B+\frac{5}{2}A\ge \frac{41}{8}\). If in addition ai ≤ 25 for all i then \(B+5A\le \frac{41}{40}\).

Fix a suitable θ ≥ 0 and consider

$$B+\theta A= -\frac{\dim X}{2}\log (2\pi )-\frac{1}{2}\mathop{\sum }\limits_{i= 1}^{N}\log {p}_{i}-\theta \mathop{\sum }\limits_{i= 1}^{N}{p}_{i}\log {p}_{i}$$

with \(\dim X= N-1=5\). Solving

$$\begin{array}{rcl}\min (B+\theta A)&{{{{{{{\rm{subject}}}}}}}}\,{{{{{\rm{to}}}}}}&{p}_{1}+\cdots+{p}_{6}= 1\\ &&{p}_{1},\ldots,\,{p}_{6}\ge 0\end{array}$$

on the five-simplex gives a linear lower bound for the cluster. This bound does not use terminality: it applies to any weighted projective space of dimension five. The expression B + θA is unbounded above on the five-simplex (because B is) so we cannot obtain an upper bound this way. Instead, consider

$$\begin{array}{rcl}\max (B+\theta A)&{{{{{{{\rm{subject}}}}}}}}\,{{{{{\rm{to}}}}}}&{p}_{1}+\cdots+{p}_{6}= 1\\ &&\epsilon \le {p}_{1}\le {p}_{2}\le \cdots \le {p}_{6}\end{array}$$

for an appropriate small positive ϵ, which we can take to be 1/a where a is the maximum sum of the weights. For Fig. 9, for example, we can take a = 124, and in general, such an a exists because there are only finitely many terminal weighted projective spaces. This gives a linear upper bound for the cluster.

The same methods yield linear bounds on each of the clusters in Fig. 7a. As the Figure shows, however, the clusters are not linearly separable.

Discussion

We developed machine learning models that predict, with high accuracy, the dimension of a Fano variety from its regularised quantum period. These models apply to weighted projective spaces and toric varieties of Picard rank two with terminal quotient singularities. We then established rigorous asymptotics for the regularised quantum period of these Fano varieties. The form of the asymptotics implies that, in these cases, the regularised quantum period of a Fano variety X determines the dimension of X. The asymptotics also give a theoretical underpinning for the success of the machine learning models.

Perversely, because the series involved converge extremely slowly, reading the dimension of a Fano variety directly from the asymptotics of the regularised quantum period is not practical. For the same reason, enhancing the feature set of our machine learning models by including a \(\log d\) term in the linear regression results in less accurate predictions. So although the asymptotics in Theorems 5 and 6 determine the dimension in theory, in practice, the most effective way to determine the dimension of an unknown Fano variety from its quantum period is to apply a machine learning model.

The insights gained from machine learning were the key to our formulation of the rigorous results in Theorems 5 and 6. Indeed, it might be hard to discover these results without a machine learning approach. It is notable that the techniques in the proof of Theorem 6 – the identification of generating functions for Gromov–Witten invariants of toric varieties with certain hypergeometric functions – have been known since the late 1990s and have been studied by many experts in hypergeometric functions since then. For us, the essential step in the discovery of the results was the feature extraction that we performed as part of our ML pipeline.

This work demonstrates that machine learning can uncover previously unknown structure in complex mathematical data, and is a powerful tool for developing rigorous mathematical results; cf.22. It also provides evidence for a fundamental conjecture in the Fano classification programme21: that the regularised quantum period of a Fano variety determines that variety.

Methods

In this section, we prove Theorem 5 and Theorem 6. The following result implies Theorem 5.

Theorem 8

Let X denote the weighted projective space \({\mathbb{P}}({a}_{1},\ldots,\,{a}_{N})\), so that the dimension of X is N − 1. Let cd denote the coefficient of td in the regularised quantum period \({\widehat{G}}_{X}(t)\) given in (4). Let a = a1 + … + aN. Then cd = 0 unless d is divisible by a, and

$$\log {c}_{ka} \sim ka\left[\log a-\frac{1}{a}\mathop{\sum }\limits_{i= 1}^{N}{a}_{i}\log {a}_{i}\right]-\frac{\dim X}{2}\log (ka) \\ +\frac{1+\dim X}{2}\log a-\frac{\dim X}{2}\log (2\pi )-\frac{1}{2}\mathop{\sum }\limits_{i= 1}^{N}\log {a}_{i}$$

That is, non-zero coefficients cd satisfy

$$\log {c}_{d} \sim Ad-\frac{\dim X}{2}\log d+B$$

as d → , where

$$A= -\mathop{\sum }\limits_{i=1}^{N}{p}_{i}\log {p}_{i}\quad B= -\frac{\dim X}{2}\log (2\pi )-\frac{1}{2}\mathop{\sum }\limits_{i= 1}^{N}\log {p}_{i}$$

and pi = ai/a.

Proof

Combine Stirling’s formula

$$n! \sim \sqrt{2\pi n}{\left(\frac{n}{e}\right)}^{n}$$

with the closed formula (4) for cka. □

Toric varieties of Picard rank 2

Consider a toric variety X of Picard rank two and dimension N − 2 with weight matrix

$$\left(\begin{array}{ccccc}{a}_{1}&{a}_{2}&{a}_{3}&\cdots \,&{a}_{N}\\ {b}_{1}&{b}_{2}&{b}_{3}&\cdots \,&{b}_{N}\end{array}\right)$$

as in (2). Let us move to more invariant notation, writing αi for the linear form on \({{\mathbb{R}}}^{2}\) defined by the transpose of the ith column of the weight matrix, and α = α1 +  + αN. Eq. (5) becomes

$${\widehat{G}}_{X}(t)= \mathop{\sum}\limits_{k\in {{\mathbb{Z}}}^{2}\cap C}\frac{(\alpha \cdot k)!}{\mathop{\prod }\nolimits_{i= 1}^{N}({\alpha }_{i}\cdot k)!}{t}^{\alpha \cdot k}$$

where C is the cone \(C= \{x\in {{\mathbb{R}}}^{2}| {\alpha }_{i}\cdot x\ge 0\,{{{{{{{\rm{for}}}}}}}}\,i= 1,2,\ldots,\,N\}\). As we will see, for d 0 the coefficients

$$\frac{(\alpha \cdot k)!}{\mathop{\prod }\nolimits_{i= 1}^{N}({\alpha }_{i}\cdot k)!}\quad {{{{{{{\rm{where}}}}}}}}\,k\in {{\mathbb{Z}}}^{2}\cap C\,{{{{{{{\rm{and}}}}}}}}\,\alpha \cdot k= d$$

are approximated by a rescaled Gaussian. We begin by finding the mean of that Gaussian, that is, by minimising

$$\mathop{\prod }\limits_{i=1}^{N}({\alpha }_{i}\cdot k)!\quad {{{{{{{\rm{where}}}}}}}}\,k\in {{\mathbb{Z}}}^{2}\cap C\,{{{{{{{\rm{and}}}}}}}}\,\alpha \cdot k=d.$$

For k in the strict interior of C with αk = d, we have that

$$({\alpha }_{i}\cdot k)! \sim {\left(\frac{{\alpha }_{i}\cdot k}{e}\right)}^{{\alpha }_{i}\cdot k}$$

as d → .

Proposition 9

The constrained optimisation problem

$$\min \mathop{\prod }\limits_{i=1}^{N}{({\alpha }_{i}\cdot x)}^{{\alpha }_{i}\cdot x}\quad \,{{\mbox{subject to}}}\,\left\{\begin{array}{l}x\in C\quad \\ \alpha \cdot x=d\quad \end{array}\right.$$

has a unique solution x = x*. Furthermore, setting pi = (αix*)/(αx*) we have that the monomial

$$\mathop{\prod }\limits_{i=1}^{N}{p}_{i}^{{\alpha }_{i}\cdot k}$$

depends on \(k\in {{\mathbb{Z}}}^{2}\) only via αk.

Proof

Taking logarithms gives the equivalent problem

$$\min \mathop{\sum }\limits_{i=1}^{N}({\alpha }_{i}\cdot x)\log ({\alpha }_{i}\cdot x)\quad \,{{\mbox{subject to}}}\,\left\{\begin{array}{l}x\in C\quad \\ \alpha \cdot x=d\quad \end{array}\right.$$
(6)

The objective function \(\mathop{\sum }\nolimits_{i=1}^{N}({\alpha }_{i}\cdot x)\log ({\alpha }_{i}\cdot x)\) here is the pullback to \({{\mathbb{R}}}^{2}\) of the function

$$f({x}_{1},\ldots,\,{x}_{N})=\mathop{\sum }\limits_{i=1}^{N}{x}_{i}\log {x}_{i}$$

along the linear embedding \(\varphi :{{\mathbb{R}}}^{2}\to {{\mathbb{R}}}^{N}\) given by (α1, …, αN). Note that C is the preimage under φ of the positive orthant \({{\mathbb{R}}}_{+}^{N}\), so we need to minimise f on the intersection of the simplex x1 +  + xN = d, \(({x}_{1},\ldots,\,{x}_{N})\in {{\mathbb{R}}}_{+}^{N}\) with the image of φ. The function f is convex and decreases as we move away from the boundary of the simplex, so the minimisation problem in Eq. (6) has a unique solution x* and this lies in the strict interior of C. We can, therefore, find the minimum x* using the method of Lagrange multipliers, by solving

$$\mathop{\sum }\limits_{i=1}^{N}{\alpha }_{i}\log ({\alpha }_{i}\cdot x)+\alpha=\lambda \alpha$$
(7)

for \(\lambda \in {\mathbb{R}}\) and x in the interior of C with αx = d. Thus

$$\mathop{\sum }\limits_{i=1}^{N}{\alpha }_{i}\log ({\alpha }_{i}\cdot {x}^{*})=(\lambda -1)\alpha$$

and, evaluating on \(k\in {{\mathbb{Z}}}^{2}\) and exponentiating, we see that

$$\mathop{\prod }\limits_{i=1}^{N}{({\alpha }_{i}\cdot {x}^{*})}^{{\alpha }_{i}\cdot k}$$

depends only on αk. The result follows. □

Given a solution x* to Eq. (7), any positive scalar multiple of x* also satisfies Eq. (7), with a different value of λ and a different value of d. Thus the solutions x*, as d varies, lie on a half-line through the origin. The direction vector \([\mu :\nu ]\in {{\mathbb{P}}}^{1}\) of this half-line is the unique solution to the system

$$\begin{array}{c}\mathop{\prod }\limits_{i=1}^{N}{({a}_{i}\mu+{b}_{i}\nu )}^{{a}_{i}b}=\mathop{\prod }\limits_{i=1}^{N}{({a}_{i}\mu+{b}_{i}\nu )}^{{b}_{i}a}\\ \left(\begin{array}{c}\mu \\ \nu \end{array}\right)\in C\end{array}$$
(8)

Note that the first equation here is homogeneous in μ and ν; it is equivalent to Eq. (7), by exponentiating and then eliminating λ. Any two solutions x*, for different values of d, differ by rescaling, and the quantities pi in Proposition 9 are invariant under this rescaling. They also satisfy p1 +  + pN = 1.

We use the following result, known in the literature as the “Local Theorem”41, to approximate multinomial coefficients.

Local Theorem

For p1, …, pn\(\in\) [0, 1] such that p1 +  + pn = 1, the ratio

$${d}^{\frac{n-1}{2}}\left(\begin{array}{c}d\\ {k}_{1}\cdots {k}_{n}\end{array}\right)\mathop{\prod }\limits_{i=1}^{n}{p}_{i}^{{k}_{i}}:\frac{\exp (-\frac{1}{2}\mathop{\sum }\nolimits_{i=1}^{n}{q}_{i}{x}_{i}^{2})}{{(2\pi )}^{\frac{n-1}{2}}\sqrt{{p}_{1}\cdots {p}_{n}}}\to 1$$

as d → , uniformly in all ki’s, where

$${q}_{i}=1-{p}_{i}\quad {x}_{i}=\frac{{k}_{i}-d{p}_{i}}{\sqrt{d{p}_{i}{q}_{i}}}$$

and the xi lie in bounded intervals.

Let Br denote the ball of radius r about \({x}^{*}\in {{\mathbb{R}}}^{2}\). Fix R > 0. We apply the Local Theorem with ki = αik and pi = (αix*)/(αx*), where \(k\in {{\mathbb{Z}}}^{2}\cap C\) satisfies αk = d and \(k\in {B}_{R\sqrt{d}}\). Since

$${x}_{i}=\frac{{\alpha }_{i}\cdot (k-{x}^{*})}{\sqrt{d{p}_{i}{q}_{i}}}$$

the assumption that \(k\in {B}_{R\sqrt{d}}\) ensures that the xi remain bounded as d → . Note that, by Proposition 9, the monomial \(\mathop{\prod }\nolimits_{i=1}^{N}{p}_{i}^{{k}_{i}}\) depends on k only via αk, and hence here is independent of k:

$$\mathop{\prod }\limits_{i=1}^{N}{p}_{i}^{{k}_{i}}=\mathop{\prod }\limits_{i=1}^{N}{p}_{i}^{{\alpha }_{i}\cdot {x}^{*}}=\mathop{\prod }\limits_{i=1}^{N}{p}_{i}^{d{p}_{i}}$$

Furthermore

$$\mathop{\sum }\limits_{i=1}^{N}{q}_{i}{x}_{i}^{2}=\frac{{(k-{x}^{*})}^{T}A\,(k-{x}^{*})}{d}$$

where A is the positive-definite 2 × 2 matrix given by

$$A=\mathop{\sum }\limits_{i=1}^{N}\frac{1}{{p}_{i}}{\alpha }_{i}^{T}{\alpha }_{i}$$

Thus, as d → , the ratio

$$\frac{(\alpha \cdot k)!}{\mathop{\prod }\nolimits_{i=1}^{N}({\alpha }_{i}\cdot k)!}:\frac{\exp \left(-\frac{1}{2d}{(k-{x}^{*})}^{T}A\,(k-{x}^{*})\right)}{{(2\pi d)}^{\frac{N-1}{2}}\mathop{\prod }\nolimits_{i=1}^{N}{p}_{i}^{d{p}_{i}+\frac{1}{2}}}\to 1$$
(9)

for all \(k\in {{\mathbb{Z}}}^{2}\cap C\cap {B}_{R\sqrt{d}}\) such that αk = d.

Theorem 10

(This is Theorem 6 in the main text). Let X be a toric variety of Picard rank two and dimension N − 2 with weight matrix

$$\left(\begin{array}{ccccc}{a}_{1}&{a}_{2}&{a}_{3}&\cdots \,&{a}_{N}\\ {b}_{1}&{b}_{2}&{b}_{3}&\cdots \,&{b}_{N}\end{array}\right)$$

Let a = a1 +  + aN and b = b1 +  + bN, let ℓ = gcd{a, b}, and let \([\mu :\nu ]\in {{\mathbb{P}}}^{1}\) be the unique solution to Eq. (8). Let cd denote the coefficient of td in the regularised quantum period \({\widehat{G}}_{X}(t)\). Then non-zero coefficients cd satisfy

$$\log {c}_{d} \sim Ad-\frac{\dim X}{2}\log d+B$$

as d → , where

$$A= -\mathop{\sum }\limits_{i=1}^{N}{p}_{i}\log {p}_{i}\\ B= -\frac{\dim X}{2}\log (2\pi )-\frac{1}{2}\mathop{\sum }\limits_{i=1}^{N}\log {p}_{i}-\frac{1}{2}\log \left(\mathop{\sum }\limits_{i=1}^{N}\frac{{({a}_{i}b-{b}_{i}a)}^{2}}{{\ell }^{2}{p}_{i}}\right)$$

and \({p}_{i}=\frac{\mu {a}_{i}+\nu {b}_{i}}{\mu a+\nu b}\).

Proof

We need to estimate

$${c}_{d}=\mathop{\sum}\limits_{{k\in {{\mathbb{Z}}}^{2}\cap C \atop {{{{{{{\rm{with}}}}}}}}\,\alpha \cdot k=d}}\frac{(\alpha \cdot k)!}{\mathop{\prod }\nolimits_{i=1}^{N}({\alpha }_{i}\cdot k)!}$$

Consider first the summands with \(k\in {{\mathbb{Z}}}^{2}\cap C\) such that αk = d and \(k\notin {B}_{R\sqrt{d}}\). For d sufficiently large, each such summand is bounded by \(c{d}^{-\frac{1+\dim X}{2}}\) for some constant c—see Eq. (9). Since the number of such summands grows linearly with d, in the limit d →  the contribution to cd from \(k\notin {B}_{R\sqrt{d}}\) vanishes.

As d → , therefore

$${c}_{d} \sim \frac{1}{{(2\pi d)}^{\frac{N-1}{2}}\mathop{\prod }\nolimits_{i=1}^{N}{p}_{i}^{d{p}_{i}+\frac{1}{2}}}\mathop{\sum}\limits_{{k\in {{\mathbb{Z}}}^{2}\cap C\cap {B}_{R\sqrt{d}}\atop {{{{{{{\rm{with}}}}}}}}\,\alpha \cdot k=d}}\exp \left(-\frac{{(k-{x}^{*})}^{T}A\,(k-{x}^{*})}{2d}\right)$$

Writing \({y}_{k}=(k-{x}^{*})/\sqrt{d}\), considering the sum here as a Riemann sum, and letting R → , we see that

$${c}_{d} \sim \frac{1}{{(2\pi d)}^{\frac{N-1}{2}}\mathop{\prod }\nolimits_{i=1}^{N}{p}_{i}^{d{p}_{i}+\frac{1}{2}}}\sqrt{d}{\int}_{L_{\alpha }}\exp \left(-\frac{1}{2}{y}^{T}Ay\right)\,dy$$

where Lα is the line through the origin given by \(\ker \alpha\) and dy is the measure on Lα given by the integer lattice \({{\mathbb{Z}}}^{2}\cap {L}_{\alpha }\subset {L}_{\alpha }\).

To evaluate the integral, let

$${\alpha }^{\perp }=\frac{1}{\ell }\left(\begin{array}{c}b\\ -a\end{array}\right)\quad {{{{{{{\rm{where}}}}}}}}\,\ell=\gcd \{a,b\}$$

and observe that the pullback of dy along the map \({\mathbb{R}}\to {L}_{\alpha }\) given by ttα is the standard measure on \({\mathbb{R}}\). Thus

$${\int}_{L_{\alpha }}\exp \left(-\frac{1}{2}{y}^{T}Ay\right)\,dy=\int\nolimits_{-\infty }^{\infty }\exp \left(-\frac{1}{2}\theta {x}^{2}\right)\,dx=\sqrt{\frac{2\pi }{\theta }}$$

where \(\theta=\mathop{\sum }\nolimits_{i=1}^{N}\frac{1}{{\ell }^{2}{p}_{i}}{({\alpha }_{i}\cdot {\alpha }^{\perp })}^{2}\), and

$${c}_{d} \sim \frac{1}{{(2\pi d)}^{\frac{\dim X}{2}}\mathop{\prod }\nolimits_{i=1}^{N}{p}_{i}^{d{p}_{i}+\frac{1}{2}}\sqrt{\theta }}$$

Taking logarithms gives the result. □