We need a simple function to convert OpenFermion's QubitOperator to the corresponding Cirq object, `PauliSum`. Here's a snippet that does it: ```python def qubit_operator_to_pauli_sum(qubit_op): psum = cirq.PauliSum() for ind_ops, coeff in qubit_op.terms.items(): if ind_ops == tuple(): psum += coeff continue pstring = cirq.PauliString() for ind, op in ind_ops: if op == 'X': op = cirq.X elif op == 'Y': op = cirq.Y elif op == 'Z': op = cirq.Z pstring *= op(cirq.LineQubit(ind)) psum += pstring * coeff return psum ``` but it needs tests and stuff See also https://github.com/quantumlib/OpenFermion-Cirq/issues/368#issuecomment-584381039
We need a simple function to convert OpenFermion's QubitOperator to the corresponding Cirq object,
PauliSum. Here's a snippet that does it:but it needs tests and stuff
See also #368 (comment)