ABSTRACT

In this chapter, we use the analytical results of the harmonic oscillator (both classical and quantum mechanical) to develop and test three stochastic algorithms based on the Metropolis scheme. The classical canonical ensemble integral for the harmonic oscillator is calculated first. The results should be found within the equipartition values at all the temperatures within the error bars. The reader is encouraged to experiment with different walk lengths to verify that the error bars drop as the square root of the sample size and that the results remain within significance around the equipartition. The Metropolis algorithm is then applied to the Feynman path integral, using both the discretized approach and the Fourier path expansion. The partial averaging enhancement for the Fourier algorithm, and the reweighted Fourier series are introduced. All the programs in this chapter are for monodimensional problems. Later in the book, it is shown that the extension to multidimensional problems with the effort increasing linearly, is simple. The programs are sufficiently general, to allow for a substitution of the potential energy. Caution should be used, however, when introducing potential energy models that contain barriers greater than kBT , as it is likely that quasiergodicity will arise.