+ M2 --no-readline --print-width 99
Macaulay2, version 1.9.2
with packages: ConwayPolynomials, Elimination, IntegralClosure, LLLBases, PrimaryDecomposition,
               ReesAlgebra, TangentCone

i1 : loadPackage("MatFacCurvesP4")

o1 = MatFacCurvesP4

o1 : Package

i2 : ------------------------------------------------------------------
     -- Proposition 4.2                                              --
     -- A general curve of genus 10 and degree 13 has expected Betti --
     -- table, and the matrix factorization it induces on a general  --
     -- supporting cubic threefold leads to a smooth curve of genus  --
     -- 12 and degree 14    	       	       	       	       	       	--
     ------------------------------------------------------------------
     --
     p=32009; -- a prime number

i3 : Fp=ZZ/p; -- a prime field

i4 : S=Fp[x_0..x_4];

i5 : -- We construct IE according to the first part of Algorithm 4.6
     IE=randomCurveGenus10Degree13InP4(S);

o5 : Ideal of S

i6 : -- We check that IE is a smooth curve of genus 10 and degree 13
     -- with the expected Betti table
     (codim IE, genus IE, degree IE) == (3,10,13)

o6 = true

i7 : isSmoothCurve(IE)

o7 = true

i8 : betti res IE

            0 1  2  3 4
o8 = total: 1 7 15 11 2
         0: 1 .  .  . .
         1: . .  .  . .
         2: . 5  .  . .
         3: . 2 15 11 2

o8 : BettiTally

i9 : -- We compute a matrix factorization on a supporting cubic      
     -- threefold we construct a curve via the correspondence in the 
     -- paper
     (phi,psi)=matrixFactorizationFromModule(IE);

i10 : betti psi

              0  1
o10 = total: 17 17
          2: 15  2
          3:  2 15

o10 : BettiTally

i11 : monadShape=betti map(S^{2:-1},S^{2:-1,2:-2},0);

i12 : IC=idealFromMatFac(psi,monadShape);

o12 : Ideal of S

i13 : -- The curve we produced is smooth of the right genus and       
      -- codimension                                                  
      (codim IC, genus IC, degree IC) == (3,12,14)

o13 = true

i14 : isSmoothCurve(IC)

o14 = true

i15 : betti res IC

             0 1  2  3 4
o15 = total: 1 9 18 12 2
          0: 1 .  .  . .
          1: . .  .  . .
          2: . 4  .  . .
          3: . 5 18 12 2

o15 : BettiTally

i16 :