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

QueueContext is not empty #1957

Merged
merged 5 commits into from
Dec 1, 2021
Merged

QueueContext is not empty #1957

merged 5 commits into from
Dec 1, 2021

Conversation

KetpuntoG
Copy link
Contributor

Context:
When importing pennylane QueueContext is not empty. You can check it by typing print(self.name) in the queue method of Operator.

Description of the Change:
The gates that were being added have been found.

@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 Nov 30, 2021

Codecov Report

Merging #1957 (2704bf5) into master (42482b1) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1957   +/-   ##
=======================================
  Coverage   98.81%   98.81%           
=======================================
  Files         225      225           
  Lines       17187    17187           
=======================================
  Hits        16983    16983           
  Misses        204      204           
Impacted Files Coverage Δ
...ane/transforms/decompositions/two_qubit_unitary.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 42482b1...2704bf5. Read the comment docs.

@co9olguy
Copy link
Member

Well spotted! 👀

@josh146
Copy link
Member

josh146 commented Dec 1, 2021

wow, nice catch @KetpuntoG! I'm curious how these gates ended up in a queuing context, since they seem to just be run at the module level, not within any tape/QNode 🤔

@KetpuntoG
Copy link
Contributor Author

I'm still learning about queues so I'm not entirely sure @josh146 . What I would say is that the __init__ of the gates call the queue method, which takes context = QueueContext if none is passed to the method.

Copy link
Contributor

@Jaybsoni Jaybsoni 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 !

Comment on lines +52 to +54
CNOT01 = np.array([[1, 0, 0, 0], [0, 1, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0]])
CNOT10 = np.array([[1, 0, 0, 0], [0, 0, 0, 1], [0, 0, 1, 0], [0, 1, 0, 0]])
SWAP = qml.SWAP(wires=[0, 1]).matrix
SWAP = np.array([[1, 0, 0, 0], [0, 0, 1, 0], [0, 1, 0, 0], [0, 0, 0, 1]])
Copy link
Contributor

Choose a reason for hiding this comment

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

Great find actually, never would have guessed that we start adding to the questions through here !

@KetpuntoG KetpuntoG merged commit 4b62d06 into master Dec 1, 2021
@KetpuntoG KetpuntoG deleted the queue_issue branch December 1, 2021 14:45
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