On Saturday, 28 October 2023 at 05:39:26 UTC-7 Kwankyu wrote: I looked the Magma code in ask.sagemath. There's no problem in computing a canonical divisor for the curve (through the attached function field). Computing a basis of the Riemann-Roch space is no problem as well. Actually the hard part is to construct the morphism from C to P2 from the basis. Magma does this seamlessly. But Sage lacks this functionality (perhaps because I did not implement it). I think, the gist of the matter is to convert an element of the function field to a rational function of the coordinate ring of P2.
That's actually trivially simple: if [f1,f2,f3] is the basis of your Riemann-Roch space, you just consider the map defined by [f1:f2:f3]. So you lift f1,f2,f3 to rational functions on the affine space that contains your curve: you just take the rational function representation and forget the algebraic relations between the variables. You now have rational functions in a rational function field, so you can clear denominators there. Now you have a rational map (described by polynomials) A^2->P^r under which the rational image of your curve C in A^2 is the corresponding projective image. Computing that image is the usual groebner-basis operation for finding images of rational maps, so that's potentially quite expensive. In practice, you know something about the denominators of the representations of f1,f2,f3, so you can probably do a little better. At its core, that is what the magma code does too, although perhaps it has some smart tricks here and there to try and keep degrees in check a bit. -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/ddd052ef-029c-4237-b2b7-9d5328201e07n%40googlegroups.com.