https://github.com/cqcl/phir
PHIR (PECOS High-level Intermediate Representation) Spec and data model
https://github.com/cqcl/phir
json-schema python quantinuum quantum-computing
Last synced: 19 days ago
JSON representation
PHIR (PECOS High-level Intermediate Representation) Spec and data model
- Host: GitHub
- URL: https://github.com/cqcl/phir
- Owner: CQCL
- License: bsd-3-clause
- Created: 2023-09-22T08:22:44.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-05T19:21:39.000Z (19 days ago)
- Last Synced: 2025-05-05T20:37:18.413Z (19 days ago)
- Topics: json-schema, python, quantinuum, quantum-computing
- Language: Python
- Homepage: https://cqcl.github.io/phir/
- Size: 2.11 MB
- Stars: 4
- Watchers: 11
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PHIR: _[PECOS](https://github.com/PECOS-packages/PECOS) High-level Intermediate Representation_
[](https://badge.fury.io/py/phir)
[](https://img.shields.io/badge/python-3.10%2C%203.11%2C%203.12-blue.svg)`phir` models the [PHIR specification](./spec.md) as a [Pydantic](https://docs.pydantic.dev/latest/) model.
See [our docs](https://cqcl.github.io/phir/).
Included is the tool `phir-cli` that provides validation and pretty printing on the command line.## Prerequisites
Python >=3.10
## Installation
Just issue `pip install phir` to obtain the latest stable release.
## phir CLI
The package includes a CLI for directly validating PHIR JSON files using the command line.
```sh
❯ phir-cli -h
usage: phir-cli [-h] [-s] [-v] [jsonfile]Validates and pretty prints valid PHIR
positional arguments:
jsonfile json file to validate against PHIR specoptions:
-h, --help show this help message and exit
-s, --schema dump JSON schema of the PHIR model and exit
-v, --version show program's version number and exit
```## Development
Clone the repository and run:
```sh
uv sync
uv run pre-commit install
```See `Makefile` for other useful commands.
## Testing
Issue `make tests` from the root directory.