Quantum Algorithm For Approximating Maximum Independent Sets
Quantum Algorithm For Approximating Maximum Independent Sets
1
Department of Physics and Astronomy, Stony Brook University, Stony Brook, NY 11794, USA
2
Center for Theoretical Physics, Massachusetts Institute of Technology, Cambridge, Massachusetts 02139, USA
3
D. Lee Institute, Shanghai Jiao Tong University, Shanghai 200240, China
4
Wilczek Quantum Center, School of Physics and Astronomy, Shanghai Jiao Tong University, Shanghai 200240, China
5
Department of Physics, Stockholm University, Stockholm SE-106 91, Sweden
6
Department of Physics and Origins Project, Arizona State University, Tempe AZ 25287, USA
7
International Center for Quantum Materials, School of Physics, Peking University, Beijing 100871, China
8
Collaborative Innovation Center of Quantum Matter, Beijing 100871, China
(Received 25 January 2021; accepted 24 February 2021; published online 26 February 2021)
We present a quantum algorithm for approximating maximum independent sets of a graph based on quantum
non-Abelian adiabatic mixing in the sub-Hilbert space of degenerate ground states, which generates quantum
annealing in a secondary Hamiltonian. For both sparse and dense random graphs 𝐺, numerical simulation
suggests that our algorithm on average finds an independent set of size close to the maximum size 𝛼(𝐺) in low
polynomial time. The best classical algorithms, by contrast, produce independent sets of size about half of 𝛼(𝐺)
in polynomial time.
DOI: 10.1088/0256-307X/38/3/030304
Finding a maximum independent set (MIS) of a One finds that for sparse graphs with 𝑑 ≫ 1[5]
graph is an NP-hard problem that appears difficult to
solve even approximately. In spite of decades of re- ln 𝑑
𝛼[𝐺(𝑛, 𝑚)] ∼ 2𝑛 . (1)
search, no known classical algorithm produces much 𝑑
better results than the naive, greedy strategy.
For a graph 𝐺(𝑛, 𝑚) that contains 𝑛 vertices and Here too, no classical algorithm is known or suspected
𝑚 edges, it is known that unless P = NP no polyno- to perform well—specifically, to find an independent
mial algorithm can find an 𝑂(𝑛1−𝜖 )-approximate so- set of size (1 + 𝜖)𝑛 ln𝑑𝑑 in polynomial time with non-
lution in the worst case,[1,2] where 𝜖 > 0 is an ar- vanishing probability.
bitrary small positive number that is independent of Here we introduce a quantum algorithm which ap-
𝑛. We let 𝛼(𝐺) denote the largest size of indepen- pears, in extensive numerical evidence, to perform
dent sets for a given graph 𝐺. The aforementioned much better. It builds on the quantum algorithm for
statement means that the size of the best approximate independent sets we proposed in Ref. [6], but adds a
MIS found by a polynomial algorithm is ∼𝛼(𝐺)/𝑛1−𝜖 . major new ingredient. Numerical experiments indi-
This is not an impressive result when you notice that cate that our quantum algorithm typically produces
1 ≤ 𝛼(𝐺) ≤ 𝑛. Average case performance, for both an independent set of size almost 𝛼(𝐺) in low polyno-
sparse and dense graphs, is not much better. Consider mial time, for both sparse and dense random graphs in
for example the class of Erdös–Rényi random graphs, the average-case scenario, where we average over both
denoted 𝐺(𝑛, 𝒫), where 𝒫 is the probability to gen- the final quantum measurement and many randomly
erate an edge between any pair of vertices. Erdös– generated graphs.
Rényi graphs 𝐺(𝑛, 𝒫) are dense at 𝒫 = 1/2, as their Quantum Adiabatic Evolution in the Solution-
edge numbers are proportional to 𝑛2 . For them, the Subspace. Our approach for approximating MIS builds
MIS size is typically 𝛼[𝐺(𝑛, 1/2)] ∼ 2 log2 𝑛.[3] How- on a quantum algorithm for independent sets.[6,7] To
ever, no classical algorithm is known or suspected to fix notation and to make this work self-contained, we
produce in polynomial time, with non-vanishing prob- briefly recall the earlier algorithm here. For a given
ability, an independent set of size (1 + 𝜖) log2 𝑛 for any non-empty graph 𝐺, we construct a corresponding
fixed 𝜖 > 0, neither analytically nor through numer- spin-system with the following Hamiltonian[6]
ical evidence.[4] It is common to take 𝑑 = 2 𝑚/𝑛 to ∑︁
define sparse random graphs 𝐺(𝑛, 𝑚) parametrically. 𝐻0 = 𝛥 𝜎𝑖𝑧 + 𝜎
(ˆ ˆ𝑗𝑧 + 𝜎
ˆ𝑖𝑧 𝜎
ˆ𝑗𝑧 ). (2)
⟨𝑖𝑗⟩
F. Wilczek is supported in part by the U.S. Department of Energy (Grant No. DE-SC0012567), the European Research Council
(Grant No. 742104), and the Swedish Research Council (Grant No. 335–2014-7424). B. Wu is supported by the National Key R&D
Program of China (Grant Nos. 2017YFA0303302 and 2018YFA0305602), the National Natural Science Foundation of China (Grant
No. 11921005), and Shanghai Municipal Science and Technology Major Project (Grant No. 2019SHZDZX01).
* Corresponding author. Email: [email protected]
030304-1
CHIN. PHYS. LETT. Vol. 38, No. 3 (2021) 030304 Express Letter
Here the summation ⟨𝑖𝑗⟩ is taken over all edges in the the slowness parameter, within the sub-Hilbert space
graph. Spin 𝑗 being up should be interpreted as in- spanned by the ground states of 𝐻𝜏 . However, the
clusion of site 𝑗 in the candidate set, and the terms evolution within that space is nontrivial due to the
in the Hamiltonian as imposing a penalty for connec- non-Abelian geometric phase,[8] and when 𝑟 is rotated
tion between included sites. Two key features of this back to the 𝑧-direction, upon measurement one ob-
Hamiltonian are: tains with high probability a non-trivial independent
set.[6]
1. The independent sets of a graph 𝐺 are in one- The evolution within the sub-Hilbert space of the
to-one correspondence with the ground states of ground states is given by[8]
𝐻0 . (︁ ∫︁ 𝑡 )︁
2. There is an energy gap 4𝛥 between the ground |𝜓(𝑡)⟩ = 𝑃 exp 𝑖 𝐴(𝑡′ )𝑑𝑡′ |𝜓(0)⟩ , (8)
0
states and the first excited states, independent
where 𝑃 stands for time ordering and 𝐴 is the hermi-
of 𝑛 and 𝑚.
tian nonabelian gauge matrix. The off-diagonal terms
These features allow us to explore the space of inde- of the gauge matrix 𝐴 are non-zero only when they
pendent sets through non-abelian adiabatic evolution. connect states labeled by strings 𝜇, 𝜈 separated by
We consider acting uniformly upon all the spins Hamming distance |𝜇 − 𝜈| = 1. In that case we have
with the rotation matrix 𝐴𝜇,𝜈 (𝜃) = 𝑖 ⟨𝐸𝜇 |𝜕𝑡 | 𝐸𝜈 ⟩ = 𝑖 ⟨𝑢𝑟 |𝜕𝑡 | 𝑑𝑟 ⟩
(︂ )︂
cos 𝜃2 𝑒−𝑖𝜙 sin 𝜃2 sin 𝜃 𝑑𝜙 𝑖 𝑑𝜃
𝑉𝑗 = = 𝑉𝑗−1 . (3) = + sgn(𝜇 − 𝜈) , (9)
𝑒𝑖𝜙 sin 𝜃2 − cos 𝜃2 2 𝑑𝑡 2 𝑑𝑡
where sgn(𝜇 − 𝜈) is a sign function, depending on
𝑉𝑗 represents rotation through 𝜋 around the axis the sign of first non-zero element of 𝜇 − 𝜈; and
(sin 𝜃2 cos 𝜙, sin 𝜃2 sin 𝜙, cos 𝜃2 ) and takes the unit vec- 𝜇 − 𝜈 is defined as element-wise subtractions [e.g.,
tor (0, 0, 1) to 𝑟 ≡ (sin 𝜃 cos 𝜙, sin 𝜃 sin 𝜙, cos 𝜃). Note sgn({1, 1, −1} − {−1, 1, 1}) = sgn({2, 0, −2}) = +1].
that such mapping from the 𝑆𝑂(3) rotation to 𝑉𝑗 is The diagonal terms of 𝐴 are
not unique and 𝑉𝑗 does not have unit determinant,
but it includes a convenient overall phase factor. 𝐴𝜇,𝜇 (𝜃) = 𝑖 ⟨𝐸𝜇 |𝜕𝑡 | 𝐸𝜇 ⟩
If |𝑢⟩𝑗 and |𝑑⟩𝑗 are eigenstates of 𝜎 ˆ𝑗𝑧 , that is, {︁ 𝜃 𝜃 }︁ 𝑑𝜙
𝑧 𝑧 = − 𝑛+ sin2 + (𝑛 − 𝑛+ ) cos2 ,
ˆ𝑗 |𝑢⟩𝑗 = |𝑢⟩𝑗 and 𝜎
𝜎 ˆ𝑗 |𝑑⟩𝑗 = − |𝑑⟩𝑗 , then the eigen- 2 2 𝑑𝑡
𝑧 𝑧 −1
(10)
states of 𝜏ˆ𝑗 ≡ 𝑉𝑗 𝜎 ˆ𝑗 𝑉𝑗 are
where 𝑛+ is the number of plus signs in 𝜇.
𝜃 𝜃 Equation (8) indicates that the gauge matrix 𝐴
|𝑢𝑟 ⟩𝑗 = cos |𝑢⟩𝑗 + sin 𝑒𝑖𝜙 |𝑑⟩𝑗 , (4) can be regarded as an emergent Hamiltonian for the
2 2
𝜃 𝜃 spin system, generating unitary evolution within the
|𝑑𝑟 ⟩𝑗 = sin |𝑢⟩𝑗 − cos 𝑒𝑖𝜙 |𝑑⟩𝑗 . (5) eigenspaces of the original Hamiltonians 𝐻0 . We call
2 2
this the secondary Hamiltonian. In Ref. [6], we took
Upon acting with 𝑈 = 𝑉1 ⊗ 𝑉2 ⊗ · · · ⊗ 𝑉𝑛 , we rotate 𝜃 to be fixed and let 𝜙 vary slowly. This gives rise
all the spins and find a new Hamiltonian to a time-independent secondary Hamiltonian 𝐴(𝜃).
∑︁ In this work we change both 𝜙 and 𝜃 slowly, under
𝐻𝜏 = 𝑈 𝐻0 𝑈 −1 = 𝛥 𝜏𝑖𝑧 + 𝜏ˆ𝑗𝑧 + 𝜏ˆ𝑖𝑧 𝜏ˆ𝑗𝑧 ). (6)
(ˆ the condition 𝑑𝜃/𝑑𝑡 ≪ 𝑑𝜙/𝑑𝑡. This generalization
⟨𝑖𝑗⟩ brings in profoundly different dynamics. In this case,
Of course, 𝑈 need not be implemented through phys- 𝐴(𝜃) becomes a time-dependent secondary Hamilto-
ical rotation of the computing apparatus; it can be nian with the parameter 𝜃 changing slowly. Remark-
simulated using parallel operation of simple, one-bit ably, the empty-set solution 𝜇 = {−1, −1, . . . , −1} is
gates. the ground state of 𝐴(0), but the maximum indepen-
𝐻𝜏 has the same set of eigenvalues as 𝐻0 . Its eigen- dent set (MIS), which has largest number of vertices
states of 𝐻𝜏 are obtained by rotating those of 𝐻0 , in 𝑛+ , is the ground state of 𝐴(𝜋).
the form According to the adiabatic theorem, sufficiently
slow evolution of the secondary Hamiltonian will keep
|𝐸𝜇 (𝜃, 𝜙)⟩ = |𝑠1 ⟩ ⊗ |𝑠2 ⟩ ⊗ · · · ⊗ |𝑠𝑗 ⟩ ⊗ · · · ⊗ |𝑠𝑛 ⟩ , (7) us within the ground state manifold. This means that
if we change 𝜃 slowly enough, and evolve from 𝜃 = 0
where 𝜇 is a string of {±1}𝑛 , and |𝑠𝑗 ⟩ = |𝑢𝑟 ⟩ or |𝑑𝑟 ⟩ to 𝜃 = 𝜋, we will evolve to the state representing
for 𝜇𝑗 = 1 or −1. the maximum independent set when 𝜃 = 𝜋 [note that
The quantum algorithm in Ref. [6] starts the spin at the end we must reverse the spin directions, e.g.,
system in the state 𝐸𝜇 with 𝜇 = {−1, −1, . . . , −1}, turning {−1, −1, +1} into {+1, +1, −1}, as the system
which is one of many ground states of 𝐻0 . Then all ends along the −𝑧 direction (𝜃 = 𝜋)]. This is a quan-
spins are rotated in the same way, by slowly chang- tum adiabatic algorithm for MIS. Its time complexity
ing 𝑟. The system evolves, to exponential accuracy in is determined by the energy gap of 𝐴(𝜃).[9] In a worst
030304-2
CHIN. PHYS. LETT. Vol. 38, No. 3 (2021) 030304 Express Letter
case scenario the energy gap of 𝐴(𝜃) can be exponen- is the MIS. For each 𝑛, we compute numerically the
tially small, as we will shortly exemplify. However, energy gaps of 𝐴(𝜃) for 0 ≤ 𝜃 ≤ 𝜋 and find the min-
our numerical results show that more typically, in in- imum. The results are plotted in Fig. 1, which shows
teresting cases we get independents set whose size is that the minimum energy gaps of 𝐴(𝜃) for these graphs
very close to 𝛼(𝐺). decrease exponentially with 𝑛.
Two Special Graphs. To illustrate possible behav- It is clear from these two special types of graphs
ior of the minimum energy gap of 𝐴(𝜃), let us consider that there is no universal behavior for the minimum
two special graphs. The first graph is the one that has energy gap of the gauge matrix 𝐴(𝜃).
no edges. In this case, all combinations of vertices are Quantum Algorithm for Approximately Maximal
independent sets and the gauge matrix 𝐴(𝜃) acts on Independent Set. Our quantum algorithm for find-
the whole 2𝑛 -dimension Hilbert space. Denote 𝐴(𝜃) ing an approximately maximal independent set runs
for no-edge graphs as 𝐴.˜ It can be rewritten as as follows:
sin 𝜃 𝑑𝜙
𝑛
∑︁ cos 𝜃 𝑑𝜙 ∑︁ 𝑧
𝑛 1. Construct the Hamiltonian 𝐻0 according to a
˜
𝐴(𝜃) = ˜𝑗𝑥 +
𝜎 𝜎
˜ given graph 𝐺 and prepare the system at the
2 𝑑𝑡 2 𝑑𝑡 𝑗=1 𝑗
𝑗=1 state {−1, −1, . . . , −1}.
1 𝑑𝜃
𝑛
∑︁ (︁ 𝜃 )︁
+ ˜𝑗𝑦 + cos 𝜃 − 𝑛 cos2
𝜎 𝐼, 2. Set 𝑟(𝜃, 𝜙) initially along the 𝑧 axis and slowly
2 𝑑𝑡 2 change 𝐻𝜏 according to 𝜃 = 𝜔𝜃 𝑡, 𝜙 = 𝜔𝜙 𝑡
𝑗=1 (11)
with 𝜔𝜙 being some constant and 𝜔𝜃 = 𝜋𝜔𝜙 /𝑇 .
where 𝐼 is the 2𝑛 × 2𝑛 identity matrix and contributes 𝑇 = 𝑛𝛾 is the total run time.
only a global phase factor during the evolution. Note
that these 𝜎 ˜𝑗𝑦 , 𝜎
˜𝑗𝑥 , 𝜎 ˜𝑗𝑧 are not the spin operators 𝜎𝑗𝑧 in 3. Stop the system at 𝜃 = 𝜋 and make a measure-
˜ ment along the 𝑧 axis.
𝐻0 , and they are used just to put 𝐴(𝜃) in a concise
form. If 𝑑𝜃/𝑑𝑡 is much smaller than 𝑑𝜙/𝑑𝑡, then we 4. Reverse the direction of the spins, e.g., changing
can omit the third term of 𝐴˜ and have {−1, −1, . . . , −1} into {1, 1, . . . , 1}, to achieve
the 𝜇 for the candidate answer.
˜ sin 𝜃 𝑑𝜙 ∑︁ 𝑥 cos 𝜃 𝑑𝜙 ∑︁ 𝑧
𝐴(𝜃) ≈ 𝜎
˜ + 𝜎
˜ . (12) Since the energy gap of the secondary Hamiltonian 𝐴
2 𝑑𝑡 𝑗 𝑗 2 𝑑𝑡 𝑗 𝑗
can be exponentially small, run times 𝑇 = 𝑛𝛾 which
This is effectively a Hamiltonian for 𝑛 identical non- scale polynomially do not guarantee that the system
interacting spins in the same magnetic field. Appar- will stay in the ground state of 𝐴. However, the sys-
˜
ently, 𝐴(𝜃) has a constant gap between the ground tem will stay mostly within the manifold of states
state and the first excited state. When we let 𝜃 evolve whose energy is close to the ground state, i.e., ap-
slowly from 0 to 𝜋 for a fixed period of time, the sys- proximately maximum states, if the evolution is slow
tem no matter how large will evolve from the initial enough. As a result, at the end of computation, we
ground state at 𝜃 = 0 to the ground state at 𝜃 = 𝜋. may expect to find a good approximately maximum
This is consistent with the original Hamiltonian in states. We have explored this hypothesis numerically,
Eq. (2). For the graph with no edges, the Hamilto- with excellent results in generic cases, as we will now
nian 𝐻0 is zero. This means that there is no evolution; discuss. As the adiabatic condition for 𝐻𝜏 can be sat-
the system stays in the state {−1, −1, . . . , −1}. Upon isfied (see the Supplemental Material), our numerical
reversing the direction of the spins, we get the MIS simulation is done with 𝐴 so that we can compute for
{1, 1, . . . , 1}. larger graphs. ∑︀
0.0
If the final quantum state is |𝜓𝑓 ⟩ = ℓ 𝑎ℓ |𝐸ℓ ⟩ (af-
x0
ln(minimum gap of A)
(a) (b) ter the reverse of the spin direction), we define the
-0.5 ¯ of the independent sets as
averaged size 𝑁
x1 x3 -1.0 ∑︁
x2n-1 ¯ =
... -1.5
𝑁 |𝑎ℓ |2 𝑁ℓ . (13)
x2 x4 x2n ℓ
-2.0
Here 𝑁ℓ is the size of the ℓth independent set |𝐸ℓ ⟩.
0 1 2 3 4 5 6 7 In the quantum mechanical formalism, this represents
n
the average value of a single measurement. We are
Fig. 1. (a) A special type of graphs that has 2𝑛 edges interested in the ratio 𝜅 = 𝑁 ¯ /𝛼(𝐺). Our numerical
and 2𝑛 + 1 vertices. Note that it has a unique maximum results, displayed in Fig. 2(a), show that for Erdös–
independent set {𝑥0 , 𝑥2 , . . . , 𝑥2𝑛 }. (b) The minimum en-
ergy gap of 𝐴 for these graphs as a function of 𝑛. The
Rényi random graph 𝐺(𝑛, 1/2), if we set 𝑇 ∼ 𝑛2 ,
fitting line is given by ln(gap) = 0.0286 − 0.332𝑛. the average of 𝜅 will increase to almost 1 when 𝑛 in-
creases. This is compared to the results obtained us-
The second special graph 𝑆𝑛 is shown in Fig. 1, ing the classical greedy and Metropolis algorithms[10]
which has 2𝑛+1 vertices and 2𝑛 edges. The graph has (see the Supplemental Material for details of the two
2𝑛 maximal independent sets, and only one of them algorithms). We run the classical algorithms several
030304-3
CHIN. PHYS. LETT. Vol. 38, No. 3 (2021) 030304 Express Letter
times on each graph to get 𝑁 ¯ and ratio 𝜅 = 𝑁
¯ /𝛼(𝐺), 1.000
(a)
then run the process over multiple random graphs to 0.995
find the double average 𝜅 ¯ . Our numerical results in 0.990
Fig. 2(b) show that even for small graphs, the ratio 0.985
k
𝜅
¯ in the two classical algorithms is not as close to 1 0.980
as the one with our quantum algorithm. More impor- 0.975
tantly, the classical ratio 𝜅
¯ tends to decrease when 𝑛 0.970
gets larger. This is consistent with the well known re- 0.965
sult that the best classical polynomial algorithm face
1.00
grave difficulty in pushing the ratio larger than 1/2
0.98
when 𝑛 goes to infinity[4] (see below).
0.96
Quantum
k
1.000 (a) 0.94
Greedy
0.92 Metropolis
0.995
0.90
0.990 0.88
k
(b)
0.86
0.985 4 6 8 10 12 14 16
n
0.980
Fig. 3. The average 𝜅 (or 𝜅 ¯ ) as a function of 𝑛 for ran-
1.00
dom graphs 𝐺(𝑛, 𝑚) with 𝑚 = ⌊𝑛 ln 𝑛⌋ via three different
methods. (a) The results of our quantum algorithm. We
set 𝑇 = 𝑛2 , 𝜔𝜙 = 1, 𝜔𝜃 = 𝜋/𝑇 and run over 1000 random
0.95 graphs 𝐺(𝑛, ⌊𝑛 ln 𝑛⌋). The variance of 𝜅 is around 10−5 .
Quantum The calculation is carried out with 𝐴. (b) The results
k
030304-4
CHIN. PHYS. LETT. Vol. 38, No. 3 (2021) 030304 Express Letter
polynomial classical algorithms have difficulty finding appear as the result of the final measurement. This ar-
independent sets of size 𝑘 > (1 + 𝜖𝑑 )𝑛 ln𝑑𝑑 . gument is far from rigorous, but it makes the striking
numerical results presented above appear less myste-
k=0 rious.
It has been rigorously established that quantum
k=1 diffusion can hold advantages over classical random
walk for a special types of decision trees.[12] In the fu-
k=2
ture, it will be important to investigate further why
and in what circumstances quantum diffusion is more
effective than its classical counterpart.
In summary, we have proposed a quantum algo-
k bkc
rithm for approximating the maximum independent
set of a graph 𝐺(𝑛, 𝑚) by exploiting non-Abelian adia-
batic mixing in the sub-Hilbert space of solutions and
k > kc
adiabatic evolution in the secondary Hamiltonian it
generates. Our numerical experiments indicate that
for both sparse and dense graphs on average we ob-
tain an independent set of almost maximum size 𝛼(𝐺)
size in the evolution time 𝑇 ∼ 𝑛2 with a single mea-
surement.
Fig. 4. The tree of independent sets of a graph 𝐺. Each While our numerical results are encouraging, they
point represents an independent set; the one at the top are limited to relatively small systems. Due to the ex-
represents the empty set. The tree is layered: the inde-
pendent sets 𝑆𝑘 (𝐺) in each layer has the same size 𝑘. If ponential complexity of simulating qubit systems clas-
the Hamming distance between an independent set of size sically, we only calculated systems containing up to 20
𝑘 and an independent set of 𝑘 + 1 is one, they are con- qubits. We made a heuristic argument that makes a
nected by a solid line. Each point in the layer of 𝑘 + 1 robust quantum advantage, extending to large 𝑛, seem
must be connected by a solid line with a point in the layer
of 𝑘. For clarity, we only draw the solid lines between plausible, but this question deserves much further at-
𝑘 = 0 and 𝑘 = 1 and between 𝑘 = 1 and 𝑘 = 2. For tention.
independent sets of the same size, they are connected by
dashed lines if the Hamming distance between them does
not scale up with 𝑛. Before a critical size 𝑘c , the tree is
well connected by dashed lines in each layer. When the
References
size is over 𝑘c , the layers shatter with the independent sets
[1] Johån H 1999 Acta Math. 182 105
divided into small groups, between each pair of which the
[2] Zuckerman D 2006 Proceedings of the Thirty-Eighth Annual
Hamming distance is proportional to 𝑛. At the same time,
ACM Symposium on Theory of Computing (New York: As-
the group size decreases exponentially with 𝑛.
sociation for Computing Machinery) p 681
Quantum evolution, by allowing superpositions, [3] Matula D W 1976 The Largest Clique Size in a Random
can enable more efficient exploration of a shattered Graph, Technical Report CS 7608 (Department of Com-
puter Science, Southern Methodist University, Dallas, Texas
solution landscape. All the candidates appear as com- 75275)
ponents in the wave function. In our context, differ- [4] Coja-Oghlan A and Efthymiou C 2015 Random Struct. &
ent independent sets are assigned different energies Algorithms 47 436
according to the secondary Hamiltonian. During slow [5] Frieze A M 1990 Discrete Math. 81 171
[6] Wu B, Yu H and Wilczek F 2020 Phys. Rev. A 101 012318
evolution, we can expect the system which starts cold, [7] Hu Y, Zhang Z and Wu B 2021 Chin. Phys. B 30 020308
and plausibly remains so, to approach a quasi-thermal [8] Wilczek F and Zee A 1984 Phys. Rev. Lett. 52 2111
equilibrium state, favoring larger overlaps with lower [9] Farhi E, Goldstone J, Gutmann S and Sipser M 2000
arXiv:quant-ph/0001106v1
energy eigenstates. Since low energies correspond, at [10] Jerrum M 1992 Random Struct. & Algorithms 3 347
the conclusion of the evolution, to approximate maxi- [11] Ambainis A and Regev O 2004 arXiv:quant-ph/0411152
mum independent sets, with high probability they will [12] Farhi E and Gutmann S 1998 Phys. Rev. A 58 915
030304-5
Supplemental Material: Classical and quantum algorithms for approximating
maximum independent set
A graph of n vertices and m edges is denoted as G(n, m). An independent set of a graph is a subset of its vertices,
where no pairs of vertices are connected by edges. For the graph shown in Fig.S1, the subset {x3 , x6 } is one of its
independent sets. For a graph, there are many independent sets, among which the maximum independent set (MIS)
has the largest number of vertices. For the graph in Fig.S1, the MIS is {x1 , x3 , x4 , x5 , x7 }. As finding the MIS is an
NP-hard problem, one often settles to find the best approximation of the MIS. The success of an algorithm for finding
an approximation to the MIS is measured by
κ = N/α(G) , (1)
where N is the size of the largest independent set found by the algorithm and α(G) is the size of the MIS. We first
present our quantum algorithm for approximating the MIS and its detailed numerical simulation and then compare
it to two classical algorithms, greedy algorithm and Metropolis algorithm.
For a given graph G(n, m), we construct a corresponding spin-system with the following Hamiltonian [1]
X
H0 = ∆ (σ̂iz + σ̂jz + σ̂iz σ̂jz ) , (2)
hiji
where the summation hiji is over all edges in the graph. The independent sets of G(n, m) have a one-to-one corre-
spondence with the ground states of H0 , which has a scale-independent energy gap 4∆ between the ground states
and the first excited states.
We rotate spin σ̂jz to an arbitrary direction ~r = {sin θ cos ϕ, sin θ sin ϕ, cos θ}, and obtain a new spin operator
τ̂j = Vj σ̂jz Vj−1 with
cos θ2 e−iϕ sin θ2
Vj = = Vj−1 . (3)
e sin θ2 − cos θ2
iϕ
If |uij and |dij are eigenstates of σ̂jz , that is, σ̂jz |uij = |uij and σ̂jz |dij = − |dij , the eigenstates of τ̂j are
θ θ
|u~r ij = cos |uij + sin eiϕ |dij , (4)
2 2
θ θ
|d~r ij = sin |uij − cos eiϕ |dij . (5)
2 2
2
With U = V1 ⊗ V2 ⊗ · · · ⊗ Vn , we rotate all the spins to ~r direction and get a new Hamiltonian
X
Hτ = U H0 U −1 = ∆ (τ̂i + τ̂j + τ̂i τ̂j ) (6)
hiji
The adiabatic evolution in the sub-Hilbert space of the ground states can be described by [2]
Z t
0 0
|ψ(t)i = P exp i A(t )dt |ψ(0)i , (7)
0
where P is for time ordering and A the non-Abelian gauge matrix. The off-diagonal terms of the gauge matrix A are
given by
sin θ dϕ i dθ
Aα,β (θ) = i hEα |∂t | Eβ i = i hu~r |∂t | d~r i = + sgn(α − β) , (8)
2 dt 2 dt
where sgn(x) is the sign function, depending on which of |Eα i and |Eβ i have more up-spins. Diagonal terms of A are
2 θ 2 θ dϕ
Aα,α (θ) = i hEα |∂t | Eα i = − n+ sin + (n − n+ ) cos , (9)
2 2 dt
where n+ is the number of spins in the up direction along ~r (or, the number of qubits in state |u~r i).
Our quantum algorithm for finding the approximation of MIS consists of the following steps:
1. Construct the Hamiltonian H0 according to a given graph G(n, m) and prepare the system at the state
{−1, −1, · · · , −1}.
2. Set ~r(θ, ϕ) initially along the z axis and slowly change Hτ according to θ = ωθ t, ϕ = ωϕ t with ωϕ being
some constant and ωθ = πωϕ /T . T = nγ is the total run time.
3. Stop the system at θ = π and make a measurement. Then reverse the direction of the spins, e.g.
changing {−1, −1, · · · , −1} into {1, 1, · · · , 1}, as the system ends along the −z direction.
P
If the final quantum state is |ψf i = j aj |Ej i (after the reverse of the spin direction), we define the averaged size
N̄ of the independent sets as
X
N̄ = |aj |2 Nj (10)
j
where Nj is the size of the jth independent set |Ej i. We are interested in the ratio κ = N̄ /α(G).
In the above quantum algorithm, we have assumed that a large enough energy gap ∆ can ensure the quantum
evolution stays in the subspace of the ground states. However, there is no theoretical consensus on the lower bounds
of the total adiabatic evolution time T to have negligible excitation [3–5]. We numerically investigate this issue. In
our simulation, we set ∆ = 1.
To simulate the above quantum algorithm in the whole Hilbert space, we discretize the time evolution into small
time steps ti = Mi T , that is,
where ∆t = T /M . We repeat the calculation with increasing M until the results get converged. Due to the exponential
complexity of such simulations we only get results of up to 11 qubits. But the small-scale simulation still gives strong
evidences that our evolution time T is long enough to neglect the excitation.
As the energy gap 4∆ and the evolution time T , the final state ψ(T ) will contain some excited states. We are
interested
P in the portion of |ψ(T )i that belongs to the ground states after the evolution. For the final state |ψf i =
a
j j |E i
j (after the reverse of the spin direction), we define the amplitude of all ground states as
X
g= |aj |2 , (12)
|Ej i∈ground states
3
FIG. S2: The simulations for Erdős-Rényi random graphs G(n, 1/2) with T = n2 , ωϕ = 1, ωθ = π/T . (a) The results of ground
state amplitude g for ∆ = 1 with n. The calculation runs over 1000 Erdős-Rényi random graphs G(n, 1/2). The variance of g
is around 10−5 . (b) The average κ for the two situation ∆ = 1 and ∆ → ∞(simulation with the gauge matrix A(t) instead of
H(t)). The calculation runs 1000 times over random graphs to get κ̄. The variance of κ̄ for ∆ = 1 is around 10−5 . We can see
the two curves tend to get closer when n gets larger. The dashed lines are guide for the eye.
which is also the probability that we get an correct independent set after measuring the final state |ψf i.
In Fig.S2(a) we show that with T = n2 , the final state contains nearly no excited states. In fact, with the qubit
number n increasing, the ground state probability grows, which means the adiabatic condition is better satisfied with
larger n. This is reasonable as the energy gap 4∆ does not change with
P n. This decreasing influence of finite ∆ with n
can be demonstrated further. If the final quantum state is |ψf i = j aj |Ej i (after the reverse of the spin direction),
we define the averaged size N̄ of the independent sets as
X
N̄ = |aj |2 Nj (13)
|Ej i∈ground states
where Nj is the size of the jth independent set |Ej i. We are interested in the ratio κ = N̄ /α(G). The results are
shown in Fig. S2(b) and compared to the ones with the ground-state space approximation. In the ground-state space
approximation, we assume that there is no excitation at all and the system stays completely in the sub-Hilbert space
of the ground states. This is equivalent to ∆ = ∞. The details of the ground-state space approximation can be found
in the next subsection. These results in Fig. S2(b) indicate that the two results become closer when n increases.
The above numerical simulation within the full Hilbert space shows that we can safely carry out our numerical
simulation in the subspace of the ground states with Eq.(7), which we call it ground-state space approximation. This
makes it possible for larger-scale simulation, especially for dense graphs whose total number of independent sets are
small. For the simulations of the evolution (7), we similarly discretize the time T into small time steps ti = Mi T
where ∆t = T /M . We repeat the calculation with increasing M until the results get converged.
Our numerical results in Fig.S3 show that for Erdős-Rényi random graph G(n, 1/2), if we set T ∼ n2 , the average
of r will increase to almost 1 when n increases. In contrast, the best classical polynomial algorithm can hardly get
the ratio larger than 1/2 when n goes to infinity[6].
For sparse graphs with edge number m = bn ln nc(see Fig.S4), m = n(see Fig.S5), m = 2n (see Fig.S6), the results
are quite similar.
We also tried T ∼ n (see Fig. S7). In this case the average radio r̄ will decrease when n increases. These numerical
results indicate that our quantum algorithm can find an independent set of size (1 − )α(G) in a runtime T ∼ n2 .
These results are compared to two classical algorithms, greedy algorithm and Metropolis algorithm, which will be
described in detailed in the next section. It is clear that even for graphs with small sizes our quantum algorithm
can outperform the classical ones. In m = n case the classical greedy algorithm performs as well as our quantum
4
algorithm. It is because when d = m/n is small, the graph is likely not connected, thus can be split into small
subgraphs, which greatly reduce the computational hardness for greedy algorithm.
FIG. S3: The average κ (or κ̄) as a function of n for Erdős-Rényi random graphs G(n, 1/2) with three different algorithms.
(a) The results of our quantum algorithm. We set T = n2 , ωϕ = 1, ωθ = π/T and run over 1000 Erdős-Rényi random
graphs G(n, 1/2). The variance of κ is around 10−6 . (b) The results of the Greedy algorithm and the Metropolis algorithm
in comparison with our quantum results. For the Greedy algorithm, the calculation runs 1000 times over one graph to get N̄ ,
and then runs over 1000 random graphs to get κ̄. The variance of κ̄ is around 10−4 . For the Metropolis algorithm, we set the
iteration time T = n2 and λ = n. The calculation runs 1000 times over one graph to get N̄ , and then runs over 1000 random
graphs to get κ̄. The variance of κ̄ is around 10−4 . The lines in the left figure are guide for the eye.
FIG. S4: The average κ (or κ̄) as a function of n for random graphs G(n, m) with m = bn ln nc via three different methods.
(a) The results of our quantum algorithm. We set T = n2 , ωϕ = 1, ωθ = π/T and run over 1000 random graphs G(n, bn ln nc).
The variance of κ is around 10−5 . (b) The results of the Greedy algorithm and the Metropolis algorithm in comparison with
our quantum results. For the Greedy algorithm, the calculation runs 1000 times over one graph to get N̄ , and then runs over
1000 random graphs to get κ̄. The variance of κ̄ is around 10−4 . For the Metropolis algorithm, we set the iteration time T = n2
and λ = n. The calculation runs 1000 times over one graph to get N̄ , and then runs over 1000 random graphs to get κ̄. The
variance of κ̄ is around 10−4 . The lines in the left figure are guide for the eye.
In this section we describe the details of the two classical algorithms that we have used for comparison with our
quantum algorithm.
A. Greedy algorithm
FIG. S5: The average κ (or κ̄) as a function of n for random graphs G(n, m) with m = n via three different methods. (a) The
results of our quantum algorithm. We set T = n2 , ωϕ = 1, ωθ = π/T and run over 1000 random graphs G(n, n). The variance
of κ is around 10−5 . (b) The results of the Greedy algorithm and the Metropolis algorithm in comparison with our quantum
results. For the Greedy algorithm, the calculation runs 1000 times over one graph to get N̄ , and then runs over 1000 random
graphs to get κ̄. The variance of κ̄ is around 10−4 . For the Metropolis algorithm, we set the iteration time T = n2 and λ = n.
The calculation runs 1000 times over one graph to get N̄ , and then runs over 1000 random graphs to get κ̄. The variance of κ̄
is around 10−4 . The lines in the left figure are guide for the eye.
FIG. S6: The average κ (or κ̄) as a function of n for random graphs G(n, m) with m = 2n via three different methods. (a) The
results of our quantum algorithm. We set T = n2 , ωϕ = 1, ωθ = π/T and run over 1000 random graphs G(n, 2n). The variance
of κ is around 10−5 . (b) The results of the Greedy algorithm and the Metropolis algorithm in comparison with our quantum
results. For the Greedy algorithm, the calculation runs 1000 times over one graph to get N̄ , and then runs over 1000 random
graphs to get κ̄. The variance of κ̄ is around 10−4 . For the Metropolis algorithm, we set the iteration time T = n2 and λ = n.
The calculation runs 1000 times over one graph to get N̄ , and then runs over 1000 random graphs to get κ̄. The variance of κ̄
is around 10−4 . The lines in the left figure are guide for the eye.
This type of greedy algorithm is sometimes called minimum-degree greedy algorithm[7]. The greedy algorithm
6
FIG. S7: The average κ as a function of n for Erdős-Rényi random graphs G(n, 1/2) with our quantum algorithm. The
simulation parameters are the same as in Fig.S3 except that T = n. The dashed line is guide for the eye.
performs quite well for small graphs that we considered (see Fig.S3-S6). The ratio κ̄ is only slightly outperformed by
our quantum algorithm, but it shows a decreasing trend while our quantum algorithm does not. In fact, the study by
M. Halldórsson and J. Radhakrishnan [7] shows that for graphs whose degrees of vertices d ≤ D are bounded, such
minimum-degree greedy algorithm can typically find an independent set with approximating ratio κ = 3/(D + 2).
B. Metropolis algorithm
We use the Metropolis algorithm introduced by Jerrum[8] . The main idea of the algorithm is to assign each
independent set K a weight according to its size w(K) = λ|K| and construct a Metropolis process to realize such
assignments. The construction is shown as below:
Different choices of λ will influence the performance of the algorithm. On the one hand, larger λ will assign large
independent sets larger weights, thus we have a greater probability to get a large independent set. On the other
hand, large λ will make it difficult for the algorithm to converge to equilibrium. In our calculation, we set λ = n and
iteration number T = n2 .
[1] B. Wu, H. Yu, and F. Wilczek, Physical Review A 101, 012318 (2020).
7
[2] F. Wilczek and A. Zee, Phys. Rev. Lett. 52, 2111 (1984).
[3] A. Ambainis and O. Regev, arXiv preprint quant-ph/0411152 (2004).
[4] S. Teufel, Adiabatic perturbation theory in quantum dynamics (Springer, 2003).
[5] Q. Zhang, J. Gong, and B. Wu, New Journal of Physics 16, 123024 (2014).
[6] A. Coja-Oghlan and C. Efthymiou, Random Structures & Algorithms 47, 436 (2015).
[7] M. M. Halldórsson and J. Radhakrishnan, Algorithmica 18, 145 (1997).
[8] M. Jerrum, Random Structures & Algorithms 3, 347 (1992).