-
Notifications
You must be signed in to change notification settings - Fork 558
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 StateMeasurement.process_density_matrix
method
#5628
Comments
Hi @Alex-Preciado , thank you for the detailed issue description. I've begun addressing this issue and would like to confirm my understanding of the methods
|
P.S. after double checking the |
Thank you so much @JerryChen97!! @albi3ro from our team will offer some guidance very soon. |
Thanks for the question @JerryChen97 . Firstly, We have two "postprocessing" measurement interfaces,
As for the difference between Due to these complications, we began separating state vector logic from density matrix logic. In most places in pennylane, we now treat state vectors and density matrices as distinct objects. To perform this separation smoothly and avoid breaking legacy code, we made the new Hope all that information helps :) |
Thank you so much! This is very much clear to me now; I also sensed the implied distinct treatments between Now I will block the |
Important Note
Context
Currently, measurements in PennyLane must define how to calculate the resulting number from "terminal" information, such as state, samples, or counts. For example, we have already implemented and required a
StateMeasurement.process_state(state, wire_order)
method. See the module documentation on measurements for more detailed information here.But this method is specific to statevector-based simulators. To expand this framework to density-matrix based simulators like
default.mixed
, we need to add an additional method.Implementation Details
This task is to add a new method to
StateMeasurement
:And implement it for
ProbabilityMP
(bonus points for an implementation forStateMP
,DensityMatrixMP
)Relevant functions include:
qml.math.reduce_dm
qml.math.reduce_statevector
Additional Requirements
A completed PR would:
StateMeasurement.process_density_matrix
methoddoc/releases/changelog-dev.md
. Make sure to include your name in the list of contributors at the bottom!tests/measurements/test_measurements.py
,tests/measurements/test_state.py
, andtests/measurements/test_probs.py
The text was updated successfully, but these errors were encountered: