Search code examples
physicsnumericalnumerical-methodsnumerical-analysisnumerical-integration

How to do numerical integration with quantum harmonic oscillator wavefunction?


How to do numerical integration (what numerical method, and what tricks to use) for one-dimensional integration over infinite range, where one or more functions in the integrand are 1d quantum harmonic oscillator wave functions. Among others I want to calculate matrix elements of some function in the harmonic oscillator basis:

phin(x) = Nn Hn(x) exp(-x2/2)
where Hn(x) is Hermite polynomial

Vm,n = \int_{-infinity}^{infinity} phim(x) V(x) phin(x) dx

Also in the case where there are quantum harmonic wavefunctions with different widths.

The problem is that wavefunctions phin(x) have oscillatory behaviour, which is a problem for large n, and algorithm like adaptive Gauss-Kronrod quadrature from GSL (GNU Scientific Library) take long to calculate, and have large errors.


Solution

  • An incomplete answer, since I'm a little short on time at the moment; if others can't complete the picture, I can supply more details later.

    1. Apply orthogonality of the wavefunctions whenever and wherever possible. This should significantly cut down the amount of computation.

    2. Do analytically whatever you can. Lift constants, split integrals by parts, whatever. Isolate the region of interest; most wavefunctions are band-limited, and reducing the area of interest will do a lot to save work.

    3. For the quadrature itself, you probably want to split the wavefunctions into three pieces and integrate each separately: the oscillatory bit in the center plus the exponentially-decaying tails on either side. If the wavefunction is odd, you get lucky and the tails will cancel each other, meaning you only have to worry about the center. For even wavefunctions, you only have to integrate one and double it (hooray for symmetry!). Otherwise, integrate the tails using a high order Gauss-Laguerre quadrature rule. You might have to calculate the rules yourself; I don't know if tables list good Gauss-Laguerre rules, as they're not used too often. You probably also want to check the error behavior as the number of nodes in the rule goes up; it's been a long time since I used Gauss-Laguerre rules and I don't remember if they exhibit Runge's phenomenon. Integrate the center part using whatever method you like; Gauss-Kronrod is a solid choice, of course, but there's also Fejer quadrature (which sometimes scales better to high numbers of nodes, which might work nicer on an oscillatory integrand) and even the trapezoidal rule (which exhibits stunning accuracy with certain oscillatory functions). Pick one and try it out; if results are poor, give another method a shot.

    Hardest question ever on SO? Hardly :)