Skip to content

Commit

Permalink
Adapt to new LieAlgebraModule type param
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Oct 7, 2024
1 parent 689fdde commit e9d361c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/SmashProductLie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ base_lie_algebra(
) where {C <: RingElem, LieC <: FieldElem, LieT <: LieAlgebraElem{LieC}} = Sp.L::parent_type(LieT)

base_module(Sp::SmashProductLie{C, LieC, LieT}) where {C <: RingElem, LieC <: FieldElem, LieT <: LieAlgebraElem{LieC}} =
Sp.V::LieAlgebraModule{LieC}
Sp.V

underlying_algebra(
Sp::SmashProductLie{C, LieC, LieT},
Expand Down
2 changes: 1 addition & 1 deletion src/SmashProductLieDeform.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ base_lie_algebra(

base_module(
D::SmashProductLieDeform{C, LieC, LieT},
) where {C <: RingElem, LieC <: FieldElem, LieT <: LieAlgebraElem{LieC}} = base_module(D.sp)::LieAlgebraModule{LieC}
) where {C <: RingElem, LieC <: FieldElem, LieT <: LieAlgebraElem{LieC}} = base_module(D.sp)

underlying_algebra(
D::SmashProductLieDeform{C, LieC, LieT},
Expand Down
2 changes: 1 addition & 1 deletion src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ It gets created by calling [`smash_product`](@ref).
@attributes mutable struct SmashProductLie{C <: RingElem, LieC <: FieldElem, LieT <: LieAlgebraElem{LieC}} <: NCRing
coeff_ring::Ring
L::LieAlgebra{LieC}
V::LieAlgebraModule{LieC}
V::LieAlgebraModule{LieC, LieT}
alg::FreeAssociativeAlgebra{C}
rels::Matrix{Union{Nothing, F}} where {F <: FreeAssociativeAlgebraElem{C}}

Expand Down
48 changes: 24 additions & 24 deletions test/ModuleSimpleStructure-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == V
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[v_1*, v_2*, v_3*]"
@test sprint(show, h.(basis(V))) == "LieAlgebraModuleElem{QQFieldElem}[v_1*, v_2*, v_3*]"
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[v_1*, v_2*, v_3*]"
@test sprint(show, h.(basis(V))) == "LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[v_1*, v_2*, v_3*]"
end

@testset "Duality, duality" begin
Expand All @@ -18,8 +18,8 @@
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == stdV
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[(v_1*)*, (v_2*)*, (v_3*)*]"
@test sprint(show, h.(basis(V))) == "LieAlgebraModuleElem{QQFieldElem}[v_1, v_2, v_3]"
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1*)*, (v_2*)*, (v_3*)*]"
@test sprint(show, h.(basis(V))) == "LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[v_1, v_2, v_3]"
end

@testset "Duality, direct sum" begin
Expand All @@ -29,9 +29,9 @@
@test is_isomorphism(h)
@test W == direct_sum(dual(stdV), dual(stdV), stdV)
@test sprint(show, basis(V)) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1^(1))*, (v_2^(1))*, (v_3^(1))*, (v_1^(2))*, (v_2^(2))*, (v_3^(2))*, ((v_1*)^(3))*, ((v_2*)^(3))*, ((v_3*)^(3))*]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1^(1))*, (v_2^(1))*, (v_3^(1))*, (v_1^(2))*, (v_2^(2))*, (v_3^(2))*, ((v_1*)^(3))*, ((v_2*)^(3))*, ((v_3*)^(3))*]"
@test sprint(show, h.(basis(V))) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1*)^(1), (v_2*)^(1), (v_3*)^(1), (v_1*)^(2), (v_2*)^(2), (v_3*)^(2), v_1^(3), v_2^(3), v_3^(3)]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1*)^(1), (v_2*)^(1), (v_3*)^(1), (v_1*)^(2), (v_2*)^(2), (v_3*)^(2), v_1^(3), v_2^(3), v_3^(3)]"
end

@testset "Duality, tensor product" begin
Expand All @@ -41,9 +41,9 @@
@test is_isomorphism(h)
@test W == tensor_product(dual(stdV), stdV)
@test sprint(show, basis(V)) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1⊗(v_1*))*, (v_1⊗(v_2*))*, (v_1⊗(v_3*))*, (v_2⊗(v_1*))*, (v_2⊗(v_2*))*, (v_2⊗(v_3*))*, (v_3⊗(v_1*))*, (v_3⊗(v_2*))*, (v_3⊗(v_3*))*]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1⊗(v_1*))*, (v_1⊗(v_2*))*, (v_1⊗(v_3*))*, (v_2⊗(v_1*))*, (v_2⊗(v_2*))*, (v_2⊗(v_3*))*, (v_3⊗(v_1*))*, (v_3⊗(v_2*))*, (v_3⊗(v_3*))*]"
@test sprint(show, h.(basis(V))) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1*)⊗v_1, (v_1*)⊗v_2, (v_1*)⊗v_3, (v_2*)⊗v_1, (v_2*)⊗v_2, (v_2*)⊗v_3, (v_3*)⊗v_1, (v_3*)⊗v_2, (v_3*)⊗v_3]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1*)⊗v_1, (v_1*)⊗v_2, (v_1*)⊗v_3, (v_2*)⊗v_1, (v_2*)⊗v_2, (v_2*)⊗v_3, (v_3*)⊗v_1, (v_3*)⊗v_2, (v_3*)⊗v_3]"
end

@testset "Duality, exterior power, k = $k" for k in 2:3
Expand All @@ -53,9 +53,9 @@
@test is_isomorphism(h)
@test W == exterior_power_obj(dual(stdV), k)
if k == 2
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[(v_1∧v_2)*, (v_1∧v_3)*, (v_2∧v_3)*]"
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1∧v_2)*, (v_1∧v_3)*, (v_2∧v_3)*]"
@test sprint(show, h.(basis(V))) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1*)∧(v_2*), (v_1*)∧(v_3*), (v_2*)∧(v_3*)]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1*)∧(v_2*), (v_1*)∧(v_3*), (v_2*)∧(v_3*)]"
end
end

Expand All @@ -67,9 +67,9 @@
@test W == symmetric_power_obj(dual(stdV), k)
if k == 2
@test sprint(show, basis(V)) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1^2)*, (v_1*v_2)*, (v_1*v_3)*, (v_2^2)*, (v_2*v_3)*, (v_3^2)*]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1^2)*, (v_1*v_2)*, (v_1*v_3)*, (v_2^2)*, (v_2*v_3)*, (v_3^2)*]"
@test sprint(show, h.(basis(V))) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1*)^2, 2*(v_1*)*(v_2*), 2*(v_1*)*(v_3*), (v_2*)^2, 2*(v_2*)*(v_3*), (v_3*)^2]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1*)^2, 2*(v_1*)*(v_2*), 2*(v_1*)*(v_3*), (v_2*)^2, 2*(v_2*)*(v_3*), (v_3*)^2]"
end
end

Expand All @@ -81,9 +81,9 @@
@test W == tensor_power_obj(dual(stdV), k)
if k == 2
@test sprint(show, basis(V)) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1⊗v_1)*, (v_1⊗v_2)*, (v_1⊗v_3)*, (v_2⊗v_1)*, (v_2⊗v_2)*, (v_2⊗v_3)*, (v_3⊗v_1)*, (v_3⊗v_2)*, (v_3⊗v_3)*]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1⊗v_1)*, (v_1⊗v_2)*, (v_1⊗v_3)*, (v_2⊗v_1)*, (v_2⊗v_2)*, (v_2⊗v_3)*, (v_3⊗v_1)*, (v_3⊗v_2)*, (v_3⊗v_3)*]"
@test sprint(show, h.(basis(V))) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1*)⊗(v_1*), (v_1*)⊗(v_2*), (v_1*)⊗(v_3*), (v_2*)⊗(v_1*), (v_2*)⊗(v_2*), (v_2*)⊗(v_3*), (v_3*)⊗(v_1*), (v_3*)⊗(v_2*), (v_3*)⊗(v_3*)]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1*)⊗(v_1*), (v_1*)⊗(v_2*), (v_1*)⊗(v_3*), (v_2*)⊗(v_1*), (v_2*)⊗(v_2*), (v_2*)⊗(v_3*), (v_3*)⊗(v_1*), (v_3*)⊗(v_2*), (v_3*)⊗(v_3*)]"
end
end

Expand All @@ -93,8 +93,8 @@
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == exterior_power_obj(stdV, 2)
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[v_1∧v_2, v_1∧v_3, v_2∧v_3]"
@test sprint(show, h.(basis(V))) == "LieAlgebraModuleElem{QQFieldElem}[v_1∧v_2, v_1∧v_3, v_2∧v_3]"
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[v_1∧v_2, v_1∧v_3, v_2∧v_3]"
@test sprint(show, h.(basis(V))) == "LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[v_1∧v_2, v_1∧v_3, v_2∧v_3]"
end

@testset "Direct sum: 0-dim summand" begin
Expand All @@ -107,9 +107,9 @@
@test is_isomorphism(h)
@test W == direct_sum(V1, V3)
@test sprint(show, basis(V)) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1*)^(1), (v_2*)^(1), (v_3*)^(1), (v_1∧v_2)^(3), (v_1∧v_3)^(3), (v_2∧v_3)^(3)]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1*)^(1), (v_2*)^(1), (v_3*)^(1), (v_1∧v_2)^(3), (v_1∧v_3)^(3), (v_2∧v_3)^(3)]"
@test sprint(show, h.(basis(V))) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1*)^(1), (v_2*)^(1), (v_3*)^(1), (v_1∧v_2)^(2), (v_1∧v_3)^(2), (v_2∧v_3)^(2)]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1*)^(1), (v_2*)^(1), (v_3*)^(1), (v_1∧v_2)^(2), (v_1∧v_3)^(2), (v_2∧v_3)^(2)]"
end
end

Expand All @@ -120,9 +120,9 @@
@test is_isomorphism(h)
@test W == direct_sum(stdV, exterior_power_obj(stdV, 2), dual(stdV))
@test sprint(show, basis(V)) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1^(1))^(1), (v_2^(1))^(1), (v_3^(1))^(1), ((v_1∧v_2)^(2))^(1), ((v_1∧v_3)^(2))^(1), ((v_2∧v_3)^(2))^(1), (v_1*)^(2), (v_2*)^(2), (v_3*)^(2)]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1^(1))^(1), (v_2^(1))^(1), (v_3^(1))^(1), ((v_1∧v_2)^(2))^(1), ((v_1∧v_3)^(2))^(1), ((v_2∧v_3)^(2))^(1), (v_1*)^(2), (v_2*)^(2), (v_3*)^(2)]"
@test sprint(show, h.(basis(V))) ==
"LieAlgebraModuleElem{QQFieldElem}[v_1^(1), v_2^(1), v_3^(1), (v_1∧v_2)^(2), (v_1∧v_3)^(2), (v_2∧v_3)^(2), (v_1*)^(3), (v_2*)^(3), (v_3*)^(3)]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[v_1^(1), v_2^(1), v_3^(1), (v_1∧v_2)^(2), (v_1∧v_3)^(2), (v_2∧v_3)^(2), (v_1*)^(3), (v_2*)^(3), (v_3*)^(3)]"
end

@testset "Tensor product: one factor" begin
Expand All @@ -131,8 +131,8 @@
@test is_welldefined(h)
@test is_isomorphism(h)
@test W == exterior_power_obj(stdV, 2)
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem}[v_1∧v_2, v_1∧v_3, v_2∧v_3]"
@test sprint(show, h.(basis(V))) == "LieAlgebraModuleElem{QQFieldElem}[v_1∧v_2, v_1∧v_3, v_2∧v_3]"
@test sprint(show, basis(V)) == "LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[v_1∧v_2, v_1∧v_3, v_2∧v_3]"
@test sprint(show, h.(basis(V))) == "LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[v_1∧v_2, v_1∧v_3, v_2∧v_3]"
end

