#11526: count_points() error for generic schemes. (includes patch)
----------------------------------+-----------------------------------------
Reporter: mmarco | Owner: AlexGhitza
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.7.2
Component: algebraic geometry | Keywords:
Work_issues: | Upstream: N/A
Reviewer: | Author: Miguel Marco
Merged: | Dependencies:
----------------------------------+-----------------------------------------
Old description:
> sage raises an error when trying to count the number of points of a
> subscheme of an affine scheme.
>
> See, for instance:
>
> {{{
> sage: F=FiniteField(3)
> sage: R.<x,y>=F[]
> sage: A=AffineSpace(F,2)
> sage: I=R.ideal(x^2-y^2-1)
> sage: S=A.subscheme(I)
> sage: S.count_points(2)
>
>
> ---------------------------------------------------------------------------
> NameError Traceback (most recent call
> last)
>
> /home/mmarco/sage-4.6.2/<ipython console> in <module>()
>
> /usr/lib64/python2.7/site-packages/sage/schemes/generic/scheme.py in
> count_points(self, n)
> 531 F1 = GF(q**i, name='z')
> 532 S1 = self.base_extend(F1)
> --> 533 a.append(len(S1.rational_points()))
> 534 return(a)
> 535
>
> /usr/lib64/python2.7/site-
> packages/sage/schemes/generic/algebraic_scheme.py in
> rational_points(self, F, bound)
> 1129 raise TypeError, "Unable to enumerate points over
> %s."%F
> 1130 try:
> -> 1131 return X.points()
> 1132 except TypeError:
> 1133 raise TypeError, "Unable to enumerate points over
> %s."%F
>
> /usr/lib64/python2.7/site-packages/sage/schemes/generic/homset.py in
> points(self, B)
> 162 except TypeError:
> 163 raise TypeError, "Domain of argument must be of the
> form Spec(S)."
> --> 164 if is_RationalField(R) or R == Z:
> 165 if not B > 0:
> 166 raise TypeError, "A positive bound B (= %s) must
> be specified."%B
>
> NameError: global name 'Z' is not defined
> }}}
New description:
sage raises an error when trying to count the number of points of a
subscheme of an affine scheme.
See, for instance:
{{{
sage: F=FiniteField(3)
sage: R.<x,y>=F[]
sage: A=AffineSpace(F,2)
sage: I=R.ideal(x^2-y^2-1)
sage: S=A.subscheme(I)
sage: S.count_points(2)
---------------------------------------------------------------------------
NameError Traceback (most recent call
last)
/home/mmarco/sage-4.6.2/<ipython console> in <module>()
/usr/lib64/python2.7/site-packages/sage/schemes/generic/scheme.py in
count_points(self, n)
531 F1 = GF(q**i, name='z')
532 S1 = self.base_extend(F1)
--> 533 a.append(len(S1.rational_points()))
534 return(a)
535
/usr/lib64/python2.7/site-
packages/sage/schemes/generic/algebraic_scheme.py in rational_points(self,
F, bound)
1129 raise TypeError, "Unable to enumerate points over
%s."%F
1130 try:
-> 1131 return X.points()
1132 except TypeError:
1133 raise TypeError, "Unable to enumerate points over
%s."%F
/usr/lib64/python2.7/site-packages/sage/schemes/generic/homset.py in
points(self, B)
162 except TypeError:
163 raise TypeError, "Domain of argument must be of the
form Spec(S)."
--> 164 if is_RationalField(R) or R == Z:
165 if not B > 0:
166 raise TypeError, "A positive bound B (= %s) must
be specified."%B
NameError: global name 'Z' is not defined
}}}
'''Apply:'''
[attachment:trac_11526_bugfix_with_doctest.patch]
--
Comment(by davideklund):
The patch trac_11526_bugfix_with_doctest.patch was made using Sage 4.7.1.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11526#comment:4>
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.