openfermion.linalg.fermionic_gaussian_decomposition

Decompose a matrix into a sequence of Givens rotations and particle-hole transformations on the last fermionic mode.

Main aliases

openfermion.fermionic_gaussian_decomposition, openfermion.linalg.givens_rotations.fermionic_gaussian_decomposition

The input is an N×2N matrix W with orthonormal rows. Furthermore, W must have the block form

W=(W1W2)

where W1 and W2 satisfy

W_1  W_1^\dagger + W_2  W_2^\dagger &= I

W_1  W_2^T + W_2  W_1^T &= 0.

Then W can be decomposed as

VWU=(0D)

where V and U are unitary matrices and D is a diagonal unitary matrix. Furthermore, U can be decomposed as follows:

U=BGkBG3G2BG1B,

where each Gi is a Givens rotation, and B represents swapping the N-th column with the 2N-th column, which corresponds to a particle-hole transformation on the last fermionic mode. This particle-hole transformation maps aN to aN and vice versa, while leaving the other fermionic ladder operators invariant.

The decomposition of U is returned as a list of tuples of objects describing rotations and particle-hole transformations. The list looks something like [('pht', ), (G_1, ), ('pht', G_2), ... ]. The objects within a tuple are either the string 'pht', which indicates a particle-hole transformation on the last fermionic mode, or a tuple of the form (i,j,θ,φ), which indicates a Givens rotation of rows i and j by angles θ and φ.

The matrix VTD can also be decomposed as a sequence of Givens rotations. This decomposition is needed for a circuit that prepares an excited state.

unitary_rows ndarray

A matrix with orthonormal rows and additional structure described above.

Returns

decomposition (list[tuple]):
    The decomposition of \\(U\\).
left_decomposition (list[tuple]):
    The decomposition of \\(V^T D^*\\).
diagonal (ndarray):
    A list of the nonzero entries of \\(D\\).
left_diagonal (ndarray):
    A list of the nonzero entries left from the decomposition
    of \\(V^T D^*\\).