1 Introduction

Smooth cubic surfaces are arguably one of the most famous objects in classical algebraic geometry [1,2,3]. The problem of counting lines on such surfaces also has a long standing history and there is a vast literature on the topic. In the nineteenth century, Cayley [4] and Schläfli [5] proved that a smooth cubic surface over the complex numbers always has 27 lines, while over the real numbers it can have 3, 7, 15 or 27 lines. Segre [6] showed that over any field, a smooth cubic surface can only have 0, 1, 2, 3, 5, 7, 9, 15, or 27 linesFootnote 1. Depending on the base field, some of these numbers may not be attained. Since then, the problem of counting lines on cubic surfaces over different fields attracted many mathematicians and some cases have already been classified; see Table 1.

Table 1 Classification of possible line counts for the fields \({\mathbb {C}}\), \({\mathbb {R}}\), \({\mathbb {Q}}\), \({\mathbb {F}}_q\)

Recently, McKean [7] showed that all of the numbers 0, 1, 2, 3, 5, 7, 9, 15 and 27 occur when the base field is finitely generated with at least 22 elements or a finite transcendental extension of an arbitrary field; see [7, Corollary 1.6].

In this text, our main aim is to get an idea of how many lines are on a cubic surface over \({\mathbb {Q}}_p\) or \({\mathbb {R}}\) from a probabilistic point of view. To this end, we conduct numerical experiments when the base field is \({\mathbb {Q}}_7\) or \({\mathbb {R}}\). While over the real numbers, a cubic surface can only have either 3, 7, 15 or 27 lines, by adapting the approach in an earlier version of [7]Footnote 2 to the case we are interested in, we get the following:

Theorem 1.1

Let \(n\in \{0, 1, 2, 3, 5, 7, 9, 15, 27\}\). Then there exists a smooth cubic surface over \({\mathbb {Q}}_{p}\) that contains exactly n lines. In other words, all possible line counts occur when the base field is \({\mathbb {Q}}_{p}\).

In Sect. 2, we explain how to explicitly construct (by blowing up the projective plane in 6 suitable points) a smooth cubic surface having any of the line counts mentioned in Theorem 1.1. Sections 3 and 4 focus on probabilistic computations and heuristics for both the p-adic and real case, respectively. For the p-adic case, we sample from the family of smooth cubic surfaces with four different probability measures (see Sect. 3), and compute the probability of seeing each number of lines. Table 3 summarizes the distributions of the number of lines when \(p = 7\). For the real case, we consider a one-parameter family \(({\mathbb {P}}_\lambda )_{0< \lambda < 1}\) of Gaussian distributions studied in [10]. The probability distribution of line counts is then a curve in the 3-simplex which is depicted in Fig. 1. The Galois groups attached to smooth cubic surfaces are of special interest. The final section of this paper (Sect. 5) is devoted to experimental results on which Galois groups appear for cubic surfaces defined over \({\mathbb {Q}}_{p}\). Our results suggest that Galois groups should be quite small and usually abelian. This motivates an inverse Galois problem for smooth cubic surfaces over \({\mathbb {Q}}_p\) in line with Elsenhans and Jahnel’s work [11] on the inverse Galois problem for smooth cubic surfaces over \({\mathbb {Q}}\).

Most of the results in this text were found by computation. The codes and data are made available at

https://mathrepo.mis.mpg.de/27pAdicLines/index.html.                         (1)

Our computations were carried out using the computer algebra systems Magma [12], Julia [13] and Macaulay2 [14].

2 Lines on smooth p-adic cubic surfaces

In the following, we recall a well-known representation of smooth cubic surfaces: the blow-up of the projective plane \({\mathbb {P}}^2\) at six \(\overline{{\mathbb {Q}}}_{p}\)-rational points in general position is a smooth cubic surface (see, for example, [15] for a detailed treatment). Up to a change of coordinates, the six points lie on the cuspidal cubic curve

$$\begin{aligned} {\mathscr {C}}: \theta \longmapsto (1:\theta :\theta ^3) \end{aligned}$$

and can be represented as the columns of the matrix

$$\begin{aligned} \begin{bmatrix} 1 &{} 1 &{} 1 &{} 1 &{} 1 &{} 1\\ \theta _1 &{} \theta _2 &{} \theta _3 &{} \theta _4 &{} \theta _5 &{} \theta _6\\ \theta _1^3 &{} \theta _2^3 &{} \theta _3^3 &{} \theta _4^3 &{} \theta _5^3 &{} \theta _6^3\\ \end{bmatrix}. \end{aligned}$$
(2)

The six points are said to be in general position if no three of them lie on a line and not all of them lie on a conic. Equivalently the points are in general position if both the maximal minors of (2), which are given by

