openfermion.linalg.givens_decomposition
Decompose a matrix into a sequence of Givens rotations.
openfermion.linalg.givens_decomposition(
unitary_rows, always_insert=False
)
The input is an \(m \times n\) matrix \(Q\) with \(m \leq n\).
The rows of \(Q\) are orthonormal.
\(Q\) can be decomposed as follows:
\[
V Q U^\dagger = D
\]
where \(V\) and \(U\) are unitary matrices, and \(D\)
is an \(m \times n\) matrix with the
first \(m\) columns forming a diagonal matrix and the rest of the
columns being zero. Furthermore, we can decompose \(U\) as
\[
U = G_k ... G_1
\]
where \(G_1, \ldots, G_k\) are complex Givens rotations.
A Givens rotation is a rotation within the two-dimensional subspace
spanned by two coordinate axes. Within the two relevant coordinate
axes, a Givens rotation has the form
\[
\begin{pmatrix}
\cos(\theta) & -e^{i \varphi} \sin(\theta) \\
\sin(\theta) & e^{i \varphi} \cos(\theta)
\end{pmatrix}.
\]
Args |
unitary_rows
|
A numpy array or matrix with orthonormal rows,
representing the matrix Q.
|
Returns |
givens_rotations
|
list[tuple]
A list of tuples of objects describing Givens
rotations. The list looks like [(G_1, ), (G_2, G_3), ... ].
The Givens rotations within a tuple can be implemented in parallel.
The description of a Givens rotation is itself a tuple of the
form \((i, j, \theta, \varphi)\), which represents a
Givens rotation of coordinates
\(i\) and \(j\) by angles \(\theta\) and
\(\varphi\).
|
left_unitary
|
ndarray
An \(m \times m\) numpy array representing the matrix
\(V\).
|
diagonal
|
ndarray
A list of the nonzero entries of \(D\).
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-07-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-07-14 UTC."],[],[]]