Attempt to create a perpendicular matrix P for M.

>
load(eigen)$

>
M: matrix([+1,0, 2], [0, -2, +1], [2, +1, -1]);
1 0 2 0 2 1 2 1 1

>
PL: uniteigenvectors(M);
[[[13 1 2 , 13 + 1 2 ,3],[1,1,1]],[[[ 2 213 + 13, 13 + 3 2213 + 13, 13 + 1 2213 + 13]],[[ 2 13 213, 13 3 213 213, 13 1 213 213]],[[1 3, 2 3,2 3]]]]

>
PLm: apply(’matrix, PL[2]);
[ 2 213 +13, 13+3 2213 +13, 13+1 2213 +13] [ 2 13213, 133 213213, 131 213213] [1 3, 2 3,2 3]

The problem with PL is, that it doesn’t
have a list of eigenvectors as its second
output element. It has a list, of lists,
of eigenvectors, sorted at top-level
per eigenvalue.

There just happens to be one eigenvector
per eigenvalue in this case.

This is why, to convert that to a matrix,
results in a column vector of lists.
In turn, trying to transpose that, results
in a row vector, of lists.

There’s nothing wrong in the way the matrix
is being built. It’s just useless to me,
how the uniteigenvectors() function outputs
its eigenvectors.

>
P: float(transpose(PLm));
[0.4448719185337484,0.7346560672221786,0.5122201079553044][0.8312507834516553,0.1258412430373975,0.5414666347632251][0.3333333333333333,0.6666666666666666,0.6666666666666666]

>
ReduceDepth(L) :=
block (
Output : [],
for i in L do (
Output : append(i, Output)
),
return(Output)
)$

>
P: float(transpose(apply(’matrix, ReduceDepth(PL[2]))));
0.3333333333333333 0.8312507834516553 0.4448719185337484 0.6666666666666666 0.1258412430373975 0.7346560672221786 0.66666666666666660.54146663476322510.5122201079553044

The order of columns has been reversed, but
the result will be equivalent.

>
D: transpose(P).M.P;
3.0 0.0 1.110223024625156 1016 0.0 2.3027756377319942.220446049250313 1016 0.0 0.0 1.302775637731994