PropertyT.jl/src/sqadjop.jl

91 lines
2.5 KiB
Julia
Raw Normal View History

2022-11-07 16:09:02 +01:00
# move to Groups
Base.keys(a::Alphabet) = keys(1:length(a))
2019-06-30 13:19:24 +02:00
2022-11-07 16:09:02 +01:00
## the old 1812.03456 definitions
2019-06-30 13:19:24 +02:00
function isopposite(
σ::PG.AbstractPermutation,
τ::PG.AbstractPermutation,
i = 1,
j = 2,
)
return i^σ i^τ && i^σ j^τ && j^σ i^τ && j^σ j^τ
end
2019-06-30 13:19:24 +02:00
function isadjacent(
σ::PG.AbstractPermutation,
τ::PG.AbstractPermutation,
i = 1,
j = 2,
)
return (i^σ == i^τ && j^σ j^τ) || # first equal, second differ
(j^σ == j^τ && i^σ i^τ) || # second equal, first differ
(i^σ == j^τ && j^σ i^τ) || # first σ equal to second τ
(j^σ == i^τ && i^σ j^τ) # second σ equal to first τ
end
2019-06-30 13:19:24 +02:00
2022-11-07 16:09:02 +01:00
function _ncycle(start, length, n=start + length - 1)
p = Vector{UInt8}(1:n)
2022-11-07 16:09:02 +01:00
@assert n start + length - 1
for k in start:start+length-2
p[k] = k + 1
2019-06-30 13:19:24 +02:00
end
2022-11-07 16:09:02 +01:00
p[start+length-1] = start
return PG.Perm(p)
2019-06-30 13:19:24 +02:00
end
alternating_group(n::Integer) = PG.PermGroup([_ncycle(i, 3) for i in 1:n-2])
2019-06-30 13:19:24 +02:00
2022-11-07 16:09:02 +01:00
function small_gens(G::MatrixGroups.SpecialLinearGroup)
A = alphabet(G)
S = map([(1, 2), (2, 1)]) do (i, j)
k = findfirst(l -> (l.i == i && l.j == j), A)
@assert !isnothing(k)
G(Groups.word_type(G)([k]))
2019-06-30 13:19:24 +02:00
end
2022-11-07 16:09:02 +01:00
return union!(S, inv.(S))
2019-06-30 13:19:24 +02:00
end
2022-11-07 16:09:02 +01:00
function small_gens(G::Groups.AutomorphismGroup{<:FreeGroup})
A = alphabet(G)
S = map([(:ϱ, 1, 2), (:ϱ, 2, 1), (, 1, 2), (, 2, 1)]) do (id, i, j)
k = findfirst(l -> (l.id == id && l.i == i && l.j == j), A)
@assert !isnothing(k)
G(Groups.word_type(G)([k]))
2019-06-30 13:19:24 +02:00
end
2022-11-07 16:09:02 +01:00
return union!(S, inv.(S))
2019-06-30 13:19:24 +02:00
end
function small_laplacian(RG::SA.StarAlgebra)
G = SA.object(RG)
2022-11-07 16:09:02 +01:00
S₂ = small_gens(G)
return length(S₂) * one(RG) - sum(RG(s) for s in S₂)
2019-06-30 13:19:24 +02:00
end
function SqAdjOp(A::SA.StarAlgebra, n::Integer, Δ₂ = small_laplacian(A))
2022-11-07 16:09:02 +01:00
@assert parent(Δ₂) === A
alt_n = alternating_group(n)
G = SA.object(A)
2022-11-07 16:09:02 +01:00
act = action_by_conjugation(G, alt_n)
2019-06-30 13:19:24 +02:00
Δ₂s = Dict(σ => SW.action(act, σ, Δ₂) for σ in alt_n)
2019-06-30 13:19:24 +02:00
2022-11-07 16:09:02 +01:00
sq, adj, op = zero(A), zero(A), zero(A)
tmp = zero(A)
2019-06-30 13:19:24 +02:00
2022-11-07 16:09:02 +01:00
for σ in alt_n
SA.add!(sq, sq, SA.mul!(tmp, Δ₂s[σ], Δ₂s[σ]))
2022-11-07 16:09:02 +01:00
for τ in alt_n
2019-06-30 13:19:24 +02:00
if isopposite(σ, τ)
SA.add!(op, op, SA.mul!(tmp, Δ₂s[σ], Δ₂s[τ]))
2019-06-30 13:19:24 +02:00
elseif isadjacent(σ, τ)
SA.add!(adj, adj, SA.mul!(tmp, Δ₂s[σ], Δ₂s[τ]))
2019-06-30 13:19:24 +02:00
end
end
end
2022-11-07 16:09:02 +01:00
k = factorial(n - 2)
return sq ÷ k, adj ÷ k^2, op ÷ k^2
2019-06-30 13:19:24 +02:00
end