#8428: Problem with rational_points over plane curves AND addition of
rational_points_iterator function
----------------------------------+-----------------------------------------
   Reporter:  cturner             |       Owner:  AlexGhitza
       Type:  defect              |      Status:  new       
   Priority:  major               |   Milestone:            
  Component:  algebraic geometry  |    Keywords:            
     Author:  Charlie Turner      |    Upstream:  N/A       
   Reviewer:                      |      Merged:            
Work_issues:                      |  
----------------------------------+-----------------------------------------
Description changed by cturner:

Old description:

> The newly "improved" rational_points function for projective plane curves
> (#8193) has a bug; if for some (Y,Z) the polynomial defining the curve
> becomes identically 0, it returns a ValueError caused by the function
> trying to factorise 0 as a polynomial.
>
> Here is an example
>
> {{{
> sage: F = GF(2)
> sage: P2.<X,Y,Z> = ProjectiveSpace(F,2)
> sage: C = Curve(X*Y)
> sage: a = C.rational_points_iterator()
> sage: a.next()
> (1 : 0 : 0)
> sage: a.next()
> (0 : 1 : 0)
> sage: a.next()
> ---------------------------------------------------------------------------
> ValueError                                Traceback (most recent call
> last)
>
> /home/charlie/<ipython console> in <module>()
>
> /home/charlie/sage-current/local/lib/python2.6/site-
> packages/sage/schemes/plane_curves/projective_curve.pyc
> in rational_points_iterator(self)
>    353         # points with Z = 1
>    354         for y in K:
> --> 355             for x in R(g(X,y,one)).roots(multiplicities=False):
>    356                 yield(self.point([x,y,one]))
>    357
>
> /home/charlie/sage-current/local/lib/python2.6/site-
> packages/sage/rings/polynomial/polynomial_element.so
> in sage.rings.polynomial.polynomial_element.Polynomial.roots
> (sage/rings/polynomial/polynomial_element.c:30111)()
>
> /home/charlie/sage-current/local/lib/python2.6/site-
> packages/sage/rings/polynomial/polynomial_element.so
> in sage.rings.polynomial.polynomial_element.Polynomial.factor
> (sage/rings/polynomial/polynomial_element.c:18463)()
> ValueError: factorization of 0 not defined
> }}}
>
> A patch to improve this is on its way.

New description:

 The newly "improved" rational_points function for projective plane curves
 (#8193) has a bug; if for some (Y,Z) the polynomial defining the curve
 becomes identically 0, it returns a ValueError caused by the function
 trying to factorise 0 as a polynomial.

 Here is an example

 {{{
 sage: F = GF(2)
 sage: P2.<X,Y,Z> = ProjectiveSpace(F,2)
 sage: C = Curve(X*Y)
 sage: a = C.rational_points_iterator()
 sage: a.next()
 (1 : 0 : 0)
 sage: a.next()
 (0 : 1 : 0)
 sage: a.next()
 ---------------------------------------------------------------------------
 ValueError                                Traceback (most recent call
 last)

 /home/charlie/<ipython console> in <module>()

 /home/charlie/sage-current/local/lib/python2.6/site-
 packages/sage/schemes/plane_curves/projective_curve.pyc
 in rational_points_iterator(self)
    353         # points with Z = 1
    354         for y in K:
 --> 355             for x in R(g(X,y,one)).roots(multiplicities=False):
    356                 yield(self.point([x,y,one]))
    357

 /home/charlie/sage-current/local/lib/python2.6/site-
 packages/sage/rings/polynomial/polynomial_element.so
 in sage.rings.polynomial.polynomial_element.Polynomial.roots
 (sage/rings/polynomial/polynomial_element.c:30111)()

 /home/charlie/sage-current/local/lib/python2.6/site-
 packages/sage/rings/polynomial/polynomial_element.so
 in sage.rings.polynomial.polynomial_element.Polynomial.factor
 (sage/rings/polynomial/polynomial_element.c:18463)()
 ValueError: factorization of 0 not defined
 }}}

 I propose to write new rational_points_iterator function that will return
 an iterator over the set of rational points of the projective plane curve.
 It will avoid this bug. It will be called by rational_points to return a
 list of all these rational point. A patch to do all of this is on its way.

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8428#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to