1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-23 08:15:29 +01:00

characters of symmetric group are now implemented in Nemo

This commit is contained in:
kalmar 2017-07-17 12:26:10 +02:00
parent d7b7759e5d
commit 4e48917a38

View File

@ -1,84 +1,3 @@
###############################################################################
#
# Characters of PermutationGroup
#
###############################################################################
function chars(G::PermutationGroup)
permtype_unsorted(σ::Nemo.perm) = [length(c) for c in cycles(σ)]
permtype(σ::Nemo.perm) = sort(permtype_unsorted(σ), rev=true)
χ_id(σ::Nemo.perm) = 1
χ_sgn(σ::Nemo.perm) = sign(σ)
function χ_reg(σ::Nemo.perm)
fixed_points = countnz([(x == y? 1 : 0) for (x,y) in enumerate(σ.d)])
return fixed_points - 1
end
χ_regsgn(σ::Nemo.perm) = sign(σ)*χ_reg(σ)
if G.n == 1
return [χ_id]
elseif G.n == 2
return [χ_id, χ_sgn]
elseif G.n == 3
return [χ_id, χ_sgn, χ_reg]
elseif G.n == 4
function χ_regviaS3(σ::Nemo.perm)
vals = Dict{Vector{Int}, Int}(
[1,1,1,1] => 2,
[2,1,1] => 0,
[2,2] => 2,
[3,1] =>-1,
[4] => 0
)
return vals[permtype(σ)]
end
return [χ_id, χ_sgn, χ_regviaS3, χ_reg, χ_regsgn]
elseif G.n == 5
function ϱ(σ::Nemo.perm)
vals = Dict{Vector{Int}, Int}(
[1,1,1,1,1] => 5,
[2,1,1,1] => 1,
[2,2,1] => 1,
[3,1,1] =>-1,
[3,2] => 1,
[4,1] =>-1,
[5] => 0
)
return vals[permtype(σ)]
end
ϱ_sgn(σ::Nemo.perm) = sign(σ)*ϱ(σ)
function ψ(σ::Nemo.perm)
vals = Dict{Vector{Int}, Int}(
[1,1,1,1,1] => 6,
[2,1,1,1] => 0,
[2,2,1] => -2,
[3,1,1] => 0,
[3,2] => 0,
[4,1] => 0,
[5] => 1
)
return vals[permtype(σ)]
end
return [χ_id, χ_sgn, χ_reg, χ_regsgn, ϱ, ϱ_sgn, ψ]
else
throw("Characters for $G unknown!")
end
end
###############################################################################
#
# Character of DirectProducts