All Projects → Q-Compiler → UniversalQCompiler

Q-Compiler / UniversalQCompiler

Licence: Apache-2.0 license
Synthesizing arbitrary quantum computations

Programming Languages

Mathematica
289 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to UniversalQCompiler

ddsim
MQT DDSIM - A quantum circuit simulator based on decision diagrams written in C++
Stars: ✭ 45 (-15.09%)
Mutual labels:  quantum-computing, quantum-circuits
qcec
MQT QCEC - A tool for Quantum Circuit Equivalence Checking
Stars: ✭ 64 (+20.75%)
Mutual labels:  quantum-computing, quantum-circuits
QuantumClifford.jl
Clifford circuits, graph states, and other quantum Stabilizer formalism tools.
Stars: ✭ 48 (-9.43%)
Mutual labels:  quantum-computing, quantum-circuits
miniqubit
Quantum emulator of the IBM Quantum experience
Stars: ✭ 24 (-54.72%)
Mutual labels:  quantum-computing, quantum-computer
qcor
C++ compiler for heterogeneous quantum-classical computing built on Clang and XACC
Stars: ✭ 78 (+47.17%)
Mutual labels:  quantum-computing, compilers
Awesome Quantum Software
Curated list of open-source quantum software projects.
Stars: ✭ 647 (+1120.75%)
Mutual labels:  quantum-computing, compilers
Cirq
A python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Stars: ✭ 3,115 (+5777.36%)
Mutual labels:  quantum-computing, quantum-circuits
Pytket
Python module for interfacing with the CQC t|ket> library of quantum software
Stars: ✭ 162 (+205.66%)
Mutual labels:  quantum-computing, compilers
QuantumInformation.jl
A Julia package for numerical computation in quantum information theory
Stars: ✭ 81 (+52.83%)
Mutual labels:  quantum-computing
IBM-Quantum-QCE20-Tutorials
Repository of code notebooks for tutorials at IEEE Quantum Week (QCE20) https://qce.quantum.ieee.org/tutorials/
Stars: ✭ 38 (-28.3%)
Mutual labels:  quantum-computing
QSimulator.jl
Unitary and Lindbladian evolution in Julia
Stars: ✭ 19 (-64.15%)
Mutual labels:  quantum-computing
QCompress-1
Quantum Autoencoder Implementation using Forest and OpenFermion
Stars: ✭ 20 (-62.26%)
Mutual labels:  quantum-computing
Tutorials
This repository contains study material that EPFL, Harvard, MIT Quantum Computing associations and others provide to the students as training and practice.
Stars: ✭ 34 (-35.85%)
Mutual labels:  quantum-computing
LL-Script
Simple script
Stars: ✭ 38 (-28.3%)
Mutual labels:  compilers
suicide
LLVM pass that detects one undefined behavior, and emits code to delete your hard drive
Stars: ✭ 33 (-37.74%)
Mutual labels:  compilers
New-ML-Data-Science-Framework-Tutorials-By-EJ
Internet's Most Popular Tutorials on Fresh-off-the-shelf ML & Data Science Technologies, Authored by Yours Truly.
Stars: ✭ 18 (-66.04%)
Mutual labels:  quantum-computing
qiskit.org
The Qiskit official website
Stars: ✭ 85 (+60.38%)
Mutual labels:  quantum-computing
jet
A Fast C and Python like Programming Language that puts the Developer first. WIP
Stars: ✭ 41 (-22.64%)
Mutual labels:  compilers
public research
Publicly available research done by BOHR.TECHNOLOGY.
Stars: ✭ 16 (-69.81%)
Mutual labels:  quantum-computing
qc portfolio optimization
A program that implements the portfolio optimization experiments using a hybrid quantum computing algorithm from arXiv:1911.05296. The code was developed as part of the 2020 Quantum mentorship program. Many thanks to my mentor Guoming Wang from Zapata Computing!
Stars: ✭ 21 (-60.38%)
Mutual labels:  quantum-computing

UniversalQCompiler - An opensource software package for decomposing generic quantum computations

UniversalQCompiler provides a Mathematica package that allows to decompose generic quantum computations into sequences of C-NOT gates and arbitrary single-qubit rotations. In particular, the package allows for the following:

  • Decomposing isometries from m to n qubits, and hence, in particular decomposing arbitrary unitaries on m qubits and to do state preparation
  • Decomposing quantum channels from m to n qubits
  • Decomposing POVMs on m qubits
  • Simplifying gate sequences
  • Drawing quantum circuits within Mathematica
  • Exporting quantum circuits to LATEX
  • Running quantum circuits on the IBM Q Experience (using the OpenQASM converter)
  • Compilation for trapped ions, i.e., converting between gate sequences using CNOT (and single-qubit rotation) to those that use Molmer-Sorensen gates

A detailed documentation of the Mathematica package can be found on our webpage. The notebook Examples.nb helps the user to get started quickly and provides a short overview over the methods provided by UniversalQCompiler.

This project also contains a converter (based on ProjectQ) to translate gate sequences from the Mathematica package UniversalQCompiler to OpenQASM, the quantum assembly language used, for instance, by the IBM Q Experience.

Moreover, we provide bindings to directly link Python to Mathematica. This is however provided without any guarantees or support in the directory UNSTABLE

Overview

The diagram below indicates how the Mathematica packages QI and UniversalQCompiler can be used to analyse quantum information protocols for running on some quantum hardware:

alt text

Getting started

To use our Mathematica package UniversalQCompiler.m, you need to have installed Wolfram Mathematica (we tested the package for Mathematica 11.1 and 11.3). The code relies on the package QI.m which can be downloaded from https://github.com/rogercolbeck/QI. The package can then be loaded in any Mathematica notebook (see our documentation for more details).

Note that the Makefile is only used for the unstable bindings to Python. You do not need any Makefile for the Mathematica package or the QASM converter.

Feedback

We would be very happy for any feedback about UniversalQCompiler. Please do not hesitate to write us a mail ([email protected] or [email protected]) if you have any suggestions for improvements or comments.

Please cite

An overview over the package UniversalQCompiler and some theoretical background about the decomposition methods that it uses can be found on arXiv:1904.01072.

References

The code is mainly based on the following papers:

  • Raban Iten, Roger Colbeck, Ivan Kukuljan, Jonathan Home, and Matthias Christandl, Phys. Rev. A 93, 032318 (2016).
  • Emanuel Malvetti, Raban Iten, and Roger Colbeck, arXiv:2006.00016 (2020).
  • M. Plesch and Č. Brukner, Phys. Rev. A 83, 032302 (2011).
  • O. Giraud, M. Žnidarič, and B. Georgeot, Phys. Rev. A 80, 042309 (2009).
  • V. V. Shende, S. S. Bullock, and I. L. Markov, IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 25, 1000 (2006).
  • V. Bergholm, J. J. Vartiainen, M. Möttönen, and M. M.Salomaa, Phys. Rev. A 71, 052330 (2005).
  • V. V. Shende, S. S. Bullock, and I. L. Markov, Phys. Rev. A 70, 012310 (2004).
  • E. Knill, LANL report LAUR-95-2225, arXiv:quant-ph/9508006 (1995).

Authors

The first release of UniversalQCompiler (v0.1) was developed by Raban Iten (ETH Zurich) and Roger Colbeck (University of York) from 2016-19 with contributions from Emanuel Malvetti, Luca Mondada, Gabrielle Pauvert, Oliver Reardon-Smith, Ethan Redmond and Ravjot Singh Kohli:

  • Luca Mondada added the Python interface for converting the circuits to QASM.
  • Oliver Reardon-Smith added functionality to cope with small cases, wrote the first version of the visualisation code and implemented several bug fixes.
  • Ethan Redmond added functionality to compute the Knill decomposition and do state preparation.
  • Ravjot Singh Kohli wrote the first version of the code for decomposing isometries with the Column-by-Column decomposition.
  • Gabrielle Pauvert added functionality to decompose instruments.
  • Emanuel Malvetti developed code for the decomposition of (sparse) isometries using the Householder decomposition.

Emanuel Malvetti and Luca Mondada worked on the code as semester students at the Institute for Theoretical Physics at ETH Zürich under supervision of Raban Iten.

Ravjot Singh Kohli, Ethan Redmond and Gabrielle Pauvert worked on the code while summer students in the Department of Mathematics at the University of York under supervision of Roger Colbeck.

Mathematica to OpenQASM converter

A simple-to-use python script converts the Mathematica output gate sequences in list format (not containing diagonal gates, ancilla markers or post selection operations) into OpenQASM, the Quantum Assembly Language used among others by the IBM Q Experience. The converted outputs can be used directly as input for the IBM quantum computers. Note that this script requires Python version 3 and the projectq package.

The converter is composed of a single file, qasm_converter.py that can be found in the QASMConverter folder.

Installation

The script requires Python 3 to be installed as well as the packages numpy, projectq and parsimonious for parsing. If you are using pip, you can install any of these packages with the command

pip3 install PKG_NAME

Usage

First make sure the Mathematica output is numerical. Then save it to the file "data"

out = PrepareForQASM[gateList];
strm = OpenWrite["data"];
Write[strm, out];
Close[strm];

This file can then be transformed into QASM using the qasm_converter.py script:

python qasm_converter.py data OUTPUT.qasm

The QASM code will be found in OUTPUT.qasm.

The script can also convert Mathematica code into assembly code (OpenQASM) that can be direclty uploaded into the IBM Quantum Experience. To convert Mathematica code into OpenQASM code compatible with the IBM Quantum computers, use the option --ibm, or -q. You can also send the code direclty to the IBM Quantum computers using the option --simulator (-s) to run on the IBM simulator or --use-hardware (-w) to run on real hardware. See the help for more information.

python qasm_converter.py -h

Unstable Mathematica-Python bindings [not supported]

These bindings give the user a python interface to the methods that are written in Mathematica. This allows to seamleesly use the Mathematica code within any Python project. The code worked well for us, but we do not support any issues with it.

Please note that you need to have Mathematica installed on your machine, together with a valid license.

Installation

Everything can be compiled easily using the Makefile. It is highly recommended to use virtualenv to keep the installed packages on this project only.

virtualenv SOME_ENV
source SOME_ENV/bin/activate

To link Mathematica to this code, you need to open the file MathematicaLink/setup.py and change the parameters at the top of the file (your system architecture and the version of Mathematica you are using. Double check the mathematica_folder to make sure it corresponds to your actual path).

Once this is done, you can install the package easily with the following commands. Note: this Makefile uses pip as python package management system. You can also install everything manually if you are not using pip.

make unstable
make unstable-install

License

UniversalQCompiler is released under the Apache 2 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].