diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..12b042e --- /dev/null +++ b/.github/workflows/docs.yml @@ -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/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..cfadbd3 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docs/pytket-docs-theming"] + path = docs/pytket-docs-theming + url = https://github.com/Quantinuum/pytket-docs-theming.git diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 0000000..d2cdeca --- /dev/null +++ b/docs/api.md @@ -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 + +``` diff --git a/docs/changelog.md b/docs/changelog.md new file mode 100644 index 0000000..7fbe14f --- /dev/null +++ b/docs/changelog.md @@ -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 diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..1a7bbed --- /dev/null +++ b/docs/index.md @@ -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 + PyPi +``` \ No newline at end of file diff --git a/docs/pytket-docs-theming b/docs/pytket-docs-theming new file mode 160000 index 0000000..5613a5a --- /dev/null +++ b/docs/pytket-docs-theming @@ -0,0 +1 @@ +Subproject commit 5613a5a261d878d4ebea6821e53dd4c134cd00c1 diff --git a/python/hugr_qir/output.py b/python/hugr_qir/output.py index 9656f74..2d8d7bf 100644 --- a/python/hugr_qir/output.py +++ b/python/hugr_qir/output.py @@ -8,6 +8,11 @@ class OutputFormat(Enum): + """ + LLVM_IR = "llvm-ir" + BITCODE = "bitcode" + BASE64 = "base64" + """ LLVM_IR = "llvm-ir" BITCODE = "bitcode" BASE64 = "base64"