0% found this document useful (0 votes)
9 views14 pages

Lecture19 20 21

This document provides an overview of the basics of quantum computing. It discusses how quantum computations use quantum phenomena like superposition and entanglement. It then covers classical computing concepts like complexity theory and different types of algorithms before introducing the fundamentals of quantum computing, including universal quantum gates and decision problems.

Uploaded by

915431916
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views14 pages

Lecture19 20 21

This document provides an overview of the basics of quantum computing. It discusses how quantum computations use quantum phenomena like superposition and entanglement. It then covers classical computing concepts like complexity theory and different types of algorithms before introducing the fundamentals of quantum computing, including universal quantum gates and decision problems.

Uploaded by

915431916
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

Quantum Information (WiSe 22/23) Last updated: 2023-02-12

Chapter 4.1: Quantum Computing: Basics Concepts


Instructor: Dr. Christian Schilling Scriber: Ignacio Cirac and Sirui Lu

In this part, we start the next theme and perhaps the most exciting part of the course, quantum
computing. In this chapter, we begin by discussing the basics of classical computing and complexity
theory, and then we move on to the fundamentals of quantum computing and quantum complexity
theory.

1 Introduction
Computation A computation can be considered as a physical process that transforms an input
into an output. In classical computing, physical processes follow classical laws, while in quan-
tum computing, the physical processes follow laws of quantum mechanics. Compared to classical
computers, quantum computers can take advantage of exotic quantum phenomena such as super-
position and entanglement, making it possible to solve certain problems more efficiently than any
classical computer.

Input Output

Classical
Physical process
Quantum

Figure 1: Computation realized through a physical process.

Problems In a way similar to what we did in the chapter on communication complexity, given
a computation problem, we usually compare the best classical algorithm with the best quantum
algorithm to see which one is faster. Since classical algorithms have been developing for fifty years,
it is very difficult to beat the best classical algorithms. Yet, some quantum algorithms have been
proven to be faster than even the best classical algorithms. The field of quantum algorithms is
moving rapidly, and we are expecting more and more quantum algorithms with speedups to be
discovered in the future.

Complexity theory Complexity theory studies how difficult it is to use algorithms to solve certain
problems and classifies problems based on how the computational time required scales with the
size of inputs, e.g., the number of digits of the input numbers. Consider, for instance, the cases
where one only has a single input x, some natural number, and the output, f (x), is a function of
the input x. One example is factorization, i.e., the output gives a non-trivial factor if it exists and
zero otherwise. Another one is primality test, where f (x) = 1 if x is prime and f (x) = 0 otherwise.
The input size is the number of bits in x (i.e., the smallest integer larger than or equal to log2 x).
We can also have functions of two input numbers, x, y; for instance, multiplication. In that case,
one can take as the size the maximum number of digits of both numbers.

Binary
Pn form Any number x can be written in binary form, i.e. x = x1 , x2 , . . . , xn , where x =
k=1 xk 2 , n ∈ N is the number fulfilling n − 1 ≤ log2 x < n.
k−1

Asymptotic analysis and big O notation In complexity theory, we are interested in the best
algorithm and the asymptotic limit n  1. To compare the scaling of two functions in this
asymptotic limit, we use the following big O notation. Let us take the size of the input as an
integer number n ∈ N and consider two functions f, g : N → N. In the big O notation, we use
g(n) = O(f (n)) to mean that there exists M > 0, n0 ∈ N such that for n > n0 , the absolute value
of g(n) is at most a positive constant multiple of f (n), |g(n)| ≤ M |f (n)|.

1
Chapter 4.1 Quantum Information (WiSe 22/23)

Example 1.1. g(n) = n2 + n + 1 = O(n2 ). In this case we can take, for instance, M = 2 and
n0 = 2. Note that this implies that we can ignore terms like n + 1 that fulfill (n + 1)/n2 → 0 in
the limit n → ∞.
Example 1.2. g(n) = 4 log n + 1/n + 1/log n + 3 = O(log n).

Remarks/warnings about the big O notation


