On Wednesday, February 4, 2026 at 5:40:55 PM UTC+1 wrote:
could you send me code that produces the failure, so I can debug it?
That would be great!
The code is rather complex but I'll try to make a minimal example.
Best,
Michel
Martin
On Wednesday, 4 February 2026 at 14:44:24 UTC+1 wrote:
Some more details:
- The problem is deterministic. So it is not a problem with my computer.
- I am trying to print the offending element. Unfortunately whatever I do I
always get "ValueError: invalid data to initialize a permutation".
Converting the element to a string (via str, or repr) does not give an
error but it does not give the full element (the string contains .... ).
Not sure what to do.
Best,
Michel
On Wednesday, February 4, 2026 at 1:01:39 PM UTC+1 Michel VAN DEN BERGH
wrote:
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/c70bd802-90c6-444b-aa10-ab5b845bee1en%40googlegroups.com.