Skip to content

Commit

Permalink
minor changes to simple_lie_algebra-test.jl to be compatible with sim…
Browse files Browse the repository at this point in the history
…ple_lie_algebra.jl
  • Loading branch information
voggesbe committed Aug 1, 2023
1 parent ff5c445 commit ff58878
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 28 deletions.
50 changes: 23 additions & 27 deletions experimental/LieAlgebras/src/simple_lie_algebra.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ parent(x::SimpleLieAlgebraElem{C}) where {C<:RingElement} = x.parent

base_ring(L::SimpleLieAlgebra{C}) where {C<:RingElement} = L.base_ring::parent_type(C)

coefficient_ring(L::SimpleLieAlgebra{C}) where {C<:RingElement} = L.base_ring::parent_type(C)

dim(L::SimpleLieAlgebra{C}) where {C<:RingElement} = L.dim

root_system(L::SimpleLieAlgebra{C}) where {C<:RingElement} = L.root_system
Expand All @@ -86,32 +84,32 @@ end
# String I/O
#
###############################################################################
# function Base.show(io::IO, ::MIME"text/plain", L::SimpleLieAlgebra)
# io = pretty(io)
# println(io, "Simple Lie algebra")
# println(
# io, Indent(), "of type $(string(root_type(L)[1])*string(root_type(L)[2]))", Dedent()
# )
# println(io, Indent(), "of dimension $(dim(L))", Dedent())
# print(io, "over ")
# print(io, Lowercase(), coefficient_ring(L))
# end

# function Base.show(io::IO, L::SimpleLieAlgebra)
# if get(io, :supercompact, false)
# print(io, "Simple Lie algebra")
# else
# io = pretty(io)
# print(io, "Simple Lie algebra over ", Lowercase())
# print(IOContext(io, :supercompact => true), coefficient_ring(L))
# end
# end
function Base.show(io::IO, ::MIME"text/plain", L::SimpleLieAlgebra)
io = pretty(io)
println(io, "Simple Lie algebra")
println(
io, Indent(), "of type $(string(root_type(L)[1])*string(root_type(L)[2]))", Dedent()
)
println(io, Indent(), "of dimension $(dim(L))", Dedent())
print(io, "over ")
print(io, Lowercase(), coefficient_ring(L))
end

function Base.show(io::IO, V::SimpleLieAlgebra)
print(io, "Simple Lie Algebra over ")
print(IOContext(io, :compact => true), base_ring(V))
function Base.show(io::IO, L::SimpleLieAlgebra)
if get(io, :supercompact, false)
print(io, "Simple Lie algebra")
else
io = pretty(io)
print(io, "Simple Lie algebra over ", Lowercase())
print(IOContext(io, :supercompact => true), coefficient_ring(L))
end
end

# function Base.show(io::IO, V::SimpleLieAlgebra)
# print(io, "Simple Lie Algebra over ")
# print(IOContext(io, :compact => true), base_ring(V))
# end


###############################################################################
#
Expand All @@ -134,8 +132,6 @@ function bracket(
return L(mat)
end



###############################################################################
#
# Comparison
Expand Down
2 changes: 1 addition & 1 deletion experimental/LieAlgebras/test/simple_lie_algebra-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@test base_ring(a) == QQ
@test root_system(L) == RootSystem("A2")
@test root_type(L) == ("A", 2)
@test matrix(a) == zero_matrix(QQ, 1, 8)
@test Generic._matrix(a) == zero_matrix(QQ, 1, 8)
@test characteristic(L) == 0
@test symbols(L) == [Symbol("e_$i") for i in 1:8]
@test chevalley_basis(L) == [[L([1,0,0,0,0,0,0,0]), L([0,1,0,0,0,0,0,0]), L([0,0,1,0,0,0,0,0])],
Expand Down

0 comments on commit ff58878

Please sign in to comment.