Mayer-sampling Monte Carlo for estimating virial coefficients.
This project is in early development.
This implementation is based on the Mayer sampling method introduced by Singh and Kofke:
J. K. Singh and D. A. Kofke, "Mayer Sampling: Calculation of Cluster Integrals using Free-Energy Perturbation Methods," Phys. Rev. Lett. 92, 220601 (2004).
Hard-sphere reference virial coefficients are taken from:
F. H. Ree and W. G. Hoover, "Seventh Virial Coefficients for Hard Spheres and Hard Disks," J. Chem. Phys. 46, 4181–4197 (1967).
Compared to the original method, this implementation:
- Exploits symmetry in the cluster integrands instead of full explicit summation over all graphs.
- Perturbs all particles simultaneously per MC step, rather than a random subset.
- Does not perform adaptive step-size tuning.
- Uses the full cluster sum (rather than just the ring cluster) as the hard-sphere reference integrand, with known HS virial coefficients from Ree & Hoover as normalization.
The results were compared with data from:
J. A. Barker, P. J. Leonard, and A. Pompe, J. Chem. Phys. 44, 4206 (1966) (as cited in Singh and Kofke)
| Virial coefficient | Literature | Implementation |
|---|---|---|
| -2.5381 | -2.5309 | |
| 0.4297 | 0.4469 | |
| -0.2769 | -1.7438 |
Requires Python 3.11+ and uv.
uv syncRun the example script:
uv run python scripts/msmc_example.py --T_reduced 1.0Set up pre-commit hooks:
uv run pre-commit installFor clangd support, install just and run just configure.