+ 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 : ------------------------------------------------------------------
     -- Theorem 5.1, Section 5.2                                     --
     -- Using auxiliary curves Z to construct curves C               --
     ------------------------------------------------------------------
     --
     p=32009; -- a prime number

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

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

i5 : H={13,4,4,4,4,4,4,4,4,4,4}; -- the hyperplane class on Y

i6 : (Y,pts)=alexanderSurface(S);

i7 : -- we assume here that (g,d)=(16,17)
     Z={31,10,10,10,10,10,10,9,9,9,9}

o7 = {31, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9}

o7 : List

i8 : time IZ=properTransformAlexander(S,Z,pts); -- takes 25 sec
     -- used 24.6267 seconds

o8 : Ideal of S

i9 : N=auxiliarLineBundle(Y,IZ);

i10 : betti res N -- the expected Betti table

             0  1  2 3 4
o10 = total: 6 14 16 9 1
          1: 6 10  3 . .
          2: .  3  . . .
          3: .  1 13 9 1

o10 : BettiTally

i11 : (phi,psi)=matrixFactorizationFromModule(N);

i12 : betti dual psi

              0  1
o12 = total: 23 23
         -6: 19  1
         -5:  .  3
         -4:  4 19

o12 : BettiTally

i13 : monadShape=betti map(S^{4:-2},S^{3:-2,1:-1},0)

             0 1
o13 = total: 4 4
          0: . 1
          1: . 3
          2: 4 .

o13 : BettiTally

i14 : time IC=idealFromMatFac(dual psi, monadShape); -- takes 358 sec
     -- used 358.007 seconds

o14 : Ideal of S

i15 : -- We check that C has all the desired properties
      (codim IC, genus IC, degree IC) == (3, 16, 17)

o15 = true

i16 : isSmoothCurve(IC)

o16 = true

i17 : betti res IC -- expected Betti table

             0  1  2  3 4
o17 = total: 1 17 29 14 1
          0: 1  .  .  . .
          1: .  .  .  . .
          2: .  .  .  . .
          3: . 17 29 13 .
          4: .  .  .  1 1

o17 : BettiTally

i18 : omegaC=Ext^2(IC,S^{-5}); -- canonical module of C

i19 : fomega=res omegaC;

i20 : sM=S^{1:-5}**coker transpose fomega.dd_3;

i21 : betti res sM

             0  1  2 3
o21 = total: 5 19 18 4
          0: 1  .  . .
          1: .  .  . .
          2: 4 19 18 1
          3: .  .  . 3

o21 : BettiTally

i22 : gIC=gens IC;

              1       17
o22 : Matrix S  <--- S

i23 : betti res (sM**(S/(ideal(gIC * random(source gIC,S^{-4}))))) -- expected resolution

             0  1  2  3  4  5  6
o23 = total: 5 19 23 23 23 23 23
          0: 1  .  .  .  .  .  .
          1: .  .  .  .  .  .  .
          2: 4 19 19  1  .  .  .
          3: .  .  .  3  .  .  .
          4: .  .  4 19 19  1  .
          5: .  .  .  .  .  3  .
          6: .  .  .  .  4 19 19
          7: .  .  .  .  .  .  .
          8: .  .  .  .  .  .  4

o23 : BettiTally

i24 : -- We check whether Y intersection X = C U Z
      X=ideal ring psi;

o24 : Ideal of S

i25 : YpX=Y+X;

o25 : Ideal of S

i26 : CiZ=intersect(IZ,IC);

o26 : Ideal of S

i27 : saturate YpX == CiZ -- true

o27 = true

i28 :