Skip to content

Conversation

@codrut3
Copy link
Contributor

@codrut3 codrut3 commented Jan 3, 2026

Change _group_into_moment_compatible to take into account measurement and control keys. Otherwise two incompatible operations can be put in the same moment.
I also changed _can_add_op_at to look at measurement and control keys.
I added unit tests that show the issue.

Change _group_into_moment_compatible to take into account measurement
and control keys.
@codrut3 codrut3 requested review from a team and vtomole as code owners January 3, 2026 10:28
@codrut3 codrut3 requested a review from mpharrigan January 3, 2026 10:28
@github-actions github-actions bot added the size: M 50< lines changed <250 label Jan 3, 2026
@codecov
Copy link

codecov bot commented Jan 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.57%. Comparing base (ceb9432) to head (b11b2de).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7823      +/-   ##
==========================================
- Coverage   99.57%   99.57%   -0.01%     
==========================================
  Files        1102     1102              
  Lines       98772    98828      +56     
==========================================
+ Hits        98352    98407      +55     
- Misses        420      421       +1     

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@daxfohl
Copy link
Collaborator

daxfohl commented Jan 4, 2026

Allowing multiple measurements to the same key in the same moment was a requirement from the HW team. Unless that has changed, this would be breaking.

@codrut3
Copy link
Contributor Author

codrut3 commented Jan 5, 2026

Thank you for pointing this out @daxfohl ! Doesn't this mean this condition here is also wrong:

not op_measurement_keys.isdisjoint(moment_measurement_keys)

@daxfohl
Copy link
Collaborator

daxfohl commented Jan 6, 2026

Maybe. Though it can't be removed completely, because then it could fall through to earlier moments and break commutativity. (There's a lot of https://xkcd.com/1172/ in the circuit construction code).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M 50< lines changed <250

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants