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

deprecate tape.is_sampled and tape.all_sampled #4773

Merged
merged 4 commits into from
Nov 3, 2023

Conversation

timmysilv
Copy link
Contributor

Context:
tape.is_sampled and tape.all_sampled are not very useful and could really be evaluated on a per-call basis. Plus, maintaining the correctness of these values can be difficult if new measurements are introduced.

Description of the Change:
Raise a warning whenever those properties are accessed.

Benefits:
We're getting rid of stuff that may not necessarily belong on the tape API! 🧹

Possible Drawbacks:
In the deprecation notice, we're suggesting the 4 measurement types that are currently being used, but they are theoretically subject to change. We discussed other things to recommend, but I think this is the best option so far because it's the same as what we use in QubitDevice.execute. Sure, it might change one day. But by then, the properties (and their warnings) will be removed altogether!

[sc-45870]

Copy link

codecov bot commented Nov 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8aee680) 99.64% compared to head (af33e18) 99.64%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4773      +/-   ##
==========================================
- Coverage   99.64%   99.64%   -0.01%     
==========================================
  Files         381      381              
  Lines       34308    34042     -266     
==========================================
- Hits        34187    33920     -267     
- Misses        121      122       +1     
Files Coverage Δ
pennylane/_device.py 99.41% <ø> (-0.01%) ⬇️
pennylane/_qubit_device.py 99.44% <100.00%> (ø)
pennylane/interfaces/jax.py 98.93% <100.00%> (-0.08%) ⬇️
pennylane/interfaces/jax_jit.py 100.00% <100.00%> (ø)
pennylane/tape/qscript.py 100.00% <100.00%> (ø)
pennylane/tape/tape.py 98.49% <ø> (-0.06%) ⬇️

... and 38 files with indirect coverage changes

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

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.

👍 Just a comment about the moved block on the deprecations page, but looks good to me :)

@timmysilv timmysilv requested a review from a team November 3, 2023 13:41
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.

🚀

@timmysilv timmysilv enabled auto-merge (squash) November 3, 2023 14:28
@timmysilv timmysilv merged commit a3edb09 into master Nov 3, 2023
33 checks passed
@timmysilv timmysilv deleted the deprecate-tape-sampled branch November 3, 2023 16:09
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

3 participants