qml.qchem._terms_to_qubit_operator

_terms_to_qubit_operator(coeffs, ops)[source]

Converts a 2-tuple of complex coefficients and PennyLane operations to OpenFermion QubitOperator.

This function is the inverse of _qubit_operator_to_terms.

Parameters
  • coeffs (array[complex]) – coefficients for each observable, same length as ops

  • ops (Iterable[pennylane.operation.Observable]) – List of PennyLane observables as Tensor products of Pauli observables

Returns

an instance of OpenFermion’s QubitOperator.

Return type

QubitOperator