Opened 10 years ago
Closed 10 years ago
#14264 closed defect (fixed)
Fix negation of Jacobian morphisms
Reported by: | SimonKing | Owned by: | AlexGhitza |
---|---|---|---|
Priority: | major | Milestone: | sage-5.9 |
Component: | algebra | Keywords: | Jacobian morphism |
Cc: | Merged in: | sage-5.9.beta4 | |
Authors: | Simon King | Reviewers: | Travis Scrimshaw |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
The following fails with a coercion error:
sage: P.<x> = QQ[] sage: f = x^5 - x + 1; h = x sage: C = HyperellipticCurve(f,h,'u,v') sage: J = C.jacobian() sage: K.<t> = NumberField(x^2-2) sage: R.<x> = K[] sage: Q = J(K)([x^2-t,R(1)]) sage: Q (u^2 - t, v - 1) sage: -Q (u^2 - t, v + u + 1)
The reason is that in the __neg__
method, the remainder of a polynomial h over the rationals is computed modulo a non-constant polynomial over a number field. The involved __mod__
method of FLINT polynomials would try to coerce the modulus into the parent of h, which fails here for obvious reasons.
I see two possible solutions:
- Make sure in
JacobianMorphism_divisor_class_field.__neg__
that h and the modulus live in the same ring, e.g., by adding the modulus to h before computing the remainder (which won't change the result). - In the
__mod__
method of FLINT polynomials, invoke coercion_model.canonical_coercion on h and the modulus, rather than trying to coerce the modulus into the parent of h.
With the second approach, the output of __mod__
would potentially live in a different ring (which should not be the case!) and it would imply a general slowdown of the __mod__
method. Therefore I prefer the first approach.
Attachments (1)
Change History (6)
Changed 10 years ago by
Attachment: | trac_14264-negative_jacobian_morphism.patch added |
---|
comment:1 Changed 10 years ago by
Authors: | → Simon King |
---|---|
Status: | new → needs_review |
comment:2 Changed 10 years ago by
Description: | modified (diff) |
---|
comment:3 Changed 10 years ago by
Description: | modified (diff) |
---|
comment:4 Changed 10 years ago by
Reviewers: | → Travis Scrimshaw |
---|---|
Status: | needs_review → positive_review |
Looks good to me.
comment:5 Changed 10 years ago by
Merged in: | → sage-5.9.beta4 |
---|---|
Resolution: | → fixed |
Status: | positive_review → closed |
I think the old formulation at the end of the ticket description was misleading.