Skip to content
Open
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ac34458
refactor docs build to use uv
CalMacCQ Mar 12, 2026
281faf9
update workflow
CalMacCQ Mar 12, 2026
e3b9673
remove poetry.lock file
CalMacCQ Mar 12, 2026
2ff6bf9
bump submodule
CalMacCQ Mar 12, 2026
b76e7b2
clean up just
CalMacCQ Mar 12, 2026
fde5a79
use uv in github workflows
CalMacCQ Mar 12, 2026
f8727ee
remove references to pytket-aqt and pytket-projectq
CalMacCQ Mar 12, 2026
6410edb
justfile fixes
CalMacCQ Mar 12, 2026
86867d6
more poetry -> uv
CalMacCQ Mar 12, 2026
e3b2ab3
rmeove some duplicate commands
CalMacCQ Mar 12, 2026
541f16e
remove just build dependency on install
CalMacCQ Mar 12, 2026
d4cd796
readme update
CalMacCQ Mar 12, 2026
15c2386
use --system flag in workflow
CalMacCQ Mar 12, 2026
217dfa5
try to fix workflow
CalMacCQ Mar 12, 2026
d45d122
try --no-venv
CalMacCQ Mar 12, 2026
0807d3c
try uv enviornment variable
CalMacCQ Mar 12, 2026
27c5f6e
try installing editable wheel again in uv env
CalMacCQ Mar 12, 2026
b1c6ff5
add uv sync
CalMacCQ Mar 12, 2026
6550f4e
try calling just install-dev in workflow
CalMacCQ Mar 12, 2026
523c27b
install-dev depends on prepare
CalMacCQ Mar 12, 2026
2190333
cleanup justfile
CalMacCQ Mar 12, 2026
4b20b82
fix link
CalMacCQ Mar 12, 2026
b0501b2
update dependencies
CalMacCQ Mar 12, 2026
ca82d25
stupid crossref thing
CalMacCQ Mar 12, 2026
8b2c8c5
bump submodule
CalMacCQ Mar 12, 2026
3cda68f
rm crosslink
CalMacCQ Mar 12, 2026
d5954a1
improve just clean
CalMacCQ Mar 12, 2026
6a7f6fe
Revert "export more stuff from .circuit"
CalMacCQ Mar 12, 2026
03ced90
finally fix problems with EdgeType, ClassicalOp and MetaOp
CalMacCQ Mar 12, 2026
4b638f6
final sm update
CalMacCQ Mar 13, 2026
9c36b8d
bump submodule
CalMacCQ Mar 13, 2026
72d10d7
restore circuit.md docs
CalMacCQ Mar 13, 2026
0e35513
fix __init__.py
CalMacCQ Mar 13, 2026
c5de015
Update pytket/docs/faqs.md
CalMacCQ Mar 18, 2026
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
14 changes: 8 additions & 6 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,14 @@ jobs:
if: needs.check_changes.outputs.tket_or_workflow_changed == 'true' || needs.check_changes.outputs.pytket_or_workflow_changed == 'true'
runs-on: ubuntu-24.04
steps:
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true
version: "0.10.9"
- uses: actions/checkout@v6
with:
submodules: recursive
submodules: true
Copy link
Contributor Author

@CalMacCQ CalMacCQ Mar 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We no longer have a the quantinuum-sphinx submodule inside the pytket-docs-theming submodule so "recursive" is unnecessary.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it do any harm to keep it "recursive"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not as far as I know. Its more for clarity. If we keep it as recursive then someone who reads this may think we have nested submodules somewhere when we do not.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern is that this could then break if we did introduce a nested submodule in the other repo.