@testset "Tensor product: trivial 1-dim factor" begin
Expand All @@ -154,9 +154,9 @@
@test is_isomorphism(h)
@test W == tensor_product(stdV, exterior_power_obj(stdV, 2), dual(stdV))
@test sprint(show, basis(V)) ==
"LieAlgebraModuleElem{QQFieldElem}[(v_1⊗(v_1∧v_2))⊗(v_1*), (v_1⊗(v_1∧v_2))⊗(v_2*), (v_1⊗(v_1∧v_2))⊗(v_3*), (v_1⊗(v_1∧v_3))⊗(v_1*), (v_1⊗(v_1∧v_3))⊗(v_2*), (v_1⊗(v_1∧v_3))⊗(v_3*), (v_1⊗(v_2∧v_3))⊗(v_1*), (v_1⊗(v_2∧v_3))⊗(v_2*), (v_1⊗(v_2∧v_3))⊗(v_3*), (v_2⊗(v_1∧v_2))⊗(v_1*), (v_2⊗(v_1∧v_2))⊗(v_2*), (v_2⊗(v_1∧v_2))⊗(v_3*), (v_2⊗(v_1∧v_3))⊗(v_1*), (v_2⊗(v_1∧v_3))⊗(v_2*), (v_2⊗(v_1∧v_3))⊗(v_3*), (v_2⊗(v_2∧v_3))⊗(v_1*), (v_2⊗(v_2∧v_3))⊗(v_2*), (v_2⊗(v_2∧v_3))⊗(v_3*), (v_3⊗(v_1∧v_2))⊗(v_1*), (v_3⊗(v_1∧v_2))⊗(v_2*), (v_3⊗(v_1∧v_2))⊗(v_3*), (v_3⊗(v_1∧v_3))⊗(v_1*), (v_3⊗(v_1∧v_3))⊗(v_2*), (v_3⊗(v_1∧v_3))⊗(v_3*), (v_3⊗(v_2∧v_3))⊗(v_1*), (v_3⊗(v_2∧v_3))⊗(v_2*), (v_3⊗(v_2∧v_3))⊗(v_3*)]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[(v_1⊗(v_1∧v_2))⊗(v_1*), (v_1⊗(v_1∧v_2))⊗(v_2*), (v_1⊗(v_1∧v_2))⊗(v_3*), (v_1⊗(v_1∧v_3))⊗(v_1*), (v_1⊗(v_1∧v_3))⊗(v_2*), (v_1⊗(v_1∧v_3))⊗(v_3*), (v_1⊗(v_2∧v_3))⊗(v_1*), (v_1⊗(v_2∧v_3))⊗(v_2*), (v_1⊗(v_2∧v_3))⊗(v_3*), (v_2⊗(v_1∧v_2))⊗(v_1*), (v_2⊗(v_1∧v_2))⊗(v_2*), (v_2⊗(v_1∧v_2))⊗(v_3*), (v_2⊗(v_1∧v_3))⊗(v_1*), (v_2⊗(v_1∧v_3))⊗(v_2*), (v_2⊗(v_1∧v_3))⊗(v_3*), (v_2⊗(v_2∧v_3))⊗(v_1*), (v_2⊗(v_2∧v_3))⊗(v_2*), (v_2⊗(v_2∧v_3))⊗(v_3*), (v_3⊗(v_1∧v_2))⊗(v_1*), (v_3⊗(v_1∧v_2))⊗(v_2*), (v_3⊗(v_1∧v_2))⊗(v_3*), (v_3⊗(v_1∧v_3))⊗(v_1*), (v_3⊗(v_1∧v_3))⊗(v_2*), (v_3⊗(v_1∧v_3))⊗(v_3*), (v_3⊗(v_2∧v_3))⊗(v_1*), (v_3⊗(v_2∧v_3))⊗(v_2*), (v_3⊗(v_2∧v_3))⊗(v_3*)]"
@test sprint(show, h.(basis(V))) ==
"LieAlgebraModuleElem{QQFieldElem}[v_1⊗(v_1∧v_2)⊗(v_1*), v_1⊗(v_1∧v_2)⊗(v_2*), v_1⊗(v_1∧v_2)⊗(v_3*), v_1⊗(v_1∧v_3)⊗(v_1*), v_1⊗(v_1∧v_3)⊗(v_2*), v_1⊗(v_1∧v_3)⊗(v_3*), v_1⊗(v_2∧v_3)⊗(v_1*), v_1⊗(v_2∧v_3)⊗(v_2*), v_1⊗(v_2∧v_3)⊗(v_3*), v_2⊗(v_1∧v_2)⊗(v_1*), v_2⊗(v_1∧v_2)⊗(v_2*), v_2⊗(v_1∧v_2)⊗(v_3*), v_2⊗(v_1∧v_3)⊗(v_1*), v_2⊗(v_1∧v_3)⊗(v_2*), v_2⊗(v_1∧v_3)⊗(v_3*), v_2⊗(v_2∧v_3)⊗(v_1*), v_2⊗(v_2∧v_3)⊗(v_2*), v_2⊗(v_2∧v_3)⊗(v_3*), v_3⊗(v_1∧v_2)⊗(v_1*), v_3⊗(v_1∧v_2)⊗(v_2*), v_3⊗(v_1∧v_2)⊗(v_3*), v_3⊗(v_1∧v_3)⊗(v_1*), v_3⊗(v_1∧v_3)⊗(v_2*), v_3⊗(v_1∧v_3)⊗(v_3*), v_3⊗(v_2∧v_3)⊗(v_1*), v_3⊗(v_2∧v_3)⊗(v_2*), v_3⊗(v_2∧v_3)⊗(v_3*)]"
"LieAlgebraModuleElem{QQFieldElem, LinearLieAlgebraElem{QQFieldElem}}[v_1⊗(v_1∧v_2)⊗(v_1*), v_1⊗(v_1∧v_2)⊗(v_2*), v_1⊗(v_1∧v_2)⊗(v_3*), v_1⊗(v_1∧v_3)⊗(v_1*), v_1⊗(v_1∧v_3)⊗(v_2*), v_1⊗(v_1∧v_3)⊗(v_3*), v_1⊗(v_2∧v_3)⊗(v_1*), v_1⊗(v_2∧v_3)⊗(v_2*), v_1⊗(v_2∧v_3)⊗(v_3*), v_2⊗(v_1∧v_2)⊗(v_1*), v_2⊗(v_1∧v_2)⊗(v_2*), v_2⊗(v_1∧v_2)⊗(v_3*), v_2⊗(v_1∧v_3)⊗(v_1*), v_2⊗(v_1∧v_3)⊗(v_2*), v_2⊗(v_1∧v_3)⊗(v_3*), v_2⊗(v_2∧v_3)⊗(v_1*), v_2⊗(v_2∧v_3)⊗(v_2*), v_2⊗(v_2∧v_3)⊗(v_3*), v_3⊗(v_1∧v_2)⊗(v_1*), v_3⊗(v_1∧v_2)⊗(v_2*), v_3⊗(v_1∧v_2)⊗(v_3*), v_3⊗(v_1∧v_3)⊗(v_1*), v_3⊗(v_1∧v_3)⊗(v_2*), v_3⊗(v_1∧v_3)⊗(v_3*), v_3⊗(v_2∧v_3)⊗(v_1*), v_3⊗(v_2∧v_3)⊗(v_2*), v_3⊗(v_2∧v_3)⊗(v_3*)]"
end

@testset "Tensor product, direct sum" begin
Expand Down

0 comments on commit e9d361c

Please sign in to comment.