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] Shot-allocation through sampling for split_non_commuting #5832

Draft
wants to merge 28 commits into
base: master
Choose a base branch
from

Conversation

Shiro-Raven
Copy link
Contributor

@Shiro-Raven Shiro-Raven commented Jun 10, 2024

Context:

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

[sc-64031]

@Shiro-Raven Shiro-Raven added the WIP 🚧 Work-in-progress label Jun 10, 2024
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.

pennylane/transforms/split_non_commuting.py Outdated Show resolved Hide resolved
)

shots_list = [
binom(n=rmng_shots, p=prob).rvs() for rmng_shots in remaining_shots_budget[idx]
Copy link
Member

Choose a reason for hiding this comment

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

Are we certain the values we put in here are always bounded between 0 and 1 (including numerical precision errors)?

pennylane/transforms/split_non_commuting.py Outdated Show resolved Hide resolved
@@ -28,10 +31,22 @@
from pennylane.typing import Result, ResultBatch


class ObsMetadata(NamedTuple):
Copy link
Member

Choose a reason for hiding this comment

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

Any advantage of using a NamedTuple vs a dataclass here?

@transform
def split_non_commuting(
tape: qml.tape.QuantumScript,
grouping_strategy: Optional[str] = "default",
term_sampling: Optional[Literal["weighted", "uniform"]] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please can this term be included in the docs

@PennyLaneAI PennyLaneAI deleted a comment from codecov bot Jun 21, 2024
Copy link

codecov bot commented Jul 18, 2024

Codecov Report

Attention: Patch coverage is 96.47059% with 3 lines in your changes missing coverage. Please review.

Project coverage is 99.66%. Comparing base (1f55c88) to head (d0ec4f2).
Report is 4 commits behind head on master.

Files Patch % Lines
pennylane/transforms/split_non_commuting.py 96.05% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5832      +/-   ##
==========================================
- Coverage   99.67%   99.66%   -0.02%     
==========================================
  Files         432      432              
  Lines       41839    41607     -232     
==========================================
- Hits        41702    41466     -236     
- Misses        137      141       +4     

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

@trbromley
Copy link
Contributor

Also @Shiro-Raven, please could you link the Shortcut story?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP 🚧 Work-in-progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants