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

Fix queuing unexpected operators with qml.measure #2328

Merged
merged 18 commits into from
Mar 16, 2022
Merged

Fix queuing unexpected operators with qml.measure #2328

merged 18 commits into from
Mar 16, 2022

Conversation

KetpuntoG
Copy link
Contributor

@KetpuntoG KetpuntoG commented Mar 15, 2022

Context:
The conditional measurement added gates that were not defined.

Description of the Change:
Following the @antalszava 's suggestion I just changed tape.queue for tape.operations + tape.measurements. The issue originally was that tape.queue contains the underlying annotated queue that doesn't describe the circuit itself. Instead, a circuit would have to be iterated using tape.operations + tape.measurements.

Related GitHub Issues:
(#2327)

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@codecov
Copy link

codecov bot commented Mar 15, 2022

Codecov Report

Merging #2328 (7490058) into master (c379bb6) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #2328   +/-   ##
=======================================
  Coverage   99.32%   99.32%           
=======================================
  Files         242      242           
  Lines       19190    19193    +3     
=======================================
+ Hits        19060    19063    +3     
  Misses        130      130           
Impacted Files Coverage Δ
pennylane/transforms/defer_measurements.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c379bb6...7490058. Read the comment docs.

Copy link
Contributor Author

@KetpuntoG KetpuntoG left a comment

Choose a reason for hiding this comment

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

I see it very well! 👍😊

tests/transforms/test_condition.py Outdated Show resolved Hide resolved
Copy link
Contributor

@antalszava antalszava left a comment

Choose a reason for hiding this comment

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

💯

@antalszava antalszava changed the title conditional measurement bug Fix queuing unexpected operators with qml.measure Mar 16, 2022
@antalszava antalszava merged commit b784969 into master Mar 16, 2022
@antalszava antalszava deleted the cond_bug branch March 16, 2022 01:30
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

2 participants