openfermion.linalg.givens_matrix_elements

Compute the matrix elements of the Givens rotation that zeroes out one of two row entries.

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.

a complex or float

A complex number representing the upper row entry

b complex or float

A complex number representing the lower row entry

which string

Either 'left' or 'right', indicating whether to zero out the left element (first argument) or right element (second argument). Default is left.

G ndarray

A 2 x 2 numpy array representing the matrix G. The numbers in the first column of G are real.