toqito.state_ops.schmidt_decomposition
- toqito.state_ops.schmidt_decomposition(rho, dim=None, k_param=0)[source]
Compute the Schmidt decomposition of a bipartite vector [WikSD].
Examples
Consider the \(3\)-dimensional maximally entangled state .. math:
u = \frac{1}{\sqrt{3}} \left( |000 \rangle + |111 \rangle + |222 \rangle \right)
We can generate this state using the
toqitomodule as follows. >>> from toqito.states import max_entangled >>> max_entangled(3) [[0.57735027],[0. ], [0. ], [0. ], [0.57735027], [0. ], [0. ], [0. ], [0.57735027]]
Computing the Schmidt decomposition of \(u\), we can obtain the corresponding singular values of \(u\) as .. math:
\frac{1}{\sqrt{3}} \left[1, 1, 1 \right]^{\text{T}}.
>>> from toqito.states import max_entangled >>> from toqito.state_ops import schmidt_decomposition >>> singular_vals, u_mat, vt_mat = schmidt_decomposition(max_entangled(3)) >>> singular_vals [[0.57735027] [0.57735027] [0.57735027]] >>> u_mat [[1. 0. 0.] [0. 1. 0.] [0. 0. 1.]] >>> vt_mat [[1. 0. 0.] [0. 1. 0.] [0. 0. 1.]]
References
[WikSD]Wikipedia: Schmidt decomposition https://en.wikipedia.org/wiki/Schmidt_decomposition
- Raises:
ValueError – If matrices are not of equal dimension.
- Parameters:
rho – A bipartite quantum state to compute the Schmidt decomposition of.
dim – An array consisting of the dimensions of the subsystems (default gives subsystems equal dimensions).
k_param – How many terms of the Schmidt decomposition should be computed (default is 0).
- Returns:
The Schmidt decomposition of the
rhoinput.