Skip to content

Commit

Permalink
LieAlgebras: Add hom_tensor
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Aug 31, 2023
1 parent 864576e commit c10bde7
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
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 @@ -57,4 +57,5 @@ canonical_injections(::LieAlgebraModule)
canonical_injection(::LieAlgebraModule, ::Int)
canonical_projections(::LieAlgebraModule)
canonical_projection(::LieAlgebraModule, ::Int)
hom_tensor(::LieAlgebraModule{C}, ::LieAlgebraModule{C}, ::Vector{<:LieAlgebraModuleHom}) where {C<:RingElement}
```
31 changes: 31 additions & 0 deletions experimental/LieAlgebras/src/LieAlgebraModuleHom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -384,3 +384,34 @@ function canonical_projection(V::LieAlgebraModule, i::Int)
)
return proj
end

# function hom_direct_sum(...)
# end

@doc raw"""
hom_tensor(V::LieAlgebraModule{C}, W::LieAlgebraModule{C}, hs::Vector{<:LieAlgebraModuleHom}) -> LieAlgebraModuleHom
Given modules `V` and `W` which are tensor products with the same number of factors,
say $V = V_1 \otimes \cdots \otimes V_r$, $W = W_1 \otimes \cdots \otimes W_r$,
and given a vector `hs` of homomorphisms $a_i : V_i \to W_i$, return
$a_1 \otimes \cdots \otimes a_r$.
"""
function hom_tensor(
V::LieAlgebraModule{C}, W::LieAlgebraModule{C}, hs::Vector{<:LieAlgebraModuleHom}
) where {C<:RingElement}
@req is_tensor_product(V) "First module must be a tensor product"
@req is_tensor_product(W) "Second module must be a tensor product"
Vs = base_modules(V)
Ws = base_modules(W)

@req length(Vs) == length(Ws) == length(hs) "Length mismatch"
@req all(i -> domain(hs[i]) === Vs[i] && codomain(hs[i]) === Ws[i], 1:length(hs)) "Domain/codomain mismatch"
decompose_V = get_attribute(V, :tensor_generator_decompose_function)::Function
pure_W = get_attribute(W, :tensor_pure_function)::Function
function map_basis(v)
v_decomposed = decompose_V(v)
image_as_tuple = Tuple(hi(vi) for (hi, vi) in zip(hs, v_decomposed))
return pure_W(image_as_tuple)
end
return hom(V, W, map(map_basis, basis(V)); check=false)
end
1 change: 1 addition & 0 deletions experimental/LieAlgebras/src/LieAlgebras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import ..Oscar:
gen,
gens,
hom,
hom_tensor,
identity_map,
ideal,
image,
Expand Down
17 changes: 17 additions & 0 deletions experimental/LieAlgebras/test/LieAlgebraModuleHom-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,21 @@
proj * inj for (proj, inj) in zip(canonical_projections(V), canonical_injections(V))
) == identity_map(V)
end

@testset "hom_tensor" begin
L = special_orthogonal_lie_algebra(QQ, 4)
V11 = standard_module(L)
V12 = dual(standard_module(L))
V21 = dual(dual(standard_module(L)))
V22 = exterior_power(standard_module(L), 2)
V1 = tensor_product(V11, V12)
V2 = tensor_product(V21, V22)
h1 = hom(V11, V21, basis(V21))
h2 = hom(V12, V22, [zero(V22) for _ in basis(V12)])

h = hom_tensor(V1, V2, [h1, h2])
@test domain(h) == V1
@test codomain(h) == V2
@test is_welldefined(h)
end
end

0 comments on commit c10bde7

Please sign in to comment.