Hello Wolfram Community
I have a list of lists. That is a matrix (listSym) containing matrices (A[1], A[2], .... , A[6]).
A[1] = {{0, 0, 2, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}};
A[2] = {{0, 0, 0, 1, 0, 0}, {0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}};
A[3] = {{0, 0, 2, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}};
A[4] = {{0, 0, 0 , 1, 0, 0}, {0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}};
A[5] = {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 2, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}};
A[6] = {{0, 0, 0, 0, 0, 0}, {0, 0, 0, 1, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0, 0}};
listSym = {A[1], A[2], A[3], A[4], A[5], A[6]};
dim = Length[listSym];
The matrix commutation of A[5] with listSym is:
AdjointMatrixCommutator [i_] := TableForm[ Dot[A[5], listSym[[i]]] - Dot[ listSym[[i]], A[5]], {i, 1, dim}, TableHeadings -> Automatic]
I want to do a commutation of A[1] with listSym, A[2] with listSym, A[3] with listSym, etc.
The matrix commutation of each A[i] with listSym (using a Do Loop) is:
Do[Print[TableForm[ Dot[A[i], listSym[[i]]] - Dot[listSym[[i]], A[i]], {i, 1,
dim}]], {i, 1, dim}];
I am getting matrices which are all zeros and that is incorrect. Can anyone show how to use a Do loop with lists (of matrix commutation).
Ps: I can provide more information for a better answer.