#ifndef harmonic_h #define harmonic_h #include "math.h" // calculate harmonic oscillator base functions, for 1 dimension // calculate also the kinetic energy part of the wave function, // using H=T+V hence T=E-V class harmonic { public: harmonic(double m=1, double c=1) {mass=m; spring=c;}; // make a base for mass m and spring constant c ~harmonic() {}; double hermite(int k, double x); // helper function, calculates Hermite polynomials double wav1d(int k, double x); // wave function in 1 dimension void setspring(double par) {spring=par;}; // set spring constant void setmass(double par) {mass=par;}; // set mass double secdiv(int k, double x); // returns operator for nabla-squared double E(int k) { return (k+0.5)*sqrt(spring/mass);}; // give energy eigenvalue private: double mass; double spring; }; #endif