9
$\begingroup$

I have an issue with a decomposition of a matrix $B$ that is positive semidefinite and that depends on a parameter $x$. Writing $\lambda_i\geq0$ the eigenvalues and $\psi_i$ the corresponding orthonormal eigenvectors, I have $B = \sum_i \lambda_i \psi_i \psi_i^\dagger$. Then I would like to rewrite $B$ as $B = \sum_i \phi_i \phi_i^\dagger$, with $\phi_i = \sqrt{\lambda_i}\psi_i$.

Concerning the Mathematica code: the matrix $B$ is defined as the tensor product of the following matrix $A$:

A = {{1, 0, 0, 1 - 2x}, {0, 0, 0, 0}, {0, 0, 0, 
  0}, {1 - 2x, 0, 0, 1}};
B = KroneckerProduct[A, A, A];

Once having defined matrix $B$, I compute the normalized eigenvectors and eigenvalues of it:

EigenVec = Map[Normalize, Eigenvectors[B]];
EigenVal = Eigenvalues[B];

Then, I define

phi[i_] := Sqrt[EigenVal[[i]]] EigenVec[[i]];

and I should be done. Yet, when checking if the rewriting of $B$ is working, I find that it is not, indeed

FullSimplify[Sum[KroneckerProduct[phi[i],Conjugate[Transpose[phi[i]]]], {i, 1, 64}] - B] // MatrixForm

output a non-zero matrix that has some dependency on the parameter $x$. I checked that there were no crossings between the eigenvalues and eigenvectors, as well as other consistency checks, without managing to understand what is wrong with that...

Any help would be appreciated.

$\endgroup$
2
  • 2
    $\begingroup$ use Eigensystem, ordering in not guaranteed to match if you use Eigenvectors and Eigenvalues separately $\endgroup$
    – I.M.
    Jul 5 at 8:25
  • $\begingroup$ I tried as well with Eigensystem, but I had the same kind of issue. I don't think it is coming from orderings of the eigenvectors and eigenvalues. $\endgroup$
    – Rafifoo
    Jul 5 at 8:32

1 Answer 1

13
$\begingroup$

Your eigenvectors in EigenVec are normalized but not orthogonal to each other, as you can see using

Table[Dot[Conjugate[EigenVec[[i]]],EigenVec[[j]]],{i,1,64},{j,1,64}]

Your matrix B has multiple eigenvalues, which can lead to this problem. You should get the correct result using

EigenVec=Orthogonalize[Eigenvectors[B]];

Remark. Note that your eigenvalues are only nonnegative if

Reduce[Thread[EigenVal>=0]]
(* 0 <= x <= 1 *)
$\endgroup$
1
  • $\begingroup$ Indeed, you are right, this is working now! Thank you ! And I agree, I forgot to mention that $x \in [0,1]$. $\endgroup$
    – Rafifoo
    Jul 5 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.