Skip to content

docs: add notebook on optimization of Guppy programs#1287

Merged
CalMacCQ merged 27 commits intomainfrom
cm/jupyter_notebook_example_opt
Dec 10, 2025
Merged

docs: add notebook on optimization of Guppy programs#1287
CalMacCQ merged 27 commits intomainfrom
cm/jupyter_notebook_example_opt

Conversation

@CalMacCQ
Copy link
Copy Markdown
Contributor

@CalMacCQ CalMacCQ commented Nov 27, 2025

closes #1284

Found a couple bugs whilst making this. Agustin has now fixed most of them.

The examples here are super trivial at the moment but I demonstrate NormalizeGuppy, RemoveRedundancies and SquashRzPhasedX.

The example using SquashRzPhasedX isn't quite working yet. It should simplify to a single Rz gate but this isn't working yet due to an issue with order edges. Should be fixed once we have the transformation in Quantinuum/hugr#2739 is part of NormalizeGuppy.

Note I moved the examples directory to be part of the docs directory so that I could include the example in the docs site more easily.

@CalMacCQ CalMacCQ requested a review from a team as a code owner November 27, 2025 13:26
@CalMacCQ CalMacCQ requested a review from ss2165 November 27, 2025 13:26
@CalMacCQ CalMacCQ marked this pull request as draft November 27, 2025 13:26
@codecov
Copy link
Copy Markdown

codecov bot commented Nov 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.61%. Comparing base (48845df) to head (06f3444).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1287      +/-   ##
==========================================
- Coverage   79.73%   79.61%   -0.13%     
==========================================
  Files         160      160              
  Lines       20623    20589      -34     
  Branches    19657    19623      -34     
==========================================
- Hits        16443    16391      -52     
- Misses       3200     3220      +20     
+ Partials      980      978       -2     
Flag Coverage Δ
python 92.92% <ø> (ø)
qis-compiler 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@CalMacCQ CalMacCQ force-pushed the cm/jupyter_notebook_example_opt branch from d8d2ebd to cc448b1 Compare December 3, 2025 13:54
requires-python = ">=3.10"
resolution-markers = [
"python_full_version >= '3.11'",
"python_full_version >= '3.14'",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think this should not appear here. Maybe I messed something up in my local env

@CalMacCQ CalMacCQ marked this pull request as ready for review December 9, 2025 17:11
@CalMacCQ CalMacCQ changed the title docs: add notebook on optimisation of Guppy programs docs: add notebook on optimization of Guppy programs Dec 9, 2025
@CalMacCQ CalMacCQ requested a review from aborgna-q December 10, 2025 12:39
Comment on lines +31 to +32
" \"tket==0.13\" \\\n",
" \"numpy>=2\"\n",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We're making a patch release

Suggested change
" \"tket==0.13\" \\\n",
" \"numpy>=2\"\n",
" \"tket==0.12.13\" \\\n"

Also, I don't think we need numpy here?

@CalMacCQ CalMacCQ enabled auto-merge December 10, 2025 16:29
@CalMacCQ CalMacCQ added this pull request to the merge queue Dec 10, 2025
Merged via the queue into main with commit e82f959 Dec 10, 2025
23 checks passed
@CalMacCQ CalMacCQ deleted the cm/jupyter_notebook_example_opt branch December 10, 2025 16:41
github-merge-queue bot pushed a commit that referenced this pull request Dec 10, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.12.13](tket-py-v0.12.12...tket-py-v0.12.13)
(2025-12-10)


### Features

* Allow running arbitrary serializable pytket passes on hugrs
([#1266](#1266))
([24875e0](24875e0))
* do constant folding by default in NormalizeGuppy
([#1309](#1309))
([3838c49](3838c49))
* implement `ComposablePass` for normalize Guppy pass
([#1286](#1286))
([d72d84d](d72d84d))
* implement `ComposeablePass` interface for any serializable pytket
pass. ([#1269](#1269))
([71cb1f2](71cb1f2))


### Bug Fixes

* update incomplete API docs for passes module
([#1308](#1308))
([0276ba2](0276ba2))
* update incorrect version info in notebook
([#1312](#1312))
([af160ed](af160ed))
* Use qsystem extensions on Tk2Circuit.from_bytes/str
([#1296](#1296))
([df9f52a](df9f52a))


### Documentation

* add notebook on optimization of Guppy programs
([#1287](#1287))
([e82f959](e82f959))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: Agustín Borgna <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a notebook example showing the new pass interface

2 participants