1. The big O notation is not tight and does not mean “equal to.” For example, despite that
n = O(n2 ) and n2 = O(n2 ), it is obvious wrong to conclude n = n2 .
2. In literature, other notations are used to express other asymptotic relations. For examples,
big Ω notation is used to express lower bounds, and big Θ is used to express asymptotically
tight bound. Don’t be confused by them.
3. Note that O(nx ) = O(10nx ), or O(log n) = O(log n + 3). In those cases, the big O notation
does not depend on whether we use binary, decimal, or any other basis to count the number
of digits of x, since they are related by a constant (in case of the number of binary digits, n,
and decimal, n0 , we have n0 = n log2 10).

Polynomial and exponential, superpolynomial and subexponential In the asymptotic limit, the
differences between polynomial and exponential functions are the most significant. That is why in
complexity theory practice, we typically do not distinguish if we have O(n), O(n2 ), or O(n3 ), as
long as they are all polynomials in n.

• We say g(n) is polynomial in n, denoted by g(n) = poly(n), if ∃k ∈ N s.t. g(n) = O(nk ).


• We say g(n) is exponential in n, denoted by g(n) = exp(n), if g(n) = O[epoly(n) ].
• We say g(n) is superpolynomial in n if g(n) > poly(n). More precisely, if ∀k, c ∈ N, ∃n
s.t. g(n) ≥ cnk . An example, the function g(n) = (log n)log n grows much faster than any
polynomials but slower than any exponential.
• We say g(n) is subexponential in n if g(n) < exp(n). More precisely, if ∀ > 0, ∃k > 0 s.t.
∀n ∈ N, g(n) ≤ ken .

Slow and fast algorithms Algorithms to compute operations can be roughly classified in terms
of the relationship between the computational time, T , and the size of the input, n:
• Fast: The time scale as a polynomial of the size of the input, that is T (n) ≤ poly(n).
• Slow: The time cannot be bounded by a given polynomial of the size of the input, that is
T (n) > poly(n) for any given polynomial and certain N .
Later we will give a more precise classification.
Example 1.3. Multiplication of a number with n bit by the number 101 requires T (n) < kn (for
some k), and therefore is√fast. The factorization√ of a number x using an algorithm that checks if
it is a divisor of 1, 2, . . . , x requires about x = 2n/2 operations, and therefore it is slow.

2 Classical Computing
Computation A classical computation is that in which the physical process is based on classical
laws (without coherent quantum phenomena). In computer science, computation is abstracted as
computing Boolean functions, i.e., mappings between bitstrings

f : {0, 1}n → {0, 1}m


(2.1)
x = (x1 , · · · , xn ) 7→ f (x) = y = (y1 , · · · , ym ).
Pn−1
Example 2.1. In the binary form x = k=0 2k xk , Multiply by the number 101, x → 101 · x, can
be considered as a function {0, 1}n → {0, 1}n+3 .

2
Chapter 4.1 Quantum Information (WiSe 22/23)

Without loss of generality, we can focus on functions

f : {0, 1}n → {0, 1} (2.2)

because any function g : {0, 1}n → {0, 1}m can be computed by computing a series of functions of
the form (2.2), f1 (x) = y1 , f2 (x) = y2 , · · · , fm (x) = ym , with each of them spiting out one bit of
the output y = y1 · · · ym . Therefore, it suffices to concentrate on functions of this form (2.2), the
so-called decision problems.

2.1 Decision problems


A decision problem is defined by a function of the form (2.2), and thus can be posed as a YES
(f (x) = 1) or NO (f (x) = 0) question of the input values x.
Example 2.2 (Examples of decision problems). (1) Primality test: deciding whether a given n-
digit natural number x is prime. (2) Divisibility: deciding whether a natural number is divisible
by some y ≥ y0 . (3) Factoring. Finding factors is not immediately a decision task. However, if
we have an efficient algorithm for testing the divisibility, we can also solve the factoring√problem
efficiently. This is because for factoring we can√ use binary search to find factors ≤ x. The
number of calls to the divisibility test is O(log x) = O(log x) = O(n). If the divisibility problem
can be computed within polynomial time, T (n) = poly(n), then factoring can also be solved within
Ta = T (n) · O(log x) = poly(n) time.

2.2 Universal gates


One would like to have computers that can perform any algorithm; that is, changing from one
algorithm to another should be done by the software. This leads to the concept of bits and gates.