- uses: extractions/setup-just@v3
with:
just-version: 1.5.0
Expand Down Expand Up @@ -355,12 +360,9 @@ jobs:
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
timeout-minutes: 20
run: |
pip install poetry==2.1.4
poetry config virtualenvs.create false
cd pytket/docs
poetry install
# just build-strict # https://github.com/quantinuum/tket/issues/2044
just build
just install-dev
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just install-dev installs a develop version of pytket inside the .venv used by uv. In theory I could use the same editable wheel from earlier in the workflow but forcing uv to not generate a .venv turned out to be annoying.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we're not using the same editable wheel maybe the docs build should be its own workflow? Not sure

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think this is a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. I'll make a separate workflow. Thanks.

just build-strict
- name: Upload artifact
if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v7
Expand Down
5 changes: 2 additions & 3 deletions pytket/docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,14 @@ cd pytket/docs

The steps outlined below can be performed with the [just command runner](https://github.com/casey/just).

## Install (requires a [poetry](https://python-poetry.org/) installation).
## Install (requires a [uv](https://docs.astral.sh/uv/) installation).

(use `just install-dev` to install a develop wheel of pytket)
To install the dependencies needed for the local docs build, run

```shell
just install
```

use `just install-dev` to install a develop wheel of pytket

## Build the html

Expand Down
8 changes: 0 additions & 8 deletions pytket/docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ A full list of available pytket backends is shown below.
{py:class}`~pytket.extensions.pyquil.backends.forest.ForestBackend`
\- A backend for running circuits on remote Rigetti devices.

{py:class}`~pytket.extensions.aqt.backends.aqt.AQTBackend`[AQTBackend]
\- Interface to an AQT device or simulator.

{py:class}`~pytket.extensions.iqm.backends.iqm.IQMBackend`
\- Interface to an IQM device or simulator.

Expand Down Expand Up @@ -66,9 +63,6 @@ A full list of available pytket backends is shown below.

{py:class}`~pytket.extensions.pyquil.backends.forest.ForestStateBackend` - State-based interface to a Rigetti device.

{py:class}`~pytket.extensions.projectq.backends.projectq_backend.ProjectQBackend`
\- Backend for running statevector simulations on the ProjectQ simulator.

{py:class}`~pytket.extensions.quest.backends.quest_backend.QuESTBackend` - Interface to the [QUEST simulator](https://quest.qtechtheory.org/docs/).

## Unitary Simulators
Expand Down Expand Up @@ -114,12 +108,10 @@ Use `QulacsBackend(result_type="density_matrix")`.
:caption: 'Extensions:'
:maxdepth: 0

pytket-aqt <https://quantinuum.github.io/pytket-aqt/api/index.html>
pytket-braket <https://docs.quantinuum.com/tket/extensions/pytket-braket>
pytket-cirq <https://docs.quantinuum.com/tket/extensions/pytket-cirq>
pytket-iqm <https://docs.quantinuum.com/tket/extensions/pytket-iqm>
pytket-pennylane <https://docs.quantinuum.com/tket/extensions/pytket-pennylane>
pytket-projectq <https://docs.quantinuum.com/tket/extensions/pytket-projectq>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pytket-projectq is no longer part of the website so this crossref gave a warning.

pytket-pyquil <https://docs.quantinuum.com/tket/extensions/pytket-pyquil>
pytket-pysimplex <https://docs.quantinuum.com/tket/extensions/pytket-pysimplex>
pytket-pyzx <https://docs.quantinuum.com/tket/extensions/pytket-pyzx>
Expand Down
4 changes: 2 additions & 2 deletions pytket/docs/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ See the manual section on [unitary synthesis](https://docs.quantinuum.com/tket/u

Q: How can I convert my qiskit {py:class}`qiskit.circuit.QuantumCircuit` to a pytket {py:class}`~.Circuit`?

A: This can be achieved using the {external+pytket-qiskit:py:func}`pytket.extensions.qiskit.qiskit_to_tk` function from the [pytket-qiskit extension](https://docs.quantinuum.com/tket/extensions/pytket-qiskit/)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annoyingly these links stopped resolving. Not sure why. Can probably fix them.

A: This can be achieved using the `qiskit_to_tk` function from the [pytket-qiskit extension](https://docs.quantinuum.com/tket/extensions/pytket-qiskit/)

```
from qiskit import QuantumCircuit
Expand All @@ -43,7 +43,7 @@ qc.cx(0, 1)
tk_circ = qiskit_to_tk(qc)
```

Conversion in the opposite direction can be accomplished using {external+pytket-qiskit:py:func}`pytket.extensions.qiskit.tk_to_qiskit`. In the case where there is no replacement for a pytket operation in qiskit the unsupported operation will be implemented in terms of the available gates.
Conversion in the opposite direction can be accomplished using `qiskit_to_tk`. In the case where there is no replacement for a pytket operation in qiskit the unsupported operation will be implemented in terms of the available gates.

Note here that `pytket` and `qiskit` use different qubit ordering conventions so care should be taken when
converting between circuit formats and interpreting results.
Expand Down
2 changes: 1 addition & 1 deletion pytket/docs/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ compiled_circ = nairobi_device.get_compiled_circuit(circ)
result = backend.run_circuit(compiled_circ, n_shots=100)
```

Here the default compilation pass is applied by {external+pytket-qiskit:py:meth}`pytket.extensions.qiskit.IBMQBackend.get_compiled_circuit`. See [this page](https://docs.quantinuum.com/tket/extensions/pytket-qiskit/#default-compilation) for more details.
Here the default compilation pass is applied by `IBMQBackend.get_compiled_circuit`. See [this page](https://docs.quantinuum.com/tket/extensions/pytket-qiskit/#default-compilation) for more details.

As an alternative, We can experiment with constructing our own circuit compilation routines in pytket. Passes from the {py:mod}`pytket.passes` module can be applied individually or composed in sequence.
See the section of the user manual on [circuit compilation](https://docs.quantinuum.com/tket/user-guide/manual/manual_compiler.html) and the corresponding [notebook example](https://docs.quantinuum.com/tket/user-guide/examples/circuit_compilation/compilation_example.html) for more.
36 changes: 18 additions & 18 deletions pytket/docs/justfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
install-dev:
poetry install
poetry run pip install ../.

install:
poetry install
poetry run pip install -U pytket

prepare:
cp -R pytket-docs-theming/_static .
cp pytket-docs-theming/conf.py .

build *SPHINX_ARGS: prepare
VERSION=$(poetry run python -c "import pytket; print(pytket.__version__)") && \
poetry run sphinx-build {{SPHINX_ARGS}} -b html . build -D html_title="pytket v$VERSION API documentation"
install: prepare
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can maybe add some more explicit comments here to explain what the commands are doing.

uv sync
uv pip install -U "pytket[ZX]"

install-dev: prepare
uv sync
uv pip install ../.[ZX] -v

build *SPHINX_ARGS:
VERSION=$(uv run python -c "import pytket; print(pytket.__version__)") && \
uv run sphinx-build {{SPHINX_ARGS}} -b html . build -D html_title="pytket v$VERSION API documentation"

linkcheck: prepare
poetry run sphinx-build -W -b linkcheck . build
uv run sphinx-build -W -b linkcheck . build

coverage: prepare
poetry run sphinx-build -W -v -b coverage . build/coverage
uv run sphinx-build -W -v -b coverage . build/coverage

build-strict: prepare
VERSION=$(poetry run python -c "import pytket; print(pytket.__version__)") && \
build-strict:
just build -W # Fail on sphinx warnings
just linkcheck
just coverage
Expand All @@ -32,12 +31,13 @@ serve: build
serve-debug:
npm exec serve build

cleanup:
# Clean up files generated by Sphinx
clean:
# Clean up files generated by Sphinx build
rm -rf jupyter_execute
rm -rf .jupyter_cache
rm -rf build

# Clean up config files in the event the build fails
clean-env:
# Clean up the files copied over from the submodule
rm -rf _static
rm -f conf.py
Loading
Loading