From 65286e09d26f3db440f8201ab2f585366bb5b663 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Sun, 13 Nov 2022 14:27:58 +0100 Subject: [PATCH] fix _positive_direction so that Adj works for N=2 --- src/roots.jl | 6 ++---- test/graded_adj.jl | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/roots.jl b/src/roots.jl index 94beb1d..3c5d6f3 100644 --- a/src/roots.jl +++ b/src/roots.jl @@ -48,10 +48,8 @@ function isorthogonal(α::AbstractRoot{N}, β::AbstractRoot{M}) where {N,M} end function _positive_direction(α::Root{N}) where {N} - last = -1 / √2^(N - 1) - return Root{N,Float64}( - SVector(ntuple(i -> ifelse(i == N, last, (√2)^-i), N)), - ) + v = α.coord + 1 / (N * 100) * rand(N) + return Root{N,Float64}(v / norm(v, 2)) end function positive(roots::AbstractVector{<:Root{N}}) where {N} diff --git a/test/graded_adj.jl b/test/graded_adj.jl index 7c65e30..2c20506 100644 --- a/test/graded_adj.jl +++ b/test/graded_adj.jl @@ -46,6 +46,28 @@ @testset "Symplectic group" begin + @testset "Sp2(ℤ)" begin + genus = 2 + 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 + + sq = sum(Δᵢ^2 for Δᵢ in values(Δs)) + @test PropertyT.Adj(Δs, :C₂) + sq == Δ^2 + end + genus = 3 halfradius = 1