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

[WIP] Fix bug where unexpected queuing occurs in qml.ctrl among other functions #6284

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

KetpuntoG
Copy link
Contributor

@KetpuntoG KetpuntoG commented Sep 19, 2024

This PR seeks to fix this bug.

The issue was that unwanted operators were being added when applying the qml.ctrl, qml.prod, qml.cond and qml.adjoint functions if they were located as arguments or kwargs.

To solve it I do a recursive search, for operators inside args and kwargs and I remove them.

Drawback:

This will delete it always. I can't think of a case where we want to add an operator to the queue by passing it as an argument.

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.

Copy link

codecov bot commented Sep 19, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.

Project coverage is 99.68%. Comparing base (cbc5a9d) to head (e921546).
Report is 4 commits behind head on master.

Files with missing lines Patch % Lines
pennylane/ops/op_math/controlled.py 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6284      +/-   ##
==========================================
- Coverage   99.69%   99.68%   -0.01%     
==========================================
  Files         443      444       +1     
  Lines       42022    42151     +129     
==========================================
+ Hits        41894    42020     +126     
- Misses        128      131       +3     

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

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