QuantumCircuitBornMachine icon indicating copy to clipboard operation
QuantumCircuitBornMachine copied to clipboard

gradient based training of Quantum Circuit Born Machine

Quantum Circuit Born Machine - the Demo

Gradient based training of Quantum Circuit Born Machine (QCBM)

Table of Contents

This project contains

  • notebooks/qcbm_gaussian.ipynb (or online), basic tutorial of training 6 bit Gaussian distribution using QCBM,
  • notebooks/qcbm_advanced.ipynb (or online), an advanced tutorial,
  • qcbm folder, a simple python project for productivity purpose.

Setup Guide

Set up your python environment

  • python 3.6
  • install python libraries

If you want to read notebooks only and do not want to use features like projectq, having numpy, scipy and matplotlib is enough. To access advanced features, you should install fire, projectq and climin.

$ conda install -c conda-forge pybind11
$ pip install -r requirements.txt

Clone this repository https://github.com/GiggleLiu/QuantumCircuitBornMachine.git to your local host.

Access online materials

  1. Sign up and sign in Google drive
  2. Connect Google drive with Google Colaboratory
    • right click on google drive page
    • More
    • Connect more apps
    • search "Colaboratory" and "CONNECT"
  3. You can make a copy of notebook to your google drive (File Menu) to save your edits.

Also, we have provided a Julia code here.

Run Bar-and-Stripes Demo on Your Localhost

$ ./program.py checkgrad  # check the correctness of gradient
$ ./program.py statgrad  # check gradient will not vanish as layer index increase.
$ ./program.py vcircuit  # visualize circuit using ProjectQ
$ ./program.py train   # train and save data.
$ ./program.py vpdf   # see bar stripe dataset PDF
$ ./program.py generate  # generate bar and stripes using trainned circuit.

Documentations

  • paper: Differentiable Learning of Quantum Circuit Born Machine (pdf), arXiv:1804.04168, Jin-Guo Liu, Lei Wang
  • slides: online

Citation

If you use this code for your research, please cite our paper:

@article{Liu2018,
  author = {Jin-Guo Liu and Lei Wang},
  title = {Differentiable Learning of Quantum Circuit Born Machine},
  year = {2018},
  eprint = {arXiv:1804.04168},
  url = {https://arxiv.org/abs/1804.04168}
}

Authors