This section collects the background needed to read the examples. Standard references are Humphreys, Introduction to Lie Algebras and Representation Theory, and Kac, Infinite Dimensional Lie Algebras.
Generalized Cartan matrices. A generalized Cartan matrix (GCM) is an integer matrix $A=(a_{ij})_{i,j=1}^r$ with $a_{ii}=2$, $a_{ij}\le 0$ for $i\ne j$, and $a_{ij}=0 \iff a_{ji}=0$. A GCM is symmetrizable if there is a diagonal matrix $D$ of positive integers with $DA$ symmetric. Commands that use the invariant form require symmetrizability and report an error when it is absent. GCMs split into three disjoint classes:
cartanType determines which case occurs; commands cartanA, cartanB, $\dots$, cartanG2 build the classical finite types, and any GCM (affine or indefinite) can be given directly as a matrix.
Roots, coroots, Weyl group. Fix a GCM $A$ of size $r$. A realization consists of a Cartan subalgebra $\mathfrak h$, linearly independent simple roots $\alpha_1,\dots,\alpha_r\in\mathfrak h^*$, and linearly independent simple coroots $\alpha_1^\vee,\dots,\alpha_r^\vee\in\mathfrak h$. For singular $A$, the simple roots need not be a basis of all of $\mathfrak h^*$ and $\dim\mathfrak h$ is larger than $r$ in a minimal realization. The package nevertheless records root-lattice elements by their coefficients in the free basis $\alpha_1,\dots,\alpha_r$. The defining pairing is $\langle\alpha_j,\alpha_i^\vee\rangle = a_{ij}$. The simple reflection $s_i$ is the linear map $s_i(\lambda) = \lambda - \langle\lambda,\alpha_i^\vee\rangle\alpha_i$. The subgroup $W$ of $\mathrm{GL}(\mathfrak{h}^*_{\mathbb{R}})$ generated by the $s_i$ is the Weyl group. The Cartan matrix determines all relations among these generators: $W$ has the Coxeter presentation $$W=\left\langle s_1,\dots,s_r\ \middle| s_i^2=1,\ (s_is_j)^{m_{ij}}=1\text{ when }m_{ij}<\infty \right\rangle,$$ where $m_{ii}=1$ and, for $i\ne j$, $$m_{ij}=\begin{cases} 2,&a_{ij}a_{ji}=0,\\ 3,&a_{ij}a_{ji}=1,\\ 4,&a_{ij}a_{ji}=2,\\ 6,&a_{ij}a_{ji}=3,\\ \infty,&a_{ij}a_{ji}\geq4. \end{cases}$$ The command coxeterMatrix computes this entire table, or one specified entry, directly from $A$. Thus disconnected nodes give commuting reflections, while a single edge gives the braid relation $s_is_js_i=s_js_is_j$. Because only the products $a_{ij}a_{ji}$ occur, $A$ and its transpose determine the same abstract Coxeter group, although their actions on roots and coroots are dual realizations. The Weyl group is finite iff $A$ is of finite type; otherwise it is infinite. An element $w = s_{i_1}\cdots s_{i_k}$ of minimal such $k$ has length $\ell(w) = k$, and the sequence $(i_1,\dots,i_k)$ is a reduced word for $w$.
The real roots are the $W$-translates of the simple roots. In affine and indefinite type there are additional imaginary roots, which are not Weyl translates of simple roots. All roots lie in the root lattice $Q = \bigoplus_i \mathbb{Z}\alpha_i$ and the height of $\alpha=\sum_i c_i\alpha_i$ is $\operatorname{ht}(\alpha)=\sum_i c_i$. Roots split as $\Phi = \Phi^+\sqcup\Phi^-$ (positive / negative), depending on the sign of their simple-root coefficients. In finite type $|\Phi^+|$ equals the number of positive roots (e.g. $120$ for $E_8$); in affine / indefinite type $\Phi^+$ is infinite and also contains imaginary roots (those of nonpositive squared norm for a symmetrizable GCM; in affine type their norm is zero). Use rootSnapshot uniformly: rootSnapshot A returns the complete positive root system in finite type, while rootSnapshot(A,H) returns every positive root through height $H$ in finite, affine, or indefinite type.
Weights, fundamental weights, the Weyl vector. The evaluations $\lambda_i:=\langle\lambda,\alpha_i^\vee\rangle$ are the Dynkin labels of a weight. Unless a page says otherwise, a list $\{\lambda_1,\dots,\lambda_r\}$ gives these labels. They determine a weight modulo the subspace of $\mathfrak h^*$ that annihilates every simple coroot. Such a list does not specify coordinates in the additional realization directions; kmWeight can retain these coordinates together with the Cartan datum. For singular $A$, the set of all $\lambda\in\mathfrak h^*$ taking integral values on the simple coroots has additional realization directions, so it is not a rank-$r$ lattice with a unique fundamental-weight basis. When $A$ is invertible (in particular, in finite type), the fundamental weights $\omega_i$ defined by $\langle\omega_i,\alpha_j^\vee\rangle=\delta_{ij}$ form the usual basis and have unique simple-root coordinates; this is the setting of fundamentalWeights. The Weyl vector $\rho$ is characterized by $\langle\rho,\alpha_i^\vee\rangle=1$ for every $i$; in finite type it is also $\rho=\tfrac12\sum_{\alpha\in\Phi^+}\alpha$ and is computed by weylVector. A Dynkin-label weight is dominant integral iff all labels are nonnegative integers.
Kac-Moody Lie algebras. To a symmetrizable GCM $A$ one associates the Kac-Moody Lie algebra $\mathfrak g(A)$. For a realization as above, it is generated by the full Cartan algebra $\mathfrak h$ together with $e_i,f_i$ ($i=1,\dots,r$), subject to $$[h,h']=0,\quad [h,e_i]=\alpha_i(h)e_i,\quad [h,f_i]=-\alpha_i(h)f_i,\quad [e_i,f_j]=\delta_{ij}\alpha_i^\vee,$$ for $h,h'\in\mathfrak h$, together with the Serre relations $(\mathrm{ad}\,e_i)^{1-a_{ij}}e_j = 0$ for $i\ne j$ (and likewise for $f_i$). Writing $h_i=\alpha_i^\vee$ recovers the usual Chevalley-generator notation. When $A$ is of finite type this recovers the classical finite-dimensional simple Lie algebras. When $A$ is of affine type $\mathfrak g(A)$ is (up to a one-dimensional central extension and a derivation) the loop algebra of a finite-dimensional Lie algebra. In indefinite type the resulting Lie algebra is usually infinite-dimensional and its imaginary-root multiplicities can be considerably more complicated. In every case $\mathfrak g(A)$ carries a root-space decomposition $\mathfrak g(A) = \mathfrak h \oplus \bigoplus_{\alpha\in\Phi}\mathfrak g_\alpha$ with $\dim\mathfrak g_\alpha = 1$ for every real root $\alpha$.
An irreducible integrable highest-weight module $V(\lambda)$ is attached to each dominant integral $\lambda$. It is generated by a highest-weight vector $v_\lambda$ satisfying $$e_i v_\lambda=0,\qquad h v_\lambda=\lambda(h)v_\lambda\ \ (h\in\mathfrak h),\qquad f_i^{\lambda_i+1}v_\lambda=0.$$ In particular $h_i v_\lambda=\lambda_i v_\lambda$ for $h_i=\alpha_i^\vee$; these eigenvalues are the Dynkin labels. In finite type $V(\lambda)$ is finite-dimensional and $\dim V(\lambda)$ is given by the Weyl dimension formula (weylDimension). In affine / indefinite type $V(\lambda)$ may be infinite-dimensional but still has a well-defined formal character governed by the Weyl–Kac character formula in the appropriate completed group algebra. The zero highest weight gives the one-dimensional trivial module; nontrivial positive-level affine integrable modules are infinite-dimensional.
Parabolic subalgebras and the Levi grading. In the examples, let $J\subseteq\{1,\dots,r\}$ be the list parabolic of removed nodes and let $I=\{1,\dots,r\}\setminus J$ be the Levi nodes. The standard Levi root subsystem is $\Phi_I=\Phi\cap\bigoplus_{i\in I}\mathbb Z\alpha_i$, with $\Phi_I^+=\Phi_I\cap\Phi^+$. The standard parabolic is $\mathfrak p_I=\mathfrak l_I\oplus\mathfrak n_I^+$, where $\mathfrak l_I=\mathfrak h\oplus \bigoplus_{\alpha\in\Phi_I}\mathfrak g_\alpha$ and $\mathfrak n_I^+=\bigoplus_{\alpha\in\Phi^+\setminus\Phi_I^+} \mathfrak g_\alpha$. The package uses the total $\mathbb Z$-degree $\deg(\sum c_k\alpha_k)=\sum_{j\in J}c_j$. Each graded piece is finite-dimensional when the derived Levi is finite type. The Irrep type records a highest-weight module for $[\mathfrak l_I,\mathfrak l_I]$: for an infinite-type Levi this is a symbolic integrable highest-weight module and is generally infinite-dimensional. Levi-center characters are forgotten, so summands differing only by central character can merge. Computing these derived-Levi highest weights is the central output of leviHighestWeights, which detects finite, affine, and indefinite type and determines any required root-height bound. See also kostantLieAlgCohomology for the general Kac–Moody Kostant formula. Its default output likewise forgets central characters; set IncludeCentralCharacter => true to retain the additional full-Levi central data in LeviIrrep records.
One extended type-A example. We now realize every definition above in one running example. The call cartanA 4 means type $A_3$, so throughout this example $$A=A_3,\qquad \mathfrak g(A)=\mathfrak{sl}_4.$$ We begin with the matrix, its symmetrizer, and its displayed node labels:
|
|
|
|
|
Thus $$A=\begin{pmatrix}2&-1&0\\-1&2&-1\\0&-1&2\end{pmatrix}.$$ It is a GCM because its diagonal entries are $2$, its off-diagonal entries are nonpositive, and its zero pattern is symmetric. Here $D=I_3$ symmetrizes $A$; in fact $A$ itself is symmetric. The diagram fixes the package labels $1$--$2$--$3$ used in every call below.
The finite, affine, and indefinite alternatives can all be seen without leaving the type-$A$ family. Attach the affine node and then the overextended node:
|
|
|
|
|
|
The three types are respectively finite, affine, and indefinite. Their determinants are $4$, $0$, and $-4$. The affine matrix $A_3^{(1)}$ has four simple roots but matrix rank $3$ and corank $1$; its minimal realization therefore has $\dim\mathfrak h=2(4)-3=5$, so the simple roots do not span all of $\mathfrak h^*$. The overextension $A_3^{++}$ is hyperbolic: deleting its overextended node leaves $A_3^{(1)}$, while deleting any other node leaves finite-type components. In Lie-theoretic terms, $\mathfrak g(A_3^{(1)})$ is the centrally extended loop algebra of $\mathfrak{sl}_4$ with its derivation, whereas $\mathfrak g(A_3^{++})$ is indefinite.
The realization and the defining pairing. In simple-root coordinates the basis vectors $\alpha_1,\alpha_2,\alpha_3$ are the standard rows. The coroot rows record all pairings $\langle\alpha_j,\alpha_i^\vee\rangle=A_{ij}$:
|
|
|
|
The vector {1,0,0} means $\alpha_1\in Q=\mathbb Z\alpha_1\oplus\mathbb Z\alpha_2\oplus\mathbb Z\alpha_3$. Its Dynkin labels are $(2,-1,0)$, the first column of $A$; similarly $\alpha_2$ has labels $(-1,2,-1)$. This is the defining root-coroot pairing written in coordinates.
Reflections, Coxeter relations, words, and length. Apply the second simple reflection first to $\alpha_1$ and then to $\alpha_2$, and then verify every defining relation for the finite and affine Weyl groups:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The two column outputs say $$s_2(\alpha_1)=\alpha_1+\alpha_2,\qquad s_2(\alpha_2)=-\alpha_2,$$ exactly as $s_i(\lambda)=\lambda-\langle\lambda,\alpha_i^\vee\rangle\alpha_i$ prescribes. The first Coxeter table is $$M(A_3)=\begin{pmatrix}1&3&2\\3&1&3\\2&3&1\end{pmatrix}.$$ Indeed, the three relevant Cartan-entry products are $(a_{12}a_{21},a_{23}a_{32},a_{13}a_{31})=(1,1,0)$, which give $(m_{12},m_{23},m_{13})=(3,3,2)$. The first true verifies $s_i^2=1$ for all three generators, and the following three do the same for $$(s_1s_2)^3=(s_2s_3)^3=(s_1s_3)^2=1.$$ Equivalently, adjacent generators satisfy $s_1s_2s_1=s_2s_1s_2$ and $s_2s_3s_2=s_3s_2s_3$, while $s_1s_3=s_3s_1$. For the affine four-cycle $A_3^{(1)}$, the displayed Coxeter table has $3$ on each edge and $2$ on each opposite pair: the four edge products are all $1$ and the two opposite-node products are $0$. The next outputs verify all four involutions, all four order-$3$ edge relations, and both order-$2$ opposite-node relations. Hence the computation checks every Coxeter relation prescribed by the affine Cartan matrix, not just a representative pair. The word $s_1s_2s_1$ has the three inversions $\alpha_1,\alpha_1+\alpha_2,\alpha_2$, hence length $3$ and is reduced. The finite Weyl group $W(A_3)\cong S_4$ has order $24$. For the affine Coxeter element $C=s_1s_2s_3s_4$, set $N=C^3-I$. The final output shows that $N\ne0$, $N^2=0$, and verifies the first five instances of $$C^{3k}=(I+N)^k=I+kN.$$ The equality holds for every $k$ by the binomial theorem, so these powers are all distinct. This gives a direct computational proof that $W(A_3^{(1)})$ is infinite.
Positive, negative, real, and imaginary roots. The complete finite positive root system is small enough to display:
|
|
|
|
The table is $$\Phi^+=\{\alpha_1,\alpha_2,\alpha_3,\, \alpha_1+\alpha_2,\,\alpha_2+\alpha_3,\, \alpha_1+\alpha_2+\alpha_3\}.$$ The negative roots are precisely their negatives. Every root shown is real. In particular the highest root $\theta=\alpha_1+\alpha_2+\alpha_3$ has height $3$, squared norm $2$, and multiplicity $1$, so $\dim\mathfrak g_\theta=1$.
The affine extension supplies the imaginary-root definition missing in finite type. At height $4$ its primitive null root first appears:
|
|
|
The row $(1,1,1,1)$ means $\delta=\alpha_1+\alpha_2+\alpha_3+\alpha_4$ in the package's 1-based affine labeling. It has norm $0$ and multiplicity $3$. Unlike the real roots, $\delta$ is not a Weyl translate of a simple root.
Dynkin labels, fundamental weights, dominance, and the Weyl vector. Return now to finite $A_3$. Since $A$ is invertible, its fundamental weights have unique simple-root coordinates:
|
|
|
|
|
|
|
|
|
The identity matrix in the second output verifies $\langle\omega_i,\alpha_j^\vee\rangle=\delta_{ij}$. The second row of the fundamental-weight matrix gives $\omega_2=\tfrac12\alpha_1+\alpha_2+\tfrac12\alpha_3$, whose Dynkin labels are $(0,1,0)$. Summing the three fundamental weights gives $\rho=\tfrac32\alpha_1+2\alpha_2+\tfrac32\alpha_3$, with Dynkin labels $(1,1,1)$. Thus $(0,1,0)$ is dominant integral, while $(1,-1,0)$ is not.
The Chevalley--Serre presentation and root spaces. For $\mathfrak{sl}_4$, take $e_i=E_{i,i+1}$, $f_i=E_{i+1,i}$, and $h_i=[e_i,f_i]$. The following literal $4$-by-$4$ matrices verify the relations:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Here $h_1=\operatorname{diag}(1,-1,0,0)$. The six true values verify, for every $i,j$, $$[h_i,h_j]=0,\quad [h_i,e_j]=A_{ij}e_j,\quad [h_i,f_j]=-A_{ij}f_j,\quad [e_i,f_j]=\delta_{ij}h_i,$$ followed by every $e$- and $f$-Serre relation. These include $[e_1,e_3]=0$ because $A_{13}=0$ and $[e_1,[e_1,e_2]]=0$ because $1-A_{12}=2$. The final matrices are $E_{13}\in\mathfrak g_{\alpha_1+\alpha_2}$ and $E_{14}\in\mathfrak g_{\alpha_1+\alpha_2+\alpha_3}$, making the root-space decomposition concrete.
An integrable highest-weight module. Take $\lambda=\omega_2$, given by its Dynkin labels $(0,1,0)$:
|
|
|
|
|
Thus $$V(\omega_2)\cong\bigwedge\nolimits^2\mathbb C^4,\qquad \dim V(\omega_2)=6.$$ Its six displayed weights all have multiplicity $1$. Concretely take $v_\lambda=e_1\wedge e_2$. The matrices above give $e_i v_\lambda=0$ for every $i$, $h_1v_\lambda=0$, $h_2v_\lambda=v_\lambda$, and $h_3v_\lambda=0$. The defining integrability relations are $f_1v_\lambda=0$, $f_2^2v_\lambda=0$, and $f_3v_\lambda=0$, exactly the exponents $\lambda_i+1$. The final output is $1$, confirming that $V(0)$ is the one-dimensional trivial module.
The adjoint highest weight $(1,0,1)$ reconnects this module language with the root-space decomposition:
|
|
The output $(15,3,15)$ says that the adjoint module is $\mathfrak{sl}_4$ itself: its twelve nonzero weights are the twelve roots, each with multiplicity $1$, and its zero-weight space is $\mathfrak h$, of dimension $3$.
A parabolic, its Levi, and its grading. Remove the middle node $J=\{2\}$. Its complement is $I=\{1,3\}$:
|
|
|
|
|
This is the Grassmannian parabolic for $\operatorname{Gr}(2,4)$. Its derived Levi is $\mathfrak{sl}_2\oplus\mathfrak{sl}_2$. Concretely, $\Phi_I=\{\pm\alpha_1,\pm\alpha_3\}$ and $$\mathfrak l_I=\mathfrak h\oplus \mathfrak g_{\alpha_1}\oplus\mathfrak g_{-\alpha_1}\oplus \mathfrak g_{\alpha_3}\oplus\mathfrak g_{-\alpha_3}.$$ The complementary positive root spaces form $$\mathfrak n_I^+ =\mathfrak g_{\alpha_2}\oplus \mathfrak g_{\alpha_1+\alpha_2}\oplus \mathfrak g_{\alpha_2+\alpha_3}\oplus \mathfrak g_{\alpha_1+\alpha_2+\alpha_3}.$$ Every listed root has middle coefficient $1$, so every root space has parabolic degree $1$. Consequently $\mathfrak n_I^+=\mathfrak g_1$ is four-dimensional and abelian, and there is no positive piece $\mathfrak g_d$ for $d\geq2$.
|
|
|
Written without package notation, the first two outputs mean $$\mathfrak g_0\big|_{\mathfrak{sl}_2\oplus\mathfrak{sl}_2} \cong (V(2)\otimes V(0))\oplus (V(0)\otimes V(2))\oplus (V(0)\otimes V(0)),$$ and $$\mathfrak g_1 \cong V(1)\otimes V(1).$$ The trivial summand in degree $0$ is the one-dimensional Levi center. The empty degree-$2$ Tally confirms that the grading has depth $1$. The Irrep objects remember the two derived-Levi factors but, by default, not that central character.
Kostant cohomology and the Levi center. Finally use the trivial ambient highest weight $\lambda=0$:
|
|
|
|
|
The output H is the complete derived-Levi decomposition of $H^q(\mathfrak n_I^+;\mathbb C)$ for $0\leq q\leq4$. Its dimensions are $1,4,6,4,1$. This agrees with $H^q(\mathfrak n_I^+;\mathbb C)\cong \bigwedge^q(\mathfrak n_I^+)^*$ because the four-dimensional nilradical is abelian. The degree-$1$ output with central characters retains central character $(-1)$, in the package's removed-node fundamental-coweight normalization, in addition to the semisimple module $V(1)\otimes V(1)$, illustrating exactly what the default Irrep output forgets.
To see two different full-Levi summands merge after that information is forgotten, remove both end nodes $J=\{1,3\}$. The surviving derived Levi is the middle $\mathfrak{sl}_2$:
|
|
|
|
|
|
|
In the Levi grading this means $$\mathfrak g_1\cong V(1)^{\oplus2},\qquad \mathfrak g_2\cong V(0).$$ The default cohomology output likewise reports two copies of $V(1)$. Including central characters separates them as $V(1)_{(-1,0)}\oplus V(1)_{(0,-1)}$: their two-component central-character labels differ even though their restrictions to the derived $\mathfrak{sl}_2$ agree.
Finally, the same type-$A$ tower illustrates what an Irrep means for an infinite-type Levi. In the hyperbolic algebra $A_3^{++}$, removing its overextended node leaves the affine Levi $A_3^{(1)}$:
|
Mathematically the output is $$H^0\cong V(0,0,0,0),\qquad H^1\cong V(1,0,0,0),\qquad H^2\cong V(0,1,0,1).$$ The first affine-Levi module is trivial. The latter two have positive affine level and are infinite-dimensional integrable highest-weight modules; here Irrep records their highest weights symbolically rather than claiming they are finite-dimensional vector spaces.
The source of this document is in /build/reproducible-path/macaulay2-1.26.11+ds/M2/Macaulay2/packages/KacMoody/Documentation.m2:812:0.