Transforms a QubitOperator into a FermionOperator using the Jordan-Wigner transform.
openfermion.transforms.reverse_jordan_wigner(
qubit_operator, n_qubits=None
)
Used in the notebooks
Operators are mapped as follows:
Z_j -> I - 2 a^\dagger_j a_j
X_j -> (a^\dagger_j + aj) Z{j-1} Z_{j-2} .. Z_0
Y_j -> i (a^\dagger_j - aj) Z{j-1} Z_{j-2} .. Z_0
Args |
qubit_operator
|
the QubitOperator to be transformed.
|
n_qubits
|
the number of qubits term acts on. If not set, defaults
to the maximum qubit number acted on by term.
|
Returns |
transformed_term
|
An instance of the FermionOperator class.
|
Raises |
TypeError
|
Input must be a QubitOperator.
|
TypeError
|
Invalid number of qubits specified.
|
TypeError
|
Pauli operators must be X, Y or Z.
|