Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Orthonormal hermitian matrices' topicStudent Support Forum > General > Archives > "Orthonormal hermitian matrices"

Next Comment >Help | Reply To Topic
Author Comment/Response
Alex
02/28/07 04:31am

Hi, I'm trying to generate an orthonormal basis of Hermitian traceless matrices. The inner product is Tr[AB]. I managed to generate the basis, but I can't get to orthonormalize it. The function GramSchmidt just doesn't evaluate. Here's the code

<< LinearAlgebra`Orthogonalization`

Basis[d_] := (
b = {{IdentityMatrix[d]}};
(*t1 = Table[{i, i} -> 1, {i, 1, d}];*)
t1 = {};
For[i = 1, i ≤ d, i++,
For[j = i + 1, j ≤ d, j++,
AppendTo[t1, {{i, j} -> 1, {j, i} -> 1}];

AppendTo[t1, {{i, j} -> \[ImaginaryI], {j, i} -> -\[ImaginaryI]}];
];
];
For[i = 1, i ≤ d - 1, i++,
AppendTo[t1, {{i, i} -> 1, {d, d} -> -1}];
];
AppendTo[b, SparseArray[#, {d, d}, 0] & /@ t1];
Flatten[b, 1] // Normal
)

CM[v_, b_] := Sum[v〚i〛b〚i〛, {i, 1, Length[v]}]
Orthogonalize[b_] := (
v = Table[Table[
KroneckerDelta[i, j], {j, 1, Length[b]}], {i, 1, Length[b]}];
GramSchmidt[v, InnerProduct -> (Tr[CM[#1, b].CM[#2, b]]) &]
)

URL: ,

Subject (listing for 'Orthonormal hermitian matrices')
Author Date Posted
Orthonormal hermitian matrices Alex 02/28/07 04:31am
Re: Orthonormal hermitian matrices Forum Modera... 03/23/07 4:16pm
Next Comment >Help | Reply To Topic