diff --git a/src/gradings.jl b/src/gradings.jl index 20edd29..f6de948 100644 --- a/src/gradings.jl +++ b/src/gradings.jl @@ -25,7 +25,6 @@ end grading(s::MatrixGroups.ElementarySymplectic) = Roots.Root(s) grading(e::MatrixGroups.ElementaryMatrix) = Roots.Root(e) -grading(t::Groups.Transvection) = grading(Groups._abelianize(t)) function grading(g::FPGroupElement) if length(word(g)) == 1 diff --git a/src/roots.jl b/src/roots.jl index 080190a..94beb1d 100644 --- a/src/roots.jl +++ b/src/roots.jl @@ -60,10 +60,7 @@ function positive(roots::AbstractVector{<:Root{N}}) where {N} return filter(α -> dot(α, pd) > 0.0, roots) end -Base.:~(α::AbstractRoot, β::AbstractRoot) = isproportional(α, β) -⟂(α::AbstractRoot, β::AbstractRoot) = isorthogonal(α, β) - -function Base.show(io::IO, r::Root{N}) where {N} +function Base.show(io::IO, r::Root) print(io, "Root$(r.coord)") end @@ -73,8 +70,7 @@ function Base.show(io::IO, ::MIME"text/plain", r::Root{N}) where {N} print(io, "Root in ℝ^$N of length $l\n", r.coord) end -E(N, i::Integer) = Root(ntuple(k -> k == i ? 1 : 0, N)) -𝕖(N, i) = E(N, i) +𝕖(N, i) = Root(ntuple(k -> k == i ? 1 : 0, N)) 𝕆(N, ::Type{T}) where {T} = Root(ntuple(_ -> zero(T), N)) """ diff --git a/test/graded_adj.jl b/test/graded_adj.jl index 117b1dd..7c65e30 100644 --- a/test/graded_adj.jl +++ b/test/graded_adj.jl @@ -1,40 +1,86 @@ -@testset "Adj for SpN via grading" begin +@testset "Adj via grading" begin - genus = 3 - halfradius = 2 + @testset "SL(n,Z) & Aut(F₄)" begin + n = 4 + halfradius = 1 + SL = MatrixGroups.SpecialLinearGroup{n}(Int8) + RSL, S, sizes = PropertyT.group_algebra(SL, halfradius=halfradius, twisted=true) - SpN = MatrixGroups.SymplecticGroup{2genus}(Int8) + Δ = RSL(length(S)) - sum(RSL(s) for s in S) - RSpN, S_sp, sizes_sp = PropertyT.group_algebra(SpN, halfradius=halfradius, twisted=true) - - Δ, Δs = let RG = RSpN, S = S_sp, ψ = identity - Δ = RG(length(S)) - sum(RG(s) for s in S) - Δs = PropertyT.laplacians( - RG, - S, - x -> (gx = PropertyT.grading(ψ(x)); Set([gx, -gx])), - ) - Δ, Δs - end - - @testset "Adj correctness: genus=$genus" begin - - all_subtypes = ( - :A₁, :C₁, Symbol("A₁×A₁"), Symbol("C₁×C₁"), Symbol("A₁×C₁"), :A₂, :C₂ - ) - - @test PropertyT.Adj(Δs, :A₂)[one(SpN)] == 384 - @test iszero(PropertyT.Adj(Δs, Symbol("A₁×A₁"))) - @test iszero(PropertyT.Adj(Δs, Symbol("C₁×C₁"))) - - @testset "divisibility by 16" begin - for subtype in all_subtypes - subtype in (:A₁, :C₁) && continue - @test isinteger(PropertyT.Adj(Δs, subtype)[one(SpN)] / 16) - end + Δs = let ψ = identity + PropertyT.laplacians( + RSL, + S, + x -> (gx = PropertyT.grading(ψ(x)); Set([gx, -gx])), + ) end - @test sum(PropertyT.Adj(Δs, subtype) for subtype in all_subtypes) == Δ^2 + + sq, adj, op = PropertyT.SqAdjOp(RSL, n) + + @test PropertyT.Adj(Δs, :A₁) == sq + @test PropertyT.Adj(Δs, :A₂) == adj + @test PropertyT.Adj(Δs, Symbol("A₁×A₁")) == op + + + halfradius = 1 + G = SpecialAutomorphismGroup(FreeGroup(n)) + RG, S, sizes = PropertyT.group_algebra(G, halfradius=halfradius, twisted=true) + + Δ = RG(length(S)) - sum(RG(s) for s in S) + + Δs = let ψ = Groups.Homomorphism(Groups._abelianize, G, SL) + PropertyT.laplacians( + RG, + S, + x -> (gx = PropertyT.grading(ψ(x)); Set([gx, -gx])), + ) + end + + sq, adj, op = PropertyT.SqAdjOp(RG, n) + + @test PropertyT.Adj(Δs, :A₁) == sq + @test PropertyT.Adj(Δs, :A₂) == adj + @test PropertyT.Adj(Δs, Symbol("A₁×A₁")) == op end + + @testset "Symplectic group" begin + genus = 3 + halfradius = 1 + + SpN = MatrixGroups.SymplecticGroup{2genus}(Int8) + + RSpN, S_sp, sizes_sp = PropertyT.group_algebra(SpN, halfradius=halfradius, twisted=true) + + Δ, Δs = let RG = RSpN, S = S_sp, ψ = identity + Δ = RG(length(S)) - sum(RG(s) for s in S) + Δs = PropertyT.laplacians( + RG, + S, + x -> (gx = PropertyT.grading(ψ(x)); Set([gx, -gx])), + ) + Δ, Δs + end + + @testset "Adj correctness: genus=$genus" begin + + all_subtypes = ( + :A₁, :C₁, Symbol("A₁×A₁"), Symbol("C₁×C₁"), Symbol("A₁×C₁"), :A₂, :C₂ + ) + + @test PropertyT.Adj(Δs, :A₂)[one(SpN)] == 384 + @test iszero(PropertyT.Adj(Δs, Symbol("A₁×A₁"))) + @test iszero(PropertyT.Adj(Δs, Symbol("C₁×C₁"))) + + @testset "divisibility by 16" begin + for subtype in all_subtypes + subtype in (:A₁, :C₁) && continue + @test isinteger(PropertyT.Adj(Δs, subtype)[one(SpN)] / 16) + end + end + @test sum(PropertyT.Adj(Δs, subtype) for subtype in all_subtypes) == Δ^2 + end + end end