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:

Status badges

Description (last modified by SimonKing)

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:

  1. 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).
  2. 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)

trac_14264-negative_jacobian_morphism.patch (2.7 KB) - added by SimonKing 10 years ago.

Download all attachments as: .zip

Change History (6)

Changed 10 years ago by SimonKing

comment:1 Changed 10 years ago by SimonKing

Authors: Simon King
Status: newneeds_review

comment:2 Changed 10 years ago by SimonKing

Description: modified (diff)

I think the old formulation at the end of the ticket description was misleading.

comment:3 Changed 10 years ago by SimonKing

Description: modified (diff)

comment:4 Changed 10 years ago by tscrim

Reviewers: Travis Scrimshaw
Status: needs_reviewpositive_review

Looks good to me.

comment:5 Changed 10 years ago by jdemeyer

Merged in: sage-5.9.beta4
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.