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>
We should also add a metadata for inline hints either here or in #1532, whichever gets merged second.