# Ticket #9182(closed defect: fixed)

Opened 3 years ago

## Jacobian of a Hyperelliptic curve doesn't coerces correctly

Reported by: Owned by: aly.deines AlexGhitza minor sage-4.4.4 algebra Point, Hyperelliptic curve N/A Robert Miller Aly Deines sage-4.4.4.alpha1

### 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)

```

## Change History

### 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:

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

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.