Module for optimizing QIR using pytket.
Project description
pytket-qirpass
This module provides a method to optimize QIR using pytket.
Installation
Python 3.9, 3.10 or 3.11 is required.
To install from PyPI:
pip install pytket-qirpass
Usage
This module provides a single function, apply_qirpass
, which takes as input
- some QIR bitcode
- a pytket compilation pass
- a target gateset
and outputs some new QIR bitcode, where the pass has been applied to the basic blocks in the input program, followed by a rebase to the target gateset.
For example:
from pytket_qirpass import apply_qirpass
from pytket.circuit import OpType
from pytket.passes import FullPeepholeOptimise
qir_out = apply_qirpass(
qir_bitcode=qir_in,
comp_pass=FullPeepholeOptimise(allow_swaps=False),
target_1q_gates={OpType.Rx, OpType.Rz},
target_2q_gates={OpType.ZZPhase},
)
Both the input and the output are Python bytes
objects.
Provided the pass preserves the circuit semantics, apply_qirpass
preserves
the QIR semantics.
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
pytket-qirpass-0.1.1.tar.gz
(279.4 kB
view hashes)
Built Distribution
Close
Hashes for pytket_qirpass-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33e95ce078b3bc5dbe24e29ee7c65b50801cbd3e53b5c14963b690a1d6811ebd |
|
MD5 | de50aa818d29a34b2c56cd3d96027241 |
|
BLAKE2b-256 | cd53732ebe0cc4f7cd10f131c009f37978c9192fb43b075b9a4582b3d5638ba2 |