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

add sampling for qubit_mixed module #6639

Merged
merged 55 commits into from
Dec 4, 2024
Merged

Conversation

JerryChen97
Copy link
Contributor

@JerryChen97 JerryChen97 commented Nov 26, 2024

Context:
In the new API interface of default_mixed, the submodule sampling is our final blocker to the remaining functionalities.
It provides three important helpers, sample_probs, sample_state and measure_with_samples.

Description of the Change:
Added the implementation of sampling.

Added the tests of sampling; note that compared with the qutrit counterpart, here the tests are highly simplified, to avoid unnecessary re-work in the future when we come back to improve the test suites for these two modules

Benefits:
Remove the blockers for the following-ups.
Drastically simplify the sampling code by reusing qubit src code

Possible Drawbacks:
There is an introduced dependency on qubit.sample_probs

Related GitHub Issues:
[sc-79095]

@JerryChen97 JerryChen97 changed the title add measure for qubit_mixed module add sampling for qubit_mixed module Nov 27, 2024
@JerryChen97 JerryChen97 self-assigned this Nov 29, 2024
@JerryChen97 JerryChen97 changed the base branch from master to add-qubit_mixed/measure November 29, 2024 19:05
@JerryChen97 JerryChen97 removed the do not merge ⚠️ Do not merge the pull request until this label is removed label Dec 3, 2024
pennylane/devices/qubit_mixed/sampling.py Outdated Show resolved Hide resolved
pennylane/devices/qubit_mixed/sampling.py Outdated Show resolved Hide resolved
Copy link
Contributor

@astralcai astralcai left a comment

Choose a reason for hiding this comment

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

No further questions from me 🚀

Copy link
Contributor

@mudit2812 mudit2812 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. I'll approve once the changelog is fixed.

doc/releases/changelog-dev.md Outdated Show resolved Hide resolved
pennylane/devices/qubit_mixed/sampling.py Outdated Show resolved Hide resolved
pennylane/devices/qubit_mixed/sampling.py Show resolved Hide resolved
Copy link
Contributor

@mudit2812 mudit2812 left a comment

Choose a reason for hiding this comment

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

I think _process_single_shot_copy should be _process_single_shot_entry. See here). However, this would be a non-blocking change, so I'm approving.

doc/releases/changelog-dev.md Outdated Show resolved Hide resolved
@JerryChen97 JerryChen97 enabled auto-merge (squash) December 4, 2024 21:39
@JerryChen97 JerryChen97 merged commit 8d43120 into master Dec 4, 2024
46 checks passed
@JerryChen97 JerryChen97 deleted the add-qubit_mixed/sampling branch December 4, 2024 22:20
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.

3 participants