ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 09 Jul 2020 22:34:03 +0200Memory problem: splitting large conjugacy class into partshttps://ask.sagemath.org/question/52398/memory-problem-splitting-large-conjugacy-class-into-parts/I'm trying to do a calculation on certain conjugacy classes in a large (Weyl) group, let's say:
W = WeylGroup(["E",8])
w = W.an_element()
for v in W.conjugacy_class(w):
if v.length() < 12:
if v.reduced_word()[0] == 1:
print v.reduced_word()
A typical conjugacy class of such W has a size in the millions. When I run this on my computer, then after about 100000 iterations it stops and prints
Error, reached the pre-set memory limit
(change it with the -o command line option)
(I'm not sure where to enter this -o command, but it wouldn't suffice anyway.)
I don't know exactly how these conjugacy classes are implemented (via GAP I think), but I was hoping that I could simply resume the calculation by using islice or e.g.
for v in W.conjugacy_class(w)[100000:200000]:
if v.length() < 12:
if v.reduced_word()[0] == 1:
print v.reduced_word()
However this doesn't seem to work - I'm guessing that it's first trying to create the entire list W.conjugacy_class(w)[100000:200000] (after crunching through the first 100000), in a less efficient way than before, taking up more memory than before.
Is there a way around this? Perhaps this can somehow be set up as a queue (in GAP!?) so that it takes up little memory?bksadieThu, 09 Jul 2020 22:34:03 +0200https://ask.sagemath.org/question/52398/symmetric group: get back conjugacy class from its generatorshttps://ask.sagemath.org/question/49641/symmetric-group-get-back-conjugacy-class-from-its-generators/The function below returns a list `r` of elements of the symmetric group that leave a certain polynomial `f` fixed.
I know (by the properties of `f` that I'm not specifiying here) that the list of `g`'s that leave it fixed generate one of the 11 conjugacy subclasses of S(4).
What is the best way to output from my code below a number between 1 and 11 that corresponds to such subclass?
R = PolynomialRing(QQ, 4, ["q1","q2","q3","q4"])
q1,q2,q3,q4 = R.gens()
f = 1 + q1 +q2 # in general, it is a polynomial with unit coefficients in the ring R
G = SymmetricGroup(4)
cl = G.conjugacy_classes_subgroups()
r = []
for g in G:
if (f * g) == f: r.append(g)
return rrue82Wed, 22 Jan 2020 11:16:56 +0100https://ask.sagemath.org/question/49641/Determining if two subgroups of a symmetric group are conjugatehttps://ask.sagemath.org/question/44357/determining-if-two-subgroups-of-a-symmetric-group-are-conjugate/If I have two particular subgroups of a symmetric group, is there any built-in way in Sage to determine if the groups are conjugate to one another? I tried creating a `ConjugacyClass` for each and then comparing them, but this gives an error:
S = SymmetricGroup(3)
gen1 = Permutation('(1,2,3)')
gen2 = Permutation('(1,3,2)')
gen3 = Permutation('(1,2)')
gen4 = Permutation('(1,3)')
G1 = PermutationGroup([gen1, gen3])
G2 = PermutationGroup([gen2, gen4])
ConjugacyClass(S, G1) == ConjugacyClass(S, G2)
When executing the very last line I get the error
TypeError: For implementing multiplication, provide the method '_mul_' for (1,2) resp. Permutation Group with generators [(1,2), (1,2,3)]
cjohnsonTue, 20 Nov 2018 20:06:56 +0100https://ask.sagemath.org/question/44357/Matrix conjugacy classes over Z and ideal classeshttps://ask.sagemath.org/question/8244/matrix-conjugacy-classes-over-z-and-ideal-classes/I had a couple questions; the first involves matrix conjugacy classes over the integers and the second involves integral bases. I'm not sure what the algorithms in Sage are for the following procedures.
1) Is it possible to determine if two integer-valued square matrices (which are conjugate over Q) are also conjugate over Z?
2) In a number field K, given an ideal class I, we can find an integral basis for a representative ideal in I by the command:
sage: I.integral_basis()
Is it possible to work in the reverse direction, that is given a set of elements in K which form an integral basis, is it possible to find the corresponding ideal and ideal class for that integral basis?
Thanks in advance for any advice.CCThu, 28 Jul 2011 21:14:45 +0200https://ask.sagemath.org/question/8244/Iterator for conjugacy classes of Snhttps://ask.sagemath.org/question/7794/iterator-for-conjugacy-classes-of-sn/Hello,
I would like to iterate through elements of a conjugacy classes of the symmetric group Sn. In other words, I'm looking for an algorithm which given an integer partition p = [p1,...,pk] of n provides an iterator over permutations with cycle decomposition whose length of cycles is exactly given by p.
There is one way which uses GAP, but as I have to iterate through conjugacy classes of S(12) and it is infinitely slow inside Sage. On the other hand, there is a useful efficient way to iterate through all permutations of Sn : there exists a "Gray code" for which two consecutive permutations differ by a swap (ie exchange of images between two elements). Such a method is implemented in cython in sage.combinat.permutation_cython (thanks Tom Boothby!).
- Do there exist algorithms for iteration through conjugacy classes of the symmetric group which is as close as possible as a Gray code ?
- Does there exist a better algorithm if we consider partitions of given length (the number k above) ? In other words, not iterating through conjugacy classes but through permutations with fixed number of cycles in their cycle decomposition.
- Is there something yet implemented in softwares included in Sage ?
Thanks,
VincentvdelecroixTue, 07 Dec 2010 16:48:05 +0100https://ask.sagemath.org/question/7794/Elementary abelian p-subgroups of a finite grouphttps://ask.sagemath.org/question/10515/elementary-abelian-p-subgroups-of-a-finite-group/Let G be a finite group. An elementary abelian p-subgroup of G is an abelian subgroup E whose exponent is p. The order of such a group is p^r from some r, called the rank of E. The lattice of all elementary abelian p-subgroups in G is called the Quillen Complex of the group G. I'm interested in using Sage to obtain some information about the Quillen Complex such as:
1. For a fixed r, how many conjugacy classes of elementary abelian p-subgroups of rank r are in G?
2. How many such subgroups are in each conjugacy class?
3. What is a set of minimal generators of a subgroup representing each conjugacy class?
In short, Magma has a command called ElementaryAbelianSubgroups which does exactly what I want, but I'd like to figure out how to do this with Sage. I'm very new to Sage, so I would appreciate as much detail in your answer as possible.
Perhaps someone has already dealt with this question, and I can benefit from their work, or perhaps there are similar commands that I can combine to answer my question.JaredThu, 05 Sep 2013 21:17:55 +0200https://ask.sagemath.org/question/10515/