In an earlier post I computed the quadratic Casimir element in the universal enveloping algebra \(U(\mathfrak g)\) of a semisimple Lie algebra \(\mathfrak g\) using Sage. The construction was very concrete: one chooses a basis of \(\mathfrak g\), writes down the Killing form matrix, inverts it, and forms the familiar element \[ \Omega_2 = \sum_i X_i X^i \in U(\mathfrak g), \] where \(\{X_i\}\) is a basis and \(\{X^i\}\) is the dual basis with respect to the Killing form.
It is natural to ask whether there is a uniform way to produce Casimir–type central elements of higher degree: elements in \(Z\big(U(\mathfrak g)\big)\) that arise from invariant homogeneous polynomials of degree \(d\) on \(\mathfrak g\). From the general theory one knows that all central elements are obtained from invariant polynomials \(f \in S(\mathfrak g)^{\mathfrak g}\) by the PBW symmetrisation map; conversely, every invariant polynomial produces a central element in this way.
Today, I’ll show how to turn this abstract picture into Sage code. The code is written so that, given a homogeneous invariant polynomial of degree \(d\) coming from the adjoint representation, we produce the corresponding degree–\(d\) Casimir–type element by polarisation and PBW symmetrisation. For \(d=2\) we recover the quadratic Casimir while in other degrees we get the central element associated to the invariant polynomial \[ x \longmapsto \mathrm{Tr}\big(\operatorname{ad}(x)^d\big). \]
There is one important representation–theoretic caveat. For a semisimple Lie algebra \(\mathfrak g\), the odd–degree trace polynomials \(\mathrm{Tr}(\operatorname{ad}(x)^d)\) vanish identically. So, the construction gives zero when \(d\) is odd. For even \(d\) the resulting central elements are generally non–primitive: they can be expressed as polynomials in the fundamental Casimirs given by the exponents of \(\mathfrak g\). The point of the code is not to solve invariant theory, but to implement faithfully the mechanism that generates central elements from invariant polynomials in a way that works uniformly for all degrees.
Let \(\mathfrak g\) be a finite–dimensional semisimple Lie algebra and let \(U(\mathfrak g)\) be its universal enveloping algebra. The adjoint representation \[ \operatorname{ad}\colon \mathfrak g \longrightarrow \mathfrak{gl}(\mathfrak g), \qquad \operatorname{ad}(x)(y) = [x,y] \] is a faithful representation of \(\mathfrak g\) on itself. For each integer \(d \geq 1\) we can consider the map \[ f_d\colon \mathfrak g \longrightarrow \mathbb C, \qquad f_d(x) = \operatorname{Tr}\big(\operatorname{ad}(x)^d\big). \] The trace is conjugation–invariant, so \(f_d\) is invariant under the adjoint group of \(\mathfrak g\); in particular \(f_d\) is a homogeneous polynomial function of degree \(d\) on \(\mathfrak g\), and it lies in the invariant subalgebra \[ S(\mathfrak g)^{\mathfrak g} \subseteq S(\mathfrak g), \] where \(S(\mathfrak g)\) is the symmetric algebra on \(\mathfrak g\).
More explicitly, fix a basis \(\{X_0,\dots,X_{n-1}\}\) of \(\mathfrak g\) and write \[ x = \sum_{i=0}^{n-1} t_i X_i \] with commuting coordinate functions \(t_0,\dots,t_{n-1}\). With respect to this basis, \(\operatorname{ad}(x)\) is a matrix whose entries are homogeneous linear forms in the \(t_i\), so its \(d\)-th power \(\operatorname{ad}(x)^d\) has entries that are homogeneous degree–\(d\) polynomials in the \(t_i\), and the trace \[ f_d(t_0,\dots,t_{n-1}) = \operatorname{Tr}\big(\operatorname{ad}(x)^d\big) \] is a homogeneous polynomial of total degree \(d\). The invariance of \(f_d\) under the adjoint group is simply the fact that \[ \operatorname{ad}(\operatorname{Ad}(g)x) = \operatorname{Ad}(g)\,\operatorname{ad}(x)\,\operatorname{Ad}(g)^{-1} \] and the trace is invariant under conjugation. Thus each \(f_d\) defines an element of \(S^d(\mathfrak g^\vee)^{\mathfrak g}\).
The symmetric algebra \(S(\mathfrak g)\) is naturally isomorphic, as a graded vector space, to the algebra of polynomial functions on \(\mathfrak g\). Each homogeneous polynomial \(f_d\) can be viewed as a symmetric \(d\)–linear form \[ T_d\colon \mathfrak g^{\times d} \longrightarrow \mathbb C, \] obtained from \(f_d\) by polarisation. If we write \(f_d\) as a polynomial in the coordinates \(t_i\), \[ f_d(t_0,\dots,t_{n-1}) = \sum_{i_1,\dots,i_d} c_{i_1\cdots i_d}\, t_{i_1}\cdots t_{i_d}, \] then the coefficients \(c_{i_1\cdots i_d}\) are exactly the values of the symmetric \(d\)–linear form on the basis, \[ T_d(X_{i_1},\dots,X_{i_d}) = c_{i_1\cdots i_d}. \] Equivalently, one has the polarisation formula \[ T_d(X_{i_1},\dots,X_{i_d}) = \frac{1}{d!}\, \frac{\partial^d}{\partial t_{i_1}\cdots\partial t_{i_d}} f_d(t) \bigg|_{t=0}. \]
On the other hand, the Poincaré–Birkhoff–Witt symmetrisation map \[ \operatorname{sym}\colon S(\mathfrak g)\longrightarrow U(\mathfrak g), \qquad \operatorname{sym}(X_{i_1}\cdots X_{i_d}) = \frac{1}{d!}\sum_{\sigma\in S_d} X_{i_{\sigma(1)}}\cdots X_{i_{\sigma(d)}}, \] is a filtered linear isomorphism whose associated graded map is the identity. It is \(\mathfrak g\)–equivariant with respect to the adjoint action, and therefore it restricts to an isomorphism \[ \operatorname{sym}\colon S(\mathfrak g)^{\mathfrak g} \overset{\sim}{\longrightarrow} U(\mathfrak g)^{\mathfrak g} = Z\big(U(\mathfrak g)\big). \] In particular, if we take the invariant polynomial \(f_d\) (or, equivalently, the symmetric tensor \(T_d\)) and apply PBW symmetrisation, we obtain a central element \[ C_d = \sum_{i_1,\dots,i_d} T_d(X_{i_1},\dots,X_{i_d})\, \operatorname{sym}(X_{i_1}\cdots X_{i_d}) \in Z\big(U(\mathfrak g)\big). \]
The quadratic Casimir is the special case \(d=2\): the polynomial \(f_2(x)=\mathrm{Tr}(\operatorname{ad}(x)^2)\) is (a scalar multiple of) the Killing form \(\kappa(x,x)\), and the corresponding \(C_2\) is the usual Casimir element \(\sum X_i X^i\). For \(d>2\) the central elements \(C_d\) coming from the adjoint trace are in general not algebraically independent; the structure theorem for \(S(\mathfrak g)^{\mathfrak g}\) says that this invariant ring is a polynomial algebra on \(\ell\) generators of degrees \(m_i+1\), where \(m_i\) are the exponents of \(\mathfrak g\), and only those degrees can carry primitive generators.
There is an additional phenomenon for odd \(d\). If \(d\) is odd and \(\mathfrak g\) is semisimple, then \(f_d(x) = \mathrm{Tr}(\operatorname{ad}(x)^d)\) vanishes identically. Indeed, fix a Cartan subalgebra \(\mathfrak h\) and decompose \(\mathfrak g = \mathfrak h \oplus \bigoplus_{\alpha\in\Phi} \mathfrak g_\alpha\). For \(H\in\mathfrak h\), the eigenvalues of \(\operatorname{ad}(H)\) are \(0\) on \(\mathfrak h\), \(\alpha(H)\) on \(\mathfrak g_\alpha\), and \(-\alpha(H)\) on \(\mathfrak g_{-\alpha}\). Therefore \[ \operatorname{Tr}\big(\operatorname{ad}(H)^d\big) = \sum_{\alpha\in\Phi} \alpha(H)^d + (-\alpha(H))^d = 0 \] for every odd \(d\). The trace is \(\operatorname{Ad}\)–invariant, so this identity holds on all of \(\mathfrak g\). Thus for odd \(d\) the coefficients \(T_d(X_{i_1},\dots,X_{i_d})\) all vanish and the central element \(C_d\) is zero.
The upshot is that the adjoint–trace construction gives a uniform recipe for a degree–\(d\) Casimir–type element, but for a semisimple \(\mathfrak g\) one only gets nontrivial information in the even degrees. The only genuinely primitive central generator that appears this way is the quadratic Casimir \(C_2\). The higher \(C_d\) are polynomials in the fundamental Casimirs determined by the exponents.
I now explain how to turn the discussion above into Sage code. The basic ingredients are:
L,The starting point is a finite–dimensional Lie algebra object
L in Sage, together with an ordered basis
B = list(L.basis()). We first construct the matrices of the
adjoint representation in this basis.
from sage.matrix.constructor import matrix
from itertools import product, permutations
from math import factorial
def adjoint_matrices(L):
"""
Return a list of matrices [A_0, ..., A_{n-1}] representing the adjoint
action of a finite-dimensional Lie algebra L in its own basis.
If B = (X_0,...,X_{n-1}) is L.basis() in that order, then A_i is the
matrix of ad(X_i): L -> L in the basis B, i.e. the j-th column of A_i
is the coordinate vector of [X_i, X_j].
"""
B = list(L.basis())
n = len(B)
K = L.base_ring()
mats = []
for i, x in enumerate(B):
M = matrix(K, n, n)
for j, y in enumerate(B):
br = L.bracket(x, y) # element of L
v = br.to_vector() # coordinates in the basis B
# v[k] is the coefficient of B[k] in [x,y]
for k in range(n):
M[k, j] = v[k]
mats.append(M)
return matsLet us test:
adjoint_matrices(LieAlgebra(QQ, cartan_type=['A',1]))[
[ 0 -2 0] [ 2 0 0] [ 0 0 0]
[ 0 0 1] [ 0 0 0] [-1 0 0]
[ 0 0 0], [ 0 0 -2], [ 0 2 0]
]
Given these matrices, the degree–\(d\) invariant polynomial \(f_d(x) = \mathrm{Tr}(\operatorname{ad}(x)^d)\) is obtained by forming the generic matrix \[ \operatorname{ad}(x) = \sum_{i=0}^{n-1} t_i A_i \] over a polynomial ring in the formal variables \(t_i\), taking the \(d\)-th power, and then the trace.
def invariant_polynomial(L, d):
"""
Compute f(t) = Tr(ad(x)^d) where x = sum t_i X_i and X_i is the basis of L.
Return the polynomial f and the tuple of variables t.
"""
B = L.basis().list()
n = len(B)
K = L.base_ring()
mats = adjoint_matrices(L)
R = PolynomialRing(K, 't', n)
t = R.gens()
Mx = sum(t[i] * matrix(R, mats[i]) for i in range(n))
f = (Mx**d).trace() # homogeneous degree-d polynomial in the t_i
return f, tLet us test:
invariant_polynomial(LieAlgebra(QQ, cartan_type=['A',1]),2)(8*t1^2 + 8*t0*t2, (t0, t1, t2))
At this point f is the coordinate expression of \(f_d\), and t is the tuple of
coordinate functions. To get the central element \(C_d\) in the enveloping algebra we have to
polarise \(f\) and symmetrise in the
PBW algebra. This is done by the function casimir_of_degree
below.
def casimir_of_degree(L, d):
"""
Given a finite-dimensional Lie algebra L over a field K and a function
invariant_polynomial(L,d) returning the homogeneous invariant polynomial
f(t) = f(x) = Tr(ρ(x)^d)
of degree d in coordinates t_i for x = Σ t_i X_i (basis of L),
construct the corresponding degree-d Casimir-type element in U(L) by
polarisation and PBW symmetrisation.
This generalises the quadratic Casimir construction: for d=2 and
f(x) = κ(x,x) one recovers the usual quadratic Casimir up to normalisation.
"""
B = L.basis().list()
n = len(B)
K = L.base_ring()
# f(t) homogeneous of degree d, with t = (t_0,...,t_{n-1})
f, t = invariant_polynomial(L, d)
R = f.parent()
# substitution t_i = 0 for all i
subs0 = {ti: R(0) for ti in t}
C = 0
for multi in product(range(n), repeat=d):
g = f
for idx in multi:
g = g.derivative(t[idx])
c_poly = g.subs(subs0)
if c_poly == 0:
continue
# polarisation factor 1/d!
c = K(c_poly) / K(factorial(d))
# fully symmetrised product of the basis elements indexed by 'multi'
perms = set(permutations(multi))
sym_word = 0
for p in perms:
m = 1
for j in p:
m *= B[j]
sym_word += m
sym_word = sym_word / K(len(perms))
C += c * sym_word
return CConceptually, the loop over
multi in product(range(n), repeat=d) runs over all
multi–indices \((i_1,\dots,i_d)\). The
repeated differentiation \[
g = f,\quad g = \frac{\partial g}{\partial t_{i_1}},\quad
g = \frac{\partial g}{\partial t_{i_2}},\quad \dots,\quad
g = \frac{\partial g}{\partial t_{i_d}}
\] computes the mixed partial derivative \[
\frac{\partial^d f}{\partial t_{i_1}\cdots\partial t_{i_d}},
\] and the substitution subs0 evaluates it at the
origin \(t=0\), yielding the
coefficient \[
\frac{\partial^d f}{\partial t_{i_1}\cdots\partial t_{i_d}}(0,\dots,0)
= d!\, T_d(X_{i_1},\dots,X_{i_d}).
\] Dividing by \(d!\) corrects
for this factor and produces the symmetric multilinear coefficient \(T_d(X_{i_1},\dots,X_{i_d})\). The inner
loop over perms constructs the fully symmetrised product
\[
\operatorname{sym}(X_{i_1}\cdots X_{i_d})
= \frac{1}{|\mathrm{Orb}(i_1,\dots,i_d)|}\sum_{\sigma\in S_d}
X_{i_{\sigma(1)}}\cdots X_{i_{\sigma(d)}},
\] taking into account that some multi–indices may have repeated
entries and hence fewer distinct permutations.
Putting these pieces together, the function
casimir_of_degree(L, d) returns exactly the central element
\[
C_d
= \sum_{i_1,\dots,i_d} T_d(X_{i_1},\dots,X_{i_d})\,
\operatorname{sym}(X_{i_1}\cdots X_{i_d})
\in Z\big(U(L)\big)
\] associated to the invariant polynomial \(f_d(x) =
\mathrm{Tr}(\operatorname{ad}(x)^d)\) via PBW symmetrisation.
For example, for \(d=2\) one obtains the quadratic Casimir in the guise of the adjoint–trace Killing form. In Sage, with
casimir_of_degree(LieAlgebra(QQ, cartan_type=['A',1]), 2)8*b1^2 + 8*b0*b2 - 4*b1
one recovers, up to an overall scalar depending on the normalisation
of the Killing form, the familiar element \[
\Omega_2 \sim EF + \frac{1}{4}H(H-2)
\] for \(\mathfrak{sl}_2\). For
odd \(d\) and semisimple
L, as explained above,
invariant_polynomial(L, d) is identically zero, so
casimir_of_degree correctly returns \(0\).
The cost of this construction grows quickly with \(d\) and \(\dim L\), because of the combinatorics of multi–indices and permutations. In practice it is most reasonable for low degrees (especially \(d=2\)) and moderate rank. For larger \(d\) and more complicated types one should instead use theoretical information about the exponents and the Harish–Chandra isomorphism to identify a small generating set of invariant polynomials, and then only apply this construction to those, rather than to every \(f_d\).
Now, let us test the cases we tested in my earlier post:
casimir_of_degree(LieAlgebra(QQ, cartan_type=['A',2]),2)
casimir_of_degree(LieAlgebra(QQ, cartan_type=['B',2]),2)
casimir_of_degree(LieAlgebra(QQ, cartan_type=['C',2]),2)
casimir_of_degree(LieAlgebra(QQ, cartan_type=['E',6]),2)12*b3^2 - 12*b3*b4 + 12*b4^2 + 12*b0*b5 + 12*b1*b6 + 12*b2*b7 - 12*b3 - 12*b4
12*b4^2 - 24*b4*b5 + 24*b5^2 + 24*b0*b6 + 12*b1*b7 + 24*b2*b8 + 12*b3*b9 - 36*b4 - 30*b5
24*b4^2 - 24*b4*b5 + 12*b5^2 + 12*b0*b6 + 24*b1*b7 + 24*b2*b8 + 12*b3*b9 - 30*b4 - 36*b5
48*b36^2 + 48*b37^2 - 48*b36*b38 + 48*b38^2 - 48*b37*b39 - 48*b38*b39 + 48*b39^2 - 48*b39*b40 + 48*b40^2 - 48*b40*b41 + 48*b41^2 + 48*b0*b42 + 48*b1*b43 + 48*b2*b44 + 48*b3*b45 + 48*b4*b46 + 48*b5*b47 + 48*b6*b48 + 48*b7*b49 + 48*b8*b50 + 48*b9*b51 + 48*b10*b52 + 48*b11*b53 + 48*b12*b54 + 48*b13*b55 + 48*b14*b56 + 48*b15*b57 + 48*b16*b58 + 48*b17*b59 + 48*b18*b60 + 48*b19*b61 + 48*b20*b62 + 48*b21*b63 + 48*b22*b64 + 48*b23*b65 + 48*b24*b66 + 48*b25*b67 + 48*b26*b68 + 48*b27*b69 + 48*b28*b70 + 48*b29*b71 + 48*b30*b72 + 48*b31*b73 + 48*b32*b74 + 48*b33*b75 + 48*b34*b76 + 48*b35*b77 - 384*b36 - 528*b37 - 720*b38 - 1008*b39 - 720*b40 - 384*b41
I still wasn’t able to calculate \(E_7\) or \(E_8\), but I can calculate
casimir_of_degree(LieAlgebra(QQ, cartan_type=['A',2]),3)
casimir_of_degree(LieAlgebra(QQ, cartan_type=['A',2]),4)
casimir_of_degree(LieAlgebra(QQ, cartan_type=['A',3]),4)0
36*b3^4 - 72*b3^3*b4 + 108*b3^2*b4^2 - 72*b3*b4^3 + 36*b4^4 + 72*b0*b3^2*b5 - 72*b0*b3*b4*b5 + 72*b0*b4^2*b5 + 36*b0^2*b5^2 + 72*b1*b3^2*b6 - 72*b1*b3*b4*b6 + 72*b1*b4^2*b6 + 72*b0*b1*b5*b6 + 36*b1^2*b6^2 + 72*b2*b3^2*b7 - 72*b2*b3*b4*b7 + 72*b2*b4^2*b7 + 72*b0*b2*b5*b7 + 72*b1*b2*b6*b7 + 36*b2^2*b7^2 - 72*b3^3 - 72*b4^3 - 360*b0*b3*b5 + 252*b0*b4*b5 + 252*b1*b3*b6 - 360*b1*b4*b6 - 36*b2*b5*b6 + 36*b0*b1*b7 - 36*b2*b3*b7 - 36*b2*b4*b7 - 18*b3^2 + 162*b3*b4 - 18*b4^2 + 486*b0*b5 + 486*b1*b6 - 54*b2*b7 - 18*b3 - 18*b4
40*b6^4 - 80*b6^3*b7 + 120*b6^2*b7^2 - 80*b6*b7^3 + 40*b7^4 - 48*b6^2*b7*b8 + 48*b6*b7^2*b8 - 80*b7^3*b8 + 48*b6^2*b8^2 - 48*b6*b7*b8^2 + 120*b7^2*b8^2 - 80*b7*b8^3 + 40*b8^4 + 48*b0*b6^2*b9 - 48*b0*b6*b7*b9 + 80*b0*b7^2*b9 - 80*b0*b7*b8*b9 + 80*b0*b8^2*b9 + 40*b0^2*b9^2 + 80*b1*b6^2*b10 - 80*b1*b6*b7*b10 + 80*b1*b7^2*b10 - 32*b1*b6*b8*b10 - 80*b1*b7*b8*b10 + 80*b1*b8^2*b10 + 80*b0*b1*b9*b10 + 32*b3*b6*b9*b10 + 40*b1^2*b10^2 + 80*b2*b6^2*b11 - 80*b2*b6*b7*b11 + 80*b2*b7^2*b11 - 48*b2*b7*b8*b11 + 48*b2*b8^2*b11 + 48*b0*b2*b9*b11 + 80*b1*b2*b10*b11 - 32*b4*b8*b10*b11 - 32*b5*b9*b10*b11 + 40*b2^2*b11^2 + 32*b0*b1*b6*b12 + 80*b3*b6^2*b12 - 112*b3*b6*b7*b12 + 80*b3*b7^2*b12 + 32*b3*b6*b8*b12 - 80*b3*b7*b8*b12 + 80*b3*b8^2*b12 + 80*b0*b3*b9*b12 + 80*b1*b3*b10*b12 + 80*b2*b3*b11*b12 + 32*b0*b4*b11*b12 + 32*b5*b7*b11*b12 - 32*b5*b8*b11*b12 + 40*b3^2*b12^2 + 80*b4*b6^2*b13 - 80*b4*b6*b7*b13 + 80*b4*b7^2*b13 - 32*b1*b2*b8*b13 + 32*b4*b6*b8*b13 - 112*b4*b7*b8*b13 + 80*b4*b8^2*b13 + 32*b2*b3*b9*b13 + 80*b0*b4*b9*b13 + 32*b5*b6*b9*b13 - 32*b5*b7*b9*b13 + 80*b1*b4*b10*b13 + 80*b2*b4*b11*b13 + 48*b3*b4*b12*b13 - 32*b1*b5*b12*b13 + 40*b4^2*b13^2 - 32*b0*b1*b2*b14 + 32*b0*b4*b6*b14 + 80*b5*b6^2*b14 + 32*b2*b3*b7*b14 - 32*b0*b4*b7*b14 - 48*b5*b6*b7*b14 + 48*b5*b7^2*b14 - 32*b2*b3*b8*b14 - 32*b5*b6*b8*b14 - 48*b5*b7*b8*b14 + 80*b5*b8^2*b14 + 80*b0*b5*b9*b14 - 32*b3*b4*b10*b14 + 48*b1*b5*b10*b14 + 80*b2*b5*b11*b14 + 80*b3*b5*b12*b14 + 80*b4*b5*b13*b14 + 40*b5^2*b14^2 - 120*b6^3 - 56*b6^2*b7 + 56*b6*b7^2 - 144*b7^3 - 104*b6^2*b8 + 208*b6*b7*b8 + 56*b7^2*b8 - 104*b6*b8^2 - 56*b7*b8^2 - 120*b8^3 - 56*b0*b6*b9 - 512*b0*b7*b9 + 240*b0*b8*b9 - 360*b1*b6*b10 + 296*b1*b7*b10 - 360*b1*b8*b10 - 120*b3*b9*b10 + 240*b2*b6*b11 - 512*b2*b7*b11 - 56*b2*b8*b11 + 40*b4*b10*b11 - 40*b0*b1*b12 - 344*b3*b6*b12 + 40*b3*b7*b12 - 144*b3*b8*b12 - 88*b5*b11*b12 + 120*b1*b2*b13 - 144*b4*b6*b13 + 40*b4*b7*b13 - 344*b4*b8*b13 + 56*b5*b9*b13 - 8*b2*b3*b14 + 40*b0*b4*b14 - 32*b5*b6*b14 - 280*b5*b7*b14 - 32*b5*b8*b14 + 104/3*b6^2 + 360*b6*b7 + 104/3*b7^2 + 616/3*b6*b8 + 360*b7*b8 + 104/3*b8^2 + 1856/3*b0*b9 + 1928/3*b1*b10 + 1856/3*b2*b11 + 280/3*b3*b12 + 280/3*b4*b13 - 104/3*b5*b14 - 92/3*b6 + 8/3*b7 - 92/3*b8
Two remarks are in order if one wants to go beyond the adjoint representation.
First, the mechanism above works for any homogeneous invariant polynomial \(f\in S^d(\mathfrak g)^{\mathfrak g}\), not only for \(f_d(x) = \mathrm{Tr}(\operatorname{ad}(x)^d)\). If \(\rho\colon\mathfrak g\to\mathfrak{gl}(V)\) is a finite–dimensional representation, then \[ x \longmapsto \operatorname{Tr}\big(\rho(x)^d\big) \] is also an invariant homogeneous polynomial of degree \(d\), and one can feed this \(f\) into the same polarisation–and–symmetrisation pipeline to obtain a central element in \(U(\mathfrak g)\). In particular, in type \(A_{n-1}\), the fundamental invariants of degrees \(2,3,\dots,n\) are classically constructed as traces of powers of the defining representation; their symmetrisations give the primitive higher–degree Casimir elements corresponding to the exponents.
Second, the Harish–Chandra isomorphism identifies \(Z\big(U(\mathfrak g)\big)\) with the algebra of Weyl–invariant polynomials on a Cartan subalgebra. Under this identification, the element \(C_d\) constructed above corresponds to the restriction of \(f_d\) to \(\mathfrak h\) (up to the usual \(\rho\)–shift). Thus, if one is primarily interested in eigenvalues of central elements on highest–weight modules, it is often more efficient to work entirely with invariant polynomials on \(\mathfrak h\) and Weyl–group invariant theory, and to regard the explicit PBW expressions only as a computational realisation of the abstract correspondence. The code presented here is best viewed as a concrete implementation of this correspondence for the adjoint–trace invariants, with the quadratic case singled out as the one that produces the familiar Casimir element in \(U(\mathfrak g)\) in a particularly simple and efficient way.