Ask Your Question

Revision history [back]

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:

The function "is_AbelianGroup(G)" is not working at all, the other versions of it "G.is_abelian()" and "G.is_commutative()" are both giving the following error: AttributeError: 'sage.groups.perm_gps.permgroup_element.SymmetricGroupElement' object has no attribute 'is_abelian'.

Furthermore, when I run for Reflection Groups, I get: ValueError: the input data (2) is not valid for reflection groups.

The code is as below: sage.groups.abelian_gps.abelian_group.is_AbelianGroup(x) def getSocle(G):

Z=Center(G)
gens=Generators(Z)
genK=[]
while (IsEmpty(gens) is False):
    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=Subgroups(G)
F=[]
j=subs
while j >= 1:
    sub =subs[j].subgroup
    if Inter.issubset(sub) is False: 
        F.append(sub)
    j -= 1
return F

def mu(F):

alph=0
for i in range(1,F):
    alph= 1/Order(F[i])
return alph

def abelianFactors(G):

orders=[]
gens=Generators(G)
for i in gens:
    orders.append(Order(i))
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() is True: #(?)
    return alphaAbelian(G)
else: 
    F=getMinimalFaithfulCollection(G)
    return mu(F)

def SumAlpha(Glist):

s=0
for i in range(1, order(Glist)):
    a=Alpha(Glist[i])
    s+=a
    if i == 1:
        output=Sprintf("%o",a) 
    else:
        output=Sprintf("%o + %o", output, a)

output=Sprintf("%o =", output)
return output,s

SumAlpha(ReflectionGroup(2,2,3))

Any advice on what is going wrong is greatly appreciated. Thanks.

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:

The function "is_AbelianGroup(G)" is not working at all, the other versions of it "G.is_abelian()" and "G.is_commutative()" are both giving the following error: AttributeError: 'sage.groups.perm_gps.permgroup_element.SymmetricGroupElement' object has no attribute 'is_abelian'.

Furthermore, when I run for Reflection Groups, I get: ValueError: the input data (2) is not valid for reflection groups.

The code is as below: sage.groups.abelian_gps.abelian_group.is_AbelianGroup(x) below:

def getSocle(G):

Z=Center(G)
gens=Generators(Z)
genK=[]
while (IsEmpty(gens) is False):
    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=Subgroups(G)
F=[]
j=subs
while j >= 1:
    sub =subs[j].subgroup
    if Inter.issubset(sub) is False: 
        F.append(sub)
    j -= 1
return F

def mu(F):

alph=0
for i in range(1,F):
    alph= 1/Order(F[i])
return alph

def abelianFactors(G):

orders=[]
gens=Generators(G)
for i in gens:
    orders.append(Order(i))
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() is True: #(?)
    return alphaAbelian(G)
else: 
    F=getMinimalFaithfulCollection(G)
    return mu(F)

def SumAlpha(Glist):

s=0
for i in range(1, order(Glist)):
    a=Alpha(Glist[i])
    s+=a
    if i == 1:
        output=Sprintf("%o",a) 
    else:
        output=Sprintf("%o + %o", output, a)

output=Sprintf("%o =", output)
return output,s

SumAlpha(ReflectionGroup(2,2,3))

Any advice on what is going wrong is greatly appreciated. Thanks.

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:

The function "is_AbelianGroup(G)" is not working at all, the other versions of it "G.is_abelian()" and "G.is_commutative()" are both giving the following error: AttributeError: 'sage.groups.perm_gps.permgroup_element.SymmetricGroupElement' object has no attribute 'is_abelian'.

Furthermore, 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=Center(G)
gens=Generators(Z)
genK=[]
while (IsEmpty(gens) is False):
    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=Subgroups(G)
F=[]
j=subs
while j >= 1:
    sub =subs[j].subgroup
    if Inter.issubset(sub) is False: 
        F.append(sub)
    j -= 1
return F

def mu(F):

alph=0
for i in range(1,F):
    alph= 1/Order(F[i])
return alph

def abelianFactors(G):

orders=[]
gens=Generators(G)
for i in gens:
    orders.append(Order(i))
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() is True: #(?)
    return alphaAbelian(G)
else: 
    F=getMinimalFaithfulCollection(G)
    return mu(F)

def SumAlpha(Glist):

s=0
for i in range(1, order(Glist)):
    a=Alpha(Glist[i])
    s+=a
    if i == 1:
        output=Sprintf("%o",a) 
    else:
        output=Sprintf("%o + %o", output, a)

output=Sprintf("%o =", output)
return output,s

SumAlpha(ReflectionGroup(2,2,3))Alpha(ReflectionGroup(2,2,3))

Any advice on what is going wrong is greatly appreciated. Thanks.

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:

The function "is_AbelianGroup(G)" is not working at all, the other versions of it "G.is_abelian()" and "G.is_commutative()" are both giving the following error: AttributeError: 'sage.groups.perm_gps.permgroup_element.SymmetricGroupElement' object has no attribute 'is_abelian'.

Furthermore, 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=Center(G)
gens=Generators(Z)
Z=G.center()
gens=Z.gens()
genK=[]
while (IsEmpty(gens) is False):
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=Subgroups(G)
subs=G.subgroups()
F=[]
j=subs
while j >= 1:
    sub =subs[j].subgroup
    if Inter.issubset(sub) is False: 
        F.append(sub)
    j -= 1
