Bug or feature in Jacobian of hyperelliptic curve?

91 views
Skip to first unread message

Georgi Guninski

unread,
Jul 31, 2024, 10:33:47 AM7/31/24
to sage-...@googlegroups.com
I need non-torsion element of Jacobian of hyperelliptic curve,
would someone give example?

IIRC something very close to the following worked about
5 years ago, but now I get trivial result.

Session:
#Author: Georgi Guninski
K.<x>=QQ[]
C=HyperellipticCurve(x^5+x+5^2-2);
J=C.jacobian();
P=J(1,5);
2*P
#(1) ##is this correct?

Georgi Guninski

unread,
Jul 31, 2024, 11:03:36 AM7/31/24
to sage-...@googlegroups.com
Why the following doesn't work?

Session:
#Author: Georgi Guninski
K.<u>=QQ[]
C=HyperellipticCurve(u^5+u+5^2-2);
J=C.jacobian();
print("J=",J);
P=J(1,5);
#output
J= Jacobian of Hyperelliptic Curve over Rational Field defined by y^2
= x^5 + x + 23

---------------------------------------------------------------------------
TypeError: unsupported operand parent(s) for *: 'Univariate Polynomial
Ring in u over Rational Field' and 'Univariate Polynomial Ring in x
over Rational Field'

Martin R

unread,
Jul 31, 2024, 11:26:06 AM7/31/24
to sage-devel
I know nothing about hyperelliptic curves.  From the code, it seems possible that `self._names` is not taken into account properly.

In jacobian_morphism.py, we have

class JacobianMorphism_divisor_class_field(AdditiveGroupElement, SchemeMorphism):
[...]
    def __init__(self, parent, polys, check=True):
[...]
            f, h = C.hyperelliptic_polynomials()
            a, b = polys
            if not (b**2 + h*b - f) % a == 0:

and in your case, C.hyperelliptic_polynomials() gives

sage: C.hyperelliptic_polynomials()
(u^5 + u + 23, 0)

However, the caller JacobianHomset_divisor_classes.__call__ in  jacobian_homset.py does the follwing:

    def __call__(self, P):
[...]
                    R = PolynomialRing(self.value_ring(), 'x')
                    P1 = R(P1)
                    P2 = R(P2)
                    return JacobianMorphism_divisor_class_field(self, (P1, P2))

i.e., it converts your input to polynomials in `x`.  So that cannot work.

Martin

Nils Bruin

unread,
Jul 31, 2024, 11:46:14 AM7/31/24
to sage-devel
Yes, it is correct. To get a non-torsion element:

D=J(x-1,5)

For your other report:

K.<u>=QQ[]
C=HyperellipticCurve(u^5+u+5^2-2);
J=C.jacobian();
print("J=",J);
P=J(1,5); #error here

If you change the last line to P=J(1*u^0,5*u^0) then it does work. It looks like there is some preprocessing on the arguments that changes constants into polynomials and it looks like this has been hardcoded to J.base_ring()['x']. It should use

J.curve().hyperelliptic_polynomials()[0].parent()

instead.

Nils Bruin

unread,
Jul 31, 2024, 12:32:49 PM7/31/24
to sage-devel

Georgi Guninski

unread,
Jul 31, 2024, 12:52:27 PM7/31/24
to sage-...@googlegroups.com
On Wed, Jul 31, 2024 at 7:32 PM Nils Bruin <nbr...@sfu.ca> wrote:
>
> This is now:
>
> https://github.com/sagemath/sage/pull/38459
>

You are missing the `Author` from the original report.

Which license pisses off most SageMath, Inc to
include in future testcases (if any)?

Nils Bruin

unread,
Jul 31, 2024, 2:37:19 PM7/31/24
to sage-devel
Did you mean you want your name mentioned in the reference to the sage-devel discussion in the issue description? Done.

Concerning "licenses" for test cases: anything that's not GPL2+ does not get included in sagemath. If the bug is important enough to be fixed, it will be discovered independently and get its own non-derivative tests. So I don't think many people bother to specify licenses for bug reports.
Reply all
Reply to author
Forward
0 new messages