Skip to main content

Documentation Status PyPi version arXiv

jVMC

This is an impementation of Variational Monte Carlo (VMC) for quantum many-body dynamics using the JAX library (and Flax on top) to exploit the blessings of automatic differentiation for easy model composition and just-in-time compilation for execution on accelerators.

  1. Documentation
  2. Installation
  3. Migrating from jVMC 1.x
  4. Using jVMC with AI coding agents
  5. Online example
  6. Important gotchas
  7. Citing jVMC

Please report bugs as well as other issues or suggestions on our issues page.

Documentation

Documentation is available here.

Installation

Option 1: pip-install

    pip install jVMC

To install jVMC with GPU support, use

    pip install jVMC[cuda12]

or pip install jVMC[cuda13] depending on your CUDA version. This is assuming, that jax[cuda12]/jax[cuda13] will work for you (see the JAX documentation), and additionally installs jaxmg for distributed linear algebra across multiple GPUs.

On a cluster where CUDA is already provided (e.g. via an environment module) rather than pip-installed, use the -local variant instead, e.g. pip install jVMC[cuda12-local] or pip install jVMC[cuda13-local].

Option 2: Clone and pip-install for development

  1. Clone the jVMC repository and check out the development branch:

     git clone https://github.com/markusschmitt/vmc_jax.git
     cd vmc_jax
    
  2. pip-install the package

     pip install -e ".[dev]"
    

Test that everything worked, e.g. run 'python -c "import jVMC"' from a place different than vmc_jax.

Migrating from jVMC 1.x

jVMC 2.0 changes most of the API. See MIGRATION.md for what changed and how to port existing scripts.

Using jVMC with AI coding agents

The folder skills/jvmc is an Agent Skill that teaches coding agents how to use jVMC 2.0. Without it, agents tend to write code for the 1.x API. To install it for Claude Code, copy the folder into your skills directory, using the tag of the jVMC version you have installed:

    git clone --depth 1 --branch <version tag> https://github.com/computational-quantum-science/jvmc-2.0.git jvmc-src
    cp -r jvmc-src/skills/jvmc ~/.claude/skills/

Use <your project>/.claude/skills/ instead of ~/.claude/skills/ to enable it for one project only. For other agents, copy the folder into their skills directory.

Online example

Open In Colab

Click on the badge above to open a notebook that implements an exemplary ground state search in Google Colab.

Important gotchas

Out-of-memory issues and batching

Memory requirements grow with increasing network sizes. To avoid out-of-memory issues, the batch_size parameter of the NQS class has to be adjusted. The batch_size indicates on how many input configurations the network is evaluated concurrently. Out-of-memory issues are usually resolved by reducing this number. The num_chains parameter of the Sampler class for Markov Chain Monte Carlo sampling plays a similar role, but its optimal values in terms of computational speed are typically not memory critical.

Citing jVMC

If you use the jVMC package for your research, please cite our reference paper SciPost Phys. Codebases 2 (2022)

    @Article{jVMC,
            title={{jVMC: Versatile and performant variational Monte Carlo leveraging automated differentiation and GPU acceleration}},
            author={Markus Schmitt and Moritz Reh},
            journal={SciPost Phys. Codebases},
            pages={2},
            year={2022},
            publisher={SciPost},
            doi={10.21468/SciPostPhysCodeb.2},
            url={https://scipost.org/10.21468/SciPostPhysCodeb.2},
    }

Metadata

Release files for jVMC 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jVMC 2.0.0
File Size Uploaded Provenance Actions
jvmc-2.0.0.tar.gz 142.5 kB Without provenance Details for jvmc-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jVMC 2.0.0
File Interpreter ABI Platform Actions
jvmc-2.0.0-py3-none-any.whl Python 3 none any Details for jvmc-2.0.0-py3-none-any.whl

Total release size: 313.3 kB

Release files / jvmc-2.0.0.tar.gz

Download URL jvmc-2.0.0.tar.gz
Size 142.5 kB
Tags Source
SHA-256 checksum
How to use checksums
45abb8a99af29c0e8948d0fd88502518d87120d94eef85d8441c69acba074ed4
BLAKE2b-256 checksum
How to use checksums
0caf5d2d5a213b7541573f48111bf052b0b044121a667d63fd2a491bc822aa76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / jvmc-2.0.0-py3-none-any.whl

Download URL jvmc-2.0.0-py3-none-any.whl
Size 170.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dee769068fea1ea7abf33c6950b0e30a79bd02558c672fc11931f0cb24d26af5
BLAKE2b-256 checksum
How to use checksums
92787d7217bf7aba7f77f42b70350fab253fa4005c97228a9a11836c4bf6fb82
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Security for jVMC 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page