Minimal Faithful Degree code not working.

asked 2022-04-21 22:51:24 +0100

Zander K gravatar image

updated 2022-04-28 01:16:08 +0100

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.

edit retag flag offensive close merge delete

Comments

I do not see the error about is_abelianin Sage 9.5, nor in https://sagecell.sagemath.org

Max Alekseyev gravatar imageMax Alekseyev ( 2022-04-22 04:20:54 +0100 )edit

I think i fixed that, I'll edit it. The biggest issue is that I'm getting that the Cayley Sum of the symmetric group of order 4 is zero. Which is clearly wrong.

Zander K gravatar imageZander K ( 2022-04-24 21:50:50 +0100 )edit

I do not know what is the expected result, but you can insert a few print statements here and there in your code to see and verify correctness of intermediate results.

Max Alekseyev gravatar imageMax Alekseyev ( 2022-04-25 16:03:12 +0100 )edit

The definition of mu looks suspicious, as alph is simply overwritten with each iteration of the loop.

rburing gravatar imagerburing ( 2022-04-26 15:46:12 +0100 )edit

wait why is it being overwritten?

Zander K gravatar imageZander K ( 2022-04-28 01:19:07 +0100 )edit