Giter VIP home page Giter VIP logo

quantum-enhanced-variational-autoencoder's Introduction

Quantum-enhanced-variational-autoencdoer

This repository contains the source code for the paper: Learning hard distributions with quantum-enhanced Variational Autoencoders

  • The sourcecode is available under the folder Sourcecode with sample notebooks in Notebooks.
  • All datasets used for the experiments are present in Datasets. These include 4-qubit and 8-qubit states obtained from product states, haar states, quantum-circuit states, and quantum-kicked rotor states.

Installation

  1. Clone this Github repository using the following command in your command line/terminal :
    git clone [email protected]:Anantha-Rao12/Quantum-enhanced-variational-autoencoder.git

  2. Create a Python (>=3.2) virtual environemnt and call it 'Decoding-Quantum-States-with-NMR-env'.

  • On Linux/ MacOS : python3 -m venv qiskitml-env
  • On Windows : python -m venv qiskitml-env

A new directory called qiskitml-env will be created.

  1. Activate the Virtual Environment by running:
  • On Linux/ MacOS: source qiskitml-env/bin/activate
  • On Windows: .\qiskitml-env\Scripts\activate
  1. In the new virtual environemnt , run pip3 install -r requirements.txt to install all dependencies. On Windows, pip3 should be replaced by pip.

You are ready to start experiemnting with the code!

Execution

For the sake of simplicity and quick execution, we have a QeVAEWrapper() class that implements a QeVAE with default parameters. The model can be initialized, trained, and samples can be generated as shown in the notebook How to Train a QeVAE.ipynb. The three main steps are:

  1. Creating the dataloaders : dataloaders, dataloader_info = setup_dataloaders(dataset, want_datasetsize=1, train_size=0.75)

  2. Creating and fitting the mode:

qevae = QeVAEWrapper(num_qubits=2, latentsize=1)
qevae.fit(traindataloader, validdataloader, original_results=dataset_dict)
  1. Finally, after training, we can generate samples using qevae.sample()

Example notebooks

Under the Notebooks directory, we have two notebooks that show how we train QeVAEs for two tasks: (1) Learning the distribution (2) Compressing the circuit. The respective notebooks are titled 4qubit_productstates_analysis.ipynb and Circuit_compilation_QeVAE.ipynb contain more details on implementation.

Contact

DM Anantha S Rao - @anantharao00
For clarifications and queries -- Anantha Rao @2023

Project Link: https://github.com/AnanthaRao-12/Quantum-enhanced-variational-autoencoder

quantum-enhanced-variational-autoencoder's People

Contributors

anantha-rao12 avatar

Stargazers

 avatar  avatar  avatar

Watchers

Dhiraj Madan avatar anupamaray avatar  avatar

Forkers

bolunzhangzbl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.