Cartan Matrices and Their Inverses (Killing Form)

cartan["a",ell_] :=
Module[{i,j,c},
	c[i_,j_] := 2/; i==j;
	c[i_,j_] := -1/; j==i-1 || j==i+1;
	c[i_,j_] := 0;
	Table[c[i,j], {i,ell}, {j,ell}]
]

cartan["b",ell_] :=
Module[{i,j,c},
	c[ell-1,ell] = -2;
	c[i_,j_] := 2/; i==j;
	c[i_,j_] := -1/; j==i-1 || j==i+1;
	c[i_,j_] = 0;
	Table[c[i,j], {i,ell}, {j,ell}]
]

cartan["c",ell_] :=
Module[{i,j,c},
	c[ell,ell-1] = -2;
	c[i_,j_] := 2/; i==j;
	c[i_,j_] := -1/; j==i-1 || j==i+1;
	c[i_,j_] = 0;
	Table[c[i,j], {i,ell}, {j,ell}]
]

cartan["d",ell_] :=
Module[{i,j,c},
	c[ell-2,ell] = -1;
	c[ell-1,ell] = 0;
	c[ell,ell-2] = -1; c[ell,ell-1] := 0;
	c[i_,j_] := 2/; i==j;
	c[i_,j_] := -1/; j==i-1 || j==i+1;
	c[i_,j_] = 0;
	Table[c[i,j], {i,ell}, {j,ell}]
]

cartan["e",6] =
{{2,-1,0,0,0,0},
{-1,2,-1,0,0,0},
{0,-1,2,-1,0,-1},
{0,0,-1,2,-1,0},
{0,0,0,-1,2,0},
{0,0,-1,0,0,2}};

cartan["e",7] =
{{2,-1,0,0,0,0,0},
{-1,2,-1,0,0,0,0},
{0,-1,2,-1,0,0,0},
{0,0,-1,2,-1,0,-1},
{0,0,0,-1,2,-1,0},
{0,0,0,0,-1,2,0},
{0,0,0,-1,0,0,2}};

cartan["e",8] =
{{2,-1,0,0,0,0,0,0},
{-1,2,-1,0,0,0,0,0},
{0,-1,2,-1,0,0,0,0},
{0,0,-1,2,-1,0,0,0},
{0,0,0,-1,2,-1,0,-1},
{0,0,0,0,-1,2,-1,0},
{0,0,0,0,0,-1,2,0},
{0,0,0,0,-1,0,0,2}};

cartan["f"] =
{{2,-1,0,0},
 {-1,2,-2,0},
 {0,-1,2,-1},
 {0,0,-1,2}};

cartan["g"] = {{2,-3},{-1,2}};

ca5 = cartan["a",5]; ca5 //MatrixForm

Inverse[ca5] //MatrixForm

cb5 = cartan["b",5]; cb5 //MatrixForm

Inverse[cb5] //MatrixForm

Divide last column by 2 to get Killing form

cc5 = cartan["c",5]; cc5 //MatrixForm

Inverse[cc5] //MatrixForm

Multiply last column by 2 to get Killing form.

cd5 = cartan["d",5]; cd5 //MatrixForm

Inverse[cd5] //MatrixForm

ce6 = cartan["e",6]; ce6 //MatrixForm

Inverse[ce6] //MatrixForm

ce7 = cartan["e",7]; ce6 //MatrixForm

Inverse[ce7] //MatrixForm

ce8 = cartan["e",8]; ce8 //MatrixForm

Inverse[ce8] //MatrixForm

cf4 = cartan["f"]; cf4 //MatrixForm

Inverse[cf4] //MatrixForm

Divide last two columns by 2 to get Killing form.

cg2 = cartan["g"]; cg2 //MatrixForm

Inverse[cg2] //MatrixForm