This repository is deprecated.
Functionality for converting Qiskit to QIR is now part of the Modern QDK's Qiskit interop.
For the Modern QDK repository, please visit Microsoft/qsharp.
You can also try out the Modern QDK in VS Code for Web at vscode.dev/quantum.
For more information about the Modern QDK and Azure Quantum, visit https://aka.ms/AQ/Documentation.
Qiskit to QIR translator.
from qiskit import QuantumCircuit
from qiskit_qir import to_qir_module
circuit = QuantumCircuit(3, 3, name="my-circuit")
circuit.h(0)
circuit.cx(0, 1)
circuit.cx(1, 2)
circuit.measure([0,1,2], [0, 1, 2])
module, entry_points = to_qir_module(circuit)
bitcode = module.bitcode
ir = str(module)
Install qiskit-qir
with pip
:
pip install qiskit-qir
Note: this will automatically install PyQIR if needed.
To install the package from source, clone the repo onto your machine, browse to the root directory and run
pip install -e .
First, install the development dependencies using
pip install -r requirements_dev.txt
To run the tests in your local environment, run
make test
To run the tests in virtual environments on supported Python versions, run
make test-all
To build the docs using Sphinx, run
make docs