Skip to content

Commit

Permalink
Add new notebook and remove useless modules
Browse files Browse the repository at this point in the history
  • Loading branch information
gscriva committed Oct 26, 2022
1 parent 5244589 commit d506b02
Show file tree
Hide file tree
Showing 20 changed files with 818 additions and 3,142 deletions.
6 changes: 3 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cff-version: 1.0.1
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.1
version: 1.0.2
doi: 10.5281/zenodo.7118502
date-released: 2022-09-28
date-released: 2022-10-26
url: "https://github.com/gscriva/n-mcmc"
57 changes: 0 additions & 57 deletions Dockerfile

This file was deleted.

32 changes: 28 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<a href="https://pytorchlightning.ai/"><img alt="Lightning" src="https://img.shields.io/badge/-Lightning-792ee5?logo=pytorchlightning&logoColor=white"></a>
<a href="https://hydra.cc/"><img alt="Config: Hydra" src="https://img.shields.io/badge/Config-Hydra-89b8cd"></a>
<a href="https://github.com/ashleve/lightning-hydra-template"><img alt="Template" src="https://img.shields.io/badge/-Lightning--Hydra--Template-017F2F?style=flat&logo=github&labelColor=gray"></a><br>
[![Paper](http://img.shields.io/badge/paper-arxiv.1001.2234-B31B1B.svg)](https://www.nature.com/articles/nature14539)
[![Paper](http://img.shields.io/badge/paper-arxiv.1001.2234-B31B1B.svg)](https://arxiv.org/abs/2210.11288v1)
[![DOI](https://zenodo.org/badge/542095061.svg)](https://zenodo.org/badge/latestdoi/542095061)

</div>
Expand All @@ -18,7 +18,7 @@ Adiabatic quantum computers are being used to tackle the optimization task, corr
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 [`accelerating_monte_carlo`](notebooks/accelerating_monte_carlo.ipynb) without re-running anything. If you want to reproduce the same plots of the article, move the notebook in the parent directory `n-mcmc`, dowload the data and install the dependecies before run it.
For a visual summary (with some results) you can have a look to the notebook [`article_figures`](article_figures.ipynb) 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
Expand All @@ -33,7 +33,31 @@ bash bash/setup_conda.sh
# install requirements
pip install -r requirements.txt
```
Get the data from the Zenodo directory #TODO and unzip them in [data/](data/)
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
├── data_for_fig
| ├── data_fig1.csv
| .
| .
| .
| └── data_fig7.csv
└── datasets
├── 100-1mus
| ├── train_1us.npy
| └── train_1us.npy
.
.
.
└── 484-z8-1mus
├── ...
└── ...
```

Train model with default configuration
```yaml
Expand All @@ -52,7 +76,7 @@ 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.ckpt --model=made
python predict.py --ckpt-path=logs/the/trained/model/path.ckpt --model=made
```

<br>
509 changes: 509 additions & 0 deletions article_figures.ipynb

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions example.env

This file was deleted.

Empty file removed notebooks/.gitkeep
Empty file.
Loading

0 comments on commit d506b02

Please sign in to comment.