Skip to content

Conversation

@lmondada
Copy link
Contributor

@lmondada lmondada commented Oct 28, 2025

I want to define a Subcircuit as a combination of Intervals on resource paths (the parts with linear, non-copyable data), and ASTs of fully classical, copyable data.

@lmondada lmondada force-pushed the lm/copyable-expr-pr branch from 3249a88 to 16e358a Compare October 28, 2025 14:33
@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

❌ Patch coverage is 93.53234% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.97%. Comparing base (d34b013) to head (c7278d6).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
tket/src/subcircuit/expression.rs 94.35% 9 Missing and 1 partial ⚠️
tket/src/resource/scope.rs 87.50% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1209      +/-   ##
==========================================
+ Coverage   78.77%   78.97%   +0.20%     
==========================================
  Files         153      154       +1     
  Lines       18910    19111     +201     
  Branches    17808    18009     +201     
==========================================
+ Hits        14896    15093     +197     
- Misses       3070     3076       +6     
+ Partials      944      942       -2     
Flag Coverage Δ
python 92.65% <ø> (ø)
qis-compiler 68.40% <ø> (ø)
rust 78.59% <93.53%> (+0.21%) ⬆️

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.

@lmondada lmondada force-pushed the lm/copyable-expr-pr branch 2 times, most recently from cadeb13 to 244a2f8 Compare October 28, 2025 14:39
@lmondada lmondada force-pushed the lm/copyable-expr-pr branch from 244a2f8 to 0ba8534 Compare October 28, 2025 14:49
@lmondada lmondada marked this pull request as ready for review October 28, 2025 14:49
@lmondada lmondada requested a review from a team as a code owner October 28, 2025 14:49
@lmondada lmondada requested review from acl-cqc and cqc-alec and removed request for cqc-alec October 28, 2025 14:49
Copy link
Contributor

@acl-cqc acl-cqc left a comment

Choose a reason for hiding this comment

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

I've suggested a lot of renamings and minor stuff, but nothing major, so I guess I'm happy for this to go in, but with the proviso...

...that I am still not certain whether we shouldn't have a single SiblingSubgraph for all the classical computation associated with a set of intervals rather than many potentially-overlapping ones...maybe I would need to see some examples

@lmondada
Copy link
Contributor Author

not certain whether we shouldn't have a single SiblingSubgraph for all the classical computation associated with a set of intervals rather than many potentially-overlapping ones...

I agree that the fact that multiple copyable expressions might have overlapping nodes is not great. That being said

  1. your suggestion would require removing the convexity assumption (and enforcement) of [SiblingSubgraph] in hugr. This move would be quite breaking and should be thought through well. Might be something to add to clean-up november+december 😅 I agree that if non-convex SiblingSubgraphs existed, we could design this differently
  2. You'll see in the upcoming Subcircuit PR that these (overlapping) copyable expressions are not stored within the subcircuit -- they are constructed on the fly from the set of inputs of the subcircuit. In other words, they are not part of the data of the subcircuit, but are much more like computable properties of the subcircuit. Thus, the fact that overlapping expressions can be produced depending on which copyable values we are interested in is not so concerning.

Overall, I agree that there are further follow-ups and clean-ups that should be considered and executed, but this is a step in the right direction: it's helping construct a layer of abstraction above SiblingSubgraph, which is badly needed.

@lmondada
Copy link
Contributor Author

Thanks a lot Alan for the review!! Will now go through your comments and merge this in.

@lmondada lmondada enabled auto-merge October 30, 2025 11:04
@lmondada lmondada added this pull request to the merge queue Oct 30, 2025
Merged via the queue into main with commit 52fc658 Oct 30, 2025
24 checks passed
@lmondada lmondada deleted the lm/copyable-expr-pr branch October 30, 2025 11:12
@hugrbot hugrbot mentioned this pull request Oct 27, 2025
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.

3 participants