/* From: "COMPUTATIONAL PHYSICS, 2nd Ed" by RH Landau, MJ Paez, and CC Bordeianu Copyright Wiley-VCH, 2007. Electronic Materials copyright: R Landau, Oregon State Univ, 2007; MJ Paez, Univ Antioquia, 2007; & CC Bordeianu, Univ Bucharest, 2007 Support by National Science Foundation */ // bound.c: Bound states in momentum space of delta shell potential /* using the LAPACK dgeev and Gaussian integration * comment: LAPACK has to be installed on your system and the file * gauss.c has to be in the same directory * The energy eigenvalue is printed to standard output and * the corresponding eigenvector to the file bound.dat */ #include #include #include "gauss.c" #define min 0.0 // integration limits #define max 200.0 #define size 64 // grid points #define lambda -1.0 // parameters for potential #define u 0.5 #define b 2.0 #define PI 3.1415926535897932385E0 main() { int i, j , c1, c2, c5, ok; char c3, c4; double A[size][size], AT[size*size]; // hamiltonian double V[size][size]; // potential double WR[size], WI[size]; // eigenvalues double VR[size][size], VL[1][1]; // eigenvectors double WORK[5*size]; // work space double k[size], w[size]; // points, weights FILE *out; // save data in bound.dat out = fopen("bound.dat","w"); gauss(size, 0, min, max, k, w); // call gauss integration // set up hamiltonian matrix for (i=0; i