Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement reset feature for mid-circuit measurements #507

Merged
merged 2 commits into from
Feb 16, 2024

Conversation

rauletorresc
Copy link
Contributor

@rauletorresc rauletorresc commented Feb 13, 2024

Context: We want to support in Catalyst the existent reset feature of the measure function of PennyLane.

Description of the Change: The logic is implemented at the measure function right after the instantiation of the MidCircuitMeasure object. It applies a PauliX gate to the qubit, but only if the measurement result was 1.

Benefits: No need to involve MLIR and runtime on the process.

TODO:

  • Frontend implementation
  • Tests
  • Changelog updates

[sc-56696]

@rauletorresc rauletorresc added runtime Pull requests that update the runtime compiler Pull requests that update the compiler frontend Pull requests that update the frontend labels Feb 13, 2024
@rauletorresc rauletorresc self-assigned this Feb 13, 2024
@rauletorresc rauletorresc force-pushed the implement-reset-at-measure branch 3 times, most recently from cc7dfb0 to cd5f8d7 Compare February 15, 2024 20:24
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (b009321) 99.55% compared to head (b849cec) 99.55%.

Files Patch % Lines
frontend/catalyst/pennylane_extensions.py 84.61% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #507   +/-   ##
=======================================
  Coverage   99.55%   99.55%           
=======================================
  Files          43       43           
  Lines        7866     7870    +4     
  Branches      537      537           
=======================================
+ Hits         7831     7835    +4     
  Misses         18       18           
  Partials       17       17           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rauletorresc rauletorresc marked this pull request as ready for review February 15, 2024 20:40
@rauletorresc rauletorresc removed runtime Pull requests that update the runtime compiler Pull requests that update the compiler labels Feb 15, 2024
doc/changelog.md Outdated Show resolved Hide resolved
@rauletorresc rauletorresc added the ci:build-wheels Run the wheel building workflows on this Pull Request label Feb 15, 2024
Copy link
Collaborator

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Looks good 👍

doc/changelog.md Outdated Show resolved Hide resolved
doc/changelog.md Outdated Show resolved Hide resolved
frontend/catalyst/pennylane_extensions.py Outdated Show resolved Hide resolved
frontend/catalyst/pennylane_extensions.py Show resolved Hide resolved
@dime10
Copy link
Collaborator

dime10 commented Feb 16, 2024

The coverage does seem bugged, I think we can merge as is 👍

@rauletorresc rauletorresc merged commit 7f54ce5 into main Feb 16, 2024
62 of 63 checks passed
@rauletorresc rauletorresc deleted the implement-reset-at-measure branch February 16, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:build-wheels Run the wheel building workflows on this Pull Request frontend Pull requests that update the frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants