… for c = 1 : N-2 U_matrix (c,c) = U(c); end Next, we have to represent the operator as a matrix of size (N-2)(N-2). From the definitions of the first and second derivatives of the function we can approximate them by the equations y(x), Hence, the second derivative matrix for = 6 can be written as a 44 N The SD matrix size is (N-2)(N-2) and not because the second derivative of the NN function can’t be evaluated at the end points, = 1 and = The kinetic energy matrix n n N. [K] is then defined as We can now define the Hamiltonian matrix as A sample code [se_solve.m] for the generating the Hamiltonian matrix is % Make Second Derivative Matrix ------------------------------------------ off = ones(num-3,1); SD_matrix = (-2*eye(num-2) + diag(off,1) + diag(off,-1))/dx2; % Make KE Matrix K_matrix = Cse * SD_matrix; % Make Hamiltonian Matrix H_matrix = K_matrix + U_matrix; Therefore, the Schrodinger Equation in matrix form is This is an eigenvalue equation in matrix form the action of the Hamilton matrix results in each value to be the vector being multiplied by a multiplied by the set of
… for c = 1 : N-2 U_matrix (c,c) = U(c); end Next, we have to represent the operator as a matrix of size (N-2)(N-2). From the definitions of the first and second derivatives of the function y(x), we can approximate them by the equations Hence, the second derivative matrix for N = 6 can be written as a 44 The SD matrix size is (N-2)(N-2) and not NN because the second derivative of the function can’t be evaluated at the end points, n = 1 and n = N. The kinetic energy matrix [K] is then defined as We can now define the Hamiltonian matrix as A sample code [se_solve.m] for the generating the Hamiltonian matrix is % Make Second Derivative Matrix ------------------------------------------ off = ones(num-3,1); SD_matrix = (-2*eye(num-2) + diag(off,1) + diag(off,-1))/dx2; % Make KE Matrix K_matrix = Cse * SD_matrix; % Make Hamiltonian Matrix H_matrix = K_matrix + U_matrix; Therefore, the Schrodinger Equation in matrix form is This is an eigenvalue equation in matrix form the action of the Hamilton matrix results in each value to be the vector being multiplied by a multiplied by the set of
schrodinger.docx