openfermion.linalg.jordan_wigner_sparse

Initialize a Scipy sparse matrix from a FermionOperator.

Operators are mapped as follows: a_j^\dagger -> Z0 .. Z{j-1} (X_j - iY_j) / 2 a_j -> Z0 .. Z{j-1} (X_j + iY_j) / 2

fermion_operator FermionOperator

instance of the FermionOperator class.

n_qubits int

Number of qubits.

The corresponding Scipy sparse matrix.