Giter Site home page Giter Site logo

dmc's Introduction

DMC

An implementation of the Diffusion Monte Carlo method (DMC) for calculating the ground-state energy and wave function of a quantum system. This code is based on the algorithm described in Ref. [1].

Compilation

This program relies on the C++ functionality only present in C++11 or newer. Notably it makes use of the STL thread library. The code can be compiled with a command of the form

g++ -O3 -pthread dmc.cpp -o dmc

or the equivalent for your compiler of choice.

Running

DMC calculations may be run by passing appropriate arguments to the template function

template< int maxN, int dp >
void runSimulation( const int pNum, const int N0, const int nb, const double xmin, const double xmax,
                    const double timeStep, const double relaxTime, const double alpha,
                    std::array<double, dp> &x0, std::function<double (std::array<double, dp> &)> &V,
                    const int numThreads = 1, const bool printWF = false, const bool printDist = false )

The parameters are:

-maxN: The maximum number of points in the distribution.

-dp: The effective dimension of the problem, the number of particles multiplied by the spatial dimension.

-pNum: The number of particles.

-N0: The initial number of points in the distribution.

-nb: The number of buckets used for determining the wave function.

-xmin and xmax: Defines the support of the wave function [xmin,xmax]^dp.

-timeStep: The time step in atomic units.

-alpha: Update parameter for the self consistent energy calculation.

-x0: The initial position of all points in the distribution.

-V: The potential.

-numThreads: The number of concurrent simulations run.

-printWF: A boolean flag that controls output of the wave function

-printDist: A boolean flag that controls output of the distribution of points.

Two other functions that may be of interest to the user are

double uniform( const double a, const double b)
double gaussian( const double mean, const double stdDev)

which can be used to generate random numbers drawn from uniform/Gaussian distributions. These may be useful for generating initial values for x0.

The sample parameters provided in dmc.cpp will calculate the ground state of the quantum harmonic oscillator.

References

[1] I. Kosztin, B. Faber, and K. Schulten, Introduction to the Diffusion Monte Carlo Method. arXiv:physics/9702023 [physics.comp-ph].

dmc's People

Contributors

m0baxter avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.