Re: [sage-support] Re: Canonical divisor help

2023-10-30 Thread Kwankyu
Now with (draft) PR https://github.com/sagemath/sage/pull/36592 the ask.sagemath problem is solved by P2. = ProjectiveSpace(QQ, 2) f = 2*x^5 - 4*x^3*y*z + x^2*y*z^2 + 2*x*y^3*z + 2*x*y^2*z^2+ y^5 C = Curve(f) kC = C.function_field() K = kC.gen().differential().divisor() # canonical divisor

Re: [sage-support] Re: Canonical divisor help

2023-10-29 Thread Kwankyu
This is simpler sage: psi = C.hom(liftedbasis, P2) sage: psi.image() Closed subscheme of Projective Space of dimension 2 over Rational Field defined by: x^2 + x*y + 2*y*z On Monday, October 30, 2023 at 5:45:27 AM UTC+9 Nils Bruin wrote: On Monday, 30 October 2023 at 00:19:47 UTC+13 Kwankyu

Re: [sage-support] Re: Canonical divisor help

2023-10-29 Thread Nils Bruin
On Monday, 30 October 2023 at 00:19:47 UTC+13 Kwankyu wrote: What is your code? P2. = ProjectiveSpace(QQ, 2) f = 2*x^5 - 4*x^3*y*z + x^2*y*z^2 + 2*x*y^3*z + 2*x*y^2*z^2+ y^5 C = Curve(f) kC = C.function_field() D = kC(kC.base_field().gen(0)).differential().divisor() L,m,s =

Re: [sage-support] Re: Canonical divisor help

2023-10-29 Thread Kwankyu
The most pressing problem in sage at the moment seems to be that presently there only seem to be morphisms between schemes. You need rational maps for this (especially from a singular model, the map to a canonical model might only be a rational map). "SchemeMorphism" in Sage is a map

Re: [sage-support] Re: Canonical divisor help

2023-10-28 Thread Nils Bruin
On Saturday, 28 October 2023 at 18:50:12 UTC-7 Nils Bruin wrote: On Saturday, 28 October 2023 at 15:26:35 UTC-7 Kwankyu wrote: f1, f2, f3 are univariate polynomials (say in y) over rational function field (say in x). Then x and y are not always the variables X and Y of the coordinate ring of

Re: [sage-support] Re: Canonical divisor help

2023-10-28 Thread Nils Bruin
On Saturday, 28 October 2023 at 15:26:35 UTC-7 Kwankyu wrote: f1, f2, f3 are univariate polynomials (say in y) over rational function field (say in x). Then x and y are not always the variables X and Y of the coordinate ring of the affine plane. Things are more complicated if the curve is in

Re: [sage-support] Re: Canonical divisor help

2023-10-28 Thread Kwankyu
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

Re: [sage-support] Re: Canonical divisor help

2023-10-28 Thread John H Palmieri
Nils, thanks to you, too, for your responses. On Saturday, October 28, 2023 at 11:16:39 AM UTC-7 Nils Bruin wrote: > 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

Re: [sage-support] Re: Canonical divisor help

2023-10-28 Thread Nils Bruin
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

Re: [sage-support] Re: Canonical divisor help

2023-10-28 Thread John H Palmieri
Thanks for all of your posts, Kwankyu. Helpful and informative. John On Saturday, October 28, 2023 at 6:19:48 AM UTC-7 Kwankyu wrote: > To answer John's question: > > sage: P2. = ProjectiveSpace(QQ, 2) > sage: f = 2*x^5 - 4*x^3*y*z + x^2*y*z^2 + 2*x*y^3*z + 2*x*y^2*z^2+ y^5 > sage: C =

Re: [sage-support] Re: Canonical divisor help

2023-10-28 Thread Kwankyu
To answer John's question: sage: P2. = ProjectiveSpace(QQ, 2) sage: f = 2*x^5 - 4*x^3*y*z + x^2*y*z^2 + 2*x*y^3*z + 2*x*y^2*z^2+ y^5 sage: C = P2.curve(f) sage: F = C.function_field() sage: z, = F.gens() sage: K = z.differential().divisor() # canonical divisor sage: (-K).dimension() 3 sage: f1,

Re: [sage-support] Re: Canonical divisor help

2023-10-28 Thread Kwankyu
Let me mention also the related PR https://github.com/sagemath/sage/pull/35467 which implements Jacobian groups of curves (again via function field), referencing Nils' old code. The PR is long sleeping in draft state. If anyone finds it useful, I may wake it up. On Saturday, October 28,

Re: [sage-support] Re: Canonical divisor help

2023-10-28 Thread Kwankyu
Hi, I replied to Dima's comment in https://github.com/sagemath/sage/commit/977ace651af9b99689f7b6507f91f8b4e2588ae9#r131138149. Note that the "divisor" method of a curve had existed long before I added function field machinery and attached function fields to curves. Hence actually there are

Re: [sage-support] Re: Canonical divisor help

2023-10-27 Thread Dima Pasechnik
On Sat, Oct 28, 2023 at 1:02 AM John H Palmieri wrote: > Yes, I noticed that, too. It also fails to provide any information about what > ``v`` should be (beyond saying that it should be a "valid object"): there is > no INPUT block. I've left a comment here:

Re: [sage-support] Re: Canonical divisor help

2023-10-27 Thread John H Palmieri
Hi Dima, Yes, I noticed that, too. It also fails to provide any information about what ``v`` should be (beyond saying that it should be a "valid object"): there is no INPUT block. On Friday, October 27, 2023 at 3:51:10 PM UTC-7 Dima Pasechnik wrote: > By the way, the docstring of divisor()

Re: [sage-support] Re: Canonical divisor help

2023-10-27 Thread Dima Pasechnik
By the way, the docstring of divisor() misses an example, it's def divisor(self, v, base_ring=None, check=True, reduce=True): r""" Return the divisor specified by ``v``. .. WARNING:: The coefficients of the divisor must be in the base ring and