$$\begin{aligned}{}[i j k] := (\theta _i - \theta _j ) (\theta _i - \theta _k)(\theta _j - \theta _k)(\theta _i + \theta _j + \theta _k) \quad \text { for } 1 \le i< j < k \le 6, \end{aligned}$$

and the polynomial

$$\begin{aligned}{} & {} {[}1 3 4] [1 5 6] [235] [246] - [135] [146] [234] [256]\\{} & {} \quad := (\theta _1 + \theta _2 + \theta _3 + \theta _4 + \theta _5 + \theta _6) \prod _{1 \le i < j \le 6} (\theta _i - \theta _j), \end{aligned}$$

do not vanish. These polynomials split into linear forms that together determine the hyperplane arrangement of type \(E_6\) (see [16, Section 6] for more details):

$$\begin{aligned} \begin{array}{ll} {\theta _i - \theta _j} &{} {\text { for } 1 \le i< j \le 6, } \\ {\theta _i + \theta _j + \theta _k } &{} {\text { for } 1 \le i< j < k \le 6, } \\ {\theta _1 + \theta _2 + \cdots + \theta _6.} &{} \\ \end{array} \end{aligned}$$
(3)

Definition 1.2

Let \(F = \prod \limits _{i = 1}^6 (X - \theta _i) \in {\mathbb {Q}}_{p}[X]\) be a univariate polynomial of degree 6 whose roots lie in the complement of the hyperplane arrangement (3). We denote by \({\mathcal {S}}(F)\) the smooth cubic surface that is the blow-up of the projective plane at the six points \(\{[1: \theta _i: \theta _i^3]\}_{1 \le i \le 6}\).

The defining equation of \({\mathcal {S}}(F)\) in \({\mathbb {P}}^3\) in terms of the \(\theta _i\) is determined in [15, Equation 4]. The 27 \(\overline{{\mathbb {Q}}}_{p}\)-rational lines on \({\mathcal {S}}(F)\) are of three distinct types:

  1. (i)

    \(\{E_i :i =1,\dots ,6\}\), where \(E_i\) is the exceptional divisor of the point \({\mathcal {C}} (\theta _i)\);

  2. (ii)

    \(\{F_{i, j} :i,j =1,\dots ,6,\ i\ne j\}\), where \(F_{i, j}\) is the strict transform of the line passing through the points \({\mathcal {C}} (\theta _i)\) and \({\mathcal {C}} (\theta _j)\);

  3. (iii)

    \(\{G_i :i =1,\dots ,6\}\), where \(G_i\) is the strict transform of the unique conic passing through the points \(\{{\mathcal {C}} (\theta _1),\dots ,{\mathcal {C}} (\theta _6)\} \setminus \{{\mathcal {C}} (\theta _i)\}\).

In view of constructing smooth cubic surfaces that have a prescribed number of \({\mathbb {Q}}_{p}\)-rational lines, we investigate the action of the absolute Galois group \(G = {{\,\textrm{Gal}\,}}(\overline{{\mathbb {Q}}}_{p}/{\mathbb {Q}}_{p}) \) on \({\mathcal {S}}(F)\), and show that the line-count depends only on the decomposition of F into irreducible factors over \({\mathbb {Q}}_{p}\).

Lemma 1.3

The smooth cubic surface \({\mathcal {S}}(F)\) is \({\mathbb {Q}}_{p}\)-rational and contains exactly

$$\begin{aligned} 2\ell + q + \left( {\begin{array}{c}\ell \\ 2\end{array}}\right) \end{aligned}$$

\({\mathbb {Q}}_{p}\)-rational lines, where \(\ell \) and q are the number of linear and quadratic irreducible factors of F in \({\mathbb {Q}}_{p}[X]\), respectively.

Proof

The absolute Galois group G acts on \({\mathcal {S}}(F)\) and lines on it by permuting the roots \(\theta _1, \dots , \theta _6\). In particular, for every element \(\sigma \) of G, we have

$$\begin{aligned} \sigma ({\mathcal {S}}(F)) = {\mathcal {S}}(\sigma (F)), \ \sigma (E_i) = E_{\sigma (i)}, \ \sigma (F_{i, j}) = F_{\sigma (i), \sigma (j)}, \ \sigma (G_i) = G_{\sigma (i)}, \end{aligned}$$

where we define \(\sigma (i)\) by enforcing \(\sigma (\theta _i) = \theta _{\sigma (i)}\). Since G acts trivially on \(F \in {\mathbb {Q}}_{p}[X]\), the surface \({\mathcal {S}}(F)\) is stable under G. Hence it is \({\mathbb {Q}}_{p}\)-rational. Note that the number of G-stable \(E_i\)’s is \(\ell \), the number of G-stable \(F_{i,j}\)’s is \(q + \left( {\begin{array}{c}\ell \\ 2\end{array}}\right) \), and the number of G-stable \(G_i\)’s is \(\ell \). This finishes the proof. \(\square \)

Proof of Theorem 1.1

This is a direct consequence of the above lemma. The polynomials in Table 2 have the desired numbers of irreducible linear and quadratic factors. The discriminant, the degree 5 coefficients \(\theta _1 + \dots +\theta _6\) and the expression

$$\begin{aligned} \prod _{ \# \{i, j, k\} = 3 } \theta _i + \theta _j + \theta _k \end{aligned}$$

are symmetric and can be expressed as polynomials in the coefficients of F. The non-vanishing of these quantities for the polynomials in Table 2 was certified using Macaulay2 (see (1)); therefore, the equations in (3) are not satisfied for any of these 9 polynomials. \(\square \)

Table 2 A list of surfaces \({\mathcal {S}}(F)\) that realize all possible line-counts over \({\mathbb {Q}}_{p}\)

Remark 2.3

  1. (1)

    It is clear that Theorem 1.1 continues to hold if we replace \({\mathbb {Q}}_p\) with any finite extension of \({\mathbb {Q}}_p\). In fact, it holds for any local field (one just needs to modify the above proof slightly). But, as we mentioned in the introduction, this is a special case of a theorem proved by McKean, after our work was completed, in the final version of his paper; see [7, Corollary 1.6]. We think it is still valuable to have explicit polynomials that yield the desired surfaces.

  2. (2)

    It is important to note that, while any cubic surface over \(\overline{{\mathbb {Q}}}_p\) is isomorphic to the blow-up of 6 points in general position in \(\overline{{\mathbb {Q}}}_p{\mathbb {P}}^2\) that is not the case over \({\mathbb {Q}}_p\). In other words, there are cubic surfaces defined over \({\mathbb {Q}}_p\) which do not arise from the blow-up construction as in Sect. 2. The cubic surfaces arising in that way are the cubic surfaces which have a Galois invariant (i.e. \({{\,\textrm{Gal}\,}}(\overline{{\mathbb {Q}}}_p/ {\mathbb {Q}}_p)\)-invariant) double-six. A double-six is a configuration of 12 lines \(\{L_1, \dots , L_6\}\) and \(\{L_1', \dots , L_6'\}\) in \(\overline{{\mathbb {Q}}}_p{\mathbb {P}}^3\) arranged in matrix form

    $$\begin{aligned} \begin{pmatrix} L_1 &{} L_2 &{} L_3 &{} L_4 &{} L_5 &{} L_6\\ L_1' &{} L_2' &{} L_3' &{} L_4' &{} L_5' &{} L_6' \end{pmatrix}, \end{aligned}$$

    such that any two lines of these 12 are secant if and only if they are not on the same row or column. With the notation of Definition 2.1, the configuration of lines \(\{E_1, \dots , E_6\}\) and \(\{G_1, \dots , G_6\}\) is a Galois invariant double-six; see, for example, [1, Remark V.4.9.1].

3 Heuristics for the p-adic numbers

There are plenty of ways one can construct a smooth cubic surface over \({\mathbb {Q}}_p\). Each leads to a different way of sampling such surfaces and hence a measure on the space of smooth cubic surfaces. For our probabilistic investigations, we focus on four sampling methods and describe both the measures and how the sampling process is implemented in our computations.

3.1 The haar measure

We endow the space of cubics \({\mathbb {Q}}_p[ x_0 , x_1, x_2, x_3]_{( 3 )}\) with its natural measure, defined by choosing the 20 coefficients \(\xi _{\alpha }\) of the degree 3 cubic

$$\begin{aligned} f = \sum _{|\alpha | = 3} \xi _\alpha x^{\alpha } \end{aligned}$$
(4)

to be independent and uniformly distributed in \({\mathbb {Z}}_{p}\) with respect to the Haar measure on \({\mathbb {Z}}_p\).

Definition 1.5

The probability measure of the random smooth cubic surface \({\mathcal {S}}(f)\) defined as the zero set of a random polynomial f as in (4) is called the Haar measure on the space of cubic surfaces.

Note that the singular cubics lie on a hypersurface of \({\mathbb {Q}}_p[ x_0 , x_1, x_2, x_3]_{( 3 )}\) and hence with probability 1 the random cubic f in (4) defines a smooth surface. Moreover, the Haar measure in Definition 3.1 is invariant under change of variables, i.e.

$$\begin{aligned} \text {for any } g \in {{\,\textrm{GL}\,}}_4({\mathbb {Z}}_p),\ f(g\cdot x) \text { has the same istribution as } f(x). \end{aligned}$$

Remark 3.2

We remark that one may make a different choice of basis in (4) and get another measure on the space of polynomials \({\mathbb {Q}}_p[x_0, x_1, x_2, x_3]_{(3)}\). The reason we chose the monomial basis in (4) is because it is guaranteed to be invariant under change of variables, moreover when p is big enough, namely \(p > 3\), the resulting measure is actually the only one that is invariant under the action of \({{\,\textrm{GL}\,}}_4({\mathbb {Z}}_p)\), see [17, Theorem 1.1].

For our computational experiments, we can determine the coefficients only up to finite precision. So in practice, we sample the variables \(\xi _\alpha \) are considered to be random variables with uniform distribution on the set \(\{ 0, 1, \ldots , p^{N + 1} - 1 \}\) for some precision N.

We note that the Haar measure has already been used on the space of cubic surfaces over \({\mathbb {Q}}_p\) to compute the expected number of lines; see [18]. To the best of our knowledge, the other measures (to be defined next) are not recorded anywhere in the literature.

3.2 The blow-up measure

As we saw in Sect. 2, one way to construct a cubic surface is to blow the plane \({\mathbb {P}}^2\) at six points in general position. If the six points are chosen randomly, we then get a random cubic surface. More precisely we define a new measure on the space of cubic surfaces as follows:

Definition 1.7

(The blow-up measure) Let \(\xi _0, \dots , \xi _6\) be independent uniformly distributed random variables in \({\mathbb {Z}}_p\) and let F be the random polynomial \(F = \xi _0 + \xi _1 X + \dots + \xi _6 X^6\). With probability 1, the polynomial F has degree 6, its roots \(\theta _1, \dots , \theta _6\) are simple and lie in the complement of the hyperplane arrangement (3). This defines a measure on the space of degree 6 polynomials. The map \( F \longmapsto {\mathcal {S}}(F)\) determines a measure on the space of smooth cubic surfaces via pushforward which we call the blow-up measure.

Again, in practice, sampling a polynomial F is done by choosing a large integer N and sampling the coefficients of F from the set \(\{ 0, 1, \ldots , p^{N + 1} - 1 \}\) independently with respect to the uniform distribution. The number of lines on the cubic surface \({\mathcal {S}}(F)\) is determined by factorizing F over the field K and applying Lemma 2.2.

As mentioned in Remark 2.3, not all cubic surfaces over \({\mathbb {Q}}_p\) arise from a blow-up of 6 points in \({\mathbb {P}}^2\). Therefore, the blow-up measure only sees cubic surfaces with a Galois-invariant double-six.

3.3 The tropical (generic) measure

The following theorem suggests that the number of lines on a smooth cubic surface \({\mathcal {S}}(F)\) is tightly linked to the tropicalization of F:

Theorem 1.8

(Theorem 3.5 in [15]) Fix a prime \(p \ge 5\) and a cubic surface \({\mathcal {S}}(F)\) over \({\mathbb {Q}}_p\), as in Definition 2.1. If \({\mathcal {S}}(F)\) is “tropically smooth”, then the 27 lines on \({\mathcal {S}}(F)\) have distinct tropicalizations in the tropical projective space \({\mathbb {T}}{\mathbb {P}}^3\). In that case, all 27 lines on \({\mathcal {S}}(F)\) are defined over \({\mathbb {Q}}_{p}\).

When it comes to the combinatorial type of the cubic equation f (i.e., the regular subdivision it induces on the polytope \(3 \Delta _3\)), sampling from the Haar measure is not the best way of sampling polynomials with a diverse combinatorial types (or tropicalizations). Under the Haar measure on \({\mathbb {Z}}_p\), it is quite rare to see elements with a large valuation. In order to remedy this shortcoming, we may sample from \({\mathbb {Q}}_p[ x_0 , x_1, x_2, x_3]_{( 3 )} \) by prescribing the valuation of each coefficient of f. More precisely,

Definition 1.9

(The tropical measure) Let N be a positive integer and let \((\nu _{\alpha })_{|\alpha | = 3}\) be independent uniform random variables in \(\{0, \dots , N\}\). We then obtain the random cubic equation

$$\begin{aligned} f = \sum _{|\alpha | = 3} p^{\nu _\alpha } x^\alpha . \end{aligned}$$

When N is large enough, the cubic surface \({\mathcal {S}}(f)\) defined by f is almost surely smooth. This defines a measure on the space of smooth cubic surfaces which we call the tropical measure.

It is quite natural to adapt this measure in the following way:

Definition 1.10

(The tropical generic measure) Let N be a positive integer and let \((\nu _{\alpha })_{|\alpha | = 3}\) be independent uniform random variables in \(\{0, \dots , N\}\) and \((c_{\alpha })_{|\alpha | = 3}\) be independent uniform random variables in \({\mathbb {Z}}_p^{\times }\) (with respect to the Haar measure on \({\mathbb {Z}}_p\)). We then obtain the random cubic equation

$$\begin{aligned} f = \sum _{|\alpha | = 3} p^{\nu _\alpha } u_\alpha x^\alpha . \end{aligned}$$

The cubic surface \({\mathcal {S}}(f)\) is then smooth with probability 1. The measure so defined on the space of smooth cubic surfaces is called the tropical generic measure.

3.4 Experiments for \(p=7\)

For each probability measure \(\mu \) on the space of cubic surfaces, we can obtain a probability measure \(\pi ^{(\mu )}\) on the set \(\{0,1,2,3,5,7,9,15,27\}\) of possible line counts, where \(\pi ^{(\mu )}_{i}\) records the probability under \(\mu \) that a cubic surface contains i lines. In general, given the measure \(\mu \), it is quite hard to determine the distribution \((\pi ^{(\mu )}_{i})\), even for the probability distributions defined in Sect. 3. Hence, we sample a large number of cubic surfaces under each measure and use Monte–Carlo estimation to get an idea of how this distribution looks like for the measures we defined above.

We investigated each of the above measures experimentally by sampling \(10^5\) instances of smooth cubic surfaces and counting the corresponding number of lines. The latter is accomplished by using Gröbner basis techniques, or rather Lemma 2.2 for the blow-up measure. The resulting distributions on the number of lines are depicted in Table 3. The code we used for sampling surfaces and counting lines can be found at (1).

Table 3 The distribution of the number of lines for different probabilistic measures over the 7-adic numbers

It is important to note the following:

  1. (1)

    Our result only estimatesFootnote 3 the distribution \(\pi ^{(\mu )} = \left( \pi ^{(\mu )}_{k}\right) \) for any chosen measure \(\mu \). This approximation relies on the law of large numbers, so our results are random but converge to the correct distribution as the sample size gets larger and larger.

  2. (2)

    The dimension of the space of cubic equations is 20, which would make the computation of integralsFootnote 4 quite expensive. One of the advantages of the estimation method we used is that it is not affected by the dimension of the space we sample from.

  3. (3)

    When dealing with computations over a p-adic field, one has to be careful with precision. Our computation were conducted with an absolute p-adic precision of 300, while a random p-adic number in \({\mathbb {Z}}_p\) was sampled from the uniform distribution on the set \(\{0,\dots ,p^{8}-1\}\). All these choices were made so that the computation runs in a reasonable time all the while keeping the results significant.

  4. (4)

    Finally, it should also be mentioned that our implementations in (1) can be optimized a great deal from a performance point of view. So it is very much possible to go beyond the sample sizes we have used.

3.5 Interpretation of the results

We observe from Table 3 that under the Haar measure the probabilities of the line counts decrease. Actually most surfaces have 0 or 1 \({\mathbb {Q}}_p\)-lines so under this measure, it is quite rare to find a cubic surfaces with a high count of p–adic lines, in particular 27-lines (around \(\simeq 10^{-5}\) probability). This explains that the average number of p-adic lines under the Haar measure is almost 1. In fact, the following theorem quantifies the expected number which is \(\simeq 1.01749\) for \(p = 7\).

Theorem 1.11

([18, Theorem 3]) The expected number of p-adic lines on a random uniform p-adic cubic surface in \({\mathbb {P}}^3\) is \(\frac{(p^3-1)(p^2+1)}{p^5-1}\).

We observe that under both tropical measures, the chance of seeing bigger line counts is significantly higher compared to the Haar measure. Notice also that both measures yield more or less the same distribution of line counts. This is probably due to the fact that the number of lines depends heavily on the tropicalization of the cubic equation f, and hence also on the induced triangulation on the newton polytope \(3\Delta _3\). This is in light of [15, Conjecture 4.1].

As far as the blow-up measure is concerned, we see again bigger number of lines with higher probability compared to any of the other measures. This can be explained by the fact that this measure only sees the cubic surfaces with a \({\mathbb {Q}}_p\)-rational double-six, which generally have more lines than those that do not. This is in line with the results from [19, Theorem 1] where the probability \(\rho _n(r)\) that a degree n polynomial with random independent and uniform coefficients in \({\mathbb {Z}}_p\) has exactly r roots is given recursively. The particular case of interest to us is the case \(n = 6\) and \(p = 7\), where we get

$$\begin{aligned} \rho _6(0) + \rho _6(1)&= \frac{7280010099060058135701356421229303451929}{9915124900168002703437229470076926702000} \simeq 0.7343, \\ \rho _6(2)&= \frac{132142086852025648305980401844338671377}{661008326677866846895815298005128446800} \simeq 0.19991, \\ \rho _6(3)&= \frac{6274737460539590192834937928502919283}{123939061252100033792965368375961583775} \simeq 0.05063, \\ \rho _6(4)&= \frac{3279805090966404942802616745034685803}{220336108892622282298605099335042815600} \simeq 0.01489,\\ \rho _6(5)&= 0,\\ \rho _6(6)&= \frac{379252487878267254806025930638752849}{1101680544463111411493025496675214078000} \simeq 0.00035. \end{aligned}$$

Table 4 compares the exact results from [19] to the estimates obtained in our experiments.

Table 4 Comparison of theoretical and experimental results for the blow-up measure

4 Heuristics for the real numbers

Let \(V = {\mathbb {R}}[x_0,x_1,x_2,x_3]_{(3)}\) be the real vector space of homogeneous degree three polynomials in \(x = (x_0,x_1,x_2,x_3)\). We endow V with the inner product \(\langle \cdot , \cdot \rangle \) defined as

$$\begin{aligned} \langle f_1,f_2 \rangle := \frac{1}{4\pi ^2} \int _{{\mathbb {R}}^{4}} f_1(x) f_2(x) e^{- \frac{\left\Vert {x}\right\Vert ^2}{2}} dx. \end{aligned}$$

The space V is endowed with the action of the orthogonal group \(O(4,{\mathbb {R}})\) by change of variables, i.e.,

$$\begin{aligned} (g\cdot f)(x) = f(g^{-1}x) \quad \text {for any } f \in V, \ g \in O(4,{\mathbb {R}}). \end{aligned}$$

This makes V a linear representation of \(O(4,{\mathbb {R}})\) which is moreover unitary, i.e., the inner product \(\langle \cdot , \cdot \rangle \) is stable under \(O(4,{\mathbb {R}})\):

$$\begin{aligned} \langle g \cdot f_1 , \ g\cdot f_2 \rangle = \langle f_1 , f_2 \rangle \quad \text { for } f_1,f_2 \in V \text { and } g \in O(4,{\mathbb {R}}). \end{aligned}$$

However, V is not irreducible, so \(\langle \cdot , \cdot \rangle \) is the not the unique \(O(4,{\mathbb {R}})\)-invariant inner product on V. The representation V splits into two irreducible orthogonal sub-representations as follows:

$$\begin{aligned} V = {\mathscr {H}}_3 \oplus \left\Vert {x}\right\Vert ^2 \cdot {\mathcal {H}}_1 \end{aligned}$$
(5)

where \({\mathscr {H}}_3\) is the subspace of homogeneous harmonic polynomials of degree 3 and \({\mathcal {H}}_1\) is the space of homogeneous degree 1 polynomials. Let \(p_1\) and \(p_2\) be the orthogonal projections of V onto \({\mathcal {H}}_3\) and \(\left\Vert {x}\right\Vert ^2{\mathcal {H}}_1\), respectively.

Definition 1.12

Let \(\lambda \) and \(\mu \) be positive real numbers. We define the inner product \(\langle \cdot , \cdot \rangle _{\lambda , \mu } \) on V as follows:

$$\begin{aligned} \langle f_1 , f_2 \rangle _{\lambda , \mu } = \frac{1}{\lambda ^2} \ \langle p_1(f_1), p_1(f_2)\rangle \ + \ \frac{1}{\mu ^2} \ \langle p_2(f_1), p_2(f_2)\rangle . \end{aligned}$$

We also define the centered Gaussian measure \(({\mathbb {P}}_{\lambda , \mu })_{\lambda , \mu > 0}\) on V associated to \(\langle \cdot , \cdot \rangle _{\lambda , \mu }\) i.e. the measure on V whose density \(\phi _{\lambda , \mu }\) is proportional to

$$\begin{aligned} \phi _{\lambda , \mu } (f) \propto \exp \left( \frac{- \langle f , f \rangle _{\lambda , \mu }}{2}\right) , \quad \text {for } f \in V. \end{aligned}$$

The two parameter family in Definition 4.1 parametrizes all \(O(4,{\mathbb {R}})\)-invariant inner products on V and hence all non-degenerate Gaussian measures on V that are \(O(4,{\mathbb {R}})\)-invariant are of the form \({\mathbb {P}}_{\lambda , \mu }\) (see [10, Section 4] for more details).

To sample a random cubic \(f \in V\) with respect to the measure \({\mathbb {P}}_{\lambda , \mu }\), we use the orthonormal basis \(\{H_{3,i}\}_{1 \le i \le 16} \) and \( \{H_{1,j}\}_{1 \le j \le 4}\) respectively of \({\mathcal {H}}_3\) and \(\left\Vert {x}\right\Vert ^2 {\mathcal {H}}_1\) given in [20, Table 1]. More precisely, let \((\xi _{3,i})_{1 \le i \le 16}\) and \((\xi _{1,j})_{1 \le j \le 4}\) be two independent sequences of independent identically distributed standard Gaussian random variables and let us define the random cubic f as follows:

$$\begin{aligned} f = \lambda \sum _{1 \le i \le 16} \xi _{3, i} H_{3, i} \ + \ \mu \sum _{1 \le j \le 4} \xi _{1, j} H_{1, j}. \end{aligned}$$

Since multiplying with a scalar does not change the zero set of f, we may assume that \(\lambda + \mu = 1\). Then we may focus on the 1-parameter family of measures

$$\begin{aligned} {\mathbb {P}}_\lambda := {\mathbb {P}}_{\lambda , 1 - \lambda }, \quad \lambda \in (0,1). \end{aligned}$$

For each \(\lambda \in (0,1)\), we have sampled \(10^5\) cubics under \({\mathbb {P}}_{\lambda }\) and estimated the probability distribution \(\pi ^{(\lambda )} = \left( \pi ^{(\lambda )}_3, \pi ^{(\lambda )}_7, \pi ^{(\lambda )}_{15}, \pi ^{(\lambda )}_{27} \right) \) where

$$\begin{aligned} \pi ^{(\lambda )}_k = {\mathbb {P}}_{\lambda } \left( \#\{ {\mathbb {R}}\text {-rational lines in } {\mathcal {S}}(f)\} = k \right) \quad \text { for } k = 3,7,15,27. \end{aligned}$$

The result is a curve

$$\begin{aligned} (0,1) \rightarrow \Delta _3, \quad \lambda \mapsto \pi ^{(\lambda )} = \left( \pi ^{(\lambda )}_3, \pi ^{(\lambda )}_7, \pi ^{(\lambda )}_{15}, \pi ^{(\lambda )}_{27} \right) , \end{aligned}$$

in the 3-dimensional \(\Delta _3\) simplex:

$$\begin{aligned} \Delta _3 := \left\{ (p_1, p_2, p_3, p_4) \in {\mathbb {R}}_{\ge 0}^4 :p_1 + p_2 + p_3 + p_4 = 1\right\} . \end{aligned}$$

The 3-dimensional simplex \(\Delta _3\) is contained in the affine hyperplane in \({\mathbb {R}}^4\) given by \(\{x_1 + x_2 + x_3 + x_4 = 1\}\). We pick an orthogonal basis \((e_1, e_2, e_3)\) of the hyperplane \(\{x_1 + x_2 + x_3 + x_4 = 0\}\) and write expand the curve \(\lambda \mapsto \pi ^{(\lambda )}\) as follows

$$\begin{aligned} \pi ^{(\lambda )} = \frac{1}{4} (1,1,1,1) \ + \ y_{1}(\lambda ) e_1 + y_{2}(\lambda ) e_2 + y_{3}(\lambda ) e_3. \end{aligned}$$

Figure 1 depicts the curve \(\lambda \mapsto (y_{1}(\lambda ), y_{2}(\lambda ), y_{3}(\lambda ))\).

Fig. 1
figure 1

The curve \((\pi ^{(\lambda )})_{\lambda \in (0,1)}\) inside the 3-dimensional probability simplex

A particular case of interest is the distribution \(\pi ^{(1/3)} \) obtained when we sample from the Kostlan distribution \({\mathbb {P}}_{1/3}\). To estimate \(\pi ^{(1/3)}\), we sampled \(10^6\) cubics \(f \in V\) under \({\mathbb {P}}_{1/3}\) and counted the number of lines on \({\mathcal {S}}(f)\). Table 5 summarizes the estimate we obtained for \(\pi ^{(1/3)}\).

Table 5 The distribution of number of real lines under the Kostlan measure

We note that our experiments corroborate the following results of [21] and [20]:

Theorem 1.13

([21, Theorem 5]) The average number of real lines on a random cubic surface in \({\mathbb {R}}{\mathbb {P}}^3\) under the Kostlan distribution \({\mathbb {P}}_{\frac{1}{3}}\) is \(6\sqrt{2} - 3 \simeq 5.48528\).

Theorem 1.14

([20, Theorem 1]) The expected number of real lines on a random real cubic surfaces under the measure \({\mathbb {P}}_{\lambda }\) is

$$\begin{aligned} E_{\lambda } = \frac{9(8 \lambda ^2 + (1-\lambda )^2)}{ 2\lambda ^2 + (1-\lambda )^2} \left( \frac{ 2\lambda ^2 }{ 8 \lambda ^2 + (1-\lambda )^2 } - \frac{1}{3} + \frac{2}{3} \sqrt{\frac{8 \lambda ^2 + (1-\lambda )^2}{ 20 \lambda ^2 + (1-\lambda )^2} } \right) . \end{aligned}$$

Our computations were carried out using the Julia package HomotopyContinuation.jl [22]. Code and data are available at (1).

4.1 Interpretation of the results

Notice that, as \(\lambda \rightarrow 0\), the distribution \(\pi ^{(\lambda )}\) converges to the vertex \( \pi ^{(0)} = (1,0,0,0)\). So when \(\lambda \) is small, we can only hope to see surfaces with 3 real lines under \({\mathbb {P}}_{\lambda }\); see [20, Proposition 2]. As \(\lambda \rightarrow 1\) we see higher number of lines with bigger probabilities. The curve in Fig. 1 depicts of \(\pi ^{(\lambda )}\) as \(\lambda \) ranges in (0, 1). We observe that the limit distribution as \(\lambda \rightarrow 1\) (a random cubic surface under the measure \({\mathbb {P}}_{1}\) supported on \({\mathcal {H}}_3\) is smooth with probability 1) lies in the interior of the 3-dimensional probability simplex but is not easy to determine explicitly.

This poses the following question:

Question 1.15

Is the curve \((\pi ^{(\lambda )})_{\lambda \in (0,1)}\) algebraic, and if yes, what are the equations defining it?

5 Galois groups

Let S be a smooth cubic surface defined over a perfect field K, and let L be the field of definition of the 27 lines on S. Then the extension L/K is Galois, and the Galois group \({{\,\textrm{Gal}\,}}(L/K)\) is a subgroup of \(W(E_6)\), the Weyl group of order \(51840 = 2^7\cdot 3^4\cdot 5\). A natural question to ask is which subgroups of \(W(E_6)\) can be realized in this way. The answer depends, of course, on the base field K. Elsenhans–Jahnel proved the following:

Theorem 1.16

([11, Theorem 0.1]) All subgroups of \(W(E_6)\) can be realized when \(K={\mathbb {Q}}\).

Let us now consider the case where K is a non-archimedean local field of characteristic 0; such a field is isomorphic to a finite extension of \({\mathbb {Q}}_p\) for some prime p. In this case, there are certain constraints on the possible Galois groups that can arise. Let us make this more precise. Let L be a finite Galois extension of K with Galois group G, and consider (the first parts of) the ramification group filtration on G:

$$\begin{aligned} G \supseteq G_0 \supseteq G_1. \end{aligned}$$

Here, \(G_0\) and \(G_1\) are the inertia and ramification groups, respectively. It is well-known that

  • the group \(G_1\) is a p-group,

  • the quotient \(G/G_0\) must be cyclic, and

  • the quotient \(G_0/G_1\) must be cyclic of order coprime to p

(see, for example, [23, Chapter IV]). In addition to these constraints, we also have the following:

Proposition 1.17

The Galois group G is solvable.

Proof

This well-known result follows from the fact that every p-group is nilpotent. \(\square \)

Because of this proposition, the statement in Theorem 5.1 clearly can not be true for K since \(W(E_6)\) has non-solvable subgroups. Indeed, there are precisely 19 non-solvable subgroups of \(W(E_6)\) up to conjugation, and they can be computed using the following Magma code:

$$\begin{aligned}{} & {} \texttt {R}\_\texttt {E6 := RootDatum(``E6'');} \\{} & {} \texttt {Cox}\_\texttt {E6 := CoxeterGroup(R}\_\texttt {E6);}\\{} & {} \texttt {WE6 := StandardActionGroup(Cox}\_\texttt {E6);}\\{} & {} \texttt {print NonsolvableSubgroups(WE6);} \end{aligned}$$

These observations pose the following question:

Question 1.18

Which subgroups of \(W(E_6)\) can arise as Galois groups of lines on smooth cubic surfaces over \({\mathbb {Q}}_p\)? How does this list depend on p?

The results of our experiments suggest that Galois groups should be quite small and they are usually abelian. Tables 6, 7 (resp. Tables 8, 9) summarize the Galois groupsFootnote 5 obtained for a sample of 25000 surfaces over \({\mathbb {Q}}_5\) (resp. \({\mathbb {Q}}_7\)) sampled from the Haar measure, and the number of times they occurred. Our code can be found at (1).

Table 6 The 24107 abelian groups that appeared in our sample for \(p=5\)
Table 7 The 893 non-abelian groups that appeared in our sample for \(p=5\)
Table 8 The 24922 abelian groups that appeared in our sample for \(p=7\)
Table 9 The 78 non-abelian groups that appeared in our sample for \(p=7\)

Remark 5.4

Notice that the Galois groups that appeared for \(p = 5\) are more complicated. This is expected since the prime 5 divides the order of the Weyl group \(W(E_6)\). We have also tried to make the same computation for the other primes with the same property, namely 2 and 3. Determining Galois groups using the Magma’s GaloisGroup() function, however, was significantly slower in these cases. This means that more interesting groups show up for the primes 2 and 3.

We see that while the generic Galois group for surfaces over \({\mathbb {Q}}\) is \(W(E_6)\), over the p-adics there is no “generic” group but rather a list of “small” groups that can occur with positive probability. Question 5.3 would be interesting to answer in future work. We conclude this section with the following remark.

Remark 5.5

Elsenhans–Jahnel also showed that some Galois groups are possible over any field of odd characteristic as long as a field extention with that group exists; see [24, 25]. This might give some information on what happens over \({\mathbb {Q}}_p\) by lifting surfaces over \({\mathbb {F}}_p\) to \({\mathbb {Z}}_p\).