We then built up machinery to define mixing operators for a QAOA approach to this problem. Since some mixing operators are more naturally expressed in one encoding rather than another, we found it useful to describe different mixing operators in different encodings, though we emphasize that doing so is merely for convenience; all mixing operators are encoding-independent, so the descriptions may be translated from one encoding to another. The domain F is naturally expressed as strings of d-dits, a d-valued generalization of bits. For the present problem, . In addition to discussing colorings as strings of dits, we used a “one-hot” encoding into bits, with indicating whether or not vertex i is assigned color c.
4.1.1. Single Qudit Mixing Operators
We focused initially on designing partial mixers, component operators that will be used to construct full mixing operators. For this mapping of the maxColorableSubgraph problem, the partial mixers are operators acting on a qudit with dimension that mix between the colors associated to a single vertex v. As we see in subsequent sections, this is a particularly simple case of partial mixers which are often more complicated multiqubit-controlled operators. Once we have defined these single-qudit partial mixing operators, we put them together to create a full mixer for the problem.
We began by considering the following family of single-qudit mixing operators expressed in terms of qudits, and qudit operators, and then considered encodings and compilations to qubit-based architectures, which inspired us to consider other families of single-qubit mixing operators. See
Appendix C.2 and References [
36,
37] for a review of qudit operators, including the generalized Pauli operators
and
.
r-nearby-values single-qudit mixer. Let , where , which acts on a single qudit, with . We identified two special cases by name: The “single-qudit ring mixer” for , and the “fully-connected” mixer for , . Whenever we introduced a Hamiltonian, we also implicitly introduced its corresponding family of unitaries, as with and .
The single-qudit ring mixer is a cornerstone of many of the mixing constructions that we discuss. We concentrated on qubit encodings thereof, given the various projections of hardware with at least 40 qubits that will be available in the next year or two [
11,
12], though it could alternatively be implemented directly using a qudit-based architecture. We explored two natural encodings of a qudit into qubits: (1) The
one-hot encoding using
d qubits, in which each qudit basis state
,
, is encoded as
; and (2) the
binary encoding using
qubits, in which each qudit state
is encoded as the qubit computational basis state labeled by the binary representation of the integer
a. The one-hot encoding uses more qubits but supports a simpler compilation of the single-qudit ring mixer for general
d, both in the sense of it being much easier to write down a compilation, and in the sense that it uses many fewer two-qubit gates; in the one-hot encoding, 2-local mixing interactions suffice, whereas binary encoding requires
-local Hamiltonian terms, with the corresponding unitary requiring further compilation to two-qubit gates.
In the one-hot encoding, the single-qudit ring mixer is encoded as a qubit unitary
corresponding to the qubit Hamiltonian:
which acts on the qubit Hilbert space in a way that preserves the Hamming weight of computational basis states and acts as
on the encoded subspace spanned by unit Hamming weight computational basis states.
Although
is 2-local, its terms do not mutually commute. There are several implementation options. First, hardware that natively implements the multiqubit gate
directly may be plausible (much as quantum annealers already support the simultaneous application of a Hamiltonian to a large set of qubits), but most proposals for universal quantum processors are based on two-qubit gates, so a compilation to such gates is desirable both for applicability to hardware likely to be available in the near term and for error-correction and fault tolerance in the longer term. Second, we could use constructions used in quantum many-body physics to compile
into a circuit of 2-local gates [
38]. Third, the multiqubit gate
could be implemented approximately via Trotterization or other Hamiltonian simulation algorithms. A different approach, and the alternative we explore most extensively here, is to implement a different unitary rather than
, one related to
, and sharing its desirable mixing properties, as encapsulated in the design criteria of
Section 3.1, which is easier to implement. The form of the circuit obtained by Trotterization is suggestive. We considered sequentially applying unitaries corresponding to subsets of terms in the Hamiltonian, each subset chosen in such a way that the corresponding unitary is readily implementable. This reasoning mirrors the relation of H-QAOA circuits to Trotterized AQO. We give a few examples of mixers obtained in this way.
Parity single-qudit ring mixer. Still in the one-hot encoding, we partitioned the
d terms
by the parity of their indices. Let:
where:
Such “XY” gates are natively implemented on certain superconducting processors [
39].
It is easy to see that the parity single-qudit ring mixer preserves the Hamming weight and hence meets the first criterion of keeping the evolution within the feasible single-qudit subspace. To see that it also meets the second, providing transitions between all feasible computational basis states, it is useful to consider the quantum swap gate, which behaves in exactly the same way as the XY gate on the subspace spanned by
. The swap gate
is both unitary and Hermitian, and thus:
For , each term in the parity single-qudit ring mixer is a superposition of a swap gate and the identity. A single application of will have nonzero transition amplitudes only between pairs of colors with indices no more than two apart. Nevertheless, this mixer meets the second criteria because all possible orderings of d swap gates appear in repeats of the parity operator for any , thus providing nonzero amplitude transitions between all feasible computational basis states for a single-vertex graph.
When d is an integer power of two, there is also a straightforward, though more resource-intensive, compilation of the parity single-qudit ring mixer using the binary encoding. Applying a Pauli X gate to the least-significant qubit acts as on the encoded subspace. Incrementing the register by one, applying the Pauli gate to the least-significant qubit, and finally decrementing the register by one overall acts as . Therefore, we can implement by incrementing the register by one, applying an to the least-significant qubit, decrementing the register by one, and then again applying an gate to the least-significant qubit. For an l-bit register, each incrementing and decrementing operation can be written as a series of l multiply-controlled X gates, with the numbers of control ranging from 0 to .
Repeated parity single-qudit ring mixers. As we mentioned above, a single application of will have nonzero transition amplitudes only between pairs of colors with indices no more than two apart, which suggests that it may be useful to repeat the parity mixer within one mixing step.
Partition single-qudit ring mixers. We now generalize the above construction for the parity single-qudit ring mixer to more general partition mixers. For a given ordered partition
of the terms of
such that all pairs of terms within a
act on disjoint states of the qudit, let:
where:
By construction, in the one-hot encoding, the terms of commute (because they act on disjoint pairs of qubits), and so the ordering does not matter; all can be implemented in parallel. We call the “partition ” r-nearby-values single-qudit ring mixer, and the “simultaneous” r-nearby-values single-qudit ring mixer to distinguish the latter from the former. The latter is member of H-QAOA, while the former is not.
Even more generally, for a set of single-qudit ring mixers indexed by some and an ordered partition thereof, in which the single-qudit mixers within each part mutually commute, we defined a simultaneous version, and a -partitioned version, , where the order of the product over the elements of each part does not matter because they commute, and the order of the product over the parts of the partition is given by their ordering within the ordered partition .
Binary single-qudit mixer for . We now return briefly to the binary encoding, and describe a different single-qudit mixer. An alternative to the
r-nearby values single-qudit mixer, which is easily implementable using the binary encoding when
is a power of two, is the “simple binary” single-qudit mixer:
where
acts on the
ith qubit in the binary encoding of the qudit. Since the ordering of the colors was arbitrary to begin with, it does not much matter whether the Hamiltonian mixes nearby values in the ordering or mixes the colors in a different way, in this case to colors with indices whose binary representations have Hamming distance 1.
When
d is not a power of 2, a straightforward generalization of the binary single-qudit mixer experiences difficulty in meeting the first of the design criteria, since swapping one of the bit values in the binary representation may take the evolution out of the feasible subspace. While requiring
d to be a power of 2 restricts its general applicability, the binary single-qudit mixer could be useful in some interesting cases, such as 4-coloring. For 2-coloring (a problem equivalent to MaxCut), the full binary single-qudit mixer is simply the standard mixer
X. We use this encoding in
Section 5.2 to handle slack variables in a single-machine scheduling problem, a case in which there is flexibility in the upper range of the integer to be encoded, allowing us to round up to the nearest power of two when needed.
4.1.2. Full QAOA Mapping
Having introduced several partial mixers for single qudits, we now show a complete QAOA circuit for MaxColorableSubgraph with n vertices, m edges, and colors, compiled to 2-local gates on qubits. Using the one-hot encoding, we require qubits.
Mixing operator. We used as the full mixer a parity ring mixer made up of parity single-qudit ring mixers, one for each of the qudits corresponding to each vertex:
The single qubit mixers act on different qubits and can be applied in parallel. The overall parity mixing operator required a depth-2 or depth-3 circuit (for even and odd , respectively) of gates. Other single-qudit mixers we defined above, including r repeats of the parity ring mixer, other partitioned mixers, or the binary mixer, could be used in place of the parity single-qudit mixer in this construction. All of these unitary mixers by construction meet our first criterion for a mixer: Keeping the evolution in the feasible subspace. Further, each of these mixers, after at most repeats, provides nonzero amplitude transitions between all colors at a given vertex, with the product providing transitions between any two feasible states.
Phase-separation operator. The objective function can be written in classical one-hot encoding as:
where
, indicating that vertex
v has been assigned color
a. To obtain a phase-separation Hamiltonian, we substituted
for each binary variable to obtain:
The constant term affects only a physically-irrelevant global phase, and since we are only concerned about the feasible subspace, we can disregard each sum
of all
single
Z operators corresponding to a single qudit, since they multiply each of the
d Hamming weight 1 elements corresponding to the
d single qudit values by the same constant, resulting in a global phase. Removing those terms and rescaling, the phase separator now has the simpler form:
where
acts on the
ath qubit in the one-hot encoding of the
vth qudit, corresponding to coloring vertex
v with color
a. The phase separator requires a circuit containing
two-qubit gates with depth at most
, where
is the maximum degree over all vertices in the instance graph
G.
Translated back to acting on qudits, Equation (
17) acts as
(as defined in Equation (
3)), where
. We refer to this function
g as the “phase function”, which will typically be an affine transformation of the objective function, which corresponds simply to a physically irrelevant global phase and a rescaling of the parameter. Defining
using such a phase function allows us to write a simpler encoded version
that corresponds exactly to
, without qualification, on the encoded subspace.
Initial state. Any encoded coloring can be generated by a depth-1 circuit of at most n single-qubit X gates. A reasonable initial state is one in which all vertices are assigned the same color. Alternatively, we could start with any other feasible state, or the initial state could be obtained by applying one or more rounds of the mixer to a single feasible state, so that the algorithm begins with a superposition of feasible states.
The circuit depth and gate count for the full algorithm will increase when compiling to realistic near-term hardware with architectures that have nearest neighbor topological constraints limiting between which pairs of physical qubits two-qubit gates can be applied. See Reference [
22] for one approach for compiling to realistic hardware with such constraints.
Further investigation is needed to understand which mixers and initial states, for a given resource budget, result in more or less effective algorithms, and whether some have an advantage with respect to finding good parameters , and or being robust to error.