I'm trying to find the left and right eigenvectors of a pretty straightforward matrix, but Mathematica doesn't seem to be able to do it for even a 200 dimensional matrix.
Background:
Given an operator $L$, the right and left eigenvectors corresponding to the same eigenvalue $\lambda$ satisfy $$L \phi_R = \lambda \phi_R$$ $$\phi_L^T L = \lambda \phi_L^T$$ respectively. We can take the transpose of the second equation to find that the left eigenvector satisfies $$L^T \phi_L = \lambda \phi_L$$ Now, it can be shown that the left and right eigenvectors for the same eigenvalue cannot be orthogonal $$\phi_L^T \phi_R \neq 0$$ I have discretised a system of coupled first order equations and am numerically trying to find the eigenvalues and eigenvectors but for some reason Mathematica returns left and right eigenvectors that are orthogonal. I tried increasing the precision beyond Machine Precision but that didn't seem to help either.
Code:
Initialise some variables
T = 10;
NN = 100;
nn = NN - 1;
λ = 1;
g = 1;
dt = 2 T/(NN - 1);
t[i_] := -T + (i - 1) dt
Create the matrix with dimensions 2 nn
. The matrix has $(\lambda t,-\lambda t)$ alternating on the diagonals, $(g,0)$ alternating on both the upper and lower off-diagonals, $-\frac{1}{2\,dt}$ on the upper second off diagonal, and $\frac{1}{2\,dt}$ on the lower second off diagonal.
Mat=
DiagonalMatrix[Flatten[Table[{λ t[i], -λ t[i]}, {i, 1, nn}]]] +
DiagonalMatrix[Flatten[{Table[{g, 0}, {i, 1, nn - 1}], g}], 1] +
Transpose[DiagonalMatrix[Flatten[{Table[{g, 0}, {i, 1, nn - 1}], g}], 1]] +
DiagonalMatrix[Flatten[Table[{-1/(2 dt), -1/(2 dt)}, {i, 1, nn - 1}]], 2] -
Transpose[DiagonalMatrix[Flatten[Table[{-1/(2 dt), -1/(2 dt)}, {i, 1, nn - 1}]], 2]];
For periodic boundary conditions, however, I also need to add entries in top right and the bottom left
Mat[[1, 2 nn - 1]] = 1/(2 dt);
Mat[[2, 2 nn]] = 1/(2 dt);
Mat[[2 nn - 1, 1]] = -1/(2 dt);
Mat[[2 nn, 2]] = -1/(2 dt);
Define the transpose (for left eigenvectors):
MatT = Transpose[Mat];
Find eigenvalues and eigenvectors:
System = Eigensystem[N[Mat]];
SystemT = Eigensystem[N[MatT]];
Find the corresponding left and right eigenvectors corresponding to the same eigenvalue. For example, the 198th eigenvalue of the matrix and the 196th eigenvalue of the transpose are the same, so the corresponding eigenvectors should NOT be orthogonal, but I find that
System[[2, 198]].Conjugate[SystemT[[2, 196]]]
returns 0.
I'm not really sure why Mathematica is doing this. Is it just finding the eigensystem incorrectly? Do I need to increase the step size (dt
) significantly more? Just not sure why it's giving such obviously incorrect eigenvectors.