The same Levi grading extends to every symmetrizable Kac-Moody algebra. In affine and indefinite type, three features require attention:
The same commands apply in all three types:
Take affine $\widehat{\mathfrak{sl}}_2$ with parabolic $\{1\}$: the Levi is the single node $2$ (type $A_1$), and the first few graded pieces show how the real-root strings and the imaginary root spaces combine into $A_1$-modules:
|
|
|
|
Each line is Tally{V(2) => 1}, so after restriction to the derived $A_1$ Levi, $$\mathfrak g_1\cong V_{A_1}(2),\qquad \mathfrak g_2\cong V_{A_1}(2),\qquad \mathfrak g_3\cong V_{A_1}(2).$$ Each is the three-dimensional adjoint $A_1$-module. In every positive degree the two real-root spaces provide its weights $\pm2$, while the imaginary root $d\delta$ provides its zero-weight line. The modules occupy different grading degrees even though forgetting the Levi-center character makes them look identical.
Unlike the finite case, the depth does not terminate: there is a nontrivial $\mathfrak g_d$ for every $d \geq 1$. The ImaginaryMultiplicity option is an optional consistency check in untwisted type; twisted periodic multiplicities are computed automatically and do not accept a constant override.
An indefinite example: the rank-$2$ hyperbolic Kac-Moody algebra with Cartan matrix $\left(\begin{smallmatrix} 2 & -3 \\ -3 & 2 \end{smallmatrix}\right)$ has infinitely many positive roots with rapidly growing multiplicities. rootSnapshot tabulates all positive roots up to a given height together with their root multiplicities, computed by Peterson's recursion:
|
|
|
Each tuple $(a,b)$ denotes the root $a\alpha_1+b\alpha_2$; the height is $a+b$, and the multiplicity is its root-space dimension. For example, $(1,2)$ is the imaginary root $\alpha_1+2\alpha_2$, while $(1,3)$ is the real root $\alpha_1+3\alpha_2$. Both have multiplicity $1$. The table contains every positive root through height $4$. Increasing the bound to $5$ reveals the first root spaces of dimension $2$:
|
|
Thus $\dim\mathfrak g_{2\alpha_1+3\alpha_2} =\dim\mathfrak g_{3\alpha_1+2\alpha_2}=2$.
Now use the same Cartan matrix with leviHighestWeights. Removing node $1$ leaves a Levi of type $A_1$ (the single surviving node), and we decompose the first two graded pieces as Levi-modules:
|
|
The two Tally outputs translate to $$\mathfrak g_1\cong V_{A_1}(3),\qquad \mathfrak g_2\cong V_{A_1}(4)\oplus V_{A_1}(0).$$ Their dimensions are $4$ and $5+1$. The imaginary root $2\alpha_1+3\alpha_2$ has multiplicity $2$ and Levi weight zero; its extra root-space dimension appears as the trivial summand in degree $2$.
The same WeightFormat => "Partition" option works in these commands whenever every surviving Levi component is of classical type $A$, $B$, $C$, or $D$.
The source of this document is in /build/reproducible-path/macaulay2-1.26.11+ds/M2/Macaulay2/packages/KacMoody/Documentation.m2:2559:0.