Skip to content

Conversation

DaveWitteMorris
Copy link
Member

Fixes #40412.

If it is possible to iterate over a vector space and the corresponding general linear group, then it should also be possible to iterate over the associated affine group. So we add an __iter__ method to the AffineGroup class (and also a __len__ method).

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.

⌛ Dependencies

@DaveWitteMorris
Copy link
Member Author

Actually, this does not fix #40412. After this PR, list(AffineGroup(2, 2)) will work, but AffineGroup(2, 2).list() still won't work. Should a list method also be added to the AffineGroup class? I don't think it's needed, but I could be wrong.

@mantepse
Copy link
Contributor

Possibly, it should belong to the category EnumeratedSets - also in the infinite case?

@DaveWitteMorris
Copy link
Member Author

That's a good question, but I think the answer is clearly no as long as general linear groups are not in the category.

sage: AffineGroup(3,2)._GL in EnumeratedSets()
False

So I don't think that implementing yes belongs on this ticket.

@DaveWitteMorris
Copy link
Member Author

Thanks for the review!

vbraun pushed a commit to vbraun/sage that referenced this pull request Jul 26, 2025
sagemathgh-40456: __iter__ method for the AffineGroup class
    
Fixes sagemath#40412.

If it is possible to iterate over a vector space and the corresponding
general linear group, then it should also be possible to iterate over
the associated affine group.  So we add an `__iter__` method to the
`AffineGroup` class (and also a `__len__` method).

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#40456
Reported by: DaveWitteMorris
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this pull request Jul 26, 2025
sagemathgh-40456: __iter__ method for the AffineGroup class
    
Fixes sagemath#40412.

If it is possible to iterate over a vector space and the corresponding
general linear group, then it should also be possible to iterate over
the associated affine group.  So we add an `__iter__` method to the
`AffineGroup` class (and also a `__len__` method).

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#40456
Reported by: DaveWitteMorris
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this pull request Jul 27, 2025
sagemathgh-40456: __iter__ method for the AffineGroup class
    
Fixes sagemath#40412.

If it is possible to iterate over a vector space and the corresponding
general linear group, then it should also be possible to iterate over
the associated affine group.  So we add an `__iter__` method to the
`AffineGroup` class (and also a `__len__` method).

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#40456
Reported by: DaveWitteMorris
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this pull request Jul 28, 2025
sagemathgh-40456: __iter__ method for the AffineGroup class
    
Fixes sagemath#40412.

If it is possible to iterate over a vector space and the corresponding
general linear group, then it should also be possible to iterate over
the associated affine group.  So we add an `__iter__` method to the
`AffineGroup` class (and also a `__len__` method).

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#40456
Reported by: DaveWitteMorris
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this pull request Jul 29, 2025
sagemathgh-40456: __iter__ method for the AffineGroup class
    
Fixes sagemath#40412.

If it is possible to iterate over a vector space and the corresponding
general linear group, then it should also be possible to iterate over
the associated affine group.  So we add an `__iter__` method to the
`AffineGroup` class (and also a `__len__` method).

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#40456
Reported by: DaveWitteMorris
Reviewer(s):
@vbraun vbraun merged commit d5ec898 into sagemath:develop Aug 2, 2025
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AffineGroup(2, 2).list() doesn't work
3 participants