Path Integral Quantum Monte Carlo
Public Member Functions | Data Fields
HarmonicPotential Class Reference

Computes the potential energy for an external harmonic potential. More...

#include <potential.h>

+ Inheritance diagram for HarmonicPotential:
+ Collaboration diagram for HarmonicPotential:

Public Member Functions

 HarmonicPotential (double)
 Constructor.
 
 ~HarmonicPotential ()
 Destructor.
 
double V (const dVec &r)
 The potential.
 
dVec gradV (const dVec &r)
 The gradient of the potential.
 
Array< dVec, 1 > initialConfig (const Container *, MTRand &, const int)
 Initial configuration corresponding to Harmonic potential. More...
 
- Public Member Functions inherited from PotentialBase
 PotentialBase ()
 Constructor.
 
virtual ~PotentialBase ()
 Destructor.
 
virtual double V (const dVec &, const dVec &)
 The effective potential for the pair product approximation.
 
virtual double grad2V (const dVec &)
 Grad^2 of the potential.
 
virtual double dVdlambda (const dVec &, const dVec &)
 The derivative of the effective potential with respect to lambda and tau.
 
virtual double dVdtau (const dVec &, const dVec &)
 
void output (const double)
 A debug method that output's the potential to a supplied separation. More...
 
virtual Array< double, 1 > getExcLen ()
 Array to hold data elements. More...
 

Data Fields

double omega2
 
- Data Fields inherited from PotentialBase
double tailV
 Tail correction factor.
 

Additional Inherited Members

- Protected Member Functions inherited from PotentialBase
double deltaSeparation (double sep1, double sep2) const
 Return the minimum image difference for 1D separations.
 

Detailed Description

Computes the potential energy for an external harmonic potential.


We work in generalized units where hbar omega / k_B = 1.

Definition at line 145 of file potential.h.

Member Function Documentation

◆ initialConfig()

Array< dVec, 1 > HarmonicPotential::initialConfig ( const Container boxPtr,
MTRand &  random,
const int  numParticles 
)
virtual

Initial configuration corresponding to Harmonic potential.

Return an initial particle configuration.

We create particles at random locations close to the origin.

Reimplemented from PotentialBase.

Definition at line 332 of file potential.cpp.

333  {
334 
335  /* The particle configuration */
336  Array<dVec,1> initialPos(numParticles);
337  initialPos = 0.0;
338 
339  for (int n = 0; n < numParticles; n++) {
340  for (int i = 0; i < NDIM; i++)
341  initialPos(n)[i] = 0.1*boxPtr->side[i]*(-1.0 + 2.0*random.rand());
342  }
343 
344  return initialPos;
345 }
dVec side
The linear dimensions of the box.
Definition: container.h:31
#define NDIM
Number of spatial dimnsions.
Definition: common.h:71

The documentation for this class was generated from the following files: