Skip to main content

Someone wanted to learn this too, so Grasp built them a personal learning path.

You can keep exploring this one or create your own

Mapping Hamiltonians to Pauli Strings

Hello! Welcome back to our course.

In our last lesson, we explored how to construct parameterized quantum circuits, or ansätze, which are the heart of the Variational Quantum Eigensolver (VQE). We saw how these circuits, , prepare a trial ground state .

Today, we address the next crucial step in the VQE workflow: evaluating the energy expectation value, . The challenge is that the Hamiltonian for problems in chemistry or materials science is typically described using operators that are not native to a quantum computer.

This lesson directly addresses the learning outcome: Apply a mapping transformation (e.g., Jordan-Wigner) to express a simple fermionic or spin-model Hamiltonian as a sum of Pauli strings. We will bridge the gap between the physical description of a system and the operational language of qubits.

1. From Fermions to Qubits: The Fundamental Challenge

Many problems of interest, particularly in quantum chemistry, involve systems of fermions (e.g., electrons). A quantum computer, on the other hand, is a system of qubits. These two types of particles have fundamentally different quantum statistics, which is reflected in the algebra of their operators.

  • Fermions: Are indistinguishable particles that obey the Pauli exclusion principle. Their behavior is described by creation () and annihilation () operators that satisfy the canonical anti-commutation relations (CARs).
  • Qubits: Are distinguishable two-level systems. They are manipulated using Pauli operators () which act on a specific, labeled qubit . Pauli operators on different qubits commute, while those on the same qubit have their own well-known commutation relations.

The core of the mapping problem is to find a way to represent the anti-commuting nature of fermionic operators using the commuting (on different sites) operators of qubits.

The following video provides a concise introduction to this problem.

Lecture 3: Fermion-qubit mappings

This video, 'Lecture 3: Fermion-qubit mappings' from Artur Izmaylov, clearly articulates the motivation for these mappings by contrasting the properties of fermionic and qubit systems.

Please watch the first 3 minutes (00:00:00 - 00:02:54). Focus on the key differences highlighted: anti-commutation vs. commutation, and indistinguishability vs. distinguishability.

For a more formal, mathematical perspective on the fermionic anti-commutation relations, the following notes are an excellent resource.

The Fermionic canonical commutation relations and the Jordan-Wigner transform

These notes by Michael Nielsen, 'The Fermionic canonical commutation relations and the Jordan-Wigner transform', provide a rigorous mathematical treatment. We will return to this document later.

Please read Section II.A, 'The canonical commutation relations for Fermions' (page 2). This section formally defines the anti-commutation relations that any valid fermion-to-qubit mapping must preserve.

The anti-commutation relations are:

The second line implies that for , which encodes the sign change upon swapping two fermions. It also means , which is the mathematical embodiment of the Pauli exclusion principle.

2. The Jordan-Wigner Transformation

The Jordan-Wigner (JW) transformation is the most direct and historically significant method for mapping fermionic operators to qubit operators.

The Intuition

The core idea is to map the occupation of a fermionic mode (e.g., a molecular orbital) to the state of a qubit. We establish a one-to-one correspondence:

  • Orbital is unoccupied Qubit is in state .
  • Orbital is occupied Qubit is in state .

Based on this, the creation and annihilation operators and should act like qubit raising () and lowering () operators on qubit . However, this simple local mapping fails to capture the anti-commutation relations for operators on different orbitals ().

The "Wigner" String

To enforce the correct anti-symmetric statistics, we must introduce a phase factor that depends on the number of occupied orbitals with indices less than . This is accomplished by prepending a "string" of Pauli-Z operators to the local raising/lowering operator. The Pauli-Z operator on qubit contributes a factor of -1 if that qubit is in state (occupied) and +1 if it is in state (unoccupied).

This leads to the full definition of the Jordan-Wigner transformation:

where and are the raising and lowering operators for qubit . The tensor product of operators is the "Jordan-Wigner string".

The following video explains this construction in more detail.

Lecture 3: Fermion-qubit mappings

We return to Artur Izmaylov's lecture, which now details the Jordan-Wigner mapping itself.

Please watch from 00:02:54 to 00:10:16. This segment explains the intuition, introduces the Z-string to handle fermionic signs, and shows how a fermionic Hamiltonian is transformed into a qubit Hamiltonian.

A key consequence of this mapping is that a fermionic operator acting on a single mode is transformed into a qubit operator involving up to qubits. This non-locality is a defining characteristic and a primary drawback of the JW transformation, as it can lead to deep circuits.

3. Applying the Transformation: From Physics to Pauli Strings

With the mapping defined, we can translate any Hamiltonian expressed in terms of fermionic operators into a sum of Pauli strings. The electronic structure Hamiltonian in second quantization is typically written as:

