Skip to main content

A Python framework for the quantum autoencoder algorithm

Project description

Description

QCompress is a Python framework for the quantum autoencoder (QAE) algorithm. Using the code, the user can execute instances of the algorithm on either a quantum simulator or a quantum processor provided by Rigetti Computing’s Quantum Cloud Services. For a more in-depth description of QCompress (including the naming convention for the types of qubits involved in the QAE circuit), click here.

For more information about the algorithm, see Romero et al. Note that we deviate from the training technique used in the original paper and instead introduce two alternative autoencoder training schemes that require lower-depth circuits (see Sim et al).

Features

This code is based on an older version written during Rigetti Computing’s hackathon in April 2018. Since then, we’ve updated and enhanced the code, supporting the following features:

  • Executability on Rigetti’s quantum processor(s)

  • Several training schemes for the autoencoder

  • Use of the RESET operation for the encoding qubits (lowers qubit requirement)

  • User-definable training circuit and/or classical optimization routine

  • [WIP]: Use of parametric compilation (supported but being optimized. Notebook coming soon.)

Installation

To install QCompress using pip:

pip install qcompress

Try executing import qcompress to test the installation in your terminal.

To instead install QCompress from source, clone this repository, cd into it, and run:

git clone https://github.com/hsim13372/QCompress
cd QCompress
python -m pip install -e .

Note that the pyQuil version used requires Python 3.6 or later. For installation on a user QMI, please click here.

Examples

We provide several Jupyter notebooks to demonstrate the utility of QCompress. We recommend going through the notebooks in the order shown in the table (top-down).

Notebook

Feature(s)

qae_h2_demo.ipynb

Simulates the compression of the ground states of the hydrogen molecule. Uses OpenFermion and grove to generate data. Demonstrates the “halfway” training scheme.

qae_two_qubit_demo.ipynb

Simulates the compression of a two-qubit data set. Outlines how to run an instance on an actual device. Demonstrates the “full with reset” training scheme.

run_landscape_scan.ipynb

Shows user how to run landscape scans for small (few-parameter) instances. Demonstrates setup of the “full with no reset” training scheme.

Disclaimer

We note that there is a lot of room for improvement and fixes. Please feel free to submit issues and/or pull requests!

How to cite

When using QCompress for research projects, please cite:

Sukin Sim, Yudong Cao, Jonathan Romero, Peter D. Johnson and Alán Aspuru-Guzik. A framework for algorithm deployment on cloud-based quantum computers. arXiv:1810.10576. 2018.

Authors

Sukin (Hannah) Sim (Harvard), Zapata Computing, Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qcompress-0.0.1.dev10.tar.gz (106.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

qcompress-0.0.1.dev10-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

qcompress-0.0.1.dev10-py2.py3-none-any.whl (18.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file qcompress-0.0.1.dev10.tar.gz.

File metadata

  • Download URL: qcompress-0.0.1.dev10.tar.gz
  • Upload date:
  • Size: 106.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for qcompress-0.0.1.dev10.tar.gz
Algorithm Hash digest
SHA256 780d7fb3415ab43fe86d6eaa37579efb2066ea790bff7b2be340ffb9a32fd44c
MD5 952962d917d92834cb67772da7b5da8f
BLAKE2b-256 ac46484c25ace8bb2ab0796e88bec7a5041862e0ce7786e9213b1dbc923d9bb4

See more details on using hashes here.

File details

Details for the file qcompress-0.0.1.dev10-py3-none-any.whl.

File metadata

  • Download URL: qcompress-0.0.1.dev10-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for qcompress-0.0.1.dev10-py3-none-any.whl
Algorithm Hash digest
SHA256 8421c21a1d5c686272a2c1d437657c150a024ea21bb4f8351d1df2c5a6ccd42c
MD5 737bb7a8300af84d5c76c7b3890c858a
BLAKE2b-256 b7733075fdd352242c622284dc9b627503709406571acb32ce2bf1296efd4e83

See more details on using hashes here.

File details

Details for the file qcompress-0.0.1.dev10-py2.py3-none-any.whl.

File metadata

  • Download URL: qcompress-0.0.1.dev10-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for qcompress-0.0.1.dev10-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 34a2e93410ad5af6d4fdc44b10d57091ef4b5528c774d012f1d6a0e10fd14632
MD5 2d21bde0b15d41cb622c069a7616e20d
BLAKE2b-256 1035d6de814aaabf50e3a294268f5f54b29009e1d06f7ffa0ec5f604636ed391

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page