n-mcmc
Autoregressive Neural Networks for accelerating Monte Carlo simulations with quantum data
Science Score: 67.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 7 DOI reference(s) in README -
✓Academic publication links
Links to: zenodo.org -
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (13.0%) to scientific vocabulary
Keywords
Repository
Autoregressive Neural Networks for accelerating Monte Carlo simulations with quantum data
Basic Info
Statistics
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 2
Topics
Metadata Files
README.md
[-B31B1B.svg)](https://scipost.org/10.21468/SciPostPhys.15.1.018) [](https://zenodo.org/badge/latestdoi/542095061)
Description
Sampling from the low-temperature Boltzmann distribution of spin glasses is a hard computational task, relevant for physics research and important optimization problems in engineering and finance. Adiabatic quantum computers are being used to tackle the optimization task, corresponding to find the lowest energy spin configuration. In this paper we show how to exploit quantum annealers to accelerate equilibrium Markov chain Monte Carlo simulations of spin glasses at low but finite temperature. Generative neural networks are trained on spin configurations produced by the D-Wave quantum annealers. Moreover, they are used to generate smart proposals for the Metropolis- Hastings algorithm. In particular, we explore hybrid schemes by combining neural and single spin-flip proposals, as well as D-Wave and classical Monte Carlo training data. The hybrid algorithm outperforms the single spin-flip Metropolis-Hastings algorithm and it is competitive with parallel tempering in terms of correlation times, with the significant benefit of a faster equilibration.
For a visual summary (with some results) you can have a look to the notebook article_figures without re-running anything. If you want to reproduce the same plots of the article, dowload the data and install the dependecies before run it.
How to run
Install dependencies ```yaml
clone project
git clone https://github.com/gscriva/n-mcmc cd n-mcmc
[OPTIONAL] create conda environment
bash bash/setup_conda.sh
install requirements
pip install -r requirements.txt
Get the data from the Zenodo directory [10.5281/zenodo.7250436](https://doi.org/10.5281/zenodo.7250436) and move them in [data/](data/), the directory must be organized as follow:
data
├── couplings
| ├── 100.txt
| .
| .
| └── 484-z8.txt
├── dataforfig
| ├── datafig1.csv
| .
| .
| .
| └── datafig7.csv
└── datasets
├── 100-1mus
| ├── train1us.npy
| └── train1us.npy
.
.
.
└── 484-z8-1mus
├── ...
└── ...
```
Train model with default configuration ```yaml
default
python run.py ```
Train model with chosen experiment configuration from configs/experiment/ ```yaml
model with 100 spins
python run.py experiment=100spin-1nn.yaml
models with 484 spins
python run.py experiment=484spin-3nn.yaml ```
You can generate from the trained model with
yaml
python predict.py --ckpt-path=logs/the/trained/model/path.ckpt --model=made
Citation
@article{10.21468/SciPostPhys.15.1.018,
title={{Accelerating equilibrium spin-glass simulations using quantum annealers via generative deep learning}},
author={Giuseppe Scriva and Emanuele Costa and Benjamin McNaughton and Sebastiano Pilati},
journal={SciPost Phys.},
volume={15},
pages={018},
year={2023},
publisher={SciPost},
doi={10.21468/SciPostPhys.15.1.018},
url={https://scipost.org/10.21468/SciPostPhys.15.1.018},
}
Owner
- Name: Giuseppe Scriva
- Login: gscriva
- Kind: user
- Location: Zurich
- Company: University of Camerino
- Website: https://cutt.ly/gN7rbGs
- Repositories: 2
- Profile: https://github.com/gscriva
Just another infinite monkey trying to write his Divine Comedy.
Citation (CITATION.cff)
cff-version: 1.0.2 message: "If you use this software, please cite it as below." authors: - family-names: "Scriva" given-names: "Giuseppe" orcid: "https://orcid.org/0000-0001-5617-7436" title: "Accelerating equilibrium spin-glass simulations using quantum data and deep learning" version: 1.0.2 doi: 10.5281/zenodo.7118502 date-released: 2022-10-26 url: "https://github.com/gscriva/n-mcmc"
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Dependencies
- black *
- flake8 *
- hydra-colorlog ==1.1.0
- hydra-core ==1.1.0
- hydra-optuna-sweeper ==1.1.0
- isort *
- jupyterlab *
- numba *
- pre-commit *
- pudb *
- pytest *
- pytorch-lightning ==1.5.8
- rich *
- scikit-learn *
- seaborn *
- sh *
- statsmodels *
- torch >=1.8.1
- torchvision >=0.9.1
- wandb *