Bits Bits are (classical) systems with two different states 0 and 1. Any input and output number
can be encoded in these systems using binary notation. For example, if we have 5 bits, we can
represent the number 23 as 10111.

Gates The gates are the processes that transform bits. Any function can be decomposed into
basic gates that only act on a single bit or two bits. These gates are typically expressed in tables.

• Single bit gates f1 : {0, 1} 7→ {0, 1}. An example is NOT gate.

NOT: x

Input Output
0 1
1 0

• Two-bit gates f2 : {0, 1}2 7→ {0, 1}. Four common two-bit gates are AND, OR, NAND, and
NOR.

AND: x ∧ y = x · y OR: x ∨ y NAND: xy NOR: x ∧ y

Input Output Input Output Input Output Input Output


0 0 0 0 0 0 0 0 1 0 0 1
0 1 0 0 1 1 0 1 1 0 1 0
1 0 0 1 0 1 1 0 1 1 0 0
1 1 1 1 1 1 1 1 0 1 1 0

Table 1: The truth table of some two-bit logical operations.

3
Chapter 4.1 Quantum Information (WiSe 22/23)

Universal gate set These are a finite set of gates such that a sequence of these gates can perform
any computation. The gate set {AND, OR, NOT } is a universal gate set. In fact, NAND ¬(x ∧ y)
or NOR ¬(x∨y) are by themselves already universal when combined with the copy gate x 7→ (x, x).
One can show that by using NAND to construct gates from a universal gate set, such as AND,
OR, and NOT.
Example 2.3. The following circuit implements NAND → AND.

= (2.3)

Circuits When we write a program on a computer, the program is transformed into a sequence
of gates called a circuit, and then this circuit is executed. An example is given in Fig. 2.

Figure 2: An example of a logical gate sequence, a circuit.

2.3 Complexity
Size of the circuit A fundamental measure of the difficulty of computation is the amount of time
(or space) it takes to carry out the computation. Here, we will measure the computation complexity
in terms of the number of (universal) gates it takes. That is, the size of the circuit {Cn } used
to solve the given decision problem. For a given input size, the computational complexity is the
number of such gates required to carry out the computation (as a function of the input size) in
the worst case, i.e., for the input x that requires more gates, and with the best algorithm. In fact,
as we mentioned, one is less ambitious and just asks whether the computational complexity scales
polynomially(feasible algorithm) or not.

Polynomial time We call a circuit is a polynomial-size circuit if the number of gates scale polyno-
mial with N , |Cn | = poly(n). Similarly, we call a circuit an exponential size circuit if the number of
gates scales exponentially with N , |Cn | = exp(n). A decision problem can be solved in polynomial
time if there exists a polynomial-size circuit {Cn } that solves the problem.

2.4 Classification of decision problems


We will now give the classification of decision problems. We will not give a rigorous definition, as
it is used in computer science, but one that suffices for our purposes. We refer the reader to a
textbook on complexity theory for a more precise classification of problems.

The complexity class P-polynomial time We say that a decision problem belongs to the com-
plexity class P if there exists an algorithm that solves the problem and which has polynomial time
complexity. We give one example and make a few remarks.
Example 2.4. Multiplication or modular exponentiation is in P (i.e., obtaining any digit). Divis-
ibility is in P.

• The classification is independent of the hardware.


• The classification depends on the existence of the algorithm (the circuit Cn ).
• The classification may change over time as new algorithms are continued to be discovered.
An example is the primality test. It was not believed to be in P, but someone came up with
a polynomial-time algorithm in 2002.

4
Chapter 4.1 Quantum Information (WiSe 22/23)

The complexity class NP-nondeterministic polynomial time A decision problem is said to belong
to NP if the solution f (x) = 1 can be checked in polynomial time with the help of an appropriate
certificate (verifier y ∈ {0, 1}n ). That is, there exists a function g : {0, 1}n × {0, 1}n → {0, 1} in P
and that such that one can compute g(x, y) = f (x) = 1. Note that any problem in P is also in NP.
Example 2.5. Factorization is in NP. In particular, the decision problem of divisibility of x by a
number y > y0 . If it is, i.e. f (x) = 1, one can use as verifier y and check that indeed, x is divisible
by y in polynomial time. It is not in P because the best algorithm so far takes superpolynomial
time. The discrete logarithm is also in NPsince we can always verify by modular exponentiation,
which is in P.

