Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

count_points() error for generic schemes. (includes patch) #11526

Closed
miguelmarco opened this issue Jun 21, 2011 · 19 comments
Closed

count_points() error for generic schemes. (includes patch) #11526

miguelmarco opened this issue Jun 21, 2011 · 19 comments

Comments

@miguelmarco
Copy link
Contributor

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_final.patch

Component: algebraic geometry

Author: Miguel Marco, David Eklund, Frithjof Schulze

Reviewer: Johan Bosman, Julian Rueth

Merged: sage-4.8.alpha4

Issue created by migration from https://trac.sagemath.org/ticket/11526

@miguelmarco
Copy link
Contributor Author

Attachment: trac_11526_solves_error.patch.gz

@miguelmarco

This comment has been minimized.

@sagetrac-davideklund
Copy link
Mannequin

sagetrac-davideklund mannequin commented Oct 30, 2011

comment:3

The patch makes sense, it fixes a bug in the method points() of the class SchemeHomset_affine_coordinates.

Note: the same typo (Z instead of ZZ) seems to occur in the method points() of the class SchemeHomset_projective_coordinates_ring, which is not implemented yet.

@sagetrac-davideklund
Copy link
Mannequin

sagetrac-davideklund mannequin commented Oct 30, 2011

In addition to fixing the bug, the patch includes a doctest illustrating this.

@sagetrac-davideklund
Copy link
Mannequin

sagetrac-davideklund mannequin commented Oct 30, 2011

comment:4

Attachment: trac_11526_bugfix_with_doctest.patch.gz

The patch trac_11526_bugfix_with_doctest.patch was made using Sage 4.7.1.

@sagetrac-davideklund

This comment has been minimized.

@sagetrac-johanbosman
Copy link
Mannequin

sagetrac-johanbosman mannequin commented Nov 6, 2011

comment:5

Now that you're working on the docstring anyway, it would be good to add INPUT and OUTPUT sections to it, as is the standard convention.

@sagetrac-davideklund
Copy link
Mannequin

sagetrac-davideklund mannequin commented Nov 21, 2011

Attachment: trac_11526_bugfix_with_docstring.patch.gz

In addition to earlier changes, the patch includes INPUT and OUTPUT info.

@sagetrac-davideklund
Copy link
Mannequin

sagetrac-davideklund mannequin commented Nov 21, 2011

comment:6

The patch trac_11526_bugfix_with_docstring.patch was made using Sage 4.7.1.

@sagetrac-davideklund

This comment has been minimized.

@sagetrac-fschulze
Copy link
Mannequin

sagetrac-fschulze mannequin commented Dec 9, 2011

The same patch as above together with the fix in the projective case.

@saraedum
Copy link
Member

saraedum commented Dec 9, 2011

Attachment: trac_11526_bugfix_with_docstring.2.patch.gz

fixes the bug (also for the projective case), docstring with Input and Output.

@saraedum
Copy link
Member

saraedum commented Dec 9, 2011

Changed author from Miguel Marco to Miguel Marco, davideklund, Frithjof Schulze

@saraedum

This comment has been minimized.

@saraedum
Copy link
Member

saraedum commented Dec 9, 2011

Reviewer: Johan Bosman, Julian Rueth

@saraedum
Copy link
Member

saraedum commented Dec 9, 2011

comment:7

Attachment: trac_11526_final.patch.gz

Apply trac_11526_final.patch

Tested against sage-4.8.alpha3 and doctests pass.

attachment: trac_11526_final.patch is identical to [trac_11526_bugfix_with_docstring.2.patch] except for the commit message which I replaced with something that makes hopefully more sense to somebody who does not know this ticket.

We still don't have a docstring for SchemeHomset?_projective_coordinates_ring.points() but I guess that is acceptable since there wasn't any before and it's not implemented anyway.

I'm unsure if "Reviewers" should only mention the person who clicked "positive review" or everybody who was part of the review process. Anyway, I added some authors and reviewers, I hope nobody minds.

Btw. davideklund, your name is not in the AccountNamesMappedtoRealNames on the trac wiki start page.

@vbraun
Copy link
Member

vbraun commented Dec 9, 2011

comment:8

I fixed this long ago in #11599 which also contains some other important additions IMHO. I think it would be more productive if somebody could review #11599.

@jdemeyer
Copy link

Merged: sage-4.8.alpha4

@jdemeyer
Copy link

Changed author from Miguel Marco, davideklund, Frithjof Schulze to Miguel Marco, David Eklund, Frithjof Schulze

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants