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 is_sampled and its test #1126

Merged
merged 3 commits into from
Mar 9, 2021
Merged

Fix is_sampled and its test #1126

merged 3 commits into from
Mar 9, 2021

Conversation

antalszava
Copy link
Contributor

Context:

The is_sampled attribute of a quantum tape is required for generating samples on the device level. The behaviour for this attribute was modified in #1027 and #1040.

Due to a bug, this attribute is not being set currently, although its test case is passing. The reason is that the underlying device gets swapped inside the test case, ultimately leading to unexpected behaviour.

Description of the Change:

  • Adds the required line for updating the is_sampled attribute
  • Fixes the test case

Benefits:
Sampling works correctly.

Possible Drawbacks:
N/A

Related GitHub Issues:
N/A

@antalszava antalszava added the bug 🐛 Something isn't working label Mar 8, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2021

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.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 8, 2021

Codecov Report

Merging #1126 (5736b55) into master (10fde20) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1126   +/-   ##
=======================================
  Coverage   97.74%   97.74%           
=======================================
  Files         155      155           
  Lines       11783    11784    +1     
=======================================
+ Hits        11517    11518    +1     
  Misses        266      266           
Impacted Files Coverage Δ
pennylane/tape/tapes/tape.py 98.34% <100.00%> (+<0.01%) ⬆️

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 10fde20...5736b55. Read the comment docs.

Copy link
Contributor

@mariaschuld mariaschuld left a comment

Choose a reason for hiding this comment

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

Thanks so much for fixing this!

@josh146 josh146 merged commit 12c3dc2 into master Mar 9, 2021
@josh146 josh146 deleted the fix_is_sampled_tape branch March 9, 2021 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants