% i hbar dpsi/dt = -hbar^2 / 2m Dpsi + V psi
% H = -hbar^2 / 2m + V
% Put hbar = 1.

% [ 2 -1  0  0  0  0  0  0]
% [-1  2 -1  0  0  0  0  0]
% [ 0 -1  2 -1  0  0  0  0]
% [ 0  0 -1  2 -1  0  0  0]
% [ 0  0  0 -1  2 -1  0  0] + diag V
% [ 0  0  0  0 -1  2 -1  0]
% [ 0  0  0  0  0 -1  2 -1]
% [ 0  0  0  0  0  0 -1  2]

H = [2, -1,  0,  0,  0,  0,  0,  0;
    -1,  2, -1,  0,  0,  0,  0,  0;
     0, -1,  2, -1,  0,  0,  0,  0;
     0,  0, -1,  2, -1,  0,  0,  0;
     0,  0,  0, -1,  2, -1,  0,  0;
     0,  0,  0,  0, -1,  2, -1,  0;
     0,  0,  0,  0,  0, -1,  2, -1;
     0,  0,  0,  0,  0,  0, -1,  2];

[V,D]=eig(H)
disp(V);
disp(D);
