Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 13, 2023
1 parent 81e8477 commit 97f10b5
Showing 1 changed file with 61 additions and 30 deletions.
91 changes: 61 additions & 30 deletions test/ModuleSimpleStructure-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

@testset "Duality, standard" begin
V = dual(stdV)
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == V
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[v_1*, v_2*, v_3*]"
Expand All @@ -13,7 +14,8 @@

@testset "Duality, duality" begin
V = dual(dual(stdV))
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == stdV
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[(v_1*)*, (v_2*)*, (v_3*)*]"
Expand All @@ -22,7 +24,8 @@

@testset "Duality, direct sum" begin
V = dual(direct_sum(stdV, stdV, dual(stdV)))
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == direct_sum(dual(stdV), dual(stdV), stdV)
@test sprint(show, basis(V)) ==
Expand All @@ -33,7 +36,8 @@

@testset "Duality, tensor product" begin
V = dual(tensor_product(stdV, dual(stdV)))
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == tensor_product(dual(stdV), stdV)
@test sprint(show, basis(V)) ==
Expand All @@ -44,7 +48,8 @@

@testset "Duality, exterior power, k = $k" for k in 2:3
V = dual(exterior_power(stdV, k))
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == exterior_power(dual(stdV), k)
if k == 2
Expand All @@ -57,7 +62,8 @@

@testset "Duality, symmetric power, k = $k" for k in 2:5
V = dual(symmetric_power(stdV, k))
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == symmetric_power(dual(stdV), k)
if k == 2
Expand All @@ -70,7 +76,8 @@

@testset "Duality, tensor power, k = $k" for k in 2:5
V = dual(tensor_power(stdV, k))
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == tensor_power(dual(stdV), k)
if k == 2
Expand All @@ -83,7 +90,8 @@

@testset "Direct sum: one summand" begin
V = direct_sum(exterior_power(stdV, 2))
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == exterior_power(stdV, 2)
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[v_1 ∧ v_2, v_1 ∧ v_3, v_2 ∧ v_3]"
Expand All @@ -95,7 +103,8 @@
V3 = exterior_power(stdV, 2)
for V2 in [exterior_power(stdV, dim(stdV) + 1)]
V = direct_sum(V1, V2, V3)
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == direct_sum(V1, V3)
@test sprint(show, basis(V)) ==
Expand All @@ -107,7 +116,8 @@

@testset "Direct sum: nested" begin
V = direct_sum(direct_sum(stdV, exterior_power(stdV, 2)), dual(stdV))
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == direct_sum(stdV, exterior_power(stdV, 2), dual(stdV))
@test sprint(show, basis(V)) ==
Expand All @@ -118,7 +128,8 @@

@testset "Tensor product: one factor" begin
V = tensor_product(exterior_power(stdV, 2))
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == exterior_power(stdV, 2)
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[v_1 ∧ v_2, v_1 ∧ v_3, v_2 ∧ v_3]"
Expand All @@ -130,15 +141,17 @@
V3 = exterior_power(stdV, 2)
for V2 in [tensor_power(stdV, 0), exterior_power(stdV, 0), symmetric_power(stdV, 0)]
V = tensor_product(V1, V2, V3)
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == tensor_product(V1, V3)
end
end

@testset "Tensor product: nested" begin
V = tensor_product(tensor_product(stdV, exterior_power(stdV, 2)), dual(stdV))
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == tensor_product(stdV, exterior_power(stdV, 2), dual(stdV))
@test sprint(show, basis(V)) ==
Expand All @@ -149,7 +162,8 @@

