A canonical divisor is the divisor of any differential on C so the 
following does the trick:

sage: kC=C.function_field()
sage: kC(kC.base_field().gen(0)).differential().divisor()

It doesn't look like we quite have computation of Riemann-Roch spaces 
natively in sage yet, so finding effective representatives requires a 
little more work. In the RiemannSurface code this is done using singular's 
adjoint ideal code (or by Baker's theorem in cases where it applies). For 
this curve the canonical class is of degree -2, so there are no effective 
representatives in this case.

On Friday, 27 October 2023 at 15:14:00 UTC-7 John H Palmieri wrote:

> If anyone here knows anything about canonical divisors and their 
> implementation in Sage, please see 
> https://ask.sagemath.org/question/74034/converting-algebraic-geometry-magmas-code-to-sage/.
>  
> The setup:
>
> sage: P2.<x,y,z> = 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)
>
> How do you get the canonical divisor for C?
>
> (I encourage you to post answers directly to ask.sagemath.org, if you're 
> willing.)
>
> -- 
> John
>
>

-- 
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/91b14570-b83e-4dbf-8bca-0a2eff538a50n%40googlegroups.com.

Reply via email to