All Projects → saforem2 → l2hmc-qcd

saforem2 / l2hmc-qcd

Licence: Apache-2.0 license
Application of the L2HMC algorithm to simulations in lattice QCD.

Programming Languages

python
139335 projects - #7 most used programming language
Jupyter Notebook
11667 projects
shell
77523 projects

Projects that are alternatives of or similar to l2hmc-qcd

mcmc
A C++ library of Markov Chain Monte Carlo (MCMC) methods
Stars: ✭ 108 (+227.27%)
Mutual labels:  mcmc, hmc, hamiltonian-monte-carlo
SpinMonteCarlo.jl
Markov chain Monte Carlo solver for lattice spin systems implemented by Julialang
Stars: ✭ 35 (+6.06%)
Mutual labels:  monte-carlo, lattice, mcmc
LatticeQCD.jl
A native Julia code for lattice QCD with dynamical fermions in 4 dimension.
Stars: ✭ 85 (+157.58%)
Mutual labels:  monte-carlo, hmc, lattice-qcd
ml
machine learning
Stars: ✭ 29 (-12.12%)
Mutual labels:  monte-carlo, mcmc
pylj
Teaching Utility for Classical Atomistic Simulation.
Stars: ✭ 23 (-30.3%)
Mutual labels:  monte-carlo
cmna-pkg
Computational Methods for Numerical Analysis
Stars: ✭ 13 (-60.61%)
Mutual labels:  monte-carlo
gpt
A Python toolkit for lattice field theory, quantum computing, and machine learning
Stars: ✭ 60 (+81.82%)
Mutual labels:  lattice-qcd
Study-of-David-Mackay-s-book-
David Mackay's book review and problem solvings and own python codes, mathematica files
Stars: ✭ 46 (+39.39%)
Mutual labels:  hamiltonian-monte-carlo
posts
Pieces of code that have appeared on my blog with a focus on stochastic simulations.
Stars: ✭ 31 (-6.06%)
Mutual labels:  mcmc
SpinMC.jl
Classical Monte Carlo simulations for lattice spin systems
Stars: ✭ 18 (-45.45%)
Mutual labels:  monte-carlo
CorBinian
CorBinian: A toolbox for modelling and simulating high-dimensional binary and count-data with correlations
Stars: ✭ 15 (-54.55%)
Mutual labels:  mcmc
pergola
Low-cost ECP5 FPGA development board
Stars: ✭ 64 (+93.94%)
Mutual labels:  lattice
DynamicHMCExamples.jl
Examples for Bayesian inference using DynamicHMC.jl and related packages.
Stars: ✭ 33 (+0%)
Mutual labels:  mcmc
verifla
Fork of OpenVeriFla - FPGA debugging logic analyzer to use with your designs - examples (so far) for ice40/IceStorm
Stars: ✭ 21 (-36.36%)
Mutual labels:  lattice
catplot
A Python Library for Energy Profile and Abstract Grid(2D/3D) plotting
Stars: ✭ 31 (-6.06%)
Mutual labels:  lattice
MultiBUGS
Multi-core BUGS for fast Bayesian inference of large hierarchical models
Stars: ✭ 28 (-15.15%)
Mutual labels:  mcmc
libsafecrypto
WP6 of the SAFEcrypto project - a suite of lattice-based cryptographic schemes
Stars: ✭ 31 (-6.06%)
Mutual labels:  lattice
LogDensityProblems.jl
A common framework for implementing and using log densities for inference.
Stars: ✭ 26 (-21.21%)
Mutual labels:  mcmc
mc-tools
Some Monte Carlo tools
Stars: ✭ 27 (-18.18%)
Mutual labels:  monte-carlo
rough bergomi
A Python implementation of the rough Bergomi model.
Stars: ✭ 63 (+90.91%)
Mutual labels:  monte-carlo

l2hmc-qcd

pyTorch hydra tensorflow
arxiv arxiv
l2hmc-qcd codefactor

