From e9bb6f13ddacacf846bb65d32ca08bd4ee381c34 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Fri, 5 Jul 2019 18:57:39 +0200 Subject: [PATCH] add tests for actions --- test/1712.07167.jl | 12 ++++++ test/actions.jl | 104 +++++++++++++++++++++++++++++++++++++++++++++ test/runtests.jl | 1 + 3 files changed, 117 insertions(+) create mode 100644 test/actions.jl diff --git a/test/1712.07167.jl b/test/1712.07167.jl index b1bd59e..259836a 100644 --- a/test/1712.07167.jl +++ b/test/1712.07167.jl @@ -32,6 +32,18 @@ # this should be very fast due to warmstarting: @test λ ≈ PropertyT.spectral_gap(sett) atol=1e-5 @test PropertyT.check_property_T(sett) == true + + ########## + # Symmetrizing by PermGroup(3): + + sett = PropertyT.Settings("SL($N,Z)", G, S, PermGroup(N), with_SCS(4000, accel=20); + upper_bound=0.27, warmstart=true) + + PropertyT.print_summary(sett) + + λ = PropertyT.spectral_gap(sett) + @test λ > 0.269999 + @test PropertyT.interpret_results(sett, λ) == true end @testset "oSL(4,Z)" begin diff --git a/test/actions.jl b/test/actions.jl new file mode 100644 index 0000000..fd9ce04 --- /dev/null +++ b/test/actions.jl @@ -0,0 +1,104 @@ +@testset "actions on Group[Rings]" begin + Eij = PropertyT.EltaryMat + ssgs(M::MatAlgebra, i, j) = (S = [Eij(M, i, j), Eij(M, j, i)]; + S = unique([S; inv.(S)]); S) + + rmul = Groups.rmul_autsymbol + lmul = Groups.lmul_autsymbol + + function ssgs(A::AutGroup, i, j) + rmuls = [rmul(i,j), rmul(j,i)] + lmuls = [lmul(i,j), lmul(j,i)] + gen_set = A.([rmuls; lmuls]) + return unique([gen_set; inv.(gen_set)]) + end + +@testset "actions on SL(3,Z) and its group ring" begin + N = 3 + halfradius = 2 + M = MatrixAlgebra(zz, N) + S = PropertyT.generating_set(M) + E_R, sizes = Groups.generate_balls(S, one(M), radius=2halfradius); + + rdict = GroupRings.reverse_dict(E_R) + pm = GroupRings.create_pm(E_R, rdict, sizes[halfradius]; twisted=false); + RG = GroupRing(M, E_R, rdict, pm) + + @testset "correctness of actions" begin + Δ = length(S)*RG(1) - sum(RG(s) for s in S) + @test Δ == PropertyT.spLaplacian(RG, S) + + elt = S[5] + x = RG(1) - RG(elt) + elt2 = E_R[rand(sizes[1]:sizes[2])] + y = 2RG(elt2) - RG(elt) + + for G in [PermGroup(N), WreathProduct(PermGroup(2), PermGroup(N))] + @test all(g(one(M)) == one(M) for g in G) + @test all(rdict[g(m)] <= sizes[1] for g in G for m in S) + @test all(g(m)*g(n) == g(m*n) for g in G for m in S for n in S) + + @test all(g(Δ) == Δ for g in G) + @test all(g(x) == RG(1) - RG(g(elt)) for g in G) + + @test all(2RG(g(elt2)) - RG(g(elt)) == g(y) for g in G) + end + end + + @testset "small Laplacians" begin + for (i,j) in PropertyT.indexing(N) + Sij = ssgs(M, i,j) + Δij= PropertyT.spLaplacian(RG, Sij) + + @test all(p(Δij) == PropertyT.spLaplacian(RG, ssgs(M, p[i], p[j])) for p in PermGroup(N)) + + @test all(g(Δij) == PropertyT.spLaplacian(RG, ssgs(M, g.p[i], g.p[j])) for g in WreathProduct(PermGroup(2), PermGroup(N))) + end + end +end + +@testset "actions on SAut(F_3) and its group ring" begin + N = 3 + halfradius = 2 + M = SAut(FreeGroup(N)) + S = PropertyT.generating_set(M) + E_R, sizes = Groups.generate_balls(S, one(M), radius=2halfradius); + + rdict = GroupRings.reverse_dict(E_R) + pm = GroupRings.create_pm(E_R, rdict, sizes[halfradius]; twisted=false); + RG = GroupRing(M, E_R, rdict, pm) + + + @testset "correctness of actions" begin + + Δ = length(S)*RG(1) - sum(RG(s) for s in S) + @test Δ == PropertyT.spLaplacian(RG, S) + + elt = S[5] + x = RG(1) - RG(elt) + elt2 = E_R[rand(sizes[1]:sizes[2])] + y = 2RG(elt2) - RG(elt) + + for G in [PermGroup(N), WreathProduct(PermGroup(2), PermGroup(N))] + @test all(g(one(M)) == one(M) for g in G) + @test all(rdict[g(m)] <= sizes[1] for g in G for m in S) + @test all(g(m)*g(n) == g(m*n) for g in G for m in S for n in S) + + @test all(g(Δ) == Δ for g in G) + @test all(g(x) == RG(1) - RG(g(elt)) for g in G) + + @test all(2RG(g(elt2)) - RG(g(elt)) == g(y) for g in G) + end + end + + for (i,j) in PropertyT.indexing(N) + Sij = ssgs(M, i,j) + Δij= PropertyT.spLaplacian(RG, Sij) + + @test all(p(Δij) == PropertyT.spLaplacian(RG, ssgs(M, p[i], p[j])) for p in PermGroup(N)) + + @test all(g(Δij) == PropertyT.spLaplacian(RG, ssgs(M, g.p[i], g.p[j])) for g in WreathProduct(PermGroup(2), PermGroup(N))) + end +end + +end diff --git a/test/runtests.jl b/test/runtests.jl index 96bb5e0..1a0e85f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -12,6 +12,7 @@ with_SCS(iters; accel=1, eps=1e-10) = acceleration_lookback=accel, eps=eps, warm_start=true) include("1703.09680.jl") +include("actions.jl") include("1712.07167.jl") include("SOS_correctness.jl") include("1812.03456.jl")