Skip to content

Commit

Permalink
LieAlgebras: Add zero_map
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Sep 1, 2023
1 parent c4d431d commit 2879b6b
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 0 deletions.
1 change: 1 addition & 0 deletions experimental/LieAlgebras/docs/src/lie_algebra_homs.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ the images of the basis elements of $L_1$ or a $\dim L_1 \times \dim L_2$ matrix
hom(::LieAlgebra{C}, ::LieAlgebra{C}, ::Vector{<:LieAlgebraElem{C}}; check::Bool=true) where {C<:RingElement}
hom(::LieAlgebra{C}, ::LieAlgebra{C}, ::MatElem{C}; check::Bool=true) where {C<:RingElement}
identity_map(::LieAlgebra)
zero_map(::LieAlgebra{C}, ::LieAlgebra{C}) where {C<:RingElement}
```

## Functions
Expand Down
1 change: 1 addition & 0 deletions experimental/LieAlgebras/docs/src/module_homs.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ or a $\dim V_1 \times \dim V_2$ matrix.
hom(::LieAlgebraModule{C}, ::LieAlgebraModule{C}, ::Vector{<:LieAlgebraModuleElem{C}}; check::Bool=true) where {C<:RingElement}
hom(::LieAlgebraModule{C}, ::LieAlgebraModule{C}, ::MatElem{C}; check::Bool=true) where {C<:RingElement}
identity_map(::LieAlgebraModule)
zero_map(::LieAlgebraModule{C}, ::LieAlgebraModule{C}) where {C<:RingElement}
```

## Functions
Expand Down
27 changes: 27 additions & 0 deletions experimental/LieAlgebras/src/LieAlgebraHom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,30 @@ Lie algebra morphism
function identity_map(L::LieAlgebra)
return hom(L, L, basis(L); check=false)
end

@doc raw"""
zero_map(L1::LieAlgebra, L2::LieAlgebra) -> LieAlgebraHom
zero_map(L::LieAlgebra) -> LieAlgebraHom
Construct the zero map from `L1` to `L2` or from `L` to `L`.
# Examples
```jldoctest
julia> L = special_linear_lie_algebra(QQ, 3)
Special linear Lie algebra of degree 3
of dimension 8
over rational field
julia> zero_map(L)
Lie algebra morphism
from special linear Lie algebra of degree 3 over QQ
to special linear Lie algebra of degree 3 over QQ
```
"""
function zero_map(L1::LieAlgebra{C}, L2::LieAlgebra{C}) where {C<:RingElement}
return hom(L1, L2, zero_matrix(coefficient_ring(L2), dim(L1), dim(L2)); check=false)
end

function zero_map(L::LieAlgebra)
return zero_map(L, L)
end
29 changes: 29 additions & 0 deletions experimental/LieAlgebras/src/LieAlgebraModuleHom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,35 @@ function identity_map(V::LieAlgebraModule)
return hom(V, V, basis(V); check=false)
end

@doc raw"""
zero_map(V1::LieAlgebraModule, V2::LieAlgebraModule) -> LieAlgebraModuleHom
zero_map(V::LieAlgebraModule) -> LieAlgebraModuleHom
Construct the zero map from `V1` to `V2` or from `V` to `V`.
# Examples
```jldoctest
julia> L = special_linear_lie_algebra(QQ, 3);
julia> V = standard_module(L)
Standard module
of dimension 3
over special linear Lie algebra of degree 3 over QQ
julia> zero_map(V)
Lie algebra module morphism
from standard module of dimension 3 over sl_3
to standard module of dimension 3 over sl_3
```
"""
function zero_map(V1::LieAlgebraModule{C}, V2::LieAlgebraModule{C}) where {C<:RingElement}
return hom(V1, V2, zero_matrix(coefficient_ring(V2), dim(V1), dim(V2)); check=false)
end

function zero_map(V::LieAlgebraModule)
return zero_map(V, V)
end

###############################################################################
#
# Hom constructions
Expand Down
1 change: 1 addition & 0 deletions experimental/LieAlgebras/src/LieAlgebras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import ..Oscar:
symbols,
symmetric_power,
tensor_product,
zero_map,
,

Expand Down
27 changes: 27 additions & 0 deletions experimental/LieAlgebras/test/LieAlgebraHom-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,31 @@
@test h(ideal(L, [x2, x3, x4])) == sub(L, [x3])
end

@testset "Identity and zero map" begin
L1 = special_linear_lie_algebra(QQ, 3)
L2 = general_linear_lie_algebra(QQ, 3)

h = identity_map(L1)
@test domain(h) == L1
@test codomain(h) == L1
@test matrix(h) == identity_matrix(QQ, dim(L1))
for x in basis(L1)
@test h(x) == x
end
@test image(h) == sub(L1)
@test kernel(h) == ideal(L1, [zero(L1)])

h = zero_map(L1, L2)
@test domain(h) == L1
@test codomain(h) == L2
@test matrix(h) == zero_matrix(QQ, dim(L1), dim(L2))
for x in basis(L1)
@test h(x) == zero(L2)
end
@test image(h) == sub(L2, [zero(L2)])
@test kernel(h) == ideal(L1)
end

@testset "Composition" begin
L1 = special_linear_lie_algebra(QQ, 2)
L2 = special_linear_lie_algebra(QQ, 3)
Expand Down Expand Up @@ -76,6 +101,8 @@

@test is_isomorphism(identity_map(L1))
@test identity_map(L1) == inv(identity_map(L1))

@test !is_isomorphism(zero_map(L1))
end

@testset "Hum72, Exercise 2.10" begin
Expand Down

0 comments on commit 2879b6b

Please sign in to comment.