Skip to content

Commit

Permalink
Cache cartan_symmetrizer
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Aug 20, 2024
1 parent 05dd5af commit 6c16446
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion experimental/LieAlgebras/src/RootSystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ function cartan_matrix(R::RootSystem)
return R.cartan_matrix
end

@attr Vector{ZZRingElem} function cartan_symmetrizer(R::RootSystem)
return cartan_symmetrizer(cartan_matrix(R); check=false)
end

@doc raw"""
coroot(R::RootSystem, i::Int) -> RootSpaceElem
Expand Down Expand Up @@ -912,8 +916,9 @@ end
function dot(r::RootSpaceElem, w::WeightLatticeElem)
@req root_system(r) === root_system(w) "parent root system mismatch"

symmetrizer = cartan_symmetrizer(root_system(r))
return sum(
r[i] * cartan_symmetrizer(cartan_matrix(root_system(r)); check=false)[i] * w[i] for
r[i] * symmetrizer[i] * w[i] for
i in 1:rank(root_system(r));
init=zero(QQ),
)
Expand Down

0 comments on commit 6c16446

Please sign in to comment.