Skip to content

feature: advertise reset in OpenQASM supportedOperations - #432

Draft
jheckey wants to merge 1 commit into
amazon-braket:mainfrom
jheckey:feature/advertise-reset
Draft

jheckey wants to merge 1 commit into
amazon-braket:mainfrom
jheckey:feature/advertise-reset

Conversation

@jheckey

@jheckey jheckey commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Summary

StateVectorSimulator and DensityMatrixSimulator execute reset correctly, but neither lists reset in the OpenQASM action's supportedOperations. Downstream targets built from that list (for example the one in qiskit-braket-provider) therefore reject programs that contain reset on the local simulators.

Changes

  • Add "reset" to supportedOperations of the braket.ir.openqasm.program action in state_vector_simulator.py and density_matrix_simulator.py. The JAQCD action is unchanged.
  • Update the expected properties in the existing test_properties tests.

Tests

  • New tests assert reset is advertised by both simulators.
  • New end-to-end tests run x q[0]; reset q[0]; c[0] = measure q[0]; on both simulators and expect only 0.
  • Also checked manually on both simulators: reset on a whole register, after a mid-circuit measurement, inside if and for, and on an entangled qubit. All gave the expected results.
  • Full unit suite passes.

@codecov

codecov Bot commented Nov 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (bfefc3c) to head (bc4fdd8).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #432   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           50        50           
  Lines         5198      5198           
  Branches       621       621           
=========================================
  Hits          5198      5198           

☔ View full report in Codecov by Harness.
📢 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.

This branch has not been deployed

No deployments
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.

1 participant