Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def reverse_jordan_wigner(qubit_operator, n_qubits=None):
working_term.terms[list(working_term.terms)[0]] = 1.0

# Get next non-identity operator acting below 'working_qubit'.
assert len(working_term.terms) == 1
if len(working_term.terms) != 1:
raise ValueError('Qubit operator term needs to be a single term')
Comment thread
mhucka marked this conversation as resolved.
Outdated
working_qubit = pauli_operator[0] - 1
for working_operator in reversed(list(working_term.terms)[0]):
if working_operator[0] <= working_qubit:
Expand Down
Loading