Guest User

Untitled

a guest
Nov 18th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. n = 25; Nless = 10;
  2. BlockDiag[tt_, offset_] :=
  3. DiagonalMatrix[Hold /@ tt, offset] // ReleaseHold // ArrayFlatten;
  4. A[pm_] := {{-1, pm I}, {pm I, 1}};
  5. B = (2.0 - Sqrt[2]) {{1, 0}, {0, -1}};
  6. M = SparseArray[
  7. BlockDiag[Table[B, {j, 1, n}], 0] +
  8. BlockDiag[Table[A[1], n - 1], 2] +
  9. BlockDiag[Table[A[-1], n - 1], -2]];
  10. Reverse[Eigenvalues[M, -Nless]]
  11.  
  12. {-8.50551*10^-14, 8.50983*10^-14,
  13. 1.42089 + 0.0000210718 I, -1.42139 + 0.0000878787 I, -1.43983 -
  14. 0.0000374648 I, 1.44086 - 0.0000496205 I,
  15. 1.47277 + 0.000192942 I, -1.47298 - 0.0000263272 I, -1.516 -
  16. 0.000610613 I, 1.5161 - 0.0000292111 I}
Add Comment
Please, Sign In to add comment