3.1. Application to Quadratic Operators
A typical Hermitian operator that conserves the total particle number and is quadratic in the operators takes the form
For concreteness, we will work with the spin-up case. After the Jordan–Wigner transformation, this becomes
where we assume that
. Note that we also use the facts that
,
and
. Note further that when the two terms are nearest neighbors, so
, then there are no Jordan–Wigner strings. Furthermore, the Jordan–Wigner strings can both be written as
after taking into account the matrix term and the constant term.
Expanding in terms of
and
matrices, we see that
, so that we find our final result
with a similar formula for the down spins, given by
When the sites are nearest neighbors, there are no
Z terms. Using the theorem we just proved, with
, we find that
for
, with a similar formula for
. Note that the down-spin expectation value takes the same form with each index increased by
N.
The simplest way to perform this measurement is to rotate the states being measured from the z-basis to the x-basis (on sites i and k only). Then we simply measure and read off the eigenvalues for each qubit. Finally, they are multiplied together to determine the overall eigenvalue (which is for each shot). This is then averaged over many measurements to determine the expectation value.
The rotation used is exp for each qubit that is measured in the x-direction; this rotation rotates the z-axis to the x-axis, which is the familiar Hadamard gate. But, to perform an efficient measurement, we want to measure as many of these expectation values as we can. We describe how to do this next.
If we perform the rotation on every qubit, we can measure the terms with
and
, which is
hopping terms in one measurement circuit. What is neat about this simplified (nonentangling) approach is that it allows us to measure overlapping hopping terms because we are in the diagonal basis for the operators. To measure the
hopping terms, we need two circuits (one starting at
, the other at
) and can measure approximately half with each circuit (we measure a total of
hopping terms with both circuits). Proceeding up to
, with
, we need
j measurements, and we measure
pairs. Once
, we need a separate circuit for each measurement. There continue to be
hopping terms to measure. The total number of terms is then
, which is all of the hopping pairs that we have. The number of measurement circuits needed is
Note that when
N is even, this just becomes
, and when
N is odd, it becomes
. As a check, when
, there are 45 unique fermionic hopping terms for one spin, and we need 25 circuits to measure all of them. This agrees with the above formula. In general, we need about half as many measurement circuits as the unique fermionic hopping pairs we have on the lattice. This is reduced, of course, if we do not need to measure all unique hopping pairs in our Hamiltonian. We will discuss this further later in this paper.
There is a second way to measure the hopping, which is the most common way currently used—it does not use the theorem—but instead, it works in a simultaneous eigenbasis of the
and
operators, since they both commute. The eigenbasis that diagonalizes both is the so-called Bell state basis. We have, in the case where
k is the left qubit and
i is the right qubit,
The eigenvalue of
is the measured value of
, and the eigenvalue of
is
, where
is the measured value of 1 or
on the
kth qubit, and similarly for
, for the given shot. The circuit to transform to this basis is simple: (i) first we apply a CNOT using the first qubit as the control and the second qubit as the target, and then (ii) we apply a Hadamard to the first qubit. The number of measurement circuits is identical to the first measurement scheme we discussed, except for the set of circuits with
. In this case, we need to run two measurement circuits to provide the entanglement across the qubits connected by the nearest-neighbor hopping. When we have Jordan–Wigner strings present (next-nearest neighbors and further), we also multiply the corresponding
Z eigenvalues for each qubit in the string.
One can see that the states will not contribute to the average, because they change the fermion number in the state after we evaluate or onto it. Furthermore, the states have the same eigenvalues for the and measurements, which is another way to see why our theorem holds.
In comparing the two approaches, the nonentangling approach uses one fewer measurement circuit and does not require as many entangling gates for the measurement, so it should always perform better, in theory. This becomes more detrimental if the hardware does not have all-to-all connectivity, because some cases may require a significant number of swaps.
This completes the analysis for the quadratic hopping terms. The next section evaluates quartic interaction terms, where the analysis is more complicated.
3.2. Application to Quartic Operators
We now discuss the quartic terms. Since we assume that the Hamiltonian is Hermitian, there is no spin–orbit coupling or other terms that can flip spins, and all Hamiltonian matrix elements are real, the most general form involves the following set of terms:
where the lexographic inequality
means that
, or if
, then
. This has terms where
and
for the equal spin terms in the top row and
and
, and
and
for the mixed-spin terms in the bottom row. To construct the Hamiltonian, these terms are multiplied by the real numbers labeled by the same indices and summed over all allowed indices (space and spin).
When we perform the Jordan–Wigner transformation for the same-spin case, we immediately find that
where we neglect the spin degree of freedom of the fermions for clarity. Note that because we have no specific ordering relation between
j and
k (and even
l), it is not a simple exercise to simplify the Jordan–Wigner string further in this representation. The minus sign comes from the fact that
. If
, then the above form properly describes the fully transformed expression. If
and
, then we would have a Jordan–Wigner string running from
to
and from
to
l, because
.
By converting to the
and
operators and ignoring the Jordan–Wigner strings which will commute with these operators (and possible sign changes if the
Z-string from one pair overlaps with the
Z-string of the other pair), we find
which involves eight independent terms (note that the overall sign may change due to overlapping Jordan–Wigner strings). Using the nonentangled measurement scheme requires four separate measurements for each of these terms after using the theorem with
. This says, schematically,
,
,
, and
, where the schematic notation implies we are taking an expectation value of the corresponding operators—we drop the bras and kets for simplicity here. This indicates that we would need four separate measurements for each term. But, things simplify further if we use the theorem with
, where
. Then we have that
after using the theorem with
on the right hand side to remove many of the terms. Now, this says that
is equal to the expression on the right. If we rearrange, we find that
which, we want to emphasize, holds for the expectation values only. This allows us to reduce the measurements to just two independent measurements. So, we find
where we dropped the Jordan–Wigner strings for simplicity (and there may also be a sign change). For cases where the indices are close enough to each other along the Jordan–Wigner chain, one can perform multiple measurements, which we will discuss in more detail in the next section.
Similar to the quadratic terms, we can also measure all eight elements with one circuit using an entangled basis. It is more complicated than the Bell state basis. We need to find a set of states that diagonalize all of these eight Pauli strings (these eight strings all commute with each other because they all have an even number of like Pauli operators on the different sites). The states that diagonalize the system are summarized in
Table 1 and the eigenvalues of the eight operators are summarized in
Table 2. We label the states with an integer index and a parity. Each state is the sum of just two states. This construction generalizes the Bell states used to simultaneously measure the
and
operators for the quadratic terms.
The circuit to put the system into this basis is the inverse of creating a so-called NOON state from the state. It is a set of three CNOTs that use qubit 0 as control and qubits 3, 2, and 1, in turn as the target, followed by a Hadamard on qubit 0. This is a fairly simple entangling circuit to employ.
The measurement on the four qubits will produce a state
that is measured. That state is the initial state, from which the states in
Table 1 are prepared after applying a Hadamard on qubit zero followed by three CNOTS, all using the zeroth qubit as a control and the first, second, and third qubits as targets. Once the state is decoded, then
Table 2 lists the eigenvalue for the corresponding operator. Because the circuit will require a potentially large number of swaps to carry out the entangling gates (when on hardware that does not have all-to-all connectivity), the actual cost for the entangled measurement can be significant, in terms of loss of fidelity.
Because the nonentangled circuit always requires two measurements, while the entangled circuit requires only one, it seems like the entangled circuit is always better. This is certainly true in the general case, unless the entangling operation causes too much error in the result. But, in cases where the operator has no Jordan–Wigner strings, then the nonentangled circuit will allow a number of measurements to be carried out at once, similar to what happened for the quadratic operators. We will not go into the details of how this works here, nor will we go into the counting of the number of measurement circuits, as it becomes quite involved.