qml.bravyi_kitaev¶
- bravyi_kitaev(fermi_operator, n, ps=False, wire_map=None, tol=None)[source]¶
Convert a fermionic operator to a qubit operator using the Bravyi-Kitaev mapping.
Note
Hamiltonians created with this mapping should be used with operators and states that are compatible with the Bravyi-Kitaev basis.
In the Bravyi-Kitaev mapping, both occupation number and parity of the orbitals are stored non-locally. In comparison,
jordan_wigner()
stores the occupation number locally while storing the parity non-locally and vice-versa forparity_transform()
. In the Bravyi-Kitaev mapping, the fermionic creation and annihilation operators for even-labelled orbitals are mapped to the Pauli operators as\[\begin{split}\begin{align*} a^{\dagger}_0 &= \frac{1}{2} \left ( X_0 -iY_{0} \right ), \\\\ a^{\dagger}_n &= \frac{1}{2} \left ( X_{U(n)} \otimes X_n \otimes Z_{P(n)} -iX_{U(n)} \otimes Y_{n} \otimes Z_{P(n)}\right ), \\\\ \end{align*}\end{split}\]and
\[\begin{split}\begin{align*} a_0 &= \frac{1}{2} \left ( X_0 + iY_{0} \right ), \\\\ a_n &= \frac{1}{2} \left ( X_{U(n)} \otimes X_n \otimes Z_{P(n)} +iX_{U(n)} \otimes Y_{n} \otimes Z_{P(n)}\right ). \\\\ \end{align*}\end{split}\]Similarly, the fermionic creation and annihilation operators for odd-labelled orbitals are mapped to the Pauli operators as
\[\begin{split}\begin{align*} a^{\dagger}_n &= \frac{1}{2} \left ( X_{U(n)} \otimes X_n \otimes Z_{P(n)} -iX_{U(n)} \otimes Y_{n} \otimes Z_{R(n)}\right ), \\\\ \end{align*}\end{split}\]and
\[\begin{split}\begin{align*} a_n &= \frac{1}{2} \left ( X_{U(n)} \otimes X_n \otimes Z_{P(n)} +iX_{U(n)} \otimes Y_{n} \otimes Z_{R(n)}\right ), \\\\ \end{align*}\end{split}\]where \(X\), \(Y\), and \(Z\) are the Pauli operators, and \(U(n)\), \(P(n)\) and \(R(n)\) represent the update, parity and remainder sets, respectively [arXiv:1812.02233].
- Parameters
fermi_operator (FermiWord, FermiSentence) – the fermionic operator
n (int) – number of qubits, i.e., spin orbitals in the system
ps (bool) – whether to return the result as a PauliSentence instead of an Operator. Defaults to False.
wire_map (dict) – a dictionary defining how to map the orbitals of the Fermi operator to qubit wires. If None, the integers used to order the orbitals will be used as wire labels. Defaults to None.
tol (float) – tolerance for discarding the imaginary part of the coefficients
- Returns
a linear combination of qubit operators
- Return type
Union[PauliSentence, Operator]
Example
>>> w = qml.fermi.from_string('0+ 1-') >>> bravyi_kitaev(w, n=6) ( -0.25j * Y(0) + (-0.25+0j) * (X(0) @ Z(1)) + (0.25+0j) * X(0) + 0.25j * (Y(0) @ Z(1)) )
>>> bravyi_kitaev(w, n=6, ps=True) -0.25j * Y(0) + (-0.25+0j) * X(0) @ Z(1) + (0.25+0j) * X(0) + 0.25j * Y(0) @ Z(1)
>>> bravyi_kitaev(w, n=6, ps=True, wire_map={0: 2, 1: 3}) -0.25j * Y(2) + (-0.25+0j) * X(2) @ Z(3) + (0.25+0j) * X(2) + 0.25j * Y(2) @ Z(3)