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:
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
Steps To Reproduce
Consider the fractional representation
[p]/pof the identity morphism in characteristicp:The first two expressions confirm that
phiis a degree-one morphism equal to the identity:Expected Behavior
Since
phi = [p]/prepresents the identity morphism, its scaling factor should be1, andto_isogeny_chain()should return a degree-one morphism representing the identity.Methods implemented through
to_isogeny_chain(), includingrational_maps(),x_rational_map(),kernel_polynomial(), andformal(), should also work.Actual Behavior
phi.scaling_factor()raises aZeroDivisionError. Consequently,phi.to_isogeny_chain()and the methods depending on it also fail.Additional Information
EllipticCurveHom_fractional.scaling_factor()currently computesWhen the base field has characteristic
pandpdivides the denominatord, both the numerator scaling factor anddcan become zero in the base field. For[p]/p, this attempts to evaluate0/0, although the resulting morphism is the identity and has scaling factor1.This also affects
to_isogeny_chain(), which callsself.scaling_factor()while selecting the final isomorphism.The source currently contains a related FIXME noting that this can crash when
pdividesd.Environment
developChecklist