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

adjust sq, adj, op to the new world

This commit is contained in:
Marek Kaluba 2022-11-07 16:09:02 +01:00
parent 085f6bce3c
commit 4b8efd2a40
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
2 changed files with 60 additions and 76 deletions

View File

@ -17,6 +17,8 @@ include("constraint_matrix.jl")
include("sos_sdps.jl") include("sos_sdps.jl")
include("certify.jl") include("certify.jl")
include("sqadjop.jl")
include("1712.07167.jl") include("1712.07167.jl")
include("1812.03456.jl") include("1812.03456.jl")

View File

@ -1,98 +1,80 @@
isopposite(σ::Generic.Perm, τ::Generic.Perm, i=1, j=2) = import PermutationGroups.AbstractPerm
σ[i] τ[i] && σ[i] τ[j] &&
σ[j] τ[i] && σ[j] τ[j]
isadjacent(σ::Generic.Perm, τ::Generic.Perm, i=1, j=2) = # move to Groups
(σ[i] == τ[i] && σ[j] τ[j]) || # first equal, second differ Base.keys(a::Alphabet) = keys(1:length(a))
(σ[j] == τ[j] && σ[i] τ[i]) || # second equal, first differ
(σ[i] == τ[j] && σ[j] τ[i]) || # first σ equal to second τ
(σ[j] == τ[i] && σ[i] τ[j]) # second σ equal to first τ
Base.div(X::GroupRingElem, x::Number) = parent(X)(X.coeffsx) ## the old 1812.03456 definitions
function Sq(RG::GroupRing, N::Integer) isopposite(σ::AbstractPerm, τ::AbstractPerm, i=1, j=2) =
S₂ = generating_set(RG.group, 2) i^σ i^τ && i^σ j^τ && j^σ i^τ && j^σ j^τ
= Int64
Δ₂ = length(S₂)*one(RG, ) - RG(S₂, );
Alt_N = [g for g in SymmetricGroup(N) if parity(g) == 0] isadjacent(σ::AbstractPerm, τ::AbstractPerm, i=1, j=2) =
(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 τ
sq = RG() function _ncycle(start, length, n=start + length - 1)
for σ in Alt_N p = Perm(Int8(n))
GroupRings.addeq!(sq, *(Δ₂^σ, Δ₂^σ, false)) @assert n start + length - 1
for k in start:start+length-2
p[k] = k + 1
end end
return sq÷factorial(N-2) p[start+length-1] = start
return p
end end
function Adj(RG::GroupRing, N::Integer) alternating_group(n::Integer) = PermGroup([_ncycle(i, 3) for i in 1:n-2])
S₂ = generating_set(RG.group, 2)
= Int64
Δ₂ = length(S₂)*one(RG, ) - RG(S₂, );
Alt_N = [g for g in SymmetricGroup(N) if parity(g) == 0] function small_gens(G::MatrixGroups.SpecialLinearGroup)
Δ₂s = Dict(σ=>Δ₂^σ for σ in Alt_N) A = alphabet(G)
adj = RG() S = map([(1, 2), (2, 1)]) do (i, j)
k = findfirst(l -> (l.i == i && l.j == j), A)
for σ in Alt_N @assert !isnothing(k)
for τ in Alt_N G(Groups.word_type(G)([k]))
if isadjacent(σ, τ)
GroupRings.addeq!(adj, *(Δ₂s[σ], Δ₂s[τ], false))
end
end
end end
return adj÷factorial(N-2)^2 return union!(S, inv.(S))
end end
function Op(RG::GroupRing, N::Integer) function small_gens(G::Groups.AutomorphismGroup{<:FreeGroup})
if N < 4 A = alphabet(G)
return RG() 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]))
end end
S₂ = generating_set(RG.group, 2) return union!(S, inv.(S))
= Int64 end
Δ₂ = length(S₂)*one(RG, ) - RG(S₂, );
Alt_N = [g for g in SymmetricGroup(N) if parity(g) == 0] function small_laplacian(RG::StarAlgebra)
Δ₂s = Dict(σ=>Δ₂^σ for σ in Alt_N) G = StarAlgebras.object(RG)
op = RG() S₂ = small_gens(G)
return length(S₂) * one(RG) - sum(RG(s) for s in S₂)
end
for σ in Alt_N function SqAdjOp(A::StarAlgebra, n::Integer, Δ₂=small_laplacian(A))
for τ in Alt_N @assert parent(Δ₂) === A
alt_n = alternating_group(n)
G = StarAlgebras.object(A)
act = action_by_conjugation(G, alt_n)
Δ₂s = Dict(σ => SymbolicWedderburn.action(act, σ, Δ₂) for σ in alt_n)
sq, adj, op = zero(A), zero(A), zero(A)
tmp = zero(A)
for σ in alt_n
StarAlgebras.add!(sq, sq, StarAlgebras.mul!(tmp, Δ₂s[σ], Δ₂s[σ]))
for τ in alt_n
if isopposite(σ, τ) if isopposite(σ, τ)
GroupRings.addeq!(op, *(Δ₂s[σ], Δ₂s[τ], false)) StarAlgebras.add!(op, op, StarAlgebras.mul!(tmp, Δ₂s[σ], Δ₂s[τ]))
end
end
end
return op÷factorial(N-2)^2
end
for Elt in [:Sq, :Adj, :Op]
@eval begin
$Elt(RG::GroupRing{AutGroup{N}}) where N = $Elt(RG, N)
$Elt(RG::GroupRing{<:MatAlgebra}) = $Elt(RG, nrows(RG.group))
end
end
function SqAdjOp(RG::GroupRing, N::Integer)
S₂ = generating_set(RG.group, 2)
= Int64
Δ₂ = length(S₂)*one(RG, ) - RG(S₂, );
Alt_N = [σ for σ in SymmetricGroup(N) if parity(σ) == 0]
sq, adj, op = RG(), RG(), RG()
Δ₂s = Dict(σ=>Δ₂^σ for σ in Alt_N)
for σ in Alt_N
GroupRings.addeq!(sq, *(Δ₂s[σ], Δ₂s[σ], false))
for τ in Alt_N
if isopposite(σ, τ)
GroupRings.addeq!(op, *(Δ₂s[σ], Δ₂s[τ], false))
elseif isadjacent(σ, τ) elseif isadjacent(σ, τ)
GroupRings.addeq!(adj, *(Δ₂s[σ], Δ₂s[τ], false)) StarAlgebras.add!(adj, adj, StarAlgebras.mul!(tmp, Δ₂s[σ], Δ₂s[τ]))
end end
end end
end end
k = factorial(N-2) k = factorial(n - 2)
return sq÷k, adj÷k^2, op÷k^2 return sq ÷ k, adj ÷ k^2, op ÷ k^2
end end