qml.qchem.jordan_wigner

jordan_wigner(op, notation='physicist')[source]

Convert a fermionic operator to a qubit operator using the Jordan-Wigner mapping.

For instance, the one-body fermionic operator \(a_2^\dagger a_0\) should be constructed as [2, 0]. The two-body operator \(a_4^\dagger a_3^\dagger a_2 a_1\) should be constructed as [4, 3, 2, 1] with notation='physicist'. If notation is set to 'chemist', the two-body operator [4, 3, 2, 1] is constructed as \(a_4^\dagger a_3 a_2^\dagger a_1\).

Parameters
  • op (list[int]) – the fermionic operator

  • notation (str) – notation specifying the order of the two-body fermionic operators

Returns

list of coefficients and qubit operators

Return type

tuple(list[complex], list[Operation])

Example

>>> f  = [0, 0]
>>> q = jordan_wigner(f)
>>> q # corresponds to :math:`\frac{1}{2}(I_0 - Z_0)`
([(0.5+0j), (-0.5+0j)], [Identity(wires=[0]), PauliZ(wires=[0])])