Skip to content

Commit

Permalink
Add centralizer and normalizer
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Jul 20, 2023
1 parent 6a12d51 commit b3f16df
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 7 deletions.
24 changes: 20 additions & 4 deletions experimental/LieAlgebras/src/LieAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ end

###############################################################################
#
# Important ideals
# Important ideals and subalgebras
#
###############################################################################

Expand All @@ -280,9 +280,6 @@ function derived_algebra(L::LieAlgebra)
end

function center(L::LieAlgebra)
characteristic(coefficient_ring(L)) == 2 &&
error("GAP does something else for char 2 which is not implemented here.")

dim(L) == 0 && return ideal(L, [])

mat = zero_matrix(coefficient_ring(L), dim(L), dim(L)^2)
Expand All @@ -296,6 +293,24 @@ function center(L::LieAlgebra)
return ideal(L, [L(c_basis[i, :]) for i in 1:c_dim]; is_basis=true)
end

function centralizer(L::LieAlgebra, xs::AbstractVector{<:LieAlgebraElem})
@req all(x -> parent(x) == L, xs) "Incompatible Lie algebras."

mat = zero_matrix(coefficient_ring(L), dim(L), dim(L) * length(xs))
for (i, bi) in enumerate(basis(L))
for (j, xj) in enumerate(xs)
mat[i, ((j - 1) * dim(L) + 1):(j * dim(L))] = _matrix(bracket(bi, xj))
end
end

c_dim, c_basis = left_kernel(mat)
return sub(L, [L(c_basis[i, :]) for i in 1:c_dim]; is_basis=true)
end

function centralizer(L::LieAlgebra, x::LieAlgebraElem)
return centralizer(L, [x])
end

###############################################################################
#
# Properties
Expand All @@ -307,6 +322,7 @@ function is_abelian(L::LieAlgebra)
end

function is_simple(L::LieAlgebra)
is_abelian(L) && return false
error("Not implemented.") # TODO
end

Expand Down
20 changes: 20 additions & 0 deletions experimental/LieAlgebras/src/LieAlgebraIdeal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,21 @@ function bracket(
return ideal(base_lie_algebra(I1), [x * y for x in gens(I1) for y in gens(I2)])
end

###############################################################################
#
# Important ideals and subalgebras
#
###############################################################################

function normalizer(L::LieAlgebra, I::LieAlgebraIdeal)
@req parent(I) == L "Incompatible Lie algebras."
return normalizer(L, sub(L, I))
end

function centralizer(L::LieAlgebra, I::LieAlgebraIdeal)
return centralizer(L, basis(I))
end

###############################################################################
#
# Conversion
Expand All @@ -170,6 +185,11 @@ function lie_algebra(
return lie_algebra(basis(I))
end

function sub(L::LieAlgebra{C}, I::LieAlgebraIdeal{C}) where {C<:RingElement}
@req base_lie_algebra(I) === L "Incompatible Lie algebras."
return sub(L, basis(I); is_basis=true)
end

###############################################################################
#
# Constructor
Expand Down
4 changes: 4 additions & 0 deletions experimental/LieAlgebras/src/LieAlgebras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ..Oscar:
basis,
basis_matrix,
center,
centralizer,
coeff,
coefficient_ring,
coefficients,
Expand All @@ -31,6 +32,7 @@ import ..Oscar:
is_abelian,
is_simple,
ngens,
normalizer,
parent_type,
sub,
symbols,
Expand Down Expand Up @@ -62,6 +64,7 @@ export highest_weight_module
export is_direct_sum
export is_dual
export is_exterior_power
export is_self_normalizing
export is_standard_module
export is_symmetric_power
export is_tensor_power
Expand Down Expand Up @@ -113,6 +116,7 @@ export highest_weight_module
export is_direct_sum
export is_dual
export is_exterior_power
export is_self_normalizing
export is_standard_module
export is_symmetric_power
export is_tensor_power
Expand Down
49 changes: 47 additions & 2 deletions experimental/LieAlgebras/src/LieSubalgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,51 @@ function bracket(
return ideal(base_lie_algebra(S1), [x * y for x in gens(S1) for y in gens(S2)])
end

###############################################################################
#
# Important ideals and subalgebras
#
###############################################################################

function normalizer(L::LieAlgebra, S::LieSubalgebra)
@req base_lie_algebra(S) == L "Incompatible Lie algebras."

mat = zero_matrix(coefficient_ring(L), dim(L) + dim(S)^2, dim(L) * dim(S))
for (i, bi) in enumerate(basis(L))
for (j, sj) in enumerate(basis(S))
mat[i, ((j - 1) * dim(L) + 1):(j * dim(L))] = _matrix(bracket(bi, sj))
end
end
for i in 1:dim(S)
mat[(dim(L) + (i - 1) * dim(S) + 1):(dim(L) + i * dim(S)), ((i - 1) * dim(L) + 1):(i * dim(L))] = basis_matrix(
S
)
end
show(stdout, MIME"text/plain"(), mat)
println("")
sol_dim, sol = left_kernel(mat)
sol = sol[:, 1:dim(L)]
c_dim, c_basis = rref(sol)
println(c_dim)
show(stdout, MIME"text/plain"(), c_basis)
println("")
return sub(L, [L(c_basis[i, :]) for i in 1:c_dim]; is_basis=true)
end

function centralizer(L::LieAlgebra, S::LieSubalgebra)
return centralizer(L, basis(S))
end

###############################################################################
#
# Properties
#
###############################################################################

function is_self_normalizing(S::LieSubalgebra)
return normalizer(base_lie_algebra(S), S) == S
end

###############################################################################
#
# Conversion
Expand All @@ -159,7 +204,7 @@ end
function lie_algebra(
S::LieSubalgebra{C,LieT}
) where {C<:RingElement,LieT<:LieAlgebraElem{C}}
return lie_algebra(basis(S))
return lie_algebra(basis(S)) #, embedding_hom # TODO
end

###############################################################################
Expand All @@ -169,7 +214,7 @@ end
###############################################################################

function sub(L::LieAlgebra, gens::Vector; is_basis::Bool=false)
return LieSubalgebra{elem_type(coefficient_ring(L)),elem_type(L)}(L, gens; is_basis) #, embedding_hom # TODO
return LieSubalgebra{elem_type(coefficient_ring(L)),elem_type(L)}(L, gens; is_basis)
end

function sub(L::LieAlgebra{C}, gen::LieAlgebraElem{C}) where {C<:RingElement}
Expand Down
2 changes: 1 addition & 1 deletion experimental/LieAlgebras/src/LinearLieAlgebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function lie_algebra(
R = coefficient_ring(parent_L)
n = parent_L.n
s = map(AbstractAlgebra.obj_to_string, basis)
return lie_algebra(R, n, basis, s; check)
return lie_algebra(R, n, matrix_repr.(basis), s; check)
end

@doc raw"""
Expand Down

0 comments on commit b3f16df

Please sign in to comment.