P versus NP It is widely believed that P 6= NP, although it has not been proven.

NP-hard and NP-complete A crucially important property of NP is that it contains “hardest


problems” such that if any one of these problems could be solved in polynomial time, then so could
any other problem in NP.
NP-hard problems are those to which any problem in NP can be reduced to in polynomial time.
NP-complete problems are those NP-hard problems which are in NP. If any NP-complete problem
is in P, it would follow that P = NP.
Example 2.6 (3-SAT: an example of NP-complete problem.). 3-SAT problems is about determining
the satisfiability of a formula in which each clause is limited to at most three variables, such as

f (x) = (x1 ∨ x̄3 ∨ x7 ) ∧ (x1 ∨ x̄3 ∨ x7 ) ∧ (x1 ∨ x̄3 ∨ x7 ) . (2.4)

The 3-SAT problem asks whether there exist a x such that f (x) = 1. Or, equivalently, is there a
bitstring that satisfies all the clauses simultaneously?

Remarks on 3-SAT problems


• Some practical optimization problems can be formulated as 3-SAT problems. Some heuristic
algorithms may work well in practice, but their worst-case complexity is exponential.
• 3-SAT problem is not in P because the best algorithm scales exponentially with the input
size, but in NP because the solution can be verified fast (i.e., if there exists some x with
f (x) = 1, one can use y = x as verifier). In fact, the 3-SAT problem is shown to be in
NP-hard and NP-complete.

• A decision problem is a member of coNP if its complement (here, for f (x) = 0) is in the
complexity class NP.

EXP Decision problems that can be solved within an exponential amount of time.

PSPACE Decision problems that can be solved with a polynomial amount of memory (not time).

Inclusion between complexity classes It is generally believed (but not proven) that

P ⊆ NP ⊆ PSPACE ⊆ EXP. (2.5)

BPP BPPstands for bounded error probabilistic polynomial time. These are decision problems
for which the solution can be found with probability p ≥ 2/3 in polynomial time. It is believed
that
P ⊆ BPP ⊆ PSPACE (2.6)
Example 2.7. The primality test is in BPP. In practice, it is enough to consider BPPalgorithms
since by repetition we can boost the probability of solving the decision problem. Although the pri-
mality test was also shown to be in P, the P algorithm is less practical than the BPP algorithm.

5
Chapter 4.1 Quantum Information (WiSe 22/23)

EXP

PSPACE

NP

BPP P

Figure 3: Relationship among several common complexity classes.

Input n Output f (n)

Black box

Figure 4: Oracle: a black-box.

Oracles Proving separation between different complexity classes rigorously without any mathe-
matical assumptions is a daunting challenge. To make some statements, one can use a theoretical
tool called the oracle. ’Oracles’ are black boxes that compute certain functions immediately, and
we can query them.
We can define complexity classes relative to an oracle; for instance, Po is the set of decision
problems that can be computed in polynomial time by having extra access to the oracle o (and a
polynomial number of queries). The separation between complexity classes relative to oracles can
be proven. For example,
NP ⊆ P3−SAT , NP ⊆ PNP . (2.7)

3 Quantum computing
3.1 Basic concepts of quantum computing
A quantum computation can be considered as a physical process that transforms an input state
into an output state of a system. The physical process is based on coherent quantum phenomena,
such as Hamiltonian interactions.

Input |ni Output |f (n)i

Quantum process

Figure 5: Quantum computing utilizes quantum process.

Input and outputs In quantum computation, inputs and outputs are represented by states of the
system. For example, enumerating the state of a given basis as |1i, |2i, . . ., the number N would
be represented by the N –th state of this basis. Or, if we use binary notation, it can be encoded in
a state of the computational basis.

Restrictions The operation that transforms inputs into outputs has to be unitary. Since unitary
transformation conserve inner products hx|yi = hx|U † U |yi, unitary operators map orthogonal

6
Chapter 4.1 Quantum Information (WiSe 22/23)

states to orthogonal states. Therefore, the AND operation

|00i → |0i
|01i → |0i
(3.1)
|10i → |0i
|11i → |1i

could not be implemented because this operation does not conserve the scalar product (e.g.,
h00|01i = 0 but the corresponded mapped states are not orthogonal) and are thus not reversible.

Register Since AND operation can be easily implemented classical, one may infer that this re-
striction makes quantum computers less powerful than classical computers. However, there is a
simple way to circumvent this limitation. The idea is to use an auxiliary system so that the output
is written in that system while keeping the unitarity of the operation

|00i|0i → |00i|0i,
|01i|0i → |01i|0i,
(3.2)
|10i|0i → |10i|0i,
|11i|0i → |11i|1i.

In this way, the unitarity is kept because the orthogonal property is still preserved, U |x, 0i ⊥
U |y, 0i if |x, 0i ⊥ |y, 0i.
In general, if our algorithm consists of evaluating a given function f : N → N, we can design a
circuit that transform the input states according to the following table

|1i|0i → |1i|f (1)i,


|2i|0i → |2i|f (2)i,
(3.3)
...
|ni|0i → |ni|f (n)i.

Classical vs. quantum computing Using this transformation, we can, at least, do the same
computations with quantum computers as with classical computers. In fact, any efficient non-
reversible classical computation can be extended to an reversible one with only moderate effort.
Thus, there is no restriction in assuming that f is reversible. Since reversible functions can be
implemented using unitary operations, quantum computers are at least as powerful as classical
ones. All operations with fast algorithms in classical computation have fast algorithms in quantum
computation. However, there are operations for which only classical slow algorithms exist, but
there are fast quantum algorithms. The most important example is factorization.
Example 3.1. Multiplication can be efficiently realized on a quantum computer as |xi |yi |0i →
|xi |yi |x · yi.

Quantum parallelism Using the laws of Quantum Mechanics, one can do more than with the laws
of Classical Mechanics. In general, to compute a function f : N → N for the numbers 1, 2, . . . , N ,
classically one has to run the computation N times. In a quantum computer one can do the same
(3.3). However, with quantum computers we can do even more. We can prepare the input state
that is in a superposition.
N
1 X
|ψi = √ |ki|0i (3.4)
N k=1
and run the computer on this state. We obtain a superposition state
N
1 X
√ |ki|f (k)i (3.5)
N k=1

that contains all the possible values of f .


This property of using quantum superposition to run only once the computer was termed by
Feynman quantum parallelism.

7
Chapter 4.1 Quantum Information (WiSe 22/23)

However, “quantum parallelism” is not enough to speed up computation. Although in principle,


the superposition contains all the values of f , we do not have access to this information with a
single measurement. This is because if we perform a measurement, we will only obtain one result
(with a certain probability). Nevertheless, we see that with a quantum computer we can do at
least the same as with a classical computer, and possibly even more.

Idea of quantum computing The idea of quantum computing is to devise clever quantum al-
gorithms that utilize superposition and entanglement to obtain solutions more efficiently. Since
quantum computation is a probabilistic process, the output state will not be exactly the one |f (x)i
we wanted. Rather it will have some small errors |f (x)i + , but the algorithms should be designed
in a way such that the desired solution can be obtained with high probability.

Quantum circuit diagram A quantum circuit that transforms a input state |x1 i · · · |xn i = |x1 · · · xn i
to Uf |x1 · · · xn i, where Uf depends on the function we want to evaluate, is commonly represented
by the quantum circuit diagram like the following.

Uf

3.2 Quantum circuits


Universal quantum computers As in the classical case, one would like to have quantum comput-
ers that can implement any quantum algorithm; that is, changing from one algorithm to another
should be done by the software. This leads to the concept of qubits and quantum gates.

Qubits Qubits are (quantum) systems with two different states |0i and |1i. Any input and output
number can be encoded in these systems using binary notation. For example, if we have 5 qubits,
we can represent the number |23i as |10111i.

Quantum gates These are quantum processes and transform qubits.

Universal gates In principle, if we want to perform general operations, we should be able to


engineer arbitrary interactions between qubits. Fortunately, this task is enormously simplified
given the fact that any U can be decomposed as a product of gates belonging to a small elementary
set, the so-called universal set of gates. If we are able to perform the gates from this set we will
be able to perform any computation by simply applying a sequence of them.

U ≈

There are many sets of universal gates, and of course, they are equivalent. The most convenient
set is the one that contains one two-qubit gate (an operation acting on two qubits only) and a set
of single-qubit gates. We will introduce some important single-qubit gates and two-qubit gates in
the following.

8
Chapter 4.1 Quantum Information (WiSe 22/23)

3.2.1 Single qubit gates


A general single-qubit gate has the form
 
θ θ
|0i → eiµ cos e−iδ |0i + sin e−iϕ |1i , (3.6)
2 2
 
θ θ
|1i → eiµ − sin eiϕ |0i + cos eiδ |1i . (3.7)
2 2
Here, eiµ represents the global phase whose value can be chosen freely.

NOT gate For θ = π, ϕ = µ = π/2 and δ = 0 we have the quantum version of the NOT gate
. Similar to the classical NOT gate, the quantum NOT gate transforms

|0i =|1i
(3.8)
|1i =|0i

π
Hadamard gate For θ = π/2, µ = δ = ϕ = π/2 we have the Hadamard gate H = σx e−i 4 σy ,
depicted as H . The Hadamard gate realizes the transformation

1
|0i → √ (|0i + |1i) → (|0i + |1i) ,
2
(3.9)
1
|1i → √ (|0i − |1i) → (|0i − |1i) .
2
where we have dropped the normalization factor. From now on we will not include the normal-
ization whenever it is not necessary. Hadamard gate squares to identity, as one can easily verify
π π π π
H 2 = σx e−i 4 σy σx e−i 4 σy = e+i 4 σy e−i 4 σy = 1. (3.10)
Diagrammatically, we depict
H H = . (3.11)

Phase gate For µ = δ = ϕ/2 and θ = 0 we have the phase gate ϕ , a family of single-
qubit gates that map the basis states
|0i → |0i ,

(3.12)
|1i → e |1i .
After the phase gate is applied, the probability of measuring a |0i or |1i is unchanged; however,
the relative phase of the quantum state is modified. Note that this corresponds to the unitary
operator: Uϕ = e−iϕ(σz −1)/2 .
Since global phases do not matter for a single qubit, equivalently we could also use θ = 0, µ = 0
and δ = ϕ/2
|0i → e−iϕ/2 |0i ,
(3.13)
|1i → eiϕ/2 |1i .
But this is not recommended since it can lead to some confusion when one has more than one
qubit.
Two particular cases of phase gates worth special attention. They are S gate and T gate.
π
ϕ = π/2 = S = e−i 4 (σz −1) , (3.14)

π
ϕ = π/4 = T = e−i 8 (σz −1) , (3.15)

9
Chapter 4.1 Quantum Information (WiSe 22/23)

Example 3.2. The following circuit identities hold

ϕ/2 −ϕ/2 = , (3.16)

ϕ/2 −ϕ/2 = ϕ . (3.17)

The latter is up to a global phase.

General single-qubit unitaries In general, Hadamard and phase gates are enough to general
arbitrary single-qubit gates (see exercise)

Q = ϕ1 H ϕ2 H ϕ3 . (3.18)

3.2.2 Two-qubit gates


Now we turn to two-qubit gates.

Controlled-NOT gate CNOT gate UCNOT = |0i h0| ⊗ 1 + |1i h1| ⊗ σx changes the state of the
second qubit conditioned on the state of the first qubit. It is described by the following operation
on the basis |00i, |01i, |10i, |11i.
|0i |0i → |0i |0i ,
|0i |1i → |0i |1i ,
. (3.19)
|1i |0i → |1i |1i ,
|1i |1i → |1i |0i
The first qubit is therefore called control qubit, whereas the second one is called target. We depict

CNOT = . (3.20)

The controlled-NOT gate requires interaction between the qubits. This can be shown, for ex-
ample, by noticing that the input state (|0i + |1i) |0i is transformed into |00i + |11i, which is an
entangled state.
(|0i + |1i) |0i

|0i H
= |Φ+ i (3.21)
|0i

Controlled-Phase gate Controlled-Phase gate |0i h0| ⊗ 1 + |1i h1| ⊗ eiϕ(σz −1)/2

(3.22)
ϕ

adds a phase eiϕ to the second system depending on the state of the first system as
|0i |0i → |0i |0i ,
|0i |1i → |0i |1i ,
. (3.23)
|1i |0i → |1i |0i ,
|1i |1i → eiϕ |1i |1i

