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 17 commits into
base: master
Choose a base branch
from

Conversation

Shiro-Raven
Copy link
Collaborator

Context:

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@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
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.

None yet

3 participants