Skip to content

Hyperelliptic curve constructor has wrong inheritance #37612

@GiacomoPope

Description

@GiacomoPope

Steps To Reproduce

sage: R.<x> = QQ[]
sage: f = x^5 - x^4 + 3
sage: HyperellipticCurve(f).jacobian()
Jacobian of Hyperelliptic Curve over Rational Field defined by y^2 = x^5 - x^4 + 3
sage: HyperellipticCurve(f).jacobian
<bound method HyperellipticCurve_generic.jacobian of Hyperelliptic Curve over Rational Field defined by y^2 = x^5 - x^4 + 3>
sage: type(HyperellipticCurve(f).jacobian())
<class 'sage.schemes.hyperelliptic_curves.jacobian_generic.HyperellipticJacobian_generic_with_category'>

Expected Behavior

For genus two curves, the base class should be hyperelliptic_g2 which has the function

    def jacobian(self):
        """
        Return the Jacobian of the hyperelliptic curve.

        EXAMPLES::

            sage: R.<x> = QQ[]
            sage: f = x^5 - x^4 + 3
            sage: HyperellipticCurve(f).jacobian()
            Jacobian of Hyperelliptic Curve over Rational Field defined by y^2 = x^5 - x^4 + 3
        """
        return jacobian_g2.HyperellipticJacobian_g2(self)

So for a genus two curve, we expect a Jacobian of type HyperellipticJacobian_generic.HyperellipticJacobian_g2_generic but this does not happen as only the jacobian() function of HyperellipticCurve_generic is in scope.

Actual Behavior

Class construction should set the right inheritance so that the genus two functions work, or the genus two special cases should be handled within the generic class instead.

Additional Information

No response

Environment

- **Sage Version**: 10.2

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions