Giter Club home page Giter Club logo

qpe-algorithms's Introduction

QPE-Library :atom:

Overview

This is a library containing some basic and novel Quantum Phase Estimation algorithms. The four primary algorithms implemented are-

  • Basic QPE algorithm
  • Iterative QPE algorithm
  • Kitaev's QPE algorithm
  • Statistical QPE algorithm ๐Ÿ†•

Steps to use

  1. Clone the repository using git clone [url_of_repo.git].
  2. If using anaconda distribution, in the anaconda prompt, make a new virtual environment with conda create -n yourenvname python=3.9, activate by typing conda activate yourenvname and install dependenices using pip install -r requirements.txt.
  3. If not, use pip install -r requirements.txt in your python environment.
  4. You are now ready to use the modules present in the modules directory, inside this enviroment.
  5. If using conda, add the current environment to your jupyter notebook by typing python -m ipykernel install --user --name=yourenvname followed by jupyter notebook to run a jupyter instance in this environment
  6. If you have jupyter nbextensions enabled, use this link to install them in your environment.

Algorithms

All algorithms have been implemented as python classes and have support for running on an IBMQBackend and on the simulator provided by Aer. For the examples, each subfolder contains a jupyter notebook depicting the usage of the implemented algorithms.

Basic QPE Algorithm

  • This basic QPE algorithm is based on the principles of phase kickback and inverse Quantum Fourier Transform.
  • A variant called fast_QPE has also been included which uses binary exponentiation to reduce the number of unitary applications in simulation. Note that this is only applicable for simulation purposes but not in real scenarios.
  • Class Names : basic_QPE, fast_QPE
  • Module Path : modules/vanilla_qpe.py, modules/faster_basic_qpe.py
  • Main folder : Basic QPE
  • Examples : Notebook











Iterative QPE Algorithm

  • The iterative phase estimation algorithm(IQPE) is based on the principle that reducing the width of the circuit in exchange for its depth results in smaller circuits which reduce the interaction between qubits thus, reducing errors.

  • The module has a distinctive feature called unknown which uses binary exponentiation to reduce the number of unitary applications in simulation. This feature is only utilised when unknown is set to False.

  • This algorithm proves as one of the best phase estimation routines for the present day NISQ computers.

  • Class Name : general_IQPE

  • Module Path : modules/iterative_qpe.py

  • Main folder : Iterative QPE

  • Examples and Tests: Notebook

Kitaev's QPE Algorithm

  • Kitaev's algorithm for Phase Estimation is an algorithm with two forms. In this implementation, the algorithm which uses a single Unitary matrix for phase estimation is used.
  • Kitaev's algorithm is a very efficient algorithm in terms of quantum execution. Involving some classical post processing work and relatively simple circuits for the phase estimation, the only drawback for this algorithm is the number of shots required for a given precision and probability of error scale up very quickly.
  • Class Name : KQPE
  • Module Path : modules/kitaev_qpe.py
  • Main Folder : Kitaev's Algorithm
  • Examples : Notebook

Statistical QPE Algorithm

  • Statistical Phase Estimation Algorithm or SPEA is a novel approach for phase etimation based on this recent paper. SPEA uses a variational approach to solve the phase estimation and does not require the eigenvector of the unitary matrix to be prepared beforehand.
  • It proposes to give an eigenstate and eigenvalue pair of our Unitary in one successful execution of the algorithm which can be extended to find the full spectral decomposition of a matrix.
  • This library contains the original algorithm proposed by the authors and a modified algorithm. The modified approach was proposed keeping in mind that greedy choices in the original algorithm may not always propose to be optimal. One advantage of this approach is in terms of quantum execution time.
  • Since any quantum computer contains a classical controller through which it is accessed, calling the device multiple times incurs overhead in terms of the classical interfacing. While original appraoach uses exponential API calls for its execution, the modified approach only requires only a constant number of API calls to reach the result.

  • Original Algorithm
    • Class Name - SPEA
    • Module Path - modules/normal_SPEA.py
    • Main Folder - Statistical QPE
    • Examples - Notebook
  • Modified Algorithm
    • Class Names - global_max_SPEA , bundled_global_max_SPEA, bundled_global_max_alt_SPEA
    • Module Path - modules/changed_SPEA.py
    • Main Folder - Statistical QPE
    • Examples - Notebook

qpe-algorithms's People

Contributors

thegupta2012 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.