# Generalized Cartan Matrices

## `IsGeneralizedCartanMatrix(C): AlgMatElt -> BoolElt`

Whether the square matrix $C$ is a generalized Cartan matrix.

## `KacMoodyClass(C): AlgMatElt -> MonStgElt, ModMatRngElt`

The class of the indecomposable generalized Cartan matrix $C$. The first return value is a string, “a”, “b” or “c”, corresponding to the three cases described in the introduction [Introduction](introduction.md#sectalgliekmintro). The second is a positive integral column vector $v$ such that $Cv$ is positive, 0 or negative, respectively (so this return value corresponds to the vectors $\theta$, $\delta$ and $\alpha$ in the introduction).

## `KacMoodyClasses(C): AlgMatElt -> SeqEnum, SeqEnum, SeqEnum`

The class of the possibly decomposable generalized Cartan matrix $C$. Three sequences are returned: the first is a sequence of strings “a”, “b” or “c”, describing the class of each component; the second is a positive integral vector $v$ such that $Cv$ is positive, 0 or negative, respectively (see [`KacMoodyClass`](#function-kacmoodyclass)).

The third sequence $Q$ contains integral sequences $Q_i$ such that the $i$-th component is formed by taking the rows and columns with index $j$, for $j \in Q_i$.

## `Example: Generalized Cartan (ex-89fcf7)`

First, we consider an indecomposable Cartan matrix.

```magma
> C := Matrix(Integers(), 3, 3, [2,-1,0, -5,2,-1, 0,-1,2]);
> s, v := KacMoodyClass(C);
> s;
c
> v;
[2]
[5]
[1]
> C*v;
[-1]
[-1]
[-3]

```

As a second example, we consider a decomposable Cartan matrix.

```magma
> C := CartanMatrix("B2 A~3");
> S, V, Q := KacMoodyClasses(C);
> S;
[ a, b ]
> Q;
[
    [ 1, 2 ],
    [ 3, 4, 5, 6 ]
]
> C1 := Submatrix(C, Q[1], Q[1]);
> KacMoodyClass(C1);
a
> C2 := Submatrix(C, Q[2], Q[2]);
> KacMoodyClass(C2);
b

```
