Real-space quantum Monte Carlo (QMC) methods for electronic structure calculations.
Project description
PyQMC
PyQMC is a Python package for real-space quantum Monte Carlo (QMC) electronic structure calculations, designed to interoperate closely with PySCF.
Full documentation is available at pyqmc.readthedocs.io.
Features
- Variational Monte Carlo (VMC) and Diffusion Monte Carlo (DMC)
- Wavefunction optimization via stochastic reconfiguration
- Ensemble wave function optimization for excited state computation
- Trial wavefunctions: Slater-Jastrow, multi-determinant (CASSCF/selected CI), geminal, and three-body Jastrow
- Observables: energy, one- and two-body density matrices, extensible to your problem.
- Periodic boundary conditions with twist averaging and supercell support
- Parallel execution via MPI (
mpi4py) or Dask - GPU and JAX backends for high-performance evaluation
- HDF5-based checkpointing for restartable workflows
Installation
pip install pyqmc
to get the latest development version,
pip install git+https://github.com/WagnerGroup/pyqmc.git
Requirements: Python >= 3.10, PySCF >= 2.8, SciPy, h5py, pandas.
Quick Start
The high-level recipes interface handles a complete optimize -> VMC -> DMC workflow:
import pyscf
import pyqmc.recipes
# 1. Run a DFT/HF calculation with PySCF and save a checkpoint
mol = pyscf.gto.M(atom="He 0. 0. 0.", basis="ccECP_cc-pVDZ", ecp="ccecp", unit="bohr")
mf = pyscf.scf.RHF(mol)
mf.chkfile = "he_dft.hdf5"
mf.kernel()
# 2. Optimize the Slater-Jastrow wavefunction
pyqmc.recipes.OPTIMIZE("he_dft.hdf5", "he_sj.hdf5", slater_kws={"optimize_orbitals": True})
# 3. Run VMC
pyqmc.recipes.VMC("he_dft.hdf5", "he_sj_vmc.hdf5", load_parameters="he_sj.hdf5", nblocks=40)
# 4. Run DMC
pyqmc.recipes.DMC("he_dft.hdf5", "he_sj_dmc.hdf5", load_parameters="he_sj.hdf5",
nblocks=4000, tstep=0.02)
Results are saved as HDF5 files and can be read back with pyqmc.recipes.read_mc_output.
Parallel Execution
PyQMC supports parallelism via MPI using mpi4py.futures or any other futures object such as dask or concurrent:
import mpi4py.futures
import pyqmc.recipes
if __name__ == "__main___":
npartitions = 4
with mpi4py.futures.MPIPoolExecutor(max_workers=npartitions) as client:
pyqmc.recipes.OPTIMIZE("he_dft.hdf5", "he_sj.hdf5", client=client, npartitions=npartitions)
Run with: mpiexec -n 5 python -m mpi4py.futures script.py
Package Structure
| Module | Description |
|---|---|
pyqmc.recipes |
High-level OPTIMIZE, VMC, DMC functions |
pyqmc.wf |
Wavefunctions: Slater, JastrowSpin, MultiplyWF, AddWF, geminal |
pyqmc.method |
Core algorithms: VMC, DMC, line minimization, variance optimization |
pyqmc.observables |
Energy, one body density matrix, two body density matrix, ECP |
pyqmc.pbc |
Periodic boundary conditions, supercell construction, twist averaging |
pyqmc.wf.jax |
JAX-based wavefunction and GTO evaluation |
Citation
If you use PyQMC in your research, please cite the relevant papers listed in the documentation.
License
MIT License. Copyright (c) 2019-2026 The PyQMC Developers.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyqmc-0.8.1.tar.gz.
File metadata
- Download URL: pyqmc-0.8.1.tar.gz
- Upload date:
- Size: 118.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db26df517ca85eea0ea34e049fd0db5c95f2b7bb07369d3c7b15cdf0506dfe2d
|
|
| MD5 |
1e952957abcb7b42b92b07567b945b3c
|
|
| BLAKE2b-256 |
c8bdcd0296fbeb27f38c9f7421a5a4265ded3e83adce5d1ba28c6efe89ca1db2
|
Provenance
The following attestation bundles were made for pyqmc-0.8.1.tar.gz:
Publisher:
publish-to-pypi.yml on WagnerGroup/pyqmc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyqmc-0.8.1.tar.gz -
Subject digest:
db26df517ca85eea0ea34e049fd0db5c95f2b7bb07369d3c7b15cdf0506dfe2d - Sigstore transparency entry: 1704396824
- Sigstore integration time:
-
Permalink:
WagnerGroup/pyqmc@fddb539671ac810dedb30220c3f693c07148541e -
Branch / Tag:
refs/heads/master - Owner: https://github.com/WagnerGroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@fddb539671ac810dedb30220c3f693c07148541e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pyqmc-0.8.1-py3-none-any.whl.
File metadata
- Download URL: pyqmc-0.8.1-py3-none-any.whl
- Upload date:
- Size: 156.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffc2728754e2a032c2850988139584ee87e7e1e3e219e6dc863ce08746620dfc
|
|
| MD5 |
4a2090a71aff927422e729569396da4c
|
|
| BLAKE2b-256 |
4a9bd701615a05d78b7de4cf82c31f1619cb3744f051131b59537855203ecccb
|
Provenance
The following attestation bundles were made for pyqmc-0.8.1-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on WagnerGroup/pyqmc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyqmc-0.8.1-py3-none-any.whl -
Subject digest:
ffc2728754e2a032c2850988139584ee87e7e1e3e219e6dc863ce08746620dfc - Sigstore transparency entry: 1704396840
- Sigstore integration time:
-
Permalink:
WagnerGroup/pyqmc@fddb539671ac810dedb30220c3f693c07148541e -
Branch / Tag:
refs/heads/master - Owner: https://github.com/WagnerGroup
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@fddb539671ac810dedb30220c3f693c07148541e -
Trigger Event:
workflow_dispatch
-
Statement type: