Add a constructive membership test for double cosets#5532
Add a constructive membership test for double cosets#5532simonbrandhorst merged 7 commits intooscar-system:masterfrom
Conversation
- introduce a new type field `right_coset_reps`, which gets computed on demand, using the same ideas as `GAP.Globals.RepresentativesContainedRightCosets` but additionally storing the transforming elements - introduce `decompose` for writing a given element in `U*g*V` in the form `u*g*v`, with `u` in `U` and `v` in `V` - use the new data also in the nonconstructive membership test with `in` - extend the tests accordingly (The code still uses `GAP.Globals.CanonicalRightCosetElement`, which calls different methods for various kinds of group elements.)
|
Do we already have a function like your new |
For right cosets, it is much simpler: If I have an element |
There was a problem hiding this comment.
Thanks a lot. It looks good from my side.
An alternative name to decompose would be something like
is_element_with_data or is_in_with_data, constructive_membership_test. But that would set a general pattern.
So until we have settled once and for good on a name, I would suggest to call the function _decompose for the moment? Then we do not commit on a name yet (decompose is exported) and I can start using it for my purposes.
| if !isassigned(C.right_coset_reps) | ||
| C.right_coset_reps[] = _right_coset_reps(C) | ||
| end |
There was a problem hiding this comment.
I am not sure if Julia can correctly deduce that it has to fetch the value in C.right_coset_reps[] only once afterwards and then not again(in lines 922, 923).
All in all, I'd suggest to use a pattern like this:
| if !isassigned(C.right_coset_reps) | |
| C.right_coset_reps[] = _right_coset_reps(C) | |
| end | |
| rcr = _right_coset_reps(C) |
and then rename the current _right_coset_reps to, say, compute_right_coset_reps; and the new _right_coset_reps basically does
function _right_coset_reps(C)
if !isassigned(C.right_coset_reps)
C.right_coset_reps[] = _right_coset_reps(C)
end
return C.right_coset_reps[]
end
Co-authored-by: Max Horn <max@quendi.de>
right_coset_repsfor double cosets, which gets computed on demand, using the same ideas asGAP.Globals.RepresentativesContainedRightCosetsbut additionally storing the transforming elementsdecomposefor writing a given element inU*g*Vin the formu*g*v, withuinUandvinVin(The code still uses
GAP.Globals.CanonicalRightCosetElement, which calls different methods for various kinds of group elements.)