qml.qchem._qubit_operators_equivalent

_qubit_operators_equivalent(openfermion_qubit_operator, pennylane_qubit_operator, wires=None)[source]

Checks equivalence between OpenFermion QubitOperator and Pennylane VQE Hamiltonian (Tensor product of Pauli matrices).

Equality is based on OpenFermion QubitOperator’s equality.

Parameters
  • openfermion_qubit_operator (QubitOperator) – OpenFermion qubit operator represented as a Pauli summation

  • pennylane_qubit_operator (pennylane.Hamiltonian) – PennyLane Hamiltonian object

  • wires (Wires, list, tuple, dict) – Custom wire mapping used to convert to qubit operator from an observable terms measurable in a PennyLane ansatz. For types Wires/list/tuple, each item in the iterable represents a wire label corresponding to the qubit number equal to its index. For type dict, only int-keyed dict (for qubit-to-wire conversion) is accepted. If None, will map sorted wires from all Pennylane terms to consecutive int.

Returns

True if equivalent

Return type

(bool)