n-mcmc

Autoregressive Neural Networks for accelerating Monte Carlo simulations with quantum data

https://github.com/gscriva/n-mcmc

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

autoregressive made monte-carlo-simulation pixel-cnn pytorch-lightning
Last synced: 9 months ago · JSON representation ·

Repository

Autoregressive Neural Networks for accelerating Monte Carlo simulations with quantum data

Basic Info
  • Host: GitHub
  • Owner: gscriva
  • License: mit
  • Language: Jupyter Notebook
  • Default Branch: main
  • Homepage:
  • Size: 12.4 MB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 2
Topics
autoregressive made monte-carlo-simulation pixel-cnn pytorch-lightning
Created over 3 years ago · Last pushed over 2 years ago
Metadata Files
Readme License Citation

README.md

# Accelerating equilibrium spin-glass simulations using quantum data and deep learning PyTorch Lightning Config: Hydra Template
[![Paper](http://img.shields.io/badge/paper-SciPost%20Phys.%2015,%20018%20(2023)-B31B1B.svg)](https://scipost.org/10.21468/SciPostPhys.15.1.018) [![DOI](https://zenodo.org/badge/542095061.svg)](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

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

requirements.txt pypi
  • 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 *