MathOverflow is a question and answer site for professional mathematicians. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $S$ be a smooth cubic surface defined by $f\in \mathbb Q[x,y,z,w]$. Is there an algorithm to write down the 27 lines on $S$? Or at least find a field extension of $\mathbb Q$ over which these lines are defined?

share|cite|improve this question
These lectures of Jim Carlson seem to come close: His Lecture 3 gives sage code to determine whether a given cubic has 27 lines. Presumably you could extend this to actually determine the lines. – Christian Nassau Jul 30 '14 at 12:18
For a generic cubic, the Galois group is the Weyl group of $E_6$, which has an index $2$ normal simple subgroup of order 25920 so there is no solution in radicals. It is certainly possible in principle to give a degree $27$ polynomial with the right splitting field; I'll think a bit about how to do it in practice. – David Speyer Jul 30 '14 at 12:25
@ChristianNassau Indeed, if you skim Carlson's code, he parametrizes a generic line as $(x,y,z,w) = (1,t,a+b*t,c+d*t)$. The Sage code finds a degree $27$ equation obeyed by the appropriate values of $d$. I believe the other elements of his Grobner basis should write $c$ as a polynomial in $d$, $b$ as a polynomial in $c$ and $d$, and $a$ as a polyomial in $(b,c,d)$. – David Speyer Jul 30 '14 at 12:31
The Grobner basis is just this degree 27 polynomial in $d$, and then $a-P_1(d)$, $b-P_2(d)$, and $c-P_3(d)$ for different degree 26 polynomials $P_i$. As pointed out on his slides, PARI cannot compute the Galois group here (at least when he wrote that), but Magma takes about 2 seconds to say its order is 51840. – NAME_IN_CAPS Jul 31 '14 at 2:24
His Sage code should also say "F.jacobian_ideal()", not "ideal(F.jacob())" I think. – NAME_IN_CAPS Jul 31 '14 at 2:31

This work from the Mainz Algebraic Geometry Group may help:

Duco van Straten and Oliver Labs. A Visual Introduction to Cubic Surfaces Using the Computer Software Spicy. Springer Berlin Heidelberg, 2003.
Short (12-page) 2001 Dagstuhl article: PDF download link.

Here is a little snippet from p.6 (of their Dagstuhl article). They take as input six points $\{P_1,\ldots,P_6\} \subset \mathbb{P}^2$ in the plane in general position:

share|cite|improve this answer

Once you have the six points in $\mathbb{P}^2$, there is a very easy algorithm to give the cubic surface and the $27$ lines. First, the map to $\mathbb{P}^3$ corresponds to cubics through the six points. So you can choose reducible ones (union of three lines through $2$) and get generators $(f_0:\dots:f_3)$. Then, you find the equation by putting the $f_i$ into a polynomial of degree $3$ and solving the linear equation on the coefficients.

Then, the $27$ lines are the strict transforms of lines through $2$ points, conic through $5$ points and the exceptional divisors. If you have the points and the $f_i$, this is algorithmic.

To simplify your calculation, you can choose the points and choose (over an algebraically closed field) $[1:0:0]$, $[0:1:0]$, $[0:0:1]$, $[1:1:1]$, $[1:a:b]$, $[1:c:d]$.

The only non-algorithmic part is starting from the cubic to find the contraction to $\mathbb{P}^2$. This corresponds to find lines on the cubic and is then more complicated (and there is in general no solution with radicals, as explained by David Speyer).

Note that the same kind of algorithm works with del Pezzo surfaces of degree $4$, $2$, $1$. I did it often with Maple with points given.

share|cite|improve this answer

Here is yet another place to look for an algorithm: you can find a description of how to compute homogeneous equations for the Plücker coordinates of the lines on a cubic surface in the Macaulay 2 tutorial at

What you will find there is essentially is the same procedure as in Jim Carlson's Sage code mentioned in the comments above, but perhaps it is a bit easier to read. The tutorial also discusses the general problem of computing equations for the Fano variety (scheme) of a projective variety.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.