Advertisement
MatsGranvik

Norm of Eigenvectors from Eigenvalues

Nov 24th, 2019
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. (*Norm of Eigenvectors from Eigenvalues*)
  2. (*start*)
  3. Clear[nn, t, n, k, M, x];
  4. nn = 12;(*size of matrix*)
  5. t[n_, 1] = 1;
  6. t[1, k_] = 1;
  7. t[n_, k_] :=
  8. t[n, k] =
  9. If[n < k,
  10. If[And[n > 1, k > 1], -Sum[t[k - i, n], {i, 1, n - 1}], 0],
  11. If[And[n > 1, k > 1], -Sum[t[n - i, k], {i, 1, k - 1}], 0]];
  12.  
  13. "T is your favourite nn*nn Hermitian matrix"
  14. T = Table[Table[t[n, k], {k, 1, nn}], {n, 1, nn}];
  15. HermitianMatrixQ[T]
  16.  
  17. TableForm[A = Table[Table[T[[n, k]], {k, 1, nn}], {n, 1, nn}]];
  18. lambdaA = N[Eigenvalues[A]];
  19. TableForm[M = Table[Table[T[[n, k]], {k, 1, nn - 1}], {n, 1, nn - 1}]];
  20. lambdaM = N[Eigenvalues[M]];
  21. Quiet[Table[
  22. N[Product[(lambdaA[[i]] - lambdaM[[k]]), {k, 1, nn - 1}]/
  23. Product[If[Not[k == i], (lambdaA[[i]] - lambdaA[[k]]), 1], {k, 1,
  24. nn}]], {i, 1, nn}]]
  25. Table[Norm[N[Eigenvectors[A]][[i]]]^(-2), {i, 1, nn}]
  26. "The values are equal and thereby the left hand side is equal to the \
  27. right hand side in the formula."
  28. (*end*)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement