-
Notifications
You must be signed in to change notification settings - Fork 26
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 density matrix and entanglement calculations for qubits #203
Conversation
madcpf
commented
Jul 20, 2024
- Add a method in quantum world to calculate density matrix of given quantum objects (only qubits are supported now);
- Based on that method, add another method in quantum world to calculate quantum mutual information of two specified qubits. The calculation is based on https://en.wikipedia.org/wiki/Quantum_mutual_information.
I have some concerns about this PR. First, this is explicitly using a different sampler than the one provided the user as part of QuantumWorld. Second, it is using the density matrix, which is non-physical, so this will not work if the user is using a hardware device (or rather, it will use a simulator). Is it possible to change the partial traces in this entanglement measure to be measurements instead? Then, this would work for both hardware and simulation, and would not rely on the density matrix or a specific simulator. |
+Chris and Spiros for comment
My poor understanding is that this feature is meant to provide an
guesstimate of entanglement, so I'm not sure that your (otherwise spot on)
concerns matter to the output.
Chris, Spiros: thoughts?
…On Mon, Jul 22, 2024, 12:11 p.m. Doug Strain ***@***.***> wrote:
I have some concerns about this PR. First, this is explicitly using a
different sampler than the one provided the user as part of QuantumWorld.
Second, it is using the density matrix, which is non-physical, so this will
not work if the user is using a hardware device (or rather, it will use a
simulator).
Is it possible to change the partial traces in this entanglement measure
to be measurements instead? Then, this would work for both hardware and
simulation, and would not rely on the density matrix or a specific
simulator.
—
Reply to this email directly, view it on GitHub
<#203 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AM3ZMAAZCOHHIMCTB55KZPLZNUVMRAVCNFSM6AAAAABLFWCIL6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBTGMZDQMZQGU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
But we should be able to get a guesstimate of the entanglement from measurements instead of the density matrix, and, if we can do simply, we should. |
Hi all,I am not following GitHub commits, but Doug is right that using measurements is the right way to go. Chris and I have discussed using “classical shadows” to get us the density matrix info we need for entanglement measures. I don’t remember what the final verdict was on how to implement this.Best,SpirosOn Jul 22, 2024, at 9:46 AM, Ricardo Olenewa ***@***.***> wrote:+Chris and Spiros for commentMy poor understanding is that this feature is meant to provide an guesstimate of entanglement, so I'm not sure that your (otherwise spot on) concerns matter to the output. Chris, Spiros: thoughts?On Mon, Jul 22, 2024, 12:11 p.m. Doug Strain ***@***.***> wrote:
I have some concerns about this PR. First, this is explicitly using a different sampler than the one provided the user as part of QuantumWorld. Second, it is using the density matrix, which is non-physical, so this will not work if the user is using a hardware device (or rather, it will use a simulator).
Is it possible to change the partial traces in this entanglement measure to be measurements instead? Then, this would work for both hardware and simulation, and would not rely on the density matrix or a specific simulator.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
Thanks Doug and cognigami for the input! Please take a look at the updated version, which moves away from DensityMatrixSimulator. |
unitary/alpha/quantum_world.py
Outdated
def density_matrix( | ||
self, objects: Optional[Sequence[QuantumObject]] = None, count: int = 1000 | ||
) -> np.ndarray: | ||
"""Simulates the density matrix of the given objects. |
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.
Let's update the description here and then add some details about how we are assuming that this is a pure state so the density matrix is |psi><psi|
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.
Done. Thanks.