state_ops.schmidt_decomposition¶
Schmidt decomposition operation computes the schmidt decomposition of a quantum state or an operator.
Functions¶
|
Compute the Schmidt decomposition of a bipartite vector [1]. |
|
Calculate the Schmidt decomposition of an operator (matrix). |
Module Contents¶
- state_ops.schmidt_decomposition.schmidt_decomposition(rho, dim=None, k_param=0)¶
Compute the Schmidt decomposition of a bipartite vector [1].
Examples
Consider the \(3\)-dimensional maximally entangled state:
\[u = \frac{1}{\sqrt{3}} \left( |000 \rangle + |111 \rangle + |222 \rangle \right).\]We can generate this state using the
toqito
module as follows.>>> from toqito.states import max_entangled >>> max_entangled(3) array([[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
\[\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 array([[0.57735027], [0.57735027], [0.57735027]]) >>> u_mat array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]]) >>> vt_mat array([[1., 0., 0.], [0., 1., 0.], [0., 0., 1.]])
References
[1] (1,2)Wikipedia. Schmidt decomposition. URL: https://en.wikipedia.org/wiki/Schmidt_decomposition.
- Raises:
ValueError – If matrices are not of equal dimension.
- Parameters:
rho (numpy.ndarray) – A bipartite quantum state to compute the Schmidt decomposition of.
dim (int | list[int] | numpy.ndarray) – An array consisting of the dimensions of the subsystems (default gives subsystems equal dimensions).
k_param (int) – How many terms of the Schmidt decomposition should be computed (default is 0).
- Returns:
The Schmidt decomposition of the
rho
input.- Return type:
tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]
- state_ops.schmidt_decomposition._operator_schmidt_decomposition(rho, dim=None, k_param=0)¶
Calculate the Schmidt decomposition of an operator (matrix).
Given an input rho provided as a matrix, determine its corresponding Schmidt decomposition.
- Raises:
ValueError – If matrices are not of equal dimension..
- Parameters:
rho (numpy.ndarray) – The matrix.
dim (int | list[int] | numpy.ndarray) – The dimension of the matrix
k_param (int) – The number of Schmidt coefficients to compute.
- Returns:
The Schmidt decomposition of the
rho
input.- Return type:
tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]