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

Improve mid-circuit measurement conversion abilities #417

Merged
merged 25 commits into from Feb 21, 2024

Conversation

obliviateandsurrender
Copy link
Contributor

@obliviateandsurrender obliviateandsurrender commented Feb 10, 2024

  • Context - Qiskit circuits with mid-circuit measurements are supported
  • Changes - Restructured the conversion iteration to add support for conditional operations based on mid-circuit measurements.
    1. Supported - c_if (legacy), IfElseOp, and SwitchCaseOp
    2. Not supported - ForLoopOp and WhileLoopOp, mainly because doing them with qml.cond doesn't seem possible at the moment.

@obliviateandsurrender
Copy link
Contributor Author

[sc-56131]

@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (307c6c4) 100.00% compared to head (927cb2d) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #417   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            7         7           
  Lines          380       429   +49     
=========================================
+ Hits           380       429   +49     

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

@albi3ro albi3ro self-requested a review February 13, 2024 22:21
Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

Thanks for the walkthrough, here are my initial thoughts from yesterday - I'll go through it again this afternoon :)

pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

a few more little things here and there

pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

Left a few minor suggestions, but nothing blocking. Looks good to me 🚀

pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Outdated Show resolved Hide resolved
pennylane_qiskit/converter.py Show resolved Hide resolved
tests/test_converter.py Show resolved Hide resolved
tests/test_converter.py Show resolved Hide resolved
Copy link
Contributor

@albi3ro albi3ro left a comment

Choose a reason for hiding this comment

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

Thanks for adding in those test additions. Looks good to me :)

@obliviateandsurrender obliviateandsurrender merged commit dc8ec85 into master Feb 21, 2024
13 checks passed
@obliviateandsurrender obliviateandsurrender deleted the cond-mid-meas-support branch February 21, 2024 19:32
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.

None yet

4 participants