feat: Add python definitions for the TKET metadata keys#1535
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1535 +/- ##
==========================================
- Coverage 84.09% 84.05% -0.05%
==========================================
Files 188 189 +1
Lines 29298 29358 +60
Branches 28172 28174 +2
==========================================
+ Hits 24639 24676 +37
- Misses 3479 3502 +23
Partials 1180 1180
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| KEY = _metadata.CIRCUIT_REWRITE_TRACES | ||
|
|
||
|
|
||
| class Unitary(Metadata[int]): |
There was a problem hiding this comment.
Maybe UnitaryFlags? It's definitely not a unitary (i.e. matrix) itself
| KEY = _metadata.INPUT_PARAMETERS | ||
|
|
||
|
|
||
| class OpGroup(Metadata[str]): |
There was a problem hiding this comment.
Perhaps PytketOpGroup? And elsewhere in this file for other metadata relating to pytket, but there are some that are not
| return _read_pytket_register(cls.KEY, value) | ||
|
|
||
|
|
||
| class Phase(Metadata[str]): |
| individual_matches: int | ||
|
|
||
|
|
||
| class MaxQubits(Metadata[int]): |
There was a problem hiding this comment.
Should this be MaxQubitsHint?
| >>> node.metadata.get(QubitRegisters) | ||
| [('q', [0]), ('ancilla', [1])] | ||
| """ | ||
| # Changes to this file **MUST** be reflected in `tket/src/metadata.rs` |
There was a problem hiding this comment.
In the sense that they ought to match, but this doesn't mean that things will break if they don't match, right? Isn't that SHOULD ?
There was a problem hiding this comment.
I guess this means that all of my suggested renames should be applied on the rust side too, heh
There was a problem hiding this comment.
Changed to a SHOULD. I'll do the renaming on both rust and python (with some aliases for backwards compatibility)
🤖 I have created a release *beep* *boop* --- ## [0.13.1](Quantinuum/tket2@tket-py-v0.13.0...tket-py-v0.13.1) (2026-05-19) ### Features * Add python definitions for the TKET metadata keys ([Quantinuum#1535](Quantinuum#1535)) ([1bfef9a](Quantinuum@1bfef9a)) * Clean Up by Deleting Unconnected Nodes after Modifier Solve ([Quantinuum#1557](Quantinuum#1557)) ([d706867](Quantinuum@d706867)) * expose the QSystemPass to Python ([Quantinuum#1556](Quantinuum#1556)) ([394a610](Quantinuum@394a610)) * InlineFunctionsPass ([Quantinuum#1524](Quantinuum#1524)) ([f40dcef](Quantinuum@f40dcef)) * InlineHint metadata ([Quantinuum#1532](Quantinuum#1532)) ([e7949c2](Quantinuum@e7949c2)) ### Bug Fixes * Apply modifiers through function calls ([Quantinuum#1531](Quantinuum#1531)) ([6a13f0c](Quantinuum@6a13f0c)) * Incorrect matching of pytket parameters to unsupported graph ports ([Quantinuum#1561](Quantinuum#1561)) ([4fc5a25](Quantinuum@4fc5a25)) * Passes with Nested Modifier ([Quantinuum#1546](Quantinuum#1546)) ([bf6df51](Quantinuum@bf6df51)) * Update examples link in README.md ([Quantinuum#1506](Quantinuum#1506)) ([9a25ec8](Quantinuum@9a25ec8)) ### Documentation * Simplify package description. ([Quantinuum#1547](Quantinuum#1547)) ([54e855f](Quantinuum@54e855f)) --- 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 <agustin.borgna@quantinuum.com>
## 🤖 New release * `tket`: 0.18.0 -> 0.19.0 (✓ API compatible changes) * `tket-qsystem`: 0.24.0 -> 0.25.0 (✓ API compatible changes) <details><summary><i><b>Changelog</b></i></summary><p> ## `tket` <blockquote> ## [0.19.0](Quantinuum/tket2@tket-v0.18.0...tket-v0.19.0) - 2026-05-28 ### Bug Fixes - Apply modifiers through function calls ([Quantinuum#1531](Quantinuum#1531)) - Incorrect matching of pytket parameters to unsupported graph ports ([Quantinuum#1561](Quantinuum#1561)) - [**breaking**] Passes with Nested Modifier ([Quantinuum#1546](Quantinuum#1546)) - bug in hugr building when `control` modifiers are nested ([Quantinuum#1550](Quantinuum#1550)) - Multiple fixes to the pytket encoder ([Quantinuum#1566](Quantinuum#1566)) - [**breaking**] Replace non-deterministic iterations on hash maps ([Quantinuum#1582](Quantinuum#1582)) - Set inputs of functions loaded as values to top during dataflow analysis ([Quantinuum#1595](Quantinuum#1595)) - Using indexes inside dagger modifier ([Quantinuum#1588](Quantinuum#1588)) - address Miri unsoundness by installing nextest and skipping FFI/long running tests ([Quantinuum#1565](Quantinuum#1565)) - skip test_nested_array to resolve miri unsoundness ([Quantinuum#1623](Quantinuum#1623)) ### New Features - *(const-fold)* combine Consts for each out-port; write prepopulated inputs ([Quantinuum#1489](Quantinuum#1489)) - InlineFunctionsPass ([Quantinuum#1524](Quantinuum#1524)) - upgrade to hugr v0.27.1 ([Quantinuum#1568](Quantinuum#1568)) - [**breaking**] Ignore empty circuits when encoding Hugr regions into pytket ([Quantinuum#1562](Quantinuum#1562)) - Add python definitions for the TKET metadata keys ([Quantinuum#1535](Quantinuum#1535)) - Clean Up by Deleting Unconnected Nodes after Modifier Solve ([Quantinuum#1557](Quantinuum#1557)) - InlineHint metadata ([Quantinuum#1532](Quantinuum#1532)) - Allowing control flow in `control` ([Quantinuum#1603](Quantinuum#1603)) ### Performance - Improve modifier resolver pass by visiting nodes in a set ([Quantinuum#1621](Quantinuum#1621)) - Avoid string formatting in Hugr op hashing ([Quantinuum#1624](Quantinuum#1624)) ### Refactor - Replace portgraph toposort in CommandIterator with node vector ([Quantinuum#1608](Quantinuum#1608)) - [**breaking**] Deprecate commands iterator ([Quantinuum#1611](Quantinuum#1611)) ### Testing - Pin guppy version in example files, fix test ([Quantinuum#1534](Quantinuum#1534)) - Skip slow modifier test ([Quantinuum#1587](Quantinuum#1587)) - Add modifier test for subscripted control qubits ([Quantinuum#1601](Quantinuum#1601)) </blockquote> ## `tket-qsystem` <blockquote> ## [0.25.0](Quantinuum/tket2@tket-qsystem-v0.24.0...tket-qsystem-v0.25.0) - 2026-05-28 ### Bug Fixes - Multiple fixes to the pytket encoder ([Quantinuum#1566](Quantinuum#1566)) - [**breaking**] Replace non-deterministic iterations on hash maps ([Quantinuum#1582](Quantinuum#1582)) ### New Features - expose the QSystemPass to Python ([Quantinuum#1556](Quantinuum#1556)) - upgrade to hugr v0.27.1 ([Quantinuum#1568](Quantinuum#1568)) - [**breaking**] Ignore empty circuits when encoding Hugr regions into pytket ([Quantinuum#1562](Quantinuum#1562)) - *(qsystem)* [**breaking**] multiple platform extensions ([Quantinuum#1567](Quantinuum#1567)) ### Refactor - [**breaking**] Deprecate commands iterator ([Quantinuum#1611](Quantinuum#1611)) ### Testing - Pin guppy version in example files, fix test ([Quantinuum#1534](Quantinuum#1534)) </blockquote> </p></details> --- This PR was generated with [release-plz](https://github.com/release-plz/release-plz/).
We should also add a metadata for inline hints either here or in #1532, whichever gets merged second.