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.Mon, 10 Apr 2023 10:57:48 +0200Character table of a semidirect producthttps://ask.sagemath.org/question/67453/character-table-of-a-semidirect-product/ I am trying to find the character table of a semidirect product of two group with Sage. If I try the following I get an error.
K = SL(2,5)
H = CyclicPermutationGroup(2)
G = GroupSemidirectProduct(K,H)
N = G.character_table()
I guess that this is because semidirect product do not have a built-in method for computing character tables. Is there any other way of computing this?
Diego99Mon, 10 Apr 2023 10:57:48 +0200https://ask.sagemath.org/question/67453/Matrices as MatrixGroupElements - coercion errorhttps://ask.sagemath.org/question/66824/matrices-as-matrixgroupelements-coercion-error/How does one transform a matrix over GF(q^2) into an element of a matrix group? Specifically, how to get access to the base field of SU(3, q), which is GF(q^2)?
Consider the following script:
from sage.all import *
q = 3
f0 = GF(q)
f = GF(q**2, 'x')
x = f('x')
z = f0(0)
e = f0(1)
g = SU(3, q)
y = x**2
print(y==-y**q)
a = matrix([[e, z, y], [z, e, z], [z, z, e]])
print(g(a))
The output is
True
[ 1 0 x + 1]
[ 0 1 0]
[ 0 0 1]
followed by
TypeError: unable to coerce from a finite field other than the prime subfield
with a rather deep stacktrace.
My initial guess was that the problem is that I specialized 'x' as the generator for GF(q^2), but changing this to
f = GF(q**2)
x = f.gens()[0]
produces the same result.
How to get around this?Andrei SmolenskyTue, 07 Mar 2023 08:19:07 +0100https://ask.sagemath.org/question/66824/Finiteness of a group given by a presentationhttps://ask.sagemath.org/question/62832/finiteness-of-a-group-given-by-a-presentation/Let $G$ be a group generated by
"s1", "s2", "s3", "s4", "s12", "s23", "s34", "s123", "s234", "s1234"
with relations
[ s1^2, s2^2, s3^2, s4^2,
s12^2, s23^2, s34^2,
s123^2, s234^2,
s1234^2,
s1*s2*s1*s2*s1*s2, s2*s3*s2*s3*s2*s3, s3*s4*s3*s4*s3*s4,
s1*s3*s1*s3, s2*s4*s2*s4, s1*s4*s1*s4,
s1*s12*s2*s12,
s4*s34*s3*s34,
s3*s123*s23*s12*s3*s123*s23*s12,
s123*s12*s4*s34*s4*s12*s2,
s23*s1234*s12*s3*s4*s3*s12,
s23*s1234*s34*s1*s2*s1*s34 ]
# s1 s2 s3 s4
# o--------o--------o--------o
#
# non-standard joining relations
#
# s12 s23 s34
# o o o
#
# non-standard joining relations
#
# s123 s234
# o o
#
# non-standard joining relations
#
# s1234
# o
All the above equal to the identity $e$ of $G$.
Is there some function in SageMath which could check if $G$ is finite or not? Thank you very much.lijr07Tue, 14 Jun 2022 17:36:19 +0200https://ask.sagemath.org/question/62832/If statement to avoid running GAP structure_descriptionhttps://ask.sagemath.org/question/62818/if-statement-to-avoid-running-gap-structure_description/ I am using the operation structure_description to see if a finitely presented group can be recognized and labeled by Sage. Sometimes, this works fine, for example:
G1=H1/[H1(Rel[i]) for i in range(g+g*len(Y)+len(GG))];G1
Finitely presented group < x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17 | x4*x0^-1*x3, x2*x1*x0, x5^-1*x2^-1*x4^-1, x5*x3^-1*x1^-1, x10*x12^-1*x15, x8*x7*x12, x11^-1*x8^-1*x10^-1, x11*x15^-1*x7^-1, x16*x6^-1*x9, x14*x13*x6, x17^-1*x14^-1*x16^-1, x17*x9^-1*x13^-1, 1, x0, x0^2, x0, x6*x12, x1, x7*x13, x2, x8, x14, x3, x9*x15, x4, x10, x16, x5, x11, x17 >
G1.structure_description()
'C0'
However, in other cases it fails, for example:
G1=H1/[H1(Rel[i]) for i in range(g+g*len(Y)+len(GG))];G1
Finitely presented group < x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17 | x4*x6^-1*x9, x2*x1*x12, x17^-1*x8^-1*x4^-1, x5*x15^-1*x1^-1, x10*x12^-1*x15, x8*x13*x6, x5^-1*x2^-1*x10^-1, x11*x3^-1*x7^-1, x16*x0^-1*x3, x14*x7*x0, x11^-1*x14^-1*x16^-1, x17*x9^-1*x13^-1, 1, x0, x0*x12, x0*x12, x6, x1*x13*x7, x2, x8*x14, x3*x15*x9, x4*x10, x16, x5*x11*x17 >
G1.structure_description()
GAPError: Error, no method found! Error, no 4th choice method found for `StructureDescription' on 1 arguments
So the fact that this happens is very understandable - I understand it as being somehow related to the word problem. But I am running this script for many finite groups, and if this information is available, I want Sage to find it and print it - otherwise skip it. Right now, every time the script hits a case, it just fails and exits.
Is there some kind of if ...structure_description=TRUE I could wrap this line in, so that it only executes if it's going to actually work?thethinkerMon, 13 Jun 2022 16:26:01 +0200https://ask.sagemath.org/question/62818/Image of finitely generated group through an injective homomorphismhttps://ask.sagemath.org/question/62576/image-of-finitely-generated-group-through-an-injective-homomorphism/I'm doing some work with knot theory, and as a part of it, I'm taking an injection of a finitely generated group into the braid group. I want to do some computations on the image of the group, but I'm having trouble actually computing the image in Sage. This is what I have so far:
# Explicitly name generators; rho_i, sigma_i, tau_i
G.<p1, p2, p3, s1, s2, s3, t1, t2, t3, t4> = FreeGroup()
rho = [0, p1, p2, p3] # Zero padding so that rho[i] = rho_i
sigma = [0, s1, s2, s3]
tau = [0, t1, t2, t3, t4]
relations = []
# Lots of relations that aren't actually important for this
for i in range(1, 5):
for j in range(i, 5):
if i != j:
relations.append(tau[i]^-1 * tau[j]^-1 * tau[i] * tau[j])
if abs(i - j) > 1 and i < 4 and j < 4:
relations.append(rho[i]^-1 * rho[j]^-1 * rho[i] * rho[j])
relations.append(sigma[i]^-1 * sigma[j]^-1 * sigma[i] * sigma[j])
relations.append(rho[i]^-1 * sigma[j]^-1 * rho[i] * sigma[j])
# Now relations on neighboring rho_i, sigma_i, tau_i
for i in range(1, 3):
relations.append(rho[i] * rho[i+1] * rho[i] * rho[i+1]^-1 * rho[i]^-1 * rho[i]^-1)
relations.append(sigma[i] * sigma[i+1] * sigma[i] * sigma[i+1]^-1 * sigma[i]^-1 * sigma[i+1]^-1)
relations.append(rho[i] * sigma[i+1] * sigma[i] * rho[i+1]^-1 * sigma[i]^-1 * sigma[i+1]^-1)
relations.append(sigma[i] * sigma[i+1] * rho[i] * sigma[i+1]^-1 * sigma[i]^-1 * rho[i+1]^-1)
relations.append(sigma[i] * rho[i+1] * rho[i] * sigma[i+1]^-1 * rho[i]^-1 * rho[i+1]^-1)
for eta in [1, -1]:
for nu in [1, -1]:
relations.append(tau[i]^eta * sigma[i]^nu * tau[i+1]^(-eta) * sigma[i]^(-nu))
relations.append(tau[i+1]^eta * sigma[i]^nu * tau[i]^(-eta) * sigma[i]^(-nu))
relations.append(tau[i]^eta * rho[i] * tau[i+1]^(-eta) * rho[i]^-1)
relations.append(tau[i+1]^eta * rho[i] * tau[i]^(-eta) * sigma[i]^(-eta) * rho[i] * sigma[i]^eta)
relations.append(tau[i]^eta * rho[i]^-1 * tau[i+1]^(-eta) * sigma[i]^(-eta) * rho[i]^-1 * sigma[i]^eta)
relations.append(tau[i+1]^eta * rho[i]^-1 * tau[i]^(-eta) * rho[i])
# The group I want is F = G / relations
# Now inject into braid group
B = BraidGroup(8, 'b')
b = B.gens()
gen_images = []
for i in range(3):
j = 2 * i
gen_images.append(b[j]) # Image of tau_i
gen_images.append(b[j+1] * b[j+2] * b[j] * b[j+1]) # sigma_i
gen_images.append(b[j+1] * b[j+2]^-1 * b[j] * b[j+1]^-1) # rho_i
gen_images.append(b[6]) # Image of tau_4
f = G.hom(gen_images)
print(f)
for gen in G.gens():
print(f(gen))
The actual relations that I haven't aren't too important, the point is that I have the free group `G` generated by the three sets of generators, and I know what the image of each of those generators should be in the braid group. What I want to do is compute the subgroup of `B` of `f(G / relations)`, which I think is generated by the images of the original generators
b0, b1*b2*b0*b1, b1*b2^-1*b0*b1^-1, b2, b3*b4*b2*b3, b3*b4^-1*b2*b3^-1, b4, b5*b6*b4*b5, b5*b6^-1*b4*b5^-1, b6
then modded out by the image of each of the original relations, but I don't see a way to have a generator of a free group be, for example, `b1*b2*b0*b1`, e.g. something non-trivial. Is there a way of doing that, or some other way of computing the subgroup that I want?cgodfreySat, 21 May 2022 23:58:11 +0200https://ask.sagemath.org/question/62576/Minimal Faithful Degree code not working.https://ask.sagemath.org/question/62089/minimal-faithful-degree-code-not-working/I'm making code to find the minimal faithful degree of reflection groups. There are two things that are going wrong as of now:
When I run for Reflection Groups, I get:
> ValueError: the input data (2) is not valid for reflection groups.
The code is as below:
def getSocle(G):
Z=G.center()
gens=Z.gens()
genK=[]
while len(gens) == 0:
ExtractRep(~gens, ~gen)
ord=Order(gen)
p=Factorization(ord)[1][1]
n=Factorization(ord)[1][2]
gen2=gen^(p^(n-1))
genK.append(gen2) #gen2 is the element of order p in <gen>
K= G.subgroup([genK]) #(?)
return K
def getMinimalFaithfulDegree(G):
Inter=getSocle(G)
subs=G.subgroups()
F=[]
j=len(subs)
while j >= 1:
sub = subs[j-1]
if Inter.is_subgroup(sub) is False:
F.append(sub)
j -= 1
return F
def mu(F):
alph=0
for i in range(1,len(F)):
alph+= 1/F[i].order()
return alph
def abelianFactors(G):
orders=[]
gens=G.gens()
for i in gens:
orders.append(i.order())
return orders
def aplhaAbelian(G):
orders=abelianFactors(G)
return (sum(orders))/(prod(orders)) #sum of orders of cyclic groups/the product of orders, look into syntax
def Alpha(G):
if G.is_abelian(): #(?)
return alphaAbelian(G)
else:
F=getMinimalFaithfulDegree(G)
return mu(F)
Alpha(SymmetricGroup(4))
This gives 0, i don't know why.Zander KThu, 21 Apr 2022 22:51:24 +0200https://ask.sagemath.org/question/62089/How do I represent monomial reflection groups?https://ask.sagemath.org/question/61096/how-do-i-represent-monomial-reflection-groups/ Let m and n be positive integers, let $C_m$ be the cyclic group of order m and B = $C_m$ × . . . × $C_m$ be the direct product of n copies of $C_m$. For each divisor p of m define the group A(m, p, n) by
A(m, p, n) = {($θ_1$, $θ_2$, . . . , $θ_n$) ∈ B | ($θ_1$$θ_2$ . . . $θ_n$)$^{m/p}$ = 1}.
It follows that A(m, p, n) is a subgroup of index p in B and the sym- metric group Sym(n) acts naturally on A(m, p, n) by permuting the coordinates. G(m, p, n) is defined to be the semidirect product of A(m, p, n) by Sym(n). It follows that G(m, p, n) is a normal subgroup of index p in the wreath product Cm ≀ Sym(n) and thus has order $m^nn!/p$.
It is well known that these groups can be realized as finite subgroups of $GL_n(C)$, specifically as n × n matrices with exactly one non-zero entry, which is a complex m-th root of unity, in each row and column such that the product of the entries is a complex (m/p)th root of unity. Thus the groups G(m, p, n) are sometimes referred to as monomial reflection groups.Zander KMon, 14 Feb 2022 22:56:08 +0100https://ask.sagemath.org/question/61096/Creating all homomorphisms into a finite grouphttps://ask.sagemath.org/question/56462/creating-all-homomorphisms-into-a-finite-group/Let $G=< g_1,\ldots ,g_n| r_1,\ldots r_k>$ be a finite presentation of a group and let $S$ be a finite group, let's say for concreteness the symmetric group on 4 elements.
We want to create all homomorphisms $G\rightarrow S$.
One could just do the brute force search by looking at all maps from the set of generators $g_1,\ldots, g_n$ to $S$ and check which ones are homomorphisms.
Is this (or a more clever way of doing this) already implemented?GrouphomomorphismsFri, 02 Apr 2021 13:57:46 +0200https://ask.sagemath.org/question/56462/Obtaining a poset associated to a finite grouphttps://ask.sagemath.org/question/53428/obtaining-a-poset-associated-to-a-finite-group/ Let $G$ be a finite group and use Cayley's theorem to embed $G$ into the symmetric group $S_n$.
Is it possible via Sage to get the subposet of the strong Bruhat order (or the weak Bruhat order) on $S_n$ that has the points of $G$ inside $S_n$ with the induced poset structure?
klaaaSat, 12 Sep 2020 22:41:43 +0200https://ask.sagemath.org/question/53428/What is the most useful basefield for finite matrix groups?https://ask.sagemath.org/question/51559/what-is-the-most-useful-basefield-for-finite-matrix-groups/Hi everyone,
I am trying to write a notebook that does some elementary computations in a finite matrix group like conjugacy classes and character tables. It is meant to be used in cases where the group is realized explicitly as some subgroup of GL(3,R) or GL(2,R). My problem now is that if I want to implement rotations like
rotations=[]
for t in [1/3,2/3]:
rotations.append(matrix([[cos(2*pi*t),-sin(2*pi*t)],[sin(2*pi*t),cos(2*pi*t)]]))
the base ring will be the symbolic ring SR because there is a sqrt(2) in some denominators. If I then try to compute the characters via
gens=rotations
G2=MatrixGroup(gens)
G2.character_table()
I will get an error message. My assumption is that because of the base ring SR, Sage doesn't realize that this is in fact a finite group. What would a suitable base field be to make this computation possible?
Thanks in advance.Robin_FTue, 26 May 2020 17:23:17 +0200https://ask.sagemath.org/question/51559/Is there a command in SAGE which is equivalent to GAP's "ShallowCopy" ?https://ask.sagemath.org/question/48819/is-there-a-command-in-sage-which-is-equivalent-to-gaps-shallowcopy/Dear SAGE forum,
I'd like to ask the following question:
>> Is there an equivalent in SAGE of GAP's "shallowcopy" ?
I'd like to associate to two times the same group two different character tables.
In GAP it is possible to do it as follows:
G:=AlternatingGroup(5);
H:=ShallowCopy(G);
ct_G:=CharacterTable(G);
and to then construct a different character table for H.
When I try to do this in SAGE, I always get the error message that G (!) already has a character table, although I wanted to assign a different (as far as the ordering of the rows and columns are concerned) character table to H (!)
EDIT (20.11.2019):
Here is part of my sage code:
HHHH=gap.Image(iso)
GGGG=gap.ShallowCopy(gap.Image(iso))
# Hier Einschub: CTBL wie in CTBLLib (falls vorhanden) wird nun gemacht:
gap.LoadPackage('"ctbllib"')
def CTBL_Breuer_fert(X):
StrDescr = gap.StructureDescription(X)
if gap.IsString(gap.StructureDescription(X)):
StrDescr = gap.StructureDescription(X)
CTBL_Breuer = gap.CharacterTable(StrDescr)
CTBL_Breuer_fertig = gap.CharacterTableWithStoredGroup(X,CTBL_Breuer)
else:
CTBL_Breuer_fertig = gap.CharacterTable(X)
return(CTBL_Breuer_fertig)
CTBL_Breuer_fertig = CTBL_Breuer_fert(HHHH)
# Hier Ende des Einschubs
ccl = [gap.ConjugacyClass(GGGG,x) for x in MAGMA_ccls_GG_for_GAP]
gap.SetConjugacyClasses(GGGG,ccl)
gap.SetUnderlyingGroup(tbl,GGGG)
gap.SetConjugacyClasses(tbl,ccl)
bij=[1..len(ccl)]
MyRecordFile = open("GAP_Record.txt",'w')
print >> MyRecordFile, "bij:=",
print >> MyRecordFile, bij,
print >> MyRecordFile, ";"
print >> MyRecordFile, "myrecfunct:=function()"
print >> MyRecordFile, "local RECOR;"
print >> MyRecordFile, "RECOR:=rec(bijection:=bij);"
print >> MyRecordFile, "return RECOR;"
print >> MyRecordFile, "end;"
MyRecordFile.close()
gap.Read('"GAP_Record.txt"')
recor=gap.myrecfunct()
gap.CompatibleConjugacyClasses(GGGG,ccl,tbl,recor)
CTBL=gap.CharacterTableWithStoredGroup(GGGG,tbl,recor)
After this last line (with CTBL=...) the error occurs. When I delete the lines between "# Hier Einschub..." and "# Hier Ende des Einschubs ", then the code works.
I would be grateful for any help.
Thanks in advance.BernWed, 20 Nov 2019 17:19:52 +0100https://ask.sagemath.org/question/48819/Finitely presented group simplificationhttps://ask.sagemath.org/question/47636/finitely-presented-group-simplification/Hi! I have a bunch of finitely presented groups, with many generators and relations. I know that all of these are in fact cyclic groups, but many times using the "simplified()" function, I get a simpler presentation with 2 generators, rather than only one. The following is one example:
G.<x0,x5> = FreeGroup()
H =G/[(x5^-1*x0)^2*x5^-3, (x0^-1*x5^-1)^2*x0^-2*x5*x0^-1]
H is in fact just Z/27Z. Is there another way to simplify these presentations, in order to get a minimal one?
The problem here is that I do not only need to identify the specific group, but also to recover the image of the previous generators in the simplified one (as done by the simplification_isomorphism() function).danieleCWed, 28 Aug 2019 12:25:45 +0200https://ask.sagemath.org/question/47636/How would I be able to check if a given number is a solinas prime?https://ask.sagemath.org/question/46327/how-would-i-be-able-to-check-if-a-given-number-is-a-solinas-prime/Using sage, how would I be able to check whether a given number is a general mersenne prime, or if possible any other special primes?
In particular, looking to check for special primes `p` such that modulo `p` is easy to calculatejonathansmithWed, 24 Apr 2019 08:36:50 +0200https://ask.sagemath.org/question/46327/power graph of a grouphttps://ask.sagemath.org/question/41597/power-graph-of-a-group/ The power graph of a group is the graph whose vertex set is the group, two elements being adjacent if one is a power of the other.
I am wondering the notion of power graph of a group has been implemented in sage?
Kindly share your views.
Thank you.GA316Sat, 17 Mar 2018 11:34:35 +0100https://ask.sagemath.org/question/41597/How to iterate through finite groupshttps://ask.sagemath.org/question/36326/how-to-iterate-through-finite-groups/ How can I have a collection of all finite groups with order less than a given number?
I have tried
G = gap.AllSmallGroups(64)
However it does not work for other arguments. It instead spits out this [1] error for example for 63 rather than 64.
I can tell that this may be a problem with the gap library in sage so I am wondering if there is any other way to do this in sage? I just want to be able to iterate through finite groups less than a given order.
[1]
Error in lines 3-4
Traceback (most recent call last):
File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 976, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 2, in <module>
File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/sage/interfaces/interface.py", line 608, in __call__
return self._parent.function_call(self._name, list(args), kwds)
File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/sage/interfaces/gap.py", line 921, in function_call
res = self.eval(marker+cmd)
File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/sage/interfaces/gap.py", line 575, in eval
result = Expect.eval(self, input_line, **kwds)
File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/sage/interfaces/expect.py", line 1294, in eval
for L in code.split('\n') if L != ''])
File "/projects/sage/sage-7.3/local/lib/python2.7/site-packages/sage/interfaces/gap.py", line 771, in _eval_line
raise RuntimeError(message)
RuntimeError: Gap produced error output
Error, no method found! For debugging hints type ?Recovery from NoMethodFound
Error, no 2nd choice method found for `RankPGroup' on 1 arguments
executing __SAGE_LAST__:="__SAGE_LAST__";;Rank(\$sage1);;alizterTue, 17 Jan 2017 14:04:35 +0100https://ask.sagemath.org/question/36326/Calculate Right Cosetshttps://ask.sagemath.org/question/8024/calculate-right-cosets/How do I get sage to list the right cosets for the group G = GL2(F3) and the subgroup H consisting of the upper triangular matrices with 1 on the main diagonal?Xiola168Fri, 25 Mar 2011 17:58:22 +0100https://ask.sagemath.org/question/8024/