Fwd: [sage-devel] Re: Riemann-Roch spaces in Magma

5 views
Skip to first unread message

John Cremona

unread,
Mar 9, 2009, 6:42:43 PM3/9/09
to sag...@googlegroups.com
This conversation started on sage-devel but (at David Kohel's suggestion) is moving to sage-nt.

John

Forwarded conversation
Subject: [sage-devel] Riemann-Roch spaces in Magma
------------------------

From: Francisco Veach <fve...@v64.net>
Date: 2009/3/8
To: sage-devel <sage-...@googlegroups.com>



I'm currently reading through Hess' paper on calculating bases for
Riemann-Roch spaces (http://linkinghub.elsevier.com/retrieve/pii/
S0747717101905139
), hoping to be able to implement it for Sage. I'd
like to be able to learn how to compute a basis in Magma so that I'll
be able to check my results when I begin coding.

For example, at http://www.sagemath.org/doc/ref/module-sage.schemes.plane-curves.projective-curve.html,
one of the examples toward the bottom is a demonstration of an
incorrect basis that Singular gives. So far, I've set this up in Magma
as

R<x,y,z> := ProjectiveSpace(GF(5),2);
C := Curve(R,x^7 + y^7 + z^7);
pts := RationalPoints(C);

I haven't figured out how to do the next step in Magma, creating the
divisor. In the Sage example, the code is:

D = C.divisor([ (3, pts[0]), (-1,pts[1]), (10, pts[5]) ])

pts[0] = (0:4:1) corresponds to pts[5] by Magma's calculation.
Likewise, pts[1] = (1:2:1) in Sage corresponds to pts[3] in Magma, and
pts[5] = (4:1:0) in Sage corresponds to pts[6] in Magma. Once I have
the divisor D, I understand that Basis(D) computes the basis, and that
it should be [x/(y + x), (z + y)/(y + x)].

I'd also like to be able to do Hess' Example 6.3 in Magma. Magma's
documentation is clear, I'm just not sure which functions to use to
correctly create the fields, places, and divisors in question.

Specific solutions to the above, some more examples, or a general
template on how to set up Magma with a curve C over a field F and how
to find/get divisors would be helpful. The ultimate goal is to have a
large number of examples (a field, a curve, a divisor of the curve,
and the Riemann-Roch basis as calculated by Hess' algorithm in Magma)
that I can use as test cases for my implementation.

--Francisco


----------
From: John Cremona <john.c...@gmail.com>
Date: 2009/3/8
To: sage-...@googlegroups.com


You do this:

> P3:=pts[3];
> P5:=pts[5];
> P6:=pts[6];
> D:=Place(P3)+Place(P5)+Place(P6);
> D;
Divisor 1*Place at (1 : 2 : 1) + 1*Place at (0 : 4 : 1) + 1*Place at (4 : 1 : 0)
> RiemannRochSpace(D);
KModule of dimension 1 over GF(5)
Mapping from: KModule of dimension 1 over GF(5) to Function Field of C given by
a rule

The key is to wrap each point into a "place", then a Divisor is
defined by adding these (and you can also multiply them by integers).

John

2009/3/8 Francisco Veach <fve...@v64.net>:

----------
From: John Cremona <john.c...@gmail.com>
Date: 2009/3/8
To: sage-...@googlegroups.com


PS The Magma documentation is all available on line and explains this
with examples.  Try this:
http://magma.maths.usyd.edu.au/magma/htmlhelp/text1288.htm

John

2009/3/8 John Cremona <john.c...@gmail.com>:

----------
From: Francisco Veach <fve...@v64.net>
Date: 2009/3/9
To: sage-devel <sage-...@googlegroups.com>



Using an example from the Sage documentation, I have

R.<x,y,z> = ProjectiveSpace(GF(2),2)
f = x^3*y + y^3*z + x*z^3
C = Curve(f)
pts = C.rational_points()

(Note: pts = [(0 : 0 : 1), (0 : 1 : 0), (1 : 0 : 0)])

D = C.divisor([ (4, pts[0]), (0,pts[1]), (4, pts[2]) ])
C.riemann_roch_basis(D)

Output: [x/y, 1, z/y, z^2/y^2, z/x, z^2/(x*y)]

Now, I believe I've correctly written an analogous computation in
Magma:

R<x,y,z> := ProjectiveSpace(GF(2),2);
f := x^3*y + y^3*z + x*z^3;
C := Curve(R,f);
pts := RationalPoints(C);

(Note: pts = {@ (0 : 0 : 1), (0 : 1 : 0), (1 : 0 : 0) @}, so it agrees
with the coordinates from the Sage code.)

D := 4*Place(pts[1]) + 0*Place(pts[2]) + 4*Place(pts[3]);
Basis(D);

Output: [1/x^2, 1/x, 1, 1/x*x, 1/x^3*x^2 + 1/x^4, 1/x^2*x^2 + 1/x^3]
(It actually outputs the variables as $.1, I've changed it to x for
readability)

The dimensions match up, but I'm confused as to why the Magma output
only uses one variable. I realize the algorithms are different, but I
wasn't expecting Magma's output to use less variables. Is this
correct, or have I messed up the code?

----------
From: John Cremona <john.c...@gmail.com>
Date: 2009/3/9
To: sage-...@googlegroups.com


I think that the problem is that Magma uses $1 for more than one
distinct variable name.  Strange but true!  So when you changed them
all to x you see funny expressions like 1/x^2*x^2.  Probably one of
the x's is a y.

Here is how to get readable output in Magma:

> _<X,Y>:=Parent(Basis(D)[1]);
> Basis(D);
[
   1/Y^2,
   1/Y,
   1,
   1/Y*X,
   1/Y^3*X^2 + 1/Y^4,
   1/Y^2*X^2 + 1/Y^3
]

The parent of the elements of the basis is the function field of the
curve which has two variables.  Of course, it really is stupid that
Magma by default uses $1 for bot those variables!

John
2009/3/9 Francisco Veach <fve...@v64.net>:

----------
From: David Kohel <drk...@gmail.com>
Date: 2009/3/9
To: sage-devel <sage-...@googlegroups.com>



Can I suggest moving this discussion to sage-nt?

Cheers,
David


Reply all
Reply to author
Forward
0 new messages