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

Listing an infinite vector space just hangs #10470

Closed
rbeezer mannequin opened this issue Dec 13, 2010 · 10 comments
Closed

Listing an infinite vector space just hangs #10470

rbeezer mannequin opened this issue Dec 13, 2010 · 10 comments

Comments

@rbeezer
Copy link
Mannequin

rbeezer mannequin commented Dec 13, 2010

Asking for a list of elements in an infinite vector space does not raise an error, but requires a Ctrl-C to get back the command-line.

sage: V=QQ^2
sage: V
Vector space of dimension 2 over Rational Field
sage: V.list()
<hang>

Of course, finite examples work properly:

sage: V=GF(3)^2
sage: V.list()
[(0, 0), (1, 0), (2, 0), (0, 1), (1, 1), (2, 1), (0, 2), (1, 2), (2, 2)]

Maybe this should be addressed in the module code, I have not looked into the cause much. Perhaps a fix could be as simple as having a non-zero dimension with an infinite base ring throwing an error?


Apply both patches, attachment: trac_10470-listing-infinite-sets.patch and attachment: trac_10470-referee-doc.patch.

Component: linear algebra

Author: Rob Beezer

Reviewer: John Palmieri

Merged: sage-4.7.alpha4

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

@rbeezer rbeezer mannequin added this to the sage-4.7 milestone Dec 13, 2010
@rbeezer rbeezer mannequin assigned jasongrout and williamstein Dec 13, 2010
@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Dec 14, 2010

comment:1

It seems ZZ and QQ and (maybe others) have never-ending iterators. So an attempt to iterate over modules like ZZ^2 or QQ^2 just keep making linear combinations like crazy, but never coming to any finite conclusion. Testing a fix now.

@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Jan 12, 2011

Attachment: trac_10470-listing-infinite-sets.patch.gz

@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Jan 12, 2011

Author: Rob Beezer

@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Jan 12, 2011

comment:4

This was discussed further on sage-devel:

http://groups.google.com/group/sage-devel/browse_thread/thread/3bb0f163b1fb1020

Patch just checks to see if a parent knows that is infinite, and if so, bails out with an explanation. Otherwise behavior should be the same. Passes the full test suite.

@jhpalmieri
Copy link
Member

Attachment: trac_10470-referee-doc.patch.gz

apply on top of other patch

@jhpalmieri
Copy link
Member

Reviewer: John Palmieri

@jhpalmieri

This comment has been minimized.

@jhpalmieri
Copy link
Member

comment:5

I'm happy with the main patch: it gets a positive review. I've added a little documentation about using X.list() vs. list(X). If it's not appropriate, let me know and we can just go with the main patch.

@rbeezer
Copy link
Mannequin Author

rbeezer mannequin commented Mar 23, 2011

comment:6

Additional documentation looks good.

@jdemeyer
Copy link
Contributor

jdemeyer commented Apr 5, 2011

Merged: sage-4.7.alpha4

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