toqito.state_metrics.bures_distance
- toqito.state_metrics.bures_distance(rho_1, rho_2, decimals=10)[source]
Compute the Bures distance of two density matrices [WikBures].
Calculate the Bures distance between two density matrices
rho_1andrho_2defined by:\[\sqrt{2 (1 - F(\rho_1, \rho_2))},\]where \(F(\cdot)\) denotes the fidelity between \(\rho_1\) and \(\rho_2\). The return is a value between \(0\) and \(\sqrt{2}\),with \(0\) corresponding to matrices:
rho_1 = rho_2and \(\sqrt{2}\) corresponding to the case:rho_1andrho_2with orthogonal support.Examples
Consider the following Bell state
\[u = \frac{1}{\sqrt{2}} \left( |00 \rangle + |11 \rangle \right) \in \mathcal{X}.\]The corresponding density matrix of \(u\) may be calculated by:
\[\begin{split}\rho = u u^* = \frac{1}{2} \begin{pmatrix} 1 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 1 \end{pmatrix} \in \text{D}(\mathcal{X}).\end{split}\]In the event where we calculate the Bures distance between states that are identical, we should obtain the value of \(0\). This can be observed in
toqitoas follows.>>> from toqito.state_metrics import bures_distance >>> import numpy as np >>> rho = 1 / 2 * np.array( >>> [[1, 0, 0, 1], >>> [0, 0, 0, 0], >>> [0, 0, 0, 0], >>> [1, 0, 0, 1]] >>> ) >>> sigma = rho >>> bures_distance(rho, sigma) 0
References
[WikBures]Wikipedia: Bures metric https://en.wikipedia.org/wiki/Bures_metric
- Raises:
ValueError – If matrices are not of equal dimension.
- Parameters:
rho_1 – Density operator.
rho_2 – Density operator.
decimals – Number of decimal places to round to (default 10).
- Returns:
The Bures distance between
rho_1andrho_2.