Skip to main content

Qiskit to QIR translator

Project description

qiskit-qir

Qiskit to QIR translator.

This is a temporary fork until the upstream qiskit-qir supports user-defined instructions.

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-alice-bob-fork-0.5.0rc0.tar.gz (35.7 kB view details)

Uploaded Source

Built Distribution

qiskit_qir_alice_bob_fork-0.5.0rc0-py2.py3-none-any.whl (20.9 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file qiskit-qir-alice-bob-fork-0.5.0rc0.tar.gz.

File metadata

File hashes

Hashes for qiskit-qir-alice-bob-fork-0.5.0rc0.tar.gz
Algorithm Hash digest
SHA256 6414592916801242a0189f08baf04f33a5237d253f437d4b00c85053c209c6fe
MD5 4ad2d81b52f89c1f8894f28213fbaa08
BLAKE2b-256 0ee0d22e50e5a1d4a8a554c53040e71e3be20ac3490dc18ab8cbf9fefc208756

See more details on using hashes here.

File details

Details for the file qiskit_qir_alice_bob_fork-0.5.0rc0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for qiskit_qir_alice_bob_fork-0.5.0rc0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8bd1d0d69c92e950823d2a63a26298d1e9173962abc9187284547bf3dc92c119
MD5 d9ddacf8dae48962932803565dd879e3
BLAKE2b-256 2947dfd271bf875dc41d6c71469c823758e7d0f995c40da17a1be3a2e9f9eb8e

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