Here, and are one- and two-electron integrals, which are pre-computed classically. The task is to substitute the JW representation for each creation and annihilation operator and simplify the resulting products of Pauli matrices.

While this is algorithmically straightforward, it is tedious to do by hand. The result is a qubit Hamiltonian of the form:

where each is a tensor product of Pauli matrices (e.g., ) and is a real coefficient.

An Illuminating Example: Spin Models

The Jordan-Wigner transform is a two-way street. Not only can it map fermionic systems to qubits, but it can also map qubit (spin) systems to fermions. This is particularly powerful for solving certain 1D spin models by transforming them into non-interacting (quadratic) fermionic Hamiltonians, which are exactly solvable.

Let's examine this using the transverse Ising model, a canonical model in condensed matter physics:

This Hamiltonian is already a sum of Pauli strings. We can use the inverse JW transform to express the Pauli operators in terms of fermionic operators.

The following reading walks through this process. It's a beautiful demonstration of the power of the JW transform and connects directly to concepts from many-body physics.

The Fermionic canonical commutation relations and the Jordan-Wigner transform

We return to Michael Nielsen's notes. This section provides the inverse transformation and applies it to solve a 1D quantum spin system.

Please read Section III, 'THE JORDAN-WIGNER TRANSFORM' (pages 7-8). Focus on equations (32)-(34) which define the inverse map (Paulis in terms of fermions), and the subsequent example of re-expressing the transverse Ising model as a Fermi quadratic Hamiltonian.

As the notes show, simple products of neighboring Pauli operators like map to simple quadratic terms in the fermionic representation (e.g., ). This is because the long Jordan-Wigner strings of the individual operators cancel out. The result is a quadratic fermionic Hamiltonian, which can be diagonalized through standard techniques, allowing for an exact solution of the original spin model.

4. Beyond Jordan-Wigner: Other Mappings

While Jordan-Wigner is foundational, its non-locality can be a disadvantage. Other mappings have been developed to address this, most notably the Bravyi-Kitaev (BK) and Parity mappings.

These mappings use more complex schemes to encode fermionic occupation into qubit states. Their primary advantage is that they transform fermionic operators into Pauli strings with a weight (number of non-identity operators) that scales as for orbitals, compared to for Jordan-Wigner. This improved locality can lead to shallower circuits for Hamiltonian simulation and VQE.

The paper below introduces a general mathematical framework that encompasses all these mappings, with the specific mapping being determined by a binary matrix . For Jordan-Wigner, is simply the identity matrix.

Efficiently manipulating Pauli strings with PauliArray

This recent paper, 'Efficiently manipulating Pauli strings with PauliArray', discusses a software tool for these transformations but also provides a concise, generalized formula for fermion-to-qubit mappings.

Please read the section 'V. A. Fermion-to-qubit Mapping' (page 4). You don't need to dive into the software implementation details. Focus on understanding the general structure of the mapping in Equation (10) and the statement that Jordan-Wigner corresponds to the case where the mapping matrix M is the identity.

In practice, you will rarely perform these transformations by hand. Quantum computing libraries like Qiskit, PennyLane, and OpenFermion provide functions that automatically convert a physical Hamiltonian into a sum of Pauli strings using a specified mapping.

5. Conclusion

We have established the crucial link between the physical description of a quantum system and the language of a quantum computer.

Key Takeaways:

  • To simulate fermionic or spin systems on a quantum computer, their Hamiltonians must be translated into a sum of Pauli strings, .
  • This translation is achieved via a fermion-to-qubit mapping, which must correctly reproduce the fundamental anti-commutation algebra of the fermionic operators.
  • The Jordan-Wigner (JW) transformation is the canonical example. It maps orbital occupation to qubit states and uses strings of Pauli-Z operators to enforce the correct fermionic statistics.
  • The JW mapping is conceptually simple but suffers from non-locality, as operators on distant orbitals can be connected by long Pauli strings.
  • Other mappings, like Bravyi-Kitaev, offer better locality ( operator weight) at the cost of a more complex encoding scheme.
  • This transformation is a key preprocessing step for many quantum algorithms, including VQE and Hamiltonian simulation.

Preview of the Next Lesson

We have now defined the two main components for VQE: the ansatz and the qubit Hamiltonian . The final piece of the puzzle is to actually compute the energy .

In our next lesson, we will focus on the learning outcome: For a given Hamiltonian expressed as a sum of Pauli strings, devise a measurement strategy to estimate its expectation value by measuring each term individually. We will see how to measure the expectation value for each Pauli string in our Hamiltonian.

Can't find a good explanation? Sign up and we'll make it for you

Sign up