Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Run doc build and create artifact

on:
pull_request:
branches:
- main
push:
branches:
- main
- "runci/**"
schedule:
# 04:00 every Tuesday morning
- cron: "0 4 * * 2"

jobs:
docs-checks:
name: Run doc build and create artifact
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
submodules: recursive
- name: Set up uv
uses: astral-sh/setup-uv@v6
with:
version: "0.4.20"
enable-cache: true
- name: Setup dependencies
run: |
uv venv --python 3.12
- name: copy docs files
run: |
cp -R docs/pytket-docs-theming/_static docs
cp docs/pytket-docs-theming/conf.py docs
cp docs/pytket-docs-theming/pyproject.toml docs
cp docs/pytket-docs-theming/uv.lock docs
- name: Install docs dependencies
run: |
source .venv/bin/activate
uv pip install hugr-qir
cd docs
uv pip install .
sphinx-build -b html . build -D html_title=hugr-qir
sphinx-build -b linkcheck . build
- uses: actions/upload-artifact@v4
with:
name: docs
path: docs/build/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "docs/pytket-docs-theming"]
path = docs/pytket-docs-theming
url = https://github.com/Quantinuum/pytket-docs-theming.git
11 changes: 11 additions & 0 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# API documentation

The hugr-qir module allows the conversion of hugr to QIR.

See the [hugr-qir section](https://github.com/Quantinuum/hugr-qir) of the documentation website for some example usage.

```{eval-rst}
.. automodule:: hugr_qir.output.OutputFormat
.. automodule:: hugr_qir.hugr_to_qir.hugr_to_qir

```
77 changes: 77 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
```{eval-rst}
.. currentmodule:: hugr_qir
```

# Changelog

## v0.0.19

- add support for get_current_shot

## v0.0.18

- update github links
- fix lowering of discard/QFree for quantinuum-hardware targets

## v0.0.17

- fix error messages
- support more complicated guppy if/elif statements

## v0.0.16

- update hugr rust version requirement 0.24.2

## v0.0.15

- update hugr version requirement 0.14.0

## v0.0.14

- update guppylang version requirement 0.21.5
- update dependency version requirements

## v0.0.12

- add conversion of RNG functions

## v0.0.11

- add options for compilation target and optimization level
- configure output format using output_format option and remove 'emit_text' toggle

## v0.0.10

- fix issues with function names

## v0.0.9

- fix issues with windows wheels

## v0.0.8

- update guppylang version requirement 0.21.0
- update hugr version requirement 0.13.0
- update quantinuum-qircheck version requirement to 0.3.0

## v0.0.7

- expose option to validate input hugr
- update guppylang version requirement 0.20.0
- update hugr version requirement 0.12.2

## v0.0.5

- update hugr_to_qir to take ModulePointer and bytes for conversion

## v0.0.4

- update guppylang version requirement 0.19.1

## v0.0.3

- update quantinuum-qircheck version requirement to 0.2.0

## v0.0.1

- add hugr_to_qir conversion function
30 changes: 30 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
file_format: mystnb
---

# hugr-qir

`hugr-qir` is a module that offers the conversion of hugr to QIR. The HUGR can for example be generated from guppy.

`hugr-qir` is available for Python 3.10, 3.11, 3.12 and 3.13, on Linux, MacOS
and Windows. To install, run:

```
pip install hugr-qir
```



```{eval-rst}
.. toctree::
api.md
changelog.md
```

```{eval-rst}
.. toctree::
:caption: Useful links

Issue tracker <https://github.com/Quantinuum/hugr-qir/issues>
PyPi <https://pypi.org/project/hugr-qir/>
```
1 change: 1 addition & 0 deletions docs/pytket-docs-theming
Submodule pytket-docs-theming added at 5613a5
5 changes: 5 additions & 0 deletions python/hugr_qir/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@


class OutputFormat(Enum):
"""
LLVM_IR = "llvm-ir"
BITCODE = "bitcode"
BASE64 = "base64"
"""
LLVM_IR = "llvm-ir"
BITCODE = "bitcode"
BASE64 = "base64"
Expand Down
Loading