15.2.1 AG codes

Sage can compute an AG code $ C=C_X(D,E)$ by calling Singular's BrillNoether to compute a basis of the Riemann Roch space $ L(D)=L_X(D)$ . In addition to the curve $ X$ and the divisor $ D$ , you must also specify the evaluation divisor $ E$ .

As in the previous section, until the bugs in brnoth are worked out, this section is only included to illustrate syntax (or to help any developers wishing to work on this themselves).

Here's an example, one which computes a generator matrix of an associated AG code. This time we use Singular's AGCode_L command.

sage: singular.LIB('brnoeth.lib')
sage: singular.eval("ring s = 2,(x,y),lp;")
''
sage: print singular.eval("list HC = Adj_div(x3+y2+y);")
Computing affine singular points ...
Computing all points at infinity ...
Computing affine singular places ...
Computing singular places at infinity ...
Computing non-singular places at infinity ...
Adjunction divisor computed successfully
<BLANKLINE>
The genus of the curve is 1
sage: print singular.eval("list HC1 = NSplaces(1..2,HC);")
Computing non-singular affine places of degree 1 ...
Computing non-singular affine places of degree 2 ...
sage: print singular.eval("HC = extcurve(2,HC1);")
Total number of rational places : NrRatPl = 9

sage: singular.eval("intvec G = 5;")      # the rational divisor G = 5*HC[3][1]
''
sage: singular.eval("def R = HC[1][2];")
''
sage: singular.eval("setring R;")
''

The vector $ G$ represents the divisor ``5 times the point at infinity''.

Next, we compute the Riemann-Roch space.

sage: print singular.eval("BrillNoether(G,HC);")
Forms of degree 3 :
10
<BLANKLINE>
Vector basis successfully computed
<BLANKLINE>
[1]:
   _[1]=x
   _[2]=z
[2]:
   _[1]=y
   _[2]=z
[3]:
   _[1]=1
   _[2]=1
[4]:
   _[1]=y2+yz
   _[2]=xz
[5]:
   _[1]=y3+y2z
   _[2]=x2z

That was the basis of the Riemann-Roch space, where each pair of fuctions represents the quotient (first function divided by second function). Each of these basis elements get evaluated at certain points to construct the generator matrix of the code. We next construct the points.

sage: singular.eval("def R = HC[1][5];")
'// ** redefining R **'
sage: singular.eval("setring R;")
''
sage: print singular.eval("POINTS;")
[1]:
   [1]:
      0
   [2]:
      1
   [3]:
      0
[2]:
   [1]:
      0
   [2]:
      1
   [3]:
      1
[3]:
   [1]:
      0
   [2]:
      0
   [3]:
      1
[4]:
   [1]:
      (a+1)
   [2]:
      (a)
   [3]:
      1
...

plus $ 5$ more, for a total of $ 9$ rational points on the curve. We define our ``evaluation divisor'' $ D$ using a subset of these points (all but the first):

sage: singular.eval("def ER = HC[1][4];")
''
sage: singular.eval("setring ER;")
''
sage: # D = sum of the rational places no. 2..9 over F_4
sage: singular.eval("intvec D = 2..9;")
''
sage: # let us construct the corresponding evaluation AG code :
sage: print singular.eval("matrix C = AGcode_L(G,D,HC);")
Forms of degree 3 :
10
<BLANKLINE>
Vector basis successfully computed
<BLANKLINE>
sage: # here is a linear code of type [8,5,> = 3] over F_4
sage: print singular.eval("print(C);")
0,0,(a+1),(a),  1,  1,    (a),  (a+1),
1,0,(a),  (a+1),(a),(a+1),(a),  (a+1),
1,1,1,    1,    1,  1,    1,    1,    
0,0,(a),  (a+1),1,  1,    (a+1),(a),  
0,0,1,    1,    (a),(a+1),(a+1),(a)

This is, finally, our desired generator matrix, where a represents a generator of the field extension of degree $ 2$ over the base field $ GF(2)$ .

Can this be ``wrapped''?

See About this document... for information on suggesting changes.