Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thanks to John Palmieri bringing this question to the attention of sage-support group, the following answer was given by Nils Bruin and Kwankyu:

P2.<x,y,z> = 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 = (-D).function_space()

#the routine below is a bit of a shortcut based on how the affine patch for kC
#is chosen. In more general code this would need to be a little more sophisticated
def liftkC(u):
    return sum([(m.numerator()(y/x))/(m.denominator()(y/x))*(z/x)^i for i,m in enumerate(u.list())])

liftedbasis = [liftkC(m(b)) for b in L.basis()]
den = lcm([b.denominator() for b in liftedbasis])
liftedbasis = [parent(x)(b*den) for b in liftedbasis]
phi = C.hom(liftedbasis, P2)
phi.image()

As pointed out by Kwankyu, when the issue # 36592 is fixed, the code can be simplified to:

P2.<x,y,z> = 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
basis = (-K).basis_function_space()
Basis = [C._pull_from_function_field(f) for f in basis]
phi = C.hom(Basis, P2)
phi.image()  # conic