Skip to content

EllipticCurveHom_fractional fails when the characteristic divides the denominator #42576

Description

@harrshita123

Steps To Reproduce

Consider the fractional representation [p]/p of the identity morphism in characteristic p:

p = 5
E = EllipticCurve(GF(p), [1, 1])
phi = E.scalar_multiplication(p) / p

phi.degree()
phi == E.scalar_multiplication(1)
phi.scaling_factor()
phi.to_isogeny_chain()

The first two expressions confirm that phi is a degree-one morphism equal to the identity:

1
True

Expected Behavior

Since phi = [p]/p represents the identity morphism, its scaling factor should be 1, and to_isogeny_chain() should return a degree-one morphism representing the identity.

Methods implemented through to_isogeny_chain(), including rational_maps(), x_rational_map(), kernel_polynomial(), and formal(), should also work.

Actual Behavior

phi.scaling_factor() raises a ZeroDivisionError. Consequently, phi.to_isogeny_chain() and the methods depending on it also fail.

Additional Information

EllipticCurveHom_fractional.scaling_factor() currently computes

return self._phi.scaling_factor() / self._d

When the base field has characteristic p and p divides the denominator d, both the numerator scaling factor and d can become zero in the base field. For [p]/p, this attempts to evaluate 0/0, although the resulting morphism is the identity and has scaling factor 1.

This also affects to_isogeny_chain(), which calls self.scaling_factor() while selecting the final isomorphism.

The source currently contains a related FIXME noting that this can crash when p divides d.

Environment

  • OS: macOS 26.5.2
  • Sage Version: 10.10.beta5 / current develop

Checklist

  • I have searched the existing open and closed issues for a matching bug report without success.
  • I have read the documentation and troubleshooting guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions