Skip to content

Commit

Permalink
Remove two constructors
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Nov 8, 2024
1 parent fe0e885 commit ab8fc1a
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions experimental/LieAlgebras/src/RootSystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -635,16 +635,12 @@ function RootSpaceElem(root_system::RootSystem, vec::Vector{<:RationalUnion})
return RootSpaceElem(root_system, matrix(QQ, 1, length(vec), vec))
end

function RootSpaceElem(R::RootSystem, w::WeightLatticeElem)
@req root_system(w) === R "Root system mismatch"
function RootSpaceElem(w::WeightLatticeElem)
R = root_system(w)
coeffs = coefficients(w) * cartan_matrix_inv_tr(R)
return RootSpaceElem(R, matrix(QQ, coeffs))
end

function RootSpaceElem(w::WeightLatticeElem)
return RootSpaceElem(root_system(w), w)
end

function zero(::Type{RootSpaceElem}, R::RootSystem)
return RootSpaceElem(R, zero_matrix(QQ, 1, rank(R)))
end
Expand Down Expand Up @@ -1048,17 +1044,13 @@ function WeightLatticeElem(R::RootSystem, v::Vector{<:IntegerUnion})
return WeightLatticeElem(R, matrix(ZZ, 1, rank(R), v))
end

function WeightLatticeElem(R::RootSystem, r::RootSpaceElem)
@req root_system(r) === R "Root system mismatch"
function WeightLatticeElem(r::RootSpaceElem)
R = root_system(r)
coeffs = coefficients(r) * cartan_matrix_tr(R)
@req all(is_integer, coeffs) "RootSpaceElem does not correspond to a weight"
return WeightLatticeElem(R, matrix(ZZ, coeffs))
end

function WeightLatticeElem(r::RootSpaceElem)
return WeightLatticeElem(root_system(r), r)
end

function zero(::Type{WeightLatticeElem}, R::RootSystem)
return WeightLatticeElem(R, zero_matrix(ZZ, 1, rank(R)))
end
Expand Down

0 comments on commit ab8fc1a

Please sign in to comment.