qml.qchem.qubit_observable

qubit_observable(o_ferm, cutoff=1e-12, mapping='jordan_wigner')[source]

Convert a fermionic observable to a PennyLane qubit observable.

Parameters
  • o_ferm (Union[FermiWord, FermiSentence]) – fermionic operator

  • cutoff (float) – cutoff value for discarding the negligible terms

  • mapping (str) – Specifies the fermion-to-qubit mapping. Input values can be 'jordan_wigner', 'parity' or 'bravyi_kitaev'.

Returns

Simplified PennyLane Hamiltonian

Return type

Operator

Example

>>> w1 = qml.FermiWord({(0, 0) : '+', (1, 1) : '-'})
>>> w2 = qml.FermiWord({(0, 0) : '+', (1, 1) : '-'})
>>> s = qml.FermiSentence({w1 : 1.2, w2: 3.1})
>>> print(qubit_observable(s))
-0.775j * (Y(0) @ X(1)) + 0.775 * (Y(0) @ Y(1)) + 0.775 * (X(0) @ X(1)) + 0.775j * (X(0) @ Y(1))