ffsim.linalg.givens_decomposition¶
- ffsim.linalg.givens_decomposition(mat)[source]¶
Givens rotation decomposition of a unitary matrix.
The Givens rotation decomposition of an \(n \times n\) unitary matrix \(U\) is given by
\[U = D G_L^* G_{L-1}^* \cdots G_1^*\]where \(D\) is a diagonal matrix and each \(G_k\) is a Givens rotation. Here, the star \(*\) denotes the element-wise complex conjugate. A Givens rotation acts on the two-dimensional subspace spanned by the \(i\)-th and \(j\)-th basis vectors as
\[\begin{split}\begin{pmatrix} c & s \\ -s^* & c \\ \end{pmatrix}\end{split}\]where \(c\) is a real number and \(s\) is a complex number. Therefore, a Givens rotation is described by a 4-tuple \((c, s, i, j)\), where \(c\) and \(s\) are the numbers appearing in the rotation matrix, and \(i\) and \(j\) are the indices of the basis vectors of the subspace being rotated. This function always returns Givens rotations with the property that \(i\) and \(j\) differ by at most one, that is, either \(j = i + 1\) or \(j = i - 1\).
The number of Givens rotations \(L\) is at most \(\frac{n (n-1)}{2}\), but it may be less. If we think of Givens rotations acting on disjoint indices as operations that can be performed in parallel, then the entire sequence of rotations can always be performed using at most \(n\) layers of parallel operations. The decomposition algorithm is described in the reference below.
References
- Parameters:
mat (
ndarray) – The unitary matrix to decompose into Givens rotations.- Return type:
- Returns:
A list containing the Givens rotations \(G_1, \ldots, G_L\). Each Givens rotation is represented as a 4-tuple \((c, s, i, j)\), where \(c\) and \(s\) are the numbers appearing in the rotation matrix, and \(i\) and \(j\) are the indices of the basis vectors of the subspace being rotated.
A Numpy array containing the diagonal elements of the matrix \(D\).