This code implements the PIMC algorithm detailed by D. Ceperley (1995) and Boninsegni, et al. (2006). See these papers for an overview (and the details) of the algorithm.

Compiling and Running

It has dependencies on boost, GNU Scientific Library (GSL), and Open-MPI. I suggest using the most recent GNU C++ compiler, as this is what I've used to test my code, but any compiler that supports the C++14 standard will work. The makefile included in the git repository will compile and link the files into an executable called PIMC.

The working directory must have two folders: input/ and output/. The input folder must have at least one parameters file, named as parameters_#.cfg, where # is an integer (starting at zero). Here is a sample configuration file:

[Simulation Parameters]
particles                              =           32
periodic_boundary_conditions           =           true
grand_canonical_ensemble               =           false
particle_type                          =           he4
temperature                            =           1.6
mu                                     =           0
NN_grid_size                           =           1
C0                                     =           1
end_step                               =           10000
equilibration                          =           10000
time_slices                            =           32
coupling                               =           1
dimensions                             =           3
kb                                     =           1.0

The types of particles are distinguishable and indistinguishable particles in a harmonic trap (boltzmannon_harmonic, boson_harmonic), helium-4 (he4), and one- and two-component Coulomb systems (boson_coulomb, monopole_liquid, both with mass=1). grand_canonical_ensemble chooses whether to keep particle number fixed (traditional PIMC) or variable (worm-algorithm PIMC). The latter algorithm requires two initial parameters: C0, the worm constant, and mu, the chemical potential; any input for these parameters is ignored in the traditional PIMC algorithm. NN_grid_size dictates the size of each cell in the nearest-neighbor table. The coupling parameter only applies in the case of a Coulomb interaction, and is applied as an overall constant in the potential. The rest of the inputs are straightforward.

To run the program: mpirun -n nprocs /path/to/executable start_id processors_per,
where nprocs is total number of processes started by MPI, start_id is the # of the (first) parameters_#.cfg file, and processors_per is the number of processors dedicated to each parameters file. For example, mpirun -n 4 ./PIMC 1 2 will start four processes, two of which will be used for parameters_1.cfg and two for parameters_2.cfg. If no arguments are given, start_id is assumed to be zero and all processors are dedicated to the one PIMC run. If one argument is given, that argument is for start_id and once again all processors are dedicated to that one task. It is important that the number of time slices in a run be divisible by the number of processors allotted to the run.

**One argument is the common usage.**

There are two checker flags, which check the separation and neighbor tables, as well as the charges of permuted particles, for consistency and accuracy. These two flags check1 and check2 are found in the equilibrate method of runner.cpp, and can be turned on prior to compilation if one desires to check the algorithm for data-structure level mistakes.


The program will output a parameters file and an overview file containing move acceptances. There are three data files containing the energy, winding, and permutation data at all steps in which the configuration is diagonal (no open paths). The program will also output the specific path data (found in the path_dump, connections, and charges files) every 50 diagonal steps (this can be changed in the code in the run method of runner.cpp).

There are a few Python scripts used for analyzing the data. A preliminary outline of how to use these analysis scripts are found here.

Support or Contact

If you have trouble running this code, or have corrections for bugs or suggestions for improvement, please contact me at adith.ramamurti [at] and I’ll get back to you as soon as I can. Any input is welcome!