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

Group cosets: implement custom in, improve iterator #4289

Open
fingolfin opened this issue Nov 7, 2024 · 0 comments
Open

Group cosets: implement custom in, improve iterator #4289

fingolfin opened this issue Nov 7, 2024 · 0 comments
Labels
enhancement New feature or request topic: groups

Comments

@fingolfin
Copy link
Member

Right now in for group cosets resorts to iterating over the coset, which is very inefficient.

We should provide a custom method for this. I would not dispatch to GAP's, but instead implement this "directly": i.e. to test g in Hx, test if g/x in H and similar for g in xH (so that we avoid creating GapObj for those).


Speaking of iterators, the iterate implementation for GroupCoset currently directly wraps a GAP coset iterator. But (a) this requires creating a GapObj (with extra overhead for left cosets). And furthermore on the GAP side, the iterator is a wrapper for an enumerator.

Instead, the Julia iterator for a coset C could be based on the group iterator for C.H.


Lastly, contrast

Base.IteratorSize(::Type{<:GAPGroup}) = Base.SizeUnknown()
Base.IteratorSize(::Type{PermGroup}) = Base.HasLength()

versus

Base.IteratorSize(::Type{<:GroupCoset}) = Base.SizeUnknown()

I suggest we use something like this:

Base.IteratorSize(::Type{<:GroupCoset{T}}) where T = Base.IteratorSize(T)

And then I assume similar for GroupDoubleCoset.

@fingolfin fingolfin added enhancement New feature or request topic: groups labels Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request topic: groups
Projects
None yet
Development

No branches or pull requests

1 participant