# Computer code for HMSV paper

This page contains computer code that carries out the calculations needed in the paper ``The equations for the moduli space of n points on the line,'' by Benjamin Howard, John Millson, Andrew Snowden and Ravi Vakil. All the calculations concern the projective coordinate ring for the moduli space of eight points on the projective line.

### Proof of Proposition 2.9

The proof of Proposition 2.9 in the paper is a computation done in the computer algebra system Magma using the sciprt `simples_generate.m`. To run this script simply type

```magma simples_generate.m
```
at the command line. The output should look something like this:
```Magma V2.13-14    Sun Sep 23 2007 20:19:06 on math     [Seed = 3914903004]
Type ? for help.  Type -D to quit.

performing degree 2 computation...
performing degree 3 computation...
performing degree 4 computation (this may take a few minutes)...
let I be the ideal of all relations and J the ideal generated by the simple binomial
relations and the generalized Segre cubic relation s
in degree 2, I has rank 14 and J has rank 14
the largest elementary divisor of the quotient I/J in degree 2 is 1
in degree 3, I has rank 196 and J has rank 196
the largest elementary divisor of the quotient I/J in degree 3 is 1
in degree 4, I has rank 1295 and J has rank 1295
the largest elementary divisor of the quotient I/J in degree 4 is 1

Total time: 23.629 seconds, Total memory usage: 324.82MB
```

### A basis for the quadric relations

We have computed a particularly nice basis for the space of quadric relations on eight points. This basis was not needed in the paper so was not included. It is given by the following relations:

``` r1 : 0 = hl - ij
r2 : 0 = mc - na
r3 : 0 = dk - ej
r4 : 0 = bf - ga
r5 : 0 = ad + aj + di - bc - bh - cl
r6 : 0 = jf + ja + fn - hk - hm - kc
r7 : 0 = al + aj + le - mb - md - bk
r8 : 0 = jc + ja + cg - dh - df - hb
r9 : 0 = ak + aj + ki - fm - fl - mh
r10 : 0 = jb + ja + bn - ld - lc - dm
r11 : 0 = ah + aj + he - cf - ck - fd
r12 : 0 = jm + ja + mg - kl - kb - lf
r13 : 0 = aj + bh + bj - cg + df + dh + dj + dk +
fj - gn + hj + hl + j^2 + jk + jl + jm
r14 : 0 = ja + hm + ha - ki + fl + fm + fa + fb +
la - ie + ma + mc + a^2 + ab + ac + ad
```
The letters a..n are the generators for the ring given in the paper. This basis has two nice properties. First is that each relation contains a monomial with unit coefficient that does not appear in any other relation (for example, `r1` contains `ij` and no other relation does). This implies that the Z-module they generate is saturated and therefore that these relations give an integral basis for the space of all quadratic relations. Second is that they form orbits under the cyclic permutation `(1 2 3 4 5 6 7 8)`. The first four consitute an orbit as do the next eight and the last two.

We arrived at this basis through a fairly long process. First we used the C-program `rel8` (see below) written by one of us to obtain an initial basis of the space of quadric relations over Q. We then maniupalted these relations, essentially by hand, eventually arriving at the above relations. Finally, we used the magma script `simples_aux.m` to verify that these relations generate the same Z-module as do the simple binomial relations. Note that the program `rel8` also verifies that the quadric relations it gives generate the ideal of all relations in degrees 2, 3 and 4 over the rational numbers. Thus we have established this computation in two independent ways, so we can be fairly certain that an error has not been made.

The source code for `rel8` is `rel8.tar.gz`. The program computes a basis for I_2 and then calculates the dimension of the subspaces of I_3 and I_4 generated by I_2 using Matlab. These dimension calculations show that I_2 does indeed generate I_3 and I_4 over the rationals.

To run this program, first download the source code and deflate the tar file. Then run the command `make` (in the same directory as the makefile). This should produce an executable file called `rel8`. Then run this program.

Note that `rel8` invokes Matlab through a system command. Thus for this program to work you must have Matlab installed and you must be able to run it from the command line using the command `matlab`.

The program `rel8` will take a minute or two to run. When it is finished, the screen should look like the following:

```initializing program...done
outputting degree one generators...done
computing matrix of Sym^2(R_1) -> R_2 ...done
outputting generated cubic relations...done
computing rank in matlab...done
outputting generated quartic relations...done
computing rank in matlab...done

summary of results:

R_1 has dimension 14; a basis has been written to deg1_gen
I_2 has dimension 14; a basis has been written to quad_rel

Sym^3(R_1) has dimension 560; R_3 has dimension 364
thus I_3 has dimension 196
the subspace of I_3 generated by I_2 has dimension 196
therefore I_2 generates I_3

Sym^4(R_1) has dimension 2380; R_4 has dimension 1085
thus I_4 has dimension 1295
the subspace of I_4 generated by I_2 has dimension 1295
therefore I_2 generates I_4
```
The files `deg1_gen` and `quad_rel` should have been generated. They should match these files: `deg1_gen` and `quad_rel`.

### Decomposition of the second tensor power

In a previous version of the paper we needed to know how the second tensor power of the first graded piece of the ring on 8 points decomposed under the action of the symmetric group `S_8`. The GAP script `tensor2_8.gap` will do this computation.