Python based QIR Evaluation (JIT) library.
Reason this release was yanked:
Please upgrade to 0.3.2a1 or newer.
Project description
pyqir-evaluator
The pyqir-evaluator
package provides an easy way to execute generated QIR for the
purpose of
- easily testing and experimenting with QIR code
- connecting it to low-level Python-based lab software such as e.g. QCoDeS
It contains the necessary just-in-time compilation infrastructure as well an extensibility mechanism to define what actions to perform when a gate is applied in Python.
Examples
There are evaluator examples in the repository.
Let's look at how to log the gate sequence for the following example:
- Bernstein-Vazirani
We can evaluate the generated
bitcode
with the
NonadaptiveEvaluator
, andGateLogger
to print out a simple log of the quantum application.
from pyqir.evaluator import NonadaptiveEvaluator, GateLogger
from pathlib import Path
import os
path = Path(__file__).parent
file = os.path.join(path, "bernstein_vazirani.bc")
evaluator = NonadaptiveEvaluator()
logger = GateLogger()
evaluator.eval(file, logger)
print("# output from GateLogger")
logger.print()
Would generate the output:
# output from GateLogger
qubits[9]
out[9]
x qubit[8]
h qubit[0]
h qubit[1]
h qubit[2]
h qubit[3]
h qubit[4]
h qubit[5]
h qubit[6]
h qubit[7]
h qubit[8]
cx qubit[2], qubit[8]
cx qubit[3], qubit[8]
h qubit[0]
h qubit[1]
h qubit[2]
h qubit[3]
h qubit[4]
h qubit[5]
h qubit[6]
h qubit[7]
measure qubits[0] -> out[0]
measure qubits[1] -> out[1]
measure qubits[2] -> out[2]
measure qubits[3] -> out[3]
measure qubits[4] -> out[4]
measure qubits[5] -> out[5]
measure qubits[6] -> out[6]
measure qubits[7] -> out[7]
measure qubits[8] -> out[8]
Building and Testing
See Building
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file pyqir_evaluator-0.3.0a1-cp36-abi3-win_amd64.whl
.
File metadata
- Download URL: pyqir_evaluator-0.3.0a1-cp36-abi3-win_amd64.whl
- Upload date:
- Size: 17.1 MB
- Tags: CPython 3.6+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.59.0 importlib-metadata/3.10.0 keyring/22.3.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7fc5296c6dff91a36c27f01acbfca1048cf51531d2fba3122310b5e52673f4d |
|
MD5 | 25d98fe6166ab47e2dae71b4d44e8191 |
|
BLAKE2b-256 | 19301078e12a7028d97741f6b7c2c2782b28d4d38739643bb3ecc5c18edf7074 |
File details
Details for the file pyqir_evaluator-0.3.0a1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pyqir_evaluator-0.3.0a1-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 10.7 MB
- Tags: CPython 3.6+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.59.0 importlib-metadata/3.10.0 keyring/22.3.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7967e7285c16be699350d787903f1ed09579f025045c098ae5046ee32a0ce08 |
|
MD5 | d72de5b2203883ee45e7aed00970289c |
|
BLAKE2b-256 | 7b7eb4a0f72870d57b0a7defe93b6871ae22874d9fba92fbd474b8b8f1f3d53d |
File details
Details for the file pyqir_evaluator-0.3.0a1-cp36-abi3-macosx_10_7_x86_64.whl
.
File metadata
- Download URL: pyqir_evaluator-0.3.0a1-cp36-abi3-macosx_10_7_x86_64.whl
- Upload date:
- Size: 9.1 MB
- Tags: CPython 3.6+, macOS 10.7+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.25.1 requests-toolbelt/0.9.1 urllib3/1.26.4 tqdm/4.59.0 importlib-metadata/3.10.0 keyring/22.3.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce867e1debf8a8e93eeb3402a3c28ab2d50d1d2f67d7f83fd49cce483554f92a |
|
MD5 | 3b189d722ad16b5642fe350aac7d7128 |
|
BLAKE2b-256 | 3040929441983f1005778b39cdf4bda614a99f6defaeb3ae7cec8c149a8b8633 |