Ticket #9182 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Jacobian of a Hyperelliptic curve doesn't coerces correctly

Reported by: aly.deines Owned by: AlexGhitza
Priority: minor Milestone: sage-4.4.4
Component: algebra Keywords: Point, Hyperelliptic curve
Cc: Work issues:
Report Upstream: N/A Reviewers: Robert Miller
Authors: Aly Deines Merged in: sage-4.4.4.alpha1
Dependencies: Stopgaps:

Description

When defining a point on the Jacobian of a Hyperellptic curve, if a coordinate is an integer, it does not get coerced to polynomial and the following error raised: raise TypeError?, "Argument P (= %s) must have length 2."%P For example:

sage: F.<a> = GF(3)
sage: R.<x> = F[]
sage: f = x^5-1
sage: C = HyperellipticCurve(f)
sage: J = C.jacobian()
sage: X = J(F)
sage: a = x^2-x+1
sage: b = -x +1
sage: c = x-1
sage: d = 0 
sage: D1 = X([a,b])
sage: D2 = X([c,d])
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/aly/Desktop/sage-4.3.1/<ipython console> in <module>()

/home/aly/Desktop/sage-4.3.1/local/lib/python2.6/site-packages/sage/schemes/hyperelliptic_curves/jacobian_homset.py in __call__(self, P)
     86                 if is_SchemeMorphism(P1) and is_SchemeMorphism(P2):
     87                     return self(P1) - self(P2)
---> 88             raise TypeError, "Argument P (= %s) must have length 2."%P
     89         elif isinstance(P,JacobianMorphism_divisor_class_field) and self == P.parent():
     90             return P

TypeError: Argument P (= [x + 2, 0]) must have length 2.
sage: D2 = X([c,R(d)])                                                                               
sage: D2
(x + 2, y)


Attachments

trac_9182_hyper_el_points.patch Download (3.5 KB) - added by aly.deines 3 years ago.
trac_9182_doc_fix.patch Download (908 bytes) - added by aly.deines 3 years ago.

Change History

Changed 3 years ago by aly.deines

comment:1 Changed 3 years ago by aly.deines

  • Status changed from new to needs_review

comment:2 Changed 3 years ago by rlm

Those double colon lines should look like they do in the examples here:

http://www.sagemath.org/doc/developer/conventions.html

Without those extra newlines, it won't process correctly. Also, the code coming after a double colon should be further indented than the colons.

Changed 3 years ago by aly.deines

comment:3 Changed 3 years ago by aly.deines

Ok, changed.

comment:4 Changed 3 years ago by rlm

  • Priority changed from trivial to minor
  • Reviewers set to Robert Miller
  • Status changed from needs_review to positive_review

Looks good to me.

comment:5 Changed 3 years ago by mhansen

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-4.4.4.alpha1

comment:6 Changed 3 years ago by mvngu

  • Milestone set to sage-4.4.4

comment:7 Changed 2 years ago by aly.deines

  • Authors changed from Alyson Deines to Aly Deines
Note: See TracTickets for help on using tickets.