-
Notifications
You must be signed in to change notification settings - Fork 603
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
[QIM-2] Add a qml.math.state_to_density_matrix
for matrices and qml.math.partial_trace
to math module
#2569
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov Report
@@ Coverage Diff @@
## master #2569 +/- ##
=======================================
Coverage 99.60% 99.60%
=======================================
Files 249 249
Lines 20307 20368 +61
=======================================
+ Hits 20226 20288 +62
+ Misses 81 80 -1
Continue to review full report at Codecov.
|
qml.math.density_matrix
for matrix and qml.math.partial_trace
qml.math.density_matrix
for matrix and qml.math.partial_trace
Quantum Information module PR # 2
Context:
Currently the way to get the (reduced) density matrix from a matrix is a function in the device
default.mixed
.Description of the Change:
Move the density matrix capabilities for state vector to the math module and implement
partial_trace
.We add
_density_matrix_from_matrix
internal function that takes 2-d tensors for all interfaces as input and returns the (reduced) density matrix. It also add the matrix case to the functionstate_to_density_matrix
which will be the user facing function that accepts state vectors, density matrices and QNodes returning states.Benefits:
The reduced density matrix capabilities for matrices are now in the math module and it becomes a function accessible across the whole code base.