refactor!: Deprecate commands iterator - #1611
Merged
Merged
Conversation
4 tasks
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1611 +/- ##
==========================================
+ Coverage 85.52% 85.63% +0.11%
==========================================
Files 184 184
Lines 29077 29414 +337
Branches 27876 28213 +337
==========================================
+ Hits 24868 25189 +321
- Misses 3075 3092 +17
+ Partials 1134 1133 -1
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:
|
maximilianruesch
requested changes
May 22, 2026
Comment on lines
+79
to
+83
| fn ensure_resource_slot( | ||
| qubit_free_slice: &mut Vec<usize>, | ||
| slices: &mut SliceVec, | ||
| resource: ResourceId, | ||
| ) { |
Collaborator
There was a problem hiding this comment.
I have difficulty gauging what this function does. Could you add a comment / make this (especially the name) clearer?
maximilianruesch
approved these changes
May 27, 2026
aborgna-q
enabled auto-merge
May 27, 2026 15:04
This was referenced May 27, 2026
Merged
Closed
nrdcid
pushed a commit
to nrdcid/tket2
that referenced
this pull request
Jun 4, 2026
## 🤖 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/).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
CommandsIteratorwas one of the first utilities defined in this repo, and is quite focused on pytket-style flat circuits with basic quantum operations, qubit wires, and bit wires.This definition grew stale quickly, but it was used throughout the repo nonetheless.
This PR removes such uses and marks the definition as
deprecated. We should be able to remove it ontket 0.20.0.I added a
toposorted_childrenand acount_opsmethod toCircuitto replace commands usage.These will be moved to an extension trait in the future as part of #1060.
BREAKING CHANGE:
Circuit::circuit_costnow computes the cost of all descendant nodes of a circuit, not justTketOps.