📊 Slides

📒 Example Notebook


Overview

The L2HMC algorithm aims to improve upon HMC by optimizing a carefully chosen loss function which is designed to minimize autocorrelations within the Markov Chain, thereby improving the efficiency of the sampler.

This work is based on the original implementation: brain-research/l2hmc/.

A detailed description of the L2HMC algorithm can be found in the paper:

Generalizing Hamiltonian Monte Carlo with Neural Network

by Daniel Levy, Matt D. Hoffman and Jascha Sohl-Dickstein.

Broadly, given an analytically described target distribution, π(x), L2HMC provides a statistically exact sampler that:

  • Quickly converges to the target distribution (fast burn-in).
  • Quickly produces uncorrelated samples (fast mixing).
  • Is able to efficiently mix between energy levels.
  • Is capable of traversing low-density zones to mix between modes (often difficult for generic HMC).

L2HMC for LatticeQCD

Goal: Use L2HMC to efficiently generate gauge configurations for calculating observables in lattice QCD.

A detailed description of the (ongoing) work to apply this algorithm to simulations in lattice QCD (specifically, a 2D U(1) lattice gauge theory model) can be found in doc/main.pdf.

l2hmc-qcd poster

Organization

Dynamics / Network

The base class for the augmented L2HMC leapfrog integrator is implemented in the BaseDynamics (a tf.keras.Model object).

The GaugeDynamics is a subclass of BaseDynamics containing modifications for the 2D U(1) pure gauge theory.

The network is defined in l2hmc-qcd/network/functional_net.py.

Network Architecture

An illustration of the leapfrog layer updating (x, v) --> (x', v') can be seen below.

leapfrog layer

Lattice

Lattice code can be found in lattice.py, specifically the GaugeLattice object that provides the base structure on which our target distribution exists.

Additionally, the GaugeLattice object implements a variety of methods for calculating physical observables such as the average plaquette, ɸₚ, and the topological charge Q,

Training

The training loop is implemented in l2hmc-qcd/utils/training_utils.py .

To train the sampler on a 2D U(1) gauge model using the parameters specified in bin/train_configs.json:

$ python3 /path/to/l2hmc-qcd/l2hmc-qcd/train.py --json_file=/path/to/l2hmc-qcd/bin/train_configs.json

Or via the bin/train.sh script provided in bin/.

Features

  • Distributed training (via horovod): If horovod is installed, the model can be trained across multiple GPUs (or CPUs) by:

    #!/bin/bash
    
    TRAINER=/path/to/l2hmc-qcd/l2hmc-qcd/train.py
    JSON_FILE=/path/to/l2hmc-qcd/bin/train_configs.json
    
    horovodrun -np ${PROCS} python3 ${TRAINER} --json_file=${JSON_FILE}

Contact


Code author: Sam Foreman

Pull requests and issues should be directed to: saforem2

Citation

If you use this code or found this work interesting, please cite our work along with the original paper:

@misc{foreman2021deep,
      title={Deep Learning Hamiltonian Monte Carlo}, 
      author={Sam Foreman and Xiao-Yong Jin and James C. Osborn},
      year={2021},
      eprint={2105.03418},
      archivePrefix={arXiv},
      primaryClass={hep-lat}
}
@article{levy2017generalizing,
  title={Generalizing Hamiltonian Monte Carlo with Neural Networks},
  author={Levy, Daniel and Hoffman, Matthew D. and Sohl-Dickstein, Jascha},
  journal={arXiv preprint arXiv:1711.09268},
  year={2017}
}

Acknowledgement

This research used resources of the Argonne Leadership Computing Facility, which is a DOE Office of Science User Facility supported under contract DE_AC02-06CH11357. This work describes objective technical results and analysis. Any subjective views or opinions that might be expressed in the work do not necessarily represent the views of the U.S. DOE or the United States Government. Declaration of Interests - None.

Hits

Stargazers over time

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].