Skip to content

Commit

Permalink
Workaround show functions
Browse files Browse the repository at this point in the history
to not change output right now
  • Loading branch information
lgoettgens committed Nov 15, 2024
1 parent a2da730 commit 22fe6f6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import Oscar: dim
import Oscar: monomial_ordering
import Oscar: monomials

using Oscar.LieAlgebras: lie_algebra_simple_module_struct_consts_gap
using Oscar.LieAlgebras:
_root_system_type_string,
lie_algebra_simple_module_struct_consts_gap

# temp imports until `LieAlgebraStructure` is abolished
import Oscar: cartan_matrix, coefficient_ring, dim_of_simple_module, rank, root_system
Expand Down
7 changes: 5 additions & 2 deletions experimental/BasisLieHighestWeight/src/LieAlgebras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ function coefficient_ring(L::LieAlgebraStructure)
end

function Base.show(io::IO, L::LieAlgebraStructure)
io = pretty(io)
print(io, LowercaseOff(), "Lie algebra of type $(L.lie_type)$(rank(L))")
show(io, L.lie_algebra)
end

function Base.show(io::IO, mime::MIME, L::LieAlgebraStructure)
show(io, mime, L.lie_algebra)
end

function lie_algebra(type::Symbol, rk::Int)
Expand Down
34 changes: 32 additions & 2 deletions experimental/BasisLieHighestWeight/src/MonomialBasis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,22 @@ function Base.show(io::IO, ::MIME"text/plain", basis::MonomialBasis)
print(io, Indent(), "\nof highest weight $(Int.(Oscar._vec(coefficients(highest_weight(basis)))))", Dedent())
print(io, Indent(), "\nof dimension $(dim(basis))", Dedent())
print(io, Indent(), "\nwith monomial ordering $(monomial_ordering(basis))", Dedent())
print(io, "\nover ", Lowercase(), base_lie_algebra(basis))
# TODO: use the following line instead of printing workaround below
# print(io, "\nover ", Lowercase(), base_lie_algebra(basis))
# begin of workaround
L = base_lie_algebra(basis).lie_algebra
print(io, "\nover Lie algebra")
if has_root_system(L)
rs = root_system(L)
if has_root_system_type(rs)
type, ord = root_system_type_with_ordering(rs)
print(io, " of type ", _root_system_type_string(type))
if !issorted(ord)
print(io, " (non-canonical ordering)")
end
end
end
# end of workaround
if get_attribute(basis, :algorithm, nothing) === basis_lie_highest_weight_compute
print(
io,
Expand Down Expand Up @@ -100,6 +115,21 @@ function Base.show(io::IO, basis::MonomialBasis)
io,
"Monomial basis of a highest weight module with highest weight $(Int.(Oscar._vec(coefficients(highest_weight(basis))))) over ",
)
print(terse(io), Lowercase(), base_lie_algebra(basis))
# TODO: use the following line instead of printing workaround below
# print(terse(io), Lowercase(), base_lie_algebra(basis))
# begin of workaround
L = base_lie_algebra(basis).lie_algebra
print(io, "Lie algebra")
if has_root_system(L)
rs = root_system(L)
if has_root_system_type(rs)
type, ord = root_system_type_with_ordering(rs)
print(io, " of type ", _root_system_type_string(type))
if !issorted(ord)
print(io, " (non-canonical ordering)")
end
end
end
# end of workaround
end
end

0 comments on commit 22fe6f6

Please sign in to comment.