Example Gallery: Separability and entanglement testing
It would be nice to showcase how one can use toqito to check whether a quantum state (i.e. density matrix) is separable or entangled using the is_separable function. We should be careful to note that determining separability is NP-hard (in general). However, showcasing some specific states with "nice" structure that are caught in the preliminary separability checks would be nice for the sake of example.
It might also be good to give some level of treatment to what happens when a quantum state falls through all of the separability checks and hits the symmetric extension SDP. We don't need to go into terrible amounts of detail, but maybe a line or two about why this check is used, why it's hard in general, etc.
Would be good also to showcase how one can use the random module to generate a random density matrix and determine whether it is separable or not for the sake of a (general) example.
Hi @vprusso, I am implementing this tutorial! I am creating a draft that walks through the hierarchy of separability checks, including:
- Basic checks on known separable vs. entangled states.
- Random state generation and testing.
- Visualizing the transition of Werner states from separable to entangled using a parameter sweep.
Quick Question:
I noticed the existing examples in the repo are
.pyscripts. I currently have this drafted as a Jupyter Notebook (.ipynb) for easy visualization. I can open a PR with the Notebook now for you to review the logic/visuals while we decide on the format. could you clarify: Format: Should I submit this as an .ipynb notebook or a .py script? Location: Which specific directory would you like this file to be added to?
Basic checks on known separable vs. entangled states.
the is_separable function has more than a couple of basic checks. Discuss in detail those that are relevant to the example you are adding.
I can open a PR with the Notebook now for you to review the logic/visuals while we decide on the format. Format: Should I submit this as an .ipynb notebook or a .py script?
The default format for gallery examples is .py. we use sphinx-gallery. Take a look at the existing examples in docs/examples or the corresponding docs https://sphinx-gallery.github.io/stable/index.html on format etc.
FWIW while I am not too much of an AI luddite, please don't rely on LLMs entirely for the examples content. Your comment appears to be written with the help of some LLM. From experience, they are good for coding but not that much for scientific content.
@purva-thakre
I understand about the format and the content. I appreciate the heads-up: I will ensure the scientific explanations are rigorous and verify the specific logic used in the examples.
Regarding the Separability Checks, I plan to structure the example to demonstrate the hierarchy used by is_separable:
PPT Criterion: I will demonstrate a state where the Positive Partial Transpose check is sufficient (fast failure).
Symmetric Extensions: I will focus on the Werner state example here, as it requires the higher-level SDP checks (Symmetric Extensions) to detect entanglement when the state is PPT-entangled or close to the boundary.
I will convert the draft to a .py script following the Sphinx-Gallery format (using rst style comments) and open the PR shortly.