Skip to main content

Qiskit to QIR translator

Project description

qiskit-qir

Qiskit to QIR translator.

Example

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)

Installation

Install qiskit-qir with pip:

pip install qiskit-qir

Note: this will automatically install PyQIR if needed.

Development

Install from source

To install the package from source, clone the repo onto your machine, browse to the root directory and run

pip install -e .

Tests

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

Docs

To build the docs using Sphinx, run

make docs

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

qiskit-qir-0.5.0.tar.gz (33.4 kB view hashes)

Uploaded Source

Built Distribution

qiskit_qir-0.5.0-py2.py3-none-any.whl (19.8 kB view hashes)

Uploaded Python 2 Python 3

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