@testset "Tensor product, direct sum" begin
V = tensor_product(direct_sum(stdV, symmetric_power(stdV, 2)), direct_sum(dual(stdV), stdV))
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == direct_sum(
tensor_product(stdV, dual(stdV)),
Expand All @@ -165,7 +179,8 @@
V5 = stdV
V6 = symmetric_power(stdV, 2)
V = tensor_product(V1, direct_sum(V2, V3, V4), direct_sum(V5, V6))
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == direct_sum(
tensor_product(V1, V2, V5),
Expand All @@ -180,7 +195,8 @@
@testset "Exterior power: 1st power" begin
V1 = stdV
V = exterior_power(V1, 1)
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == V1
end
Expand All @@ -190,7 +206,8 @@
V2 = dual(stdV)
V3 = exterior_power(stdV, 2)
V = exterior_power(direct_sum(V1, V2, V3), 3)
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == direct_sum(
exterior_power(V1, 3),
Expand All @@ -209,7 +226,8 @@
@testset "Symmetric power: 1st power" begin
V1 = stdV
V = symmetric_power(V1, 1)
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == V1
end
Expand All @@ -219,7 +237,8 @@
V2 = dual(stdV)
V3 = exterior_power(stdV, 2)
V = symmetric_power(direct_sum(V1, V2, V3), 3)
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == direct_sum(
symmetric_power(V1, 3),
Expand All @@ -238,7 +257,8 @@
@testset "Tensor power: 1st power" begin
V1 = stdV
V = tensor_power(V1, 1)
W, h = isomorphic_module_with_simple_structure(V)
W, h = isomorphic_module_with_simple_structure(V; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == V1
end
Expand All @@ -248,7 +268,8 @@
V2 = exterior_power(dual(stdV), 2)
V3 = exterior_power(stdV, 2)
V = tensor_power(direct_sum(V1, V2, V3), 3)
W, h = isomorphic_module_with_simple_structure(V; check=false) # otherwise needs 3 minutes
W, h = isomorphic_module_with_simple_structure(V; check=false)
# @test is_welldefined(h) # needs 3 minutes
@test is_isomorphism(h)
@test W == direct_sum(
tensor_power(V1, 3), # 111
Expand Down Expand Up @@ -287,17 +308,20 @@
V3 = direct_sum(V1, V2)

V_1 = exterior_power(V3, 1)
W_1, h = isomorphic_module_with_simple_structure(V_1)
W_1, h = isomorphic_module_with_simple_structure(V_1; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W_1 == V3

V_2 = exterior_power(V3, 2)
W_2, h = isomorphic_module_with_simple_structure(V_2)
W_2, h = isomorphic_module_with_simple_structure(V_2; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W_2 == direct_sum(exterior_power(V1, 2), tensor_product(V1, V2), exterior_power(V2, 2))

V_3 = exterior_power(V3, 3)
W_3, h = isomorphic_module_with_simple_structure(V_3)
W_3, h = isomorphic_module_with_simple_structure(V_3; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test W_3 == direct_sum(
exterior_power(V1, 3),
Expand All @@ -308,7 +332,8 @@

# TODO: handle zero-dim modules (e.g. 4th exterior power of 3-dim module)
V_4 = exterior_power(V3, 4)
W_4a, ha = isomorphic_module_with_simple_structure(V_4)
W_4a, ha = isomorphic_module_with_simple_structure(V_4; check=false)
@test is_welldefined(ha)
@test is_isomorphism(ha)
W_4b, hb = isomorphic_module_with_simple_structure(
direct_sum(
Expand All @@ -317,8 +342,10 @@
tensor_product(exterior_power(V1, 2), exterior_power(V2, 2)),
tensor_product(V1, exterior_power(V2, 3)),
exterior_power(V2, 4),
),
);
check=false,
)
@test is_welldefined(hb)
@test is_isomorphism(hb)
@test W_4a == W_4b
end
Expand All @@ -327,22 +354,26 @@
V1 = symmetric_power(stdV, 3)

Ve2 = dual(exterior_power(dual(V1), 2))
We2, h = isomorphic_module_with_simple_structure(Ve2)
We2, h = isomorphic_module_with_simple_structure(Ve2; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test We2 == exterior_power(V1, 2)

Ve3 = dual(exterior_power(dual(V1), 3))
We3, h = isomorphic_module_with_simple_structure(Ve3)
We3, h = isomorphic_module_with_simple_structure(Ve3; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test We3 == exterior_power(V1, 3)

Vs2 = dual(symmetric_power(dual(V1), 2))
Ws2, h = isomorphic_module_with_simple_structure(Vs2)
Ws2, h = isomorphic_module_with_simple_structure(Vs2; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test Ws2 == symmetric_power(V1, 2)

Vt2 = dual(tensor_power(dual(V1), 2))
Wt2, h = isomorphic_module_with_simple_structure(Vt2)
Wt2, h = isomorphic_module_with_simple_structure(Vt2; check=false)
@test is_welldefined(h)
@test is_isomorphism(h)
@test Wt2 == tensor_power(V1, 2)
end
Expand Down

0 comments on commit 97f10b5

Please sign in to comment.