View source on GitHub |
Compute the matrix elements of the Givens rotation that zeroes out one of two row entries.
openfermion.linalg.givens_matrix_elements(
a, b, which='left'
)
If which='left'
then returns a matrix G such that
G * [a b]^T= [0 r]^T
otherwise, returns a matrix G such that
G * [a b]^T= [r 0]^T
where r is a complex number.
Returns | |
---|---|
G
|
ndarray
A 2 x 2 numpy array representing the matrix G. The numbers in the first column of G are real. |