-
Notifications
You must be signed in to change notification settings - Fork 615
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
sample_probs
is extracted out of sample_state
#6354
Conversation
…nylane into all_mp-processDM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far 🚀 . I've left a few comments that I think should be addressed before I can approve.
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems all resolved but somehow Github doesn't auto reset
Hi @lillian542 my implementation involved some refactoring over your previous design as well as some tests; fortunately all the tests seem smooth for now but I just want to double check to make sure there's no explicit missing point on my side |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I'm ready to approve once the incorrect docstring is fixed. None of the other comments are blockers from my end :)
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
First PR almost in 🎉 ! |
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
**Context:** Currently, the sample_state helper function accepts a state vector, turns it into probabilities, and then samples it. This task is to break out the code for sample_probs from this function. By breaking this code into it's own helper function, we can reuse it for a "sample density matrix" implementation. **Description of the Change:** - [x] Separate `devices.qubit.sampling.sample_probs` from `sample_state` - [x] Separate `devices.qubit.sampling.sample_probs_jax` from `_sample_state_jax` - [x] similar but for qutrit mixed - [x] similar but for qutrit mixed **Benefits:** Better modularization; disentanglement Future usage in new devices **Possible Drawbacks:** **Related GitHub Issues:** **Related ShortCut Stories:** [sc-73317] --------- Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
**Context:** Currently, the sample_state helper function accepts a state vector, turns it into probabilities, and then samples it. This task is to break out the code for sample_probs from this function. By breaking this code into it's own helper function, we can reuse it for a "sample density matrix" implementation. **Description of the Change:** - [x] Separate `devices.qubit.sampling.sample_probs` from `sample_state` - [x] Separate `devices.qubit.sampling.sample_probs_jax` from `_sample_state_jax` - [x] similar but for qutrit mixed - [x] similar but for qutrit mixed **Benefits:** Better modularization; disentanglement Future usage in new devices **Possible Drawbacks:** **Related GitHub Issues:** **Related ShortCut Stories:** [sc-73317] --------- Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
Context:
Currently, the sample_state helper function accepts a state vector, turns it into probabilities, and then samples it. This task is to break out the code for sample_probs from this function.
By breaking this code into it's own helper function, we can reuse it for a "sample density matrix" implementation.
Description of the Change:
devices.qubit.sampling.sample_probs
fromsample_state
devices.qubit.sampling.sample_probs_jax
from_sample_state_jax
Benefits:
Better modularization; disentanglement
Future usage in new devices
Possible Drawbacks:
Related GitHub Issues:
Related ShortCut Stories:
[sc-73317]