Minimal Faithful Degree code not working.

asked 3 years ago

Zander K gravatar image

updated 3 years ago

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.

Preview: (hide)

Comments

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

Max Alekseyev gravatar imageMax Alekseyev ( 3 years ago )

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 ( 3 years ago )

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 ( 3 years ago )

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

rburing gravatar imagerburing ( 3 years ago )

wait why is it being overwritten?

Zander K gravatar imageZander K ( 3 years ago )