Skip to main content

A python package for generating quantum circuits using quantum algorithms.

Project description

pyLIQTR Version 0.3.1

Kevin Obenland, Justin Elenewski, Arthur Kurlej, Joe Belarge, John Blue & Robert Rood


Description

pyLIQTR (LIncoln Laboratory Quantum algorithm Test and Research), is a python library for building quantum circuits derived from quantum algorithms. Once the circuits have been generated, one can simulate them (if they are small enough), or utilize them for resource estimations. The codebase is actively developed, and currently supports the following algorithms:

  • Hamiltonian Simulation using Quantum Signal Processing (QSP) for real-valued Hamiltonians

  • Ground State Estimation (GSE) using the Hadamard Test architecture with Trotterization

    • Requires openfermion (which is by default not installed), see note in Optional Installs section below.

Installation and Environment Setup

It is recommended that conda be used to manage the environment. A setup.py file is included to facilitate this. Change directory to the location of setup.py, then perform the following commands.

  • Create and activate the environment:

      conda create -n <Environment Name> python=3.8
    
      conda activate <Environment Name>
    
  • Install the package

      pip install .
    
  • Or, as a developer:

      pip install --editable .
    

Optional Installs

  • Install MPSolve polynomial solver, which is used in the angle generation algorithm. Instructions for installation can be found here: https://numpi.dm.unipi.it/software/mpsolve
  • If not installed, then scipy will be used to calculate valid angles. Angle generation using scipy will generally take longer than angle generation using mpsolve. Effort is underway to deprecate the existing angle generation in favor of a more portable and efficient method.
  • Install openfermion & pyscf.
    • Openfermion is used for the implementation of Suzuki-Trotter and as the input to our implementation of GSE. This is required to use the GSE implementation.
    • pyscf is used in conjunction with openfermion in order to generate new problem instances as input into our GSE implementation.

Overview of Examples Included as Jupyter Notebooks

There are a variety of examples provided to demonstrate the capabilities of pyLIQTR. In particular, there are demonstrations of the following algorithms (and example problems) under <pyLIQTR root>/Examples:

  • QSP
    • Vlasov-Hermite Model
    • Heisenberg Model
    • Transverse-field Ising Model
  • GSE

Where each demonstration contains five tutorial notebooks, which each serve the following purpose:

  • Tutorial_1a (Problem Description & Classical Solving)
    • This tutorial provides a brief introduction to the physical problem of interest and how pyLIQTR can be used to generate a representation of the model. This tutorial then showcases how pyLIQTR and/or numpy/scipy methods can then be used to classically solve the problem or simulate the system. We note that since we are interested in classically hard problems, these notebooks focus on small problems or special cases that can be executed on most personal computers.
  • Tutorial_1b (Solving with a Quantum Algorithm)
    • This tutorial, in conjunction with 1a, shows how this problem can be mapped from a "classical" method of solving the problem to a method conducive to running on a quantum computer, and shows how similar results can be achieved.
  • Tutorial_2 (Simulation of quantum circuit and classical comparison)
    • This tutorial contains a step-by-step pyLIQTR demo for generating a representation of the problem of interest, generating quantum circuits that simulate or solve the problem, and then simulating the quantum circuit and comparing the results against a classical technique to show that the implementation of the quantum algorithm is correct. Again, since we are interested in classically hard problems and since, for the most part, classical computers cannot efficiently simulate a quantum computer, we focus on small problems or special cases that can be ran on most personal computers.
  • Tutorial_3 (Circuit manipulation and output)
    • This tutorial shows how to take the cirq circuits that pyLIQTR generates in Tutorial_2 and decompose them to simple gates, transform them to Clifford+T gates, and to export to an OpenQASM format in order to allow for further analysis or manipulation in other tools.
  • Tutorial_4 (Circuit scaling and simple analysis)
    • This tutorial is intended to provide a "jumping off point" for using pyLIQTR to investigate problem/algorithm scaling by generating circuits of various different sizes and how they can be analyzed in python.

To summarize, Tutorials 1a, 1b, and 2 are useful for those interested in better understanding the physical models or problems, how they are classically solved and/or simulated, and how a particular quantum algorithm can be used to solve and/or simulate the problem. Tutorials 3 and 4 are useful for those interested in generating circuits for downstream analyses, such as resource analysis, for a specific problem.


Citation

DOI

Disclaimer

DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited.

© 2023 MASSACHUSETTS INSTITUTE OF TECHNOLOGY

Subject to FAR 52.227-11 – Patent Rights – Ownership by the Contractor (May 2014)
SPDX-License-Identifier: BSD-2-Clause

This material is based upon work supported by the Under Secretary of Defense for Research and Engineering under Air Force Contract No. FA8702-15-D-0001. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Under Secretary of Defense for Research and Engineering.

A portion of this research was sponsored by the United States Air Force Research Laboratory and the United States Air Force Artificial Intelligence Accelerator and was accomplished under Cooperative Agreement Number FA8750-19-2-1000. The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the United States Air Force or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein.

The software/firmware is provided to you on an As-Is basis

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

pyLIQTR-0.3.1.tar.gz (136.3 kB view details)

Uploaded Source

Built Distribution

pyLIQTR-0.3.1-py3-none-any.whl (181.6 kB view details)

Uploaded Python 3

File details

Details for the file pyLIQTR-0.3.1.tar.gz.

File metadata

  • Download URL: pyLIQTR-0.3.1.tar.gz
  • Upload date:
  • Size: 136.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pyLIQTR-0.3.1.tar.gz
Algorithm Hash digest
SHA256 1e2e1170c19270da0a2e1a93e89c8b3a0639aa7462bef1640e7b190ac3be1943
MD5 951363f07749ecac741ed7cce335be16
BLAKE2b-256 8bc7706a2d7d20f98fd56c9a64d6464c44b185f1ab24527531d4609d7cc4843d

See more details on using hashes here.

File details

Details for the file pyLIQTR-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: pyLIQTR-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 181.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for pyLIQTR-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff9992ae7da0f75cf93835a70ba711a4e4f16db513df3793fa5190ee7dc9ffe8
MD5 27951231e4792018ad1cd222707cc5f7
BLAKE2b-256 a5733b1860b7a72c388429fc09967de1ed37b16baefe12a8c1f2554b7a808dd1

See more details on using hashes here.

Supported by

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