Skip to content

Commit

Permalink
jordan-wigner: simplify SparsePauliOp before returning
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinsung committed Jul 13, 2024
1 parent 1d966f3 commit 5a00e66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/ffsim/qiskit/jordan_wigner.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def jordan_wigner(op: FermionOperator, n_qubits: int | None = None) -> SparsePau
qubit_op @= _qubit_action(action, orb + spin * norb, n_qubits)
qubit_terms.append(qubit_op)

return SparsePauliOp.sum(qubit_terms)
return SparsePauliOp.sum(qubit_terms).simplify()


@functools.cache
Expand Down

0 comments on commit 5a00e66

Please sign in to comment.