https://github.com/cqcl/hugr-qir
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.9%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: CQCL
- License: apache-2.0
- Language: LLVM
- Default Branch: main
- Size: 273 KB
Statistics
- Stars: 2
- Watchers: 6
- Forks: 0
- Open Issues: 5
- Releases: 18
Metadata Files
README.md
hugr-qir
A tool for converting Hierarchical Unified Graph Representation (HUGR, pronounced hugger) formatted quantum programs into QIR format.
Warning: Not all hugr/guppy programs can be converted to QIR
Installation
You can install from pypi via pip install hugr-qir.
Usage
Python
Use the function hugr_to_qir from the hugr_to_qir module to convert hugr to qir. By default, some basic validity checks will be run on the generated QIR. These checks can be turned off by passing validate_qir = False.
You can find an example notebook at examples/submit-guppy-h1-h2-via-qir.ipynb showing the conversion and the submission to H1/H2.
CLI
You can use the available cli after installing the python package.
This will generate qir for a given hugr file:
hugr-qir test-file.hugr
Run hugr-qir --help to see the available options.
If you want to generate a hugr file from guppy, you can do this in two steps:
1. add this to the end of your guppy file:
if __name__ == "__main__":
sys.stdout.buffer.write(guppy.compile(main).package.to_bytes())
- Generate the hugr file with:
python guppy_examples/quantum-classical-1.py > test-guppy.hugr
Development
#️⃣ Setting up the development environment
The easiest way to setup the development environment is to use the provided
devenv.nix file. This will setup a development shell with all the
required dependencies.
To use this, you will need to install devenv. Once you have it running, open a shell with:
bash
devenv shell
All the required dependencies should be available. You can automate loading the shell by setting up direnv.
Run tests
You can run the rust test with:
bash
cargo test
You can run the Python test with:
bash
pytest
If you want to update the snapshots you can do that via:
bash
pytest --snapshot-update
License
This project is licensed under Apache License, Version 2.0 (LICENSE or http://www.apache.org/licenses/LICENSE-2.0).
Owner
- Name: Cambridge Quantum
- Login: CQCL
- Kind: organization
- Location: Cambridge, UK
- Website: http://www.cambridgequantum.com
- Repositories: 48
- Profile: https://github.com/CQCL
Quantum Software and Technologies
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 33
- Total pull requests: 48
- Average time to close issues: about 1 month
- Average time to close pull requests: 5 days
- Total issue authors: 4
- Total pull request authors: 6
- Average comments per issue: 0.27
- Average comments per pull request: 0.6
- Merged pull requests: 24
- Bot issues: 0
- Bot pull requests: 2
Past Year
- Issues: 33
- Pull requests: 48
- Average time to close issues: about 1 month
- Average time to close pull requests: 5 days
- Issue authors: 4
- Pull request authors: 6
- Average comments per issue: 0.27
- Average comments per pull request: 0.6
- Merged pull requests: 24
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
- cqc-melf (21)
- doug-q (8)
- trvto (3)
- Benny-quantinuum (1)
Pull Request Authors
- cqc-melf (34)
- trvto (9)
- dependabot[bot] (2)
- aborgna-q (1)
- ss2165 (1)
- doug-q (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 502 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 12
- Total maintainers: 1
pypi.org: hugr-qir
Quantinuum's tool for converting HUGR to QIR
- Documentation: https://hugr-qir.readthedocs.io/
- License: apache-2.0
-
Latest release: 0.0.11
published 10 months ago