Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = 25; Nless = 10;
- BlockDiag[tt_, offset_] :=
- DiagonalMatrix[Hold /@ tt, offset] // ReleaseHold // ArrayFlatten;
- A[pm_] := {{-1, pm I}, {pm I, 1}};
- B = (2.0 - Sqrt[2]) {{1, 0}, {0, -1}};
- M = SparseArray[
- BlockDiag[Table[B, {j, 1, n}], 0] +
- BlockDiag[Table[A[1], n - 1], 2] +
- BlockDiag[Table[A[-1], n - 1], -2]];
- Reverse[Eigenvalues[M, -Nless]]
- {-8.50551*10^-14, 8.50983*10^-14,
- 1.42089 + 0.0000210718 I, -1.42139 + 0.0000878787 I, -1.43983 -
- 0.0000374648 I, 1.44086 - 0.0000496205 I,
- 1.47277 + 0.000192942 I, -1.47298 - 0.0000263272 I, -1.516 -
- 0.000610613 I, 1.5161 - 0.0000292111 I}
Add Comment
Please, Sign In to add comment