Abstract—In this paper, it is demonstrated that solving an instance of the vertex cover problem of any graph G with m edges and n vertices can be implemented by Hadamard gates, NOT gates, CNOT gates, CCNOT gates, Grover’s operators, and quantum measurements on a quantum computer. To test our theory, an NMR (nuclear magnetic resonance) experiment for the simplest vertex-cover problem is also performed.
VI. INTRODUCTION
n this paper, it is first demonstrated that solving an instance of the vertex cover problem of any graph with m edges and n vertices can be implemented by Hadamard gates, NOT gates, CNOT gates, CCNOT gates, Grover’s operators, and quantum measurementson a physical quantum computer. To test our theory, an NMR (nuclear magnetic resonance) experiment for the simplest vertex-cover problem is also performed.
VII. QUANTUMALGORITHMSFOROFSOLVINGTHE VERTEXCOVERPROBLEM
A. Definition of the Vertex Cover Problem
Suppose that G is a graph and G = (V, E), where V is a set of vertices in G and E is a set of edges in G. Mathematically, a vertex cover of graph G is a subset V1 ⊆ V of vertices such that for each edge (va, vb) in E, at least one of va and vb belongs to V1. Definition 4-1 is applied to denote the vertex–cover problem of graph G.
Definition 4-1: The vertex cover problem of graph G with n vertices and m edges means finding a minimum-sized vertex cover in G.
B. Computational State Space of Quantum Solutions for the Vertex Cover Problem
An arbitrary state ϕ of a quantum bit is nothing else than a linearly weighted combination of the following computational basis vectors (4.1): ϕ = l1 ⋅
0
+ l2 ⋅1
=Weng-Long Chang is with Department of Computer Science and Information Engineering, National Kaohsiung University of Applied Sciences Kaohsiung City, Taiwan 807-78, Republic of China (e-mail:
Mang Feng was with State Key Laboratory of Magnetic Resonance and Atomic and Molecular Physics, Wuhan Institute of Physics and Mathematics, Chinese Academy of Sciences, Wuhan, 430071, People’s Republic of China (e-mail: [email protected]).
l1 ⋅
1
0
21
×
⎥ ⎦
⎢ ⎤
⎣
⎡
+ l2, 1 0
2×1
⎥ ⎦
⎢ ⎤
⎣
⎡
where the weighted factors l1 and l2 ∈C2 are the so-called probability amplitudes, thus they must satisfy | l1 |2 + | l2 |2 = 1.
C. Introduction to Quantum Gates for Solving the Vertex Cover Problem
The NOT gate is a one-qubit gate and sets the only (target) bit to its negation. The CNOT (controlled NOT) gate is a two-qubit gate and flips the second qubit (the target qubit) if and only if the first qubit (the control qubit) is one. The CCNOT (controlled-controlled-NOT) gate is a three-qubit gate and flips the third qubit (the target qubit) if and only if the first qubit and second qubit (the two control qubits) are both one.
D. Constructing Quantum Networks for Finding Legal Vertex Covers
For OR operations, i
ts evaluating computation is equal to (4.4):( ⊗
kp+=1mr
p1)
⊗( r
k1)
⊗( ⊗
1p=k−1r
p)
⊗)
( ⊗
1q=nx
q →( ⊗
kp+=1mr
p1)
⊗( r
k1⊕ x
i• x
j)
⊗)
( ⊗
1p=k−1r
p ⊗( ⊗
1q=nx
q),
where•
denotes the AND operation of two Boolean variables {x ,
ix
j} for 1 ≤ i and j ≤ n, and for 1 ≤ p ≤ k − 1,r
p =r
p1⊕ x
i• x
j. For AND operations, i
ts evaluating computation is equal to (4.5):)
( ⊗
kp+=1mc
p0 ⊗( c
k0)
⊗( ⊗
1p=k−1c
p)
⊗( c
01)
⊗)
( ⊗
1p=mr
p ⊗( ⊗
1q=nx
q)
→( ⊗
kp+=1mc
p0)
⊗)
( c
k0⊕ c
k−1• r
k ⊗( ⊗
1p=k−1c
p)
⊗( c
01)
⊗)
( ⊗
1p=mr
p ⊗( ⊗
1q=nx
q),
where•
denotes the AND operation of two Boolean variables {c
k−1, r
k} for 1 ≤ k ≤ m, and for 1 ≤ p ≤ k − 1,c
p =c
p0⊕ c
p−1• r
p.
E. Constructing Quantum Networks for Finding a Minimum-sized Vertex Cover
Lemma 4-1 is used to describe that the parallel logic computation.
Lemma 4-1: The parallel logic computation of finding a vertex cover with the minimum size of vertices among legal
Quantum Algorithms of the Vertex Cover Problem on a Quantum Computer
Weng-Long Chang1*, Ting-Ting Ren2, Mang Feng3*, Shu-Chien Huang4, Lai Chin Lu5, Kawuu Weicheng Lin6 and Minyi Guo7
I
vertex covers in G is (4.6):
z
i+ j1,+1 =z
i+ j1,+1 ⊕ (c
m ∧(xi+ 1 ∧
z
i,j ∧ (∧
ik+=1j+2z
i+1,k)
)) andj
z
i+1, =z
i+1,j ⊕ (c
m ∧x
i+1 ∧ zi, j ).J
F. Quantum Algorithms for Calculating the Number of Ones to Legal Vertex Covers for Any Graph G with m Edges and n Vertices
The following quantum algorithm is proposed to work on the physical quantum computer and is used to calculate the number of ones to legal vertex covers for any graph G with m edges and n vertices.
Algorithm 4-1 (w): Quantum algorithms for calculating the number of ones to legal vertex covers for any graph G with m edges and n vertices. QEC is the quantum circuit in (4.4) and (4.5) in Subsection D and bits xi and xj represent vertices vi and vj, respectively, in the
End For
(6) Since quantum operations are reversible by nature, the auxiliary quantum bits can be restored to their initial states by reversing all these operations finished by Steps (4a) and (2).
(7) Apply Grover’s algorithm to the quantum state vector generated in Step (6).
(8) Return the result to Algorithm 4-2 after a measurement is finished.
EndAlgorithm
Lemma 4-2: Algorithm 4-1 is used to calculate the number of ones to legal vertex covers for any graph G with m edges and n vertices on a quantum computer.
G. Quantum Algorithms for Solving the Vertex Cover Problem of any Graph G with m Edges and n Vertices
The following quantum algorithm is applied to solve the vertex cover problem of any graph G with m edges and n vertices. The notations used in Algorithm 4-2 below have been denoted in previous subsections.
Algorithm 4-2: Quantum algorithms for solving the vertex cover problem of any graph G with m edges and n vertices.
(1) For w = 1 to n
(1a) Call Algorithm 4-1(w).
(1b) If the answer is obtained from the wth execution of Step (1a) then
(1c) Terminate Algorithm 4-2.
End If End For End Algorithm
Lemma 4-3: Algorithm 4-2 which is equivalent to the oracle
work (in the language of Grover’s Algorithm), that is, the target state labeling preceding Grover’s searching step, and is used to solve the vertex cover problem of any graph G with m edges and n vertices. J
VIII. COMPLEXITYASSESSMENT
The following lemmas are used to show the time complexity and the space complexity of Algorithm 4-2 for solving the vertex cover problem of any graph G with m edges and n vertices.
Lemma 5-1: The average case for time complexity of solving the vertex cover problem for any graph G with m edges and n vertices is O((
Lemma 5-2: The average case for space complexity of solving the vertex cover problem for any graph G with m edges and n vertices is O((
IX. ANEXAMPLEOFTHREE-QUBITSOLUTIONFOR THEVERTEX-COVERPROBLEM
Consider the simplest case of the vertex-cover problem with a graph G = {V, E}, where V is {v1} and E is {(v1, v1)}. Our experiment is carried out on a Varian INOVA 600 NMR spectrometer. The sample is 13
C − labelled
alanine with formula 131CH
3−
132CH NH (
2) −
133COOH
, where thepulses are used to achieve the selective excitation. The experiment has three main steps as follows.
Note that in NMR measurements, the frequencies and phases of NMR signals could clearly indicate the state the system evolves to after the readout pulses have been applied.
In our experiment, the phases of the reference of 13C spectra from a thermal equilibrium were adjusted to be in absorption (i.e., to be positive), and then the same phase corrections were
used to determine the absolute phases of the experimental spectra of 13C after the algorithm was accomplished. In our case, the final state is
123 123
( 000 + 111 ) / 2
which means the three qubits are entangled. As the readout by NMR is a weak measurement, we have no state collapse after the measurement. Besides, only single quantum coherence can be detected in NMR. As a result, we have to employ some additional operations to disentangle them for detecting the output state( 000
123+ 111
123) / 2
. For this end, we apply a CNOT gate on the second and first qubits to get the state123 123
( 000 + 011 ) / 2
, with the second qubit the control qubit and the first qubit the target one. Then the first qubit can be read out by a single π/ 2
pulse along the x-axis, as shown in Figure 6-1 (a). Similar steps applied to the second and third quits, respectively, result in the spectrum in Figure 6-1 (b) and Figure 6-1 (c). It’s evident that the experimental results are in good agreement with our theoretical prediction.X. CONCLUSIONS
A quantum algorithm has been proposed to solve the vertex cover problem of any graph G with m edges and n vertices. To test our theory, an NMR (nuclear magnetic resonance) experiment for the simplest vertex-cover problem is also performed. As the quantum algorithm makes use of the state superposition and quantum parallelism, it is argued that the vertex cover problem of any graph G with m edges and n vertices could be solved with much reduced difficulty.
(a)
(b)
(c)
Figure 6-1: Experimental spectra (a)-(c) of the three-qubit solution for the vertex-cover problem after the readout on the first, second and third qubits, respectively.