10
Chapter 4.1 Quantum Information (WiSe 22/23)

Example 3.3. A C-Phase gate can be decomposed as a product of CNOT gates and single qubit
phase gates,
ϕ/2
= . (3.24)
ϕ
ϕ/2 −ϕ/2

This identity can be easily verified by checking how do they transform two basis states |0i and |1i.
A special case (ϕ = π) is the Controlled-Z (CZ) gate, which can also be decomposed as

= . (3.25)
Z H H

Controlled-Unitary gates We can also consider controlled-Q gates, where Q is arbitrary single-
qubit gates
U = |0ih0| ⊗ 1 + |1ih1| ⊗ Q. (3.26)
Since Q is a normal matrix, we can diagonalize it as

0 1 0
 iϕ   
e 1
Q=V V =e V
† iϕ1
V† (3.27)
0 eiϕ2 0 ei(ϕ2 −ϕ1 )

using the spectral decomposition. As a result, the controlled-Q gate is decomposed as a product
of single-qubit gates and a controlled phase gate,

ϕ1
= . (3.28)
Q ϕ2 − ϕ1
V† V

SWAP gates The swap gate swaps the states of two qubits. It can be decomposed in terms of
CNOT gates as

= . (3.29)

Permutation gates Permutation gate permutates some of the basis states.

|0i |0i → |0i |1i ,


|0i |1i → |0i |0i ,
. (3.30)
|1i |0i → |1i |0i ,
|1i |1i → |1i |1i .

In the exercise, you will show any permutation gate can be written as products of controlled NOT
and NOT gates. For example, (3.30) is implemented as

. (3.31)

General 2-qubit unitaries Now we are equipped to consider general 2-qubit unitary gates.

11
Chapter 4.1 Quantum Information (WiSe 22/23)

As expected, any 2-qubit unitary gates can be written as products of elementary gates.
The proof is as follows. Given a two-qubit unitary Q, we can always write its spectral decom-
position as a product X
Q= eiϕk |ψk i hψk | = Q4 Q3 Q2 Q1 (3.32)
k

where each Qk only adds a phase eiϕk to one eigenstate |ψk i but leaves other eigenstates |ψi i,
i 6= k, invariant
Qk : |ψk i → eiϕk |ψk i
(3.33)
|ψi i → |ψi i , i 6= k.
Using the resolution of identity 1 = k |ψk i hψk |, we can write
P

Q1 = eiϕ1 |ψ1 i hψ1 | + |ψ2 i hψ2 | + |ψ3 i hψ3 | + |ψ4 i hψ4 | ,


Q2 Q1 = eiϕ1 |ψ1 i hψ1 | + eiϕ2 |ψ2 i hψ2 | + |ψ3 i hψ3 | + |ψ4 i hψ4 | ,
(3.34)
Q3 Q2 Q1 = eiϕ1 |ψ1 i hψ1 | + eiϕ2 |ψ2 i hψ2 | + eiϕ3 |ψ3 i hψ3 | + |ψ4 i hψ4 | ,
Q4 Q3 Q2 Q1 = eiϕ1 |ψ1 i hψ1 | + eiϕ2 |ψ2 i hψ2 | + eiϕ3 |ψ3 i hψ3 | + eiϕ4 |ψ4 i hψ4 | ,

Now the task reduces to how to implement Qk . Now we show that such Qk can be easily con-
structed. We claim that Qk can be constructed using Vk and ϕk ,

Vk† Vk = Qk (3.35)
ϕk

where Vk satisfies
Vk : |ψk i → |11i
(3.36)
Vk† : |11i → |ψk i
and the action on the other states can be arbitrary (as long as Vk is unitary, since the other states
ψi will be mapped on states that are orthogonal to |11i). One can easily check that inputting |ψk i
to circuit on the left hand side of (3.35) gives eiϕk |ψk i, and inputting |ψi i, i 6= k, gives |ψi i.
Now the question remaining is how to implement Vk , which maps |ψk i → |11i, |ψk⊥ i → |11⊥ i.
This problem can be further simplified by using the Schmidt decomposition of |ψk i

