However when I turn the returned GAP representatives back into elements of 
the Sage group (called "weyl_group") sometimes (very rarely) I get

Traceback (most recent call last):                                         
                                                                            
                                 
  File "/home/vdbergh/TEX/ANYA/anya/scripts/p1xp1/compute_NCCR_orbit.py", 
line 353, in <module>
    test4("X8")
  File "/home/vdbergh/TEX/ANYA/anya/scripts/p1xp1/compute_NCCR_orbit.py", 
line 341, in test4
    compute_orbit(context, col)
  File "/home/vdbergh/TEX/ANYA/anya/scripts/p1xp1/compute_NCCR_orbit.py", 
line 41, in compute_orbit
    w = weyl_group(w) ** -1  # left coset
        ^^^^^^^^^^^^^
  File "sage/structure/parent.pyx", line 901, in 
sage.structure.parent.Parent.__call__
  File "sage/structure/coerce_maps.pyx", line 164, in 
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
  File "sage/structure/coerce_maps.pyx", line 159, in 
sage.structure.coerce_maps.DefaultConvertMap_unique._call_
  File "/home/vdbergh/sage/src/sage/groups/perm_gps/permgroup.py", line 
912, in _element_constructor_
    return self.element_class(x, self, check=check)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "sage/groups/perm_gps/permgroup_element.pyx", line 518, in 
sage.groups.perm_gps.permgroup_element.PermutationGroupElement.__init__
ValueError: invalid data to initialize a permutation

Anyone knows what could be the cause of this?

Best,
Michel



On Tuesday, February 3, 2026 at 7:22:01 PM UTC+1 Michel VAN DEN BERGH wrote:

> On Tuesday, February 3, 2026 at 7:00:36 PM UTC+1 wrote:
>
> I don't know about efficient, but in the species code I use 
> libgap.RightTransveral(group, subgroup):
>
>     def structures(self, *labels):
>         labels = _label_sets(self.parent()._arity, labels)
>         n = tuple([len(U) for U in labels])
>         S = _SymmetricGroup(sum(n)).young_subgroup(n)
>         l = [e for l in labels for e in l]
>         if self._mc == n:
>             for rep in libgap.RightTransversal(S, self._dis):
>                 yield tuple(S(rep)._act_on_list_on_position(l))
>
> Does this help?
>
> Martin
>
>
> Some quick experimenting seems to indicate that this is exactly what I 
> need!
>
> Thanks a lot!
>
> Michel
>
>
> On Tuesday, 3 February 2026 at 14:25:12 UTC+1 wrote:
>
> Hi,
>
> I have a permutation group (a Weyl group in fact) and a subgroup given by 
> explicit generators. I would like to iterate over representatives for the 
> cosets of this group. Is there an efficient way to do this in Sage?
>
> I asked ChatGPT and it gave me all kinds of plausible looking commands, 
> none of which actually existed...
>
> Thanks!
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/sage-support/3b625a29-09f2-4ac2-8505-b88287e23c08n%40googlegroups.com.

Reply via email to