return F

def mu(F):

mu(F):
    alph=0
 for i in range(1,F):
     alph= 1/Order(F[i])
return alph

def abelianFactors(G):

    return alph

def abelianFactors(G): orders=[] gens=Generators(G) for i in gens: orders.append(Order(i)) return orders

def aplhaAbelian(G):

    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):

syntax

def Alpha(G): if G.is_abelian() is True: G.is_abelian(): #(?) return alphaAbelian(G) else: F=getMinimalFaithfulCollection(G) return mu(F)

Alpha(ReflectionGroup(2,2,3)) F=getMinimalFaithfulDegree(G) return mu(F)

Alpha(SymmetricGroup(4))

Any advice on what is going wrong is greatly appreciated. Thanks.

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:

The function "is_AbelianGroup(G)" is not working at all, the other versions of it "G.is_abelian()" and "G.is_commutative()" are both giving the following error: AttributeError: 'sage.groups.perm_gps.permgroup_element.SymmetricGroupElement' object has no attribute 'is_abelian'.

Furthermore, 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=subs
while j >= 1:
    sub =subs[j].subgroup
    if Inter.issubset(sub) is False: 
        F.append(sub)
    j -= 1
return F

def mu(F): alph=0 for i in range(1,F): alph= 1/Order(F[i]) return alph

def abelianFactors(G): orders=[] gens=Generators(G) for i in gens: orders.append(Order(i)) 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))

Any advice on what is going wrong is greatly appreciated. Thanks.Thanks. (I get this for symmetric groups: TypeError: unsupported operand parent(s) for <=: 'Integer Ring' and '<class 'list'="">')

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:

The function "is_AbelianGroup(G)" is not working at all, the other versions of it "G.is_abelian()" and "G.is_commutative()" are both giving the following error: AttributeError: 'sage.groups.perm_gps.permgroup_element.SymmetricGroupElement' object has no attribute 'is_abelian'.

Furthermore, 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=subs
j=len(subs)

while j >= 1:
    sub =subs[j].subgroup
= subs[j-1]
    if Inter.issubset(sub) is False: 
Inter.is_subgroup(sub) is False:
        F.append(sub)
    j -= 1
return F

def mu(F): mu(F):

alph=0
 for i in range(1,F):
    range(1,len(F)):
    alph= 1/Order(F[i])
    return alph

def abelianFactors(G): 1/F[i].order() return alph

def abelianFactors(G):

orders=[]
    gens=Generators(G)
    gens=G.gens()
for i in gens:
        orders.append(Order(i))
    return orders

def aplhaAbelian(G): 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): syntax

def Alpha(G):

if G.is_abelian(): #(?)
     return alphaAbelian(G)
 else: 
     F=getMinimalFaithfulDegree(G)
        return mu(F)

Alpha(SymmetricGroup(4))

Any advice on what is going wrong is greatly appreciated. Thanks. (I get this for symmetric groups: TypeError: unsupported operand parent(s) for <=: 'Integer Ring' and '<class 'list'="">')return mu(F)

Alpha(SymmetricGroup(4)),

This gives 0, i don't know why.

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:

The function "is_AbelianGroup(G)" is_AbelianGroup(G) is not working at all, the other versions of it "G.is_abelian()" G.is_abelian() and "G.is_commutative()" G.is_commutative() are both giving the following error:

AttributeError: 'sage.groups.perm_gps.permgroup_element.SymmetricGroupElement' object has no attribute 'is_abelian'.

Furthermore, 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):

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):


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):


def mu(F):

    alph=0
 for i in range(1,len(F)):
     alph= 1/F[i].order()
 return alph

def abelianFactors(G):


def abelianFactors(G):

    orders=[]
 gens=G.gens()
 for i in gens:
     orders.append(i.order())
 return orders

def aplhaAbelian(G):


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):


def Alpha(G):

    if G.is_abelian(): #(?)
     return alphaAbelian(G)
 else: 
     F=getMinimalFaithfulDegree(G)
     return mu(F)

Alpha(SymmetricGroup(4))

Alpha(SymmetricGroup(4)),

This gives 0, i don't know why.

click to hide/show revision 8
retagged

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:

The function is_AbelianGroup(G) is not working at all, the other versions of it G.is_abelian() and G.is_commutative() are both giving the following error:

AttributeError: 'sage.groups.perm_gps.permgroup_element.SymmetricGroupElement' object has no attribute 'is_abelian'.

Furthermore, 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.

click to hide/show revision 9
retagged

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:

The function is_AbelianGroup(G) is not working at all, the other versions of it G.is_abelian() and G.is_commutative() are both giving the following error:

AttributeError: 'sage.groups.perm_gps.permgroup_element.SymmetricGroupElement' object has no attribute 'is_abelian'.

Furthermore, 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.

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:

The function is_AbelianGroup(G) is not working at all, the other versions of it G.is_abelian() and G.is_commutative() are both giving the following error:

AttributeError: 'sage.groups.perm_gps.permgroup_element.SymmetricGroupElement' object has no attribute 'is_abelian'.

Furthermore, when 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.

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= 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.