|ψk i = c0 |u0 v0 i + c1 |u1 v1 i . (3.37)

With Schmidt decomposition, we only need to find a Rk : c0 |00i + c1 |11i → |11i, satisfying

U† U
Vk = Rk . (3.38)
V† V

This can be easily accomplished by using a permutation gate P and a single-qubit gate L

Rk = P (3.39)
L

where P implements
|0, 0i → |1, 0i
|1, 0i → |0, 0i
(3.40)
|0, 1i → |0, 1i
|1, 1i → |1, 1i
and L satisfies L(c0 |0i + c1 |1i) = |1i.

12
Chapter 4.1 Quantum Information (WiSe 22/23)

3.2.3 General multi-qubit gates


ϕ H

Q ≈ (3.41)
ϕ H

H ϕ

The idea of multi-qubit universality proof relies on a similar construction as the 2-qubit case we
have seen above. Here we will not show that but leave it as an exercise.

Universal gate set With a universal gate set, any n-qubit gate U can be realized exactly. It can
be shown that any unitary operation acting on a set of qubits can be written as a sequence of
controlled-NOT and single-qubit gates. Therefore, {H, ϕ, CNOT} is an universal gate set.

Approximate universal gate sets Any n−qubit gate U can be approximated to arbitrary precision
by gates from an approximate universal get set well. We name two such sets: (1) {H, T, CNOT}
and (2) {H, CS}, where CS is the controlled-S gate, i.e. a controlled phase gate with ϕ = π/2.

3.3 Quantum complexity


Similar to the classical case, the computational complexity measures how many basic operations
(single and two-qubit gates) are required to solve the problem. Similarly, one defines quantum
versions of certain complexity classes, which quantify the difficulty of solving problems with a
quantum computer.

The complexity class BQP Since quantum processes are inherited probabilistic, we will consider
a quantum analog to the complexity class BPP. This is BQP, which stands for bounded error
quantum polynomial time. It denotes the class of decision problems which can be solved by a
quantum computer, with probability ≥ 2/3, in polynomial time.
Example 3.4. Factoring and discrete logarithm problems are in BQP.

BQP-hard and BQP-complete BQP-hard problems are those to which any problem in BQP can
be reduced to in polynomial time. BQP-complete problems are those BQP-hard problems which
are in BQP.

Remarks:
• If you show that one problem in BQP-hard is in BPP, then BQP=BPP, and it will collapse
all the advantages of quantum computers.
• It is not clear whether BPP = P or not. In fact, many problems in BPP have been de-
randomized.
• It is believed that BPP and BQP are different because, with quantum computers, we can use
superposition and entanglement. However, one can only show that with references to oracles.
• It is widely believed that NP-complete problems cannot be solved by quantum computers
efficiently.

13
Chapter 4.1 Quantum Information (WiSe 22/23)

QMA - Quantum Merlin Arthur The complexity QMA is the quantum analog of the class NP. In-
formally, it is the set of decision problems for which when the answer is YES, there is a polynomial-
size quantum proof (a quantum state) that convinces a polynomial-time quantum verifier of the
fact with high probability. Moreover, when the answer is NO, every polynomial-size quantum state
is rejected by the verifier with high probability.
Example 3.5 P(An example of QMA-hard problem: finding ground state energies). Given a Hamil-
tonian H = ij hij where each term hij at most acts on 2 qubits and khij kop ≤ 1, we ask whether
there exists an eigenvalue smaller than certain input energy E0 . This problem is QMA-hard.

Remark

• In computer science, the idea of Quantum Merlin Arthur goes much deeper to interactive
proof systems.
• QMA contains the probabilistic version of NP, NP ⊆ QMA.
• It is generally believed that

BPP ⊆ BQP ⊆ QMA ⊆ PSPACE. (3.42)

Oracles As in the classical case, one can define problems with quantum oracles, which implement
certain unitary operators. We just count the number of calls to the oracle, but not the computa-
tional cost of implementing the oracle itself. This leads to complexity classes relative to oracles,
for which it is possible to prove separations.

♣♣♣

Acknowledgement.— We thank Maximilian Lutz, Filip Novak, and Tommy Block for their proof-
reading.

These lecture notes were kindly provided by Ignacio Cirac and Sirui Lu.

14

You might also like