jordan_wigner

jordan_wigner(op, num_qubits)

Map a FermionOperator to a SparseObservable under the Jordan-Wigner transformation. [1]

Parameters:
  • op – the fermionic operator to map.

  • num_qubits – the number of qubits for the resulting qubit operator.

Returns:

The mapped qubit operator.


Definition

The Jordan-Wigner transformation maps fermionic creation and annihilation operators to spin (or in this case, qubit) operators:

\[a^\dagger_j \rightarrow \bigotimes_{k\lt j} \sigma^Z_k \otimes \sigma^+_j ~~\text{and}~~ a_j \rightarrow \bigotimes_{k\lt j} \sigma^Z_k \otimes \sigma^-_j \, ,\]

where \(a^\dagger_j\) (\(a_j\)) is the fermionic creation (annihilation) operator acting on the \(j\)-th spin-less fermionic mode, \(\sigma^P\) with \(P \in \{X,Y,Z\}\) are the spin-\(\frac{1}{2}\) Pauli operators and \(\sigma^\pm = (\sigma^X \pm \mathrm{i} \sigma^Y) / 2\).

This mapping preserves the fermionic anti-commutation relations by introducing a chain of \(\sigma^Z\) operators on all qubits preceding the acted-upon index \(j\).

Usage

Since a FermionOperator does not determine a fixed number of modes which it acts upon, one can specify the number of qubits to map onto when calling this function.

>>> from qiskit_fermions.mappers.library import jordan_wigner
>>> from qiskit_fermions.operators import FermionOperator
>>> fop = FermionOperator.from_dict(
...     {
...         (): 2.0,
...         ((True, 0), (False, 0)): 0.1,
...         ((True, 1), (False, 2), (True, 2), (False, 1)): -1.0j,
...     }
... )
>>> qop = jordan_wigner(fop, 4)
>>> qop.simplify()
<SparseObservable with 5 terms on 4 qubits: (2.05-0.25j)() + (-0.05+0j)(Z_0) + (0+0.25j)(Z_1) + (0+0.25j)(Z_2 Z_1) + (0-0.25j)(Z_2)>