JAX accelerated Quantum Monte Carlo
See the codeJaQMC is a JAX-based framework for neural network quantum Monte Carlo (QMC). It uses deep neural networks as variational wavefunctions to solve the electronic Schrödinger equation, achieving high accuracy without relying on basis sets or density functionals.
If you’re looking for the old (pre-0.1) JaQMC codebase / APIs, use the legacy
namespace: import jaqmc_legacy.
If you're interested in neural network QMC and want to get started quickly, run real calculations, or build on top of a clean codebase — JaQMC is designed for you.
Before you begin, make sure you have:
Clone the repository and navigate to the jaqmc directory.
git clone https://github.com/bytedance/jaqmc.git
cd jaqmc
Install with uv (recommended):
uv sync --frozen --python 3.12
This installs the exact dependency versions currently tested by the project from the official PyPI index.
If you prefer pip, or if you use a PyPI mirror, create a virtual environment first and install manually:
python -m venv .venv && source .venv/bin/activate
pip install -e . -r requirements.txt --extra-index-url https://pypi.org/simple
The --extra-index-url https://pypi.org/simple flag is recommended when you use PyPI mirrors, since some mirrors may not include every required package.
For GPU acceleration, choose the option that matches your setup:
# Option 1: Download CUDA libraries (recommended; no system CUDA required)
uv sync --frozen --python 3.12 --extra cuda12
# Or with pip:
pip install -e ".[cuda12]" -r requirements.txt --extra-index-url https://pypi.org/simple
# Option 2: Use a local CUDA installation (requires CUDA 12 to already be installed)
uv sync --frozen --python 3.12 --extra cuda12-local
# Or with pip:
pip install -e ".[cuda12_local]" -r requirements.txt --extra-index-url https://pypi.org/simple
For troubleshooting GPU setup, see the JAX installation guide.
source .venv/bin/activate
# Run the hydrogen atom example
jaqmc hydrogen-atom train
# Customize parameters
jaqmc hydrogen-atom train train.optim.learning_rate.rate=0.01 train.run.iterations=200
# Run a lithium atom simulation
jaqmc molecule train system.module=atom system.symbol=Li
See the documentation for detailed guides on installation, molecular simulations, and writing custom workflows.
uv sync --frozen --python 3.12
uv tool install prek
prek install
# Run tests
pytest
# Linting and formatting
ruff check .
mypy .
ruff format .
If you use JaQMC in your research, please cite the following paper, which introduced the first version of the software:
@article{ren_towards_2023,
title = {Towards the Ground State of Molecules via Diffusion {{Monte Carlo}} on Neural Networks},
author = {Ren, Weiluo and Fu, Weizhong and Wu, Xiaojie and Chen, Ji},
year = 2023,
month = apr,
journal = {Nature Communications},
volume = {14},
number = {1},
pages = {1860},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/s41467-023-37609-3},
}
See Citing JaQMC for additional citations for specific techniques.
Python
99.7%
JAX accelerated Quantum Monte Carlo
See the codeJaQMC is a JAX-based framework for neural network quantum Monte Carlo (QMC). It uses deep neural networks as variational wavefunctions to solve the electronic Schrödinger equation, achieving high accuracy without relying on basis sets or density functionals.
If you’re looking for the old (pre-0.1) JaQMC codebase / APIs, use the legacy
namespace: import jaqmc_legacy.
If you're interested in neural network QMC and want to get started quickly, run real calculations, or build on top of a clean codebase — JaQMC is designed for you.
Before you begin, make sure you have:
Clone the repository and navigate to the jaqmc directory.
git clone https://github.com/bytedance/jaqmc.git
cd jaqmc
Install with uv (recommended):
uv sync --frozen --python 3.12
This installs the exact dependency versions currently tested by the project from the official PyPI index.
If you prefer pip, or if you use a PyPI mirror, create a virtual environment first and install manually:
python -m venv .venv && source .venv/bin/activate
pip install -e . -r requirements.txt --extra-index-url https://pypi.org/simple
The --extra-index-url https://pypi.org/simple flag is recommended when you use PyPI mirrors, since some mirrors may not include every required package.
For GPU acceleration, choose the option that matches your setup:
# Option 1: Download CUDA libraries (recommended; no system CUDA required)
uv sync --frozen --python 3.12 --extra cuda12
# Or with pip:
pip install -e ".[cuda12]" -r requirements.txt --extra-index-url https://pypi.org/simple
# Option 2: Use a local CUDA installation (requires CUDA 12 to already be installed)
uv sync --frozen --python 3.12 --extra cuda12-local
# Or with pip:
pip install -e ".[cuda12_local]" -r requirements.txt --extra-index-url https://pypi.org/simple
For troubleshooting GPU setup, see the JAX installation guide.
source .venv/bin/activate
# Run the hydrogen atom example
jaqmc hydrogen-atom train
# Customize parameters
jaqmc hydrogen-atom train train.optim.learning_rate.rate=0.01 train.run.iterations=200
# Run a lithium atom simulation
jaqmc molecule train system.module=atom system.symbol=Li
See the documentation for detailed guides on installation, molecular simulations, and writing custom workflows.
uv sync --frozen --python 3.12
uv tool install prek
prek install
# Run tests
pytest
# Linting and formatting
ruff check .
mypy .
ruff format .
If you use JaQMC in your research, please cite the following paper, which introduced the first version of the software:
@article{ren_towards_2023,
title = {Towards the Ground State of Molecules via Diffusion {{Monte Carlo}} on Neural Networks},
author = {Ren, Weiluo and Fu, Weizhong and Wu, Xiaojie and Chen, Ji},
year = 2023,
month = apr,
journal = {Nature Communications},
volume = {14},
number = {1},
pages = {1860},
publisher = {Nature Publishing Group},
issn = {2041-1723},
doi = {10.1038/s41467-023-37609-3},
}
See Citing JaQMC for additional citations for specific techniques.
Python
99.7%