Skip to content

fix: Implementation-independent MCM check#367

Merged
speller26 merged 15 commits into
mainfrom
mcm-fix
Apr 29, 2026
Merged

fix: Implementation-independent MCM check#367
speller26 merged 15 commits into
mainfrom
mcm-fix

Conversation

@speller26
Copy link
Copy Markdown
Member

@speller26 speller26 commented Apr 29, 2026

Issue #, if available:

Description of changes:

Properly makes expression MCM dependence determination implementation-independent by moving it from the concrete context class to a new abstract method called by the interpreter.

Testing done:

Verifies correct behavior with new tests backed by a context implementing dynamic circuit translation.

Merge Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.

General

Tests

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@speller26 speller26 requested a review from a team as a code owner April 29, 2026 00:44
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (3efd89c) to head (9700434).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #367   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           49        49           
  Lines         4894      4884   -10     
  Branches       565       561    -4     
=========================================
- Hits          4894      4884   -10     

☔ 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.

Comment thread src/braket/default_simulator/openqasm/interpreter.py
Comment thread src/braket/default_simulator/openqasm/interpreter.py
Comment thread src/braket/default_simulator/openqasm/interpreter.py
)
if node.target and self.context.supports_midcircuit_measurement:
self.context.add_measure(qubits, targets, classical_destination=node.target)
self.context.mark_mcm_dependent(get_identifier_name(node.target))
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This is the only functional change in this file

@speller26 speller26 merged commit 28417be into main Apr 29, 2026
37 of 50 checks passed
@speller26 speller26 deleted the mcm-fix branch April 29, 2026 20:07
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.

2 participants