#include "nr3.h" #include "eigen_sym.h" #include "gamma.h" #include "gauss_wgts.h" #include "well.h" #include "harmonic.h" #define NBASE 50 #define NGAUSSLEG 300 double WIDTH; // width for square well potential double mass=1; // mass, I use 1 everywhere double V(double x) { return x*x*(x*x-2.0); } int main() { cin >> WIDTH; cout << "Tested with a square well base of width : " << WIDTH << endl; cout.precision(8); MatDoub hamiltonian(NBASE,NBASE); well w(mass,WIDTH); // mass 1 harmonic h(mass,2.0); // string constant 2, mass 1 // test full procedure by calculating the eigenfunctions from the // hamiltonian base in the well base. // integrate from -WIDTH to +WIDTH for the well, calculate harmonic oscillator wave function with C=2 VecDoub x(NGAUSSLEG),weight(NGAUSSLEG); gauleg(-WIDTH,WIDTH,x,weight); for (int i=0; i