Skip to main content

A circuit analyzer and translator from pytket to PHIR

Project description

pytket-phir

PyPI version Python versions

PHIR stands for PECOS High-level Intermediate Representation. See PHIR specification for more.

pytket-phir is a circuit analyzer and translator from pytket to PHIR.

Also included is the CLI tool phirc that takes QASM programs as input and emulates them using PECOS.

Prerequisites

Python >=3.10

Installation

Just issue pip install pytket-phir to obtain the latest stable release.

phirc CLI

The package includes a tool for emulating QASM files from the command line using PECOS.

Install additional dependencies needed for the CLI using pip install pytket-phir[phirc].

 phirc -h
usage: phirc [-h] [-w WASM_FILE] [-m {H1}] [-v] [--version] qasm_files [qasm_files ...]

Emulates QASM program execution via PECOS

positional arguments:
  qasm_files            One or more QASM files to emulate

options:
  -h, --help            show this help message and exit
  -w WASM_FILE, --wasm-file WASM_FILE
                        Optional WASM file for use by the QASM programs
  -m {H1}, --machine {H1}
                        Machine name, H1 by default
  -v, --verbose
  --version             show program's version number and exit

Development

Clone the repository and run:

python -m venv .venv
source .venv/bin/activate
pip install -U pip setuptools
pip install -r requirements.txt
pre-commit install

Then, install the project using:

pip install -e .

See Makefile for other useful commands.

Testing

Issue pytest from the root directory.

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_phir-0.9.1.tar.gz (73.4 kB view details)

Uploaded Source

Built Distribution

pytket_phir-0.9.1-py3-none-any.whl (82.3 kB view details)

Uploaded Python 3

File details

Details for the file pytket_phir-0.9.1.tar.gz.

File metadata

  • Download URL: pytket_phir-0.9.1.tar.gz
  • Upload date:
  • Size: 73.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pytket_phir-0.9.1.tar.gz
Algorithm Hash digest
SHA256 b7ffa46bcf4cc8d0a5ebe51d26d66c5c23a50b2abd468181ef05af1902a8fb38
MD5 7c570ef73110b43c670b92d3c39426ae
BLAKE2b-256 ac0214621e9501ef9df9cb8fcb90dcd630a5d4a76523ae92ea9ebc1b46805fe7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytket_phir-0.9.1.tar.gz:

Publisher: python-publish.yml on CQCL/pytket-phir

Attestations:

File details

Details for the file pytket_phir-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: pytket_phir-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 82.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pytket_phir-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f7827513301f8e55ac76381e657ddc368c908115a95eba11c828ab3462abb1ba
MD5 f57071b7db451bd2d29c5cddc9719994
BLAKE2b-256 c5be016f613eb5f4b98c901d6124543b7afa7a7083e8853cdb5a6ef8b9d6ed9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytket_phir-0.9.1-py3-none-any.whl:

Publisher: python-publish.yml on CQCL/pytket-phir

Attestations:

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