Algebraic-geometric codes functions

This section of &GAP;'s `singular` package and the corresponding code were written by David Joyner, wdj@usna.edu, (with help from Christoph Lossen and Marco Costantini). It has been tested with `Singular` versrion 2.0.x.

To start off, several new `Singular` commands must be loaded.

The following command loads the necessary `Singular` and &GAP; commands, the packages `singular` and `GUAVA` (if not already loaded), and (re)starts `Singular`.

gap> ReadPackage("singular", "contrib/agcode.g");;

Let F be a finite and prime field. The function AllPointsOnCurve( f, F ) computes a list of generators of maximal ideals representing rationals points on a curve X defined by f(x,y)=0.

gap> F:=GF(7);; gap> R2:= PolynomialRing( F, 2 );; gap> SetTermOrdering( R2, "lp" );; # --- the term ordering must be "lp" gap> indet:= IndeterminatesOfPolynomialRing(R2);; gap> x:= indet[1];; y:= indet[2];; gap> f:=x^7-y^2-x;; gap> AllPointsOnCurve(f,F); [ [ x_1 ], [ x_1-Z(7)^0 ], [ x_1+Z(7)^4 ], [ x_1+Z(7)^5 ], [ x_1+Z(7)^0 ], [ x_1+Z(7) ], [ x_1+Z(7)^2 ] ]

Let f be a polynomial in x,y over F=GF(p) representing plane curve X defined by f(x,y)=0, where p is a prime (prime powers are not yet supported by the underlying `Singular` function). Let G, D be disjoint rational divisors on X, where D is a sum of distinct points, supp(D)={P_1, ..., P_n}. The AG code associated to f, G, D is the F defined to be the image of the evaluation map f \mapsto (f(P_1),...,f(P_n)). The function AGCode computes a list of length three, [G, n, k], where G is a generator matrix of the AG code C, n is its length, and k is its dimension.

gap> F:=GF(7);; gap> R2:= PolynomialRing( F, 2 );; gap> SetTermOrdering( R2, "lp" );; # --- the term ordering must be "lp" gap> SingularSetBaseRing(R2); gap> indet:= IndeterminatesOfPolynomialRing(R2);; gap> x:= indet[1];; y:= indet[2];; gap> f:=x^7-y^2-x;; gap> G:=[2,2,0,0,0,0,0]; D:=[4..8]; [ 2, 2, 0, 0, 0, 0, 0 ] [ 4 .. 8 ] gap> agc:=AGCode(f,G,D); [ [ [ Z(7)^3, Z(7), 0*Z(7), Z(7)^4, Z(7)^5 ], [ 0*Z(7), Z(7)^4, Z(7)^0, Z(7)^5, Z(7)^3 ], [ 0*Z(7), 0*Z(7), Z(7)^3, Z(7), Z(7)^2 ] ], 5, 3 ]

This generator matrix can be fed into the `GUAVA` command to create a linear code in &GAP;, which in turn can be fed into the `GUAVA` command to compute the minimum distance of the code.

gap> ag_mat:=agc[1];; gap> C := GeneratorMatCode( ag_mat, GF(7) ); a linear [5,3,1..3]2 code defined by generator matrix over GF(7) gap> MinimumDistance(C); 3