-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
make iter(ZZ^n) useful #33287
Comments
comment:2
I think this should be fixed on the level of categories:
|
comment:3
|
comment:5
I agree that it would be good to have such an implementation at the category level. Although we did have a reason for not doing something like this IIRC. I forget if it was backward compatibility, breaking doctests, slowdowns, or something else. For this ticket, can you also add a doctest that shows it works over other enumerated rings, such as |
comment:6
Replying to @tscrim:
Well... It doesn't:
Indeed, It looks like |
comment:7
You get the same category result for changing the base ring to
which IMO is a bug. (You also get a However, there should still be other infinite enumerated rings that are not so nice. Interestingly
but it iterates just fine. IMO also a bug. I also cannot iterate the braid groups, which I should be able to since they are finitely generated as a monoid. Group algebras over enumerated monoids should also work for this, but they don't as they fail through a strange (IMO) code path:
Nothing in this code seems to be specific to Perhaps for now we can just change the documentation to say this works for any infinite enumerated (commutative) ring? |
comment:9
Replying to @tscrim:
Done. |
comment:10
Thank you. I agree that a category level solution would be better, but that might involve some subtleties with speed, mixing finite sets, and things (unfortunately) assuming a particular order on the objects. |
Reviewer: Travis Scrimshaw |
comment:11
Thank you for reviewing! |
Changed branch from public/iter_ZZ_n to |
Changed commit from |
Changed author from Lorenz Panny to Lorenz Panny, Aleksei Udovenko |
At the moment, iterating over
ZZ^n
only ever produces vectors inℤ × {0}^(n-1)
:This patch makes Sage iterate over
ZZ^n
in a more natural order: Sorted primarily by1
‑norm, secondarily by∞
‑norm.There are two motivations to prefer this behavior in particular:
iter(ZZ^n)
now actually enumerates all ofℤ^n
rather than just a subset.CC: @tscrim
Component: categories
Author: Lorenz Panny, Aleksei Udovenko
Branch:
a001b6d
Reviewer: Travis Scrimshaw
Issue created by migration from https://trac.sagemath.org/ticket/33287
The text was updated successfully, but these errors were encountered: