Quantum computing for CS students: the unitary circuit model
1. Quantum Computing
for CS students: the
unitary circuit model
Bruno FEDRICI, PhD
21/05/19 – EPITECH Lyon
2. What does it mean to compute ?
Church-Turing thesis: Any algorithmic process can be simulated
efficiently using a Turing machine
Deutsch (1985): Can we justify C-T thesis using laws of physics ?
Quantum mechanical processes seems to be very hard to
simulate on a classical computer
Might it be that computers exploiting quantum physics laws
are not efficiently simulatable on a Turing machine ?
(Violation of C-T thesis !)
Candidate universal computer: quantum computer
3. What does it mean to compute ?
Church-Turing-Deutsch principle: Any physical process can be
efficiently simulated on a universal quantum computer
4. Models of quantum computation
A more convenient model is
the quantum circuit model
(QCircuits). This model is
mathematically equivalent to
the QTM model, but the
former is better suited for
algebraic problems than the
latter.
There are also many other
interesting alternate models
of quantum computation
(see Figure 2).
Historically, the first model of quantum computation was the
quantum Turing machine (QTM), based on classical Turing
machine.
5. Representing classical bits as a vector
One bit with the value 0, also written as (Dirac notation):
One bit with the value 1, also written as :
7. Operations on one classical bit (cbit)
0 0
Identity
1 1
0 0
Negation
1 1
0 0
Constant-0
1 1
0 0
Constant-1
0 1
8. Reversible computing
Reversible means given the operation and output value, you can
find the input value
For , given and , you can uniquely find
Operations which permute are reversible; operations which erase
or overwrite are not
Identity and Negation are reversible
Constant-0 and Constant-1 are not
Quantum algorithms rely only on reversible operations, so we will
only care about those
In fact, all quantum operators are “their own inverses”
(unitarity of quantum theory)
10. Representing multiple cbits
We call this tensored representation the product state
We can factor the product state back into the individual state
representation
The product state of n bits is a vector of size 2n
11. Operations on multiple cbits: CNOT
Operates on a pair of bits: the “control” bit and the “target” bit
If the control bit is 1, then the target bit is flipped
If the control bit is 0, then the target bit is left unchanged
The control bit is always unchanged
00 00
01 01
10 11
11 10
14. Recap cbits
We represent classical bits in vector form as for 0 and
for 1
Operations on bits are represented by matrix multiplication on
bit vectors
Quantum algorithms rely only on reversible operations
Multi-bit states are written as the tensor product of single-bit
vectors
The CNOT gate is a fundamental building block of reversible
computing
15. Qbits and superposition
Surprise ! We've actually been using single qbits all along !
The cbit vectors we've been using are just special cases of
qbit vectors
A qbit is represented by a vector where a and b are
complex numbers and:
complex numbers and:
The cbit vectors and fit within this definition
Example qbit values:
16. Qbits and superposition
How can a qbit to have a value which is not 0 or 1 ? This is
called coherent superposition, enabling quantum parallelism
When we measure the qbit, it collapses to an actual value of 0
or 1
We usually do this at the end of a quantum algorithm to get
the result
If a qbit has value then it collapses to 0 with a probability
and 1 with a probability
For example, has a chance of collapsing
to 0 or 1
The qbit has a 100% chance of collapsing to 0
17. Qbits and superposition
Multiple qbits are similarly represented by the tensor product
Note that
For example, the system (note that
and )
There's a ¼ chance each of collapsing to or
18. Operations on qbits
How do we operate on qbits ? The same way we operate on
cbits: with matrices !
All the matrix operators we have seen also work on qbits (bit
flip, CNOT, etc)
Matrix operators model the effect of devices acting on qbit
observables like spin or polarization without measuring and
collapsing qbit states:
There are several important matrix operators which only make
sense in a quantum context
19. Operations on qbits: the Hadamard gate
The Hadamard gate takes a 0- or 1-bit and puts it into exactly
equal superposition:
20. Operations on qbits: the Hadamard gate
The Hadamard gate also takes a qbit in exactly-equal
superposition, and transforms it into a 0- or 1-bit (this should
be unsurprising – remember operations are their own inverse):
We can transition out of a superposition without measurement !
We can thus structure quantum computation deterministically
instead of probabilistically
23. Recap qbits
Cbits are just a special case of qbits, which are 2-vectors of
complex numbers
Qbits can be in superposition, enabling parallelism, and are
probabilistically collapsed to cbits by measurement
Multi-qbit systems are tensor product of single-qbit systems,
like with cbits
Matrices represent operations on qbits, same as with cbits
The Hadamard gate take 0- and 1-bits to equal superposition,
and back
We can think of qbits and their operations as forming a state
machine on the unit circle
Actually the unit sphere if we use complex amplitudes
24. The Deutsch oracle
Imagine someone gives you a black box containing a function
on one bit
Recall ! What are the four possible functions on one bit ?
You don't know which function is inside the box, but you can try
inputs and see outputs
How many queries would it take to determine the function on a
classical computer ? (Answer: 2)
How many on a quantum computer ? (Answer: 2; quantum
computation requires something more than just parallelism)
25. The Deutsch oracle
What if you want to check now whether or not the function is
constant, or variable ?
Constant-0 and Constant-1 are constant, Identity and
Negation are variable
How many queries would it take to determine the function on a
classical computer ? (Answer: 2)
How many on a quantum computer ? (Answer: 1)
26. The Deutsch oracle
How can it be done in a single query !?
We combine quantum parallelism with interferences
First, we have to define what each of the four functions look
like on a quantum computer
We have an immediate problem with the constant functions
(remember, Constant-0 and Constant-1 are non reversible
operations !)
27. The Deutsch oracle
How do we write non-reversible functions in a reversible way ?
Common hack: add an additional auxiliary qbit to which the
function is applied (target register)
We thus have to rewire our black box:
before: after:
The black box leaves input data unchanged, writing function
output to the target register
BBData Target
Target
register
Data
register
BB
28. The Deutsch oracle: Constant-0
Target
register
Data
register
BB
Target
register
Data
register
Constant-0:
Black box:
29. The Deutsch oracle: Constant-1
Target
register
Data
register
BB
Target
register
Data
register
Constant-1:
Black box:
30. The Deutsch oracle: Identity
Target
register
Data
register
BB
Target
register
Data
register
Identity:
Black box:
31. The Deutsch oracle: Negation
Target
register
Data
register
BB
Target
register
Data
register
Negation:
Black box:
32. The Deutsch oracle
How do we solve it with a quantum algorithm in one query ?
If the black box function is constant, system will be in state
after the measurement
If the black box function is variable, system will be in state
after the measurement
Target
register
Data
register
BB
preprocessing post-processing
43. The Deutsch oracle
We did it ! We determined whether the function is constant or
variable in a single query !
Intuition: the difference within the categories was neutralized
(negation), while the difference between the categories was
magnified (CNOT)
This problem seems pretty contrived (and it was when it was
published)
A generalized version with an n-bit black box also exists
(Deutsch-Josza algorithm)
Determine whether the function returns the same value for
2n
inputs (i.e. constant)
45. Entanglement
If the product state of two qbits cannot be factored, they are
said to be entangled
The system of equations has no solution, so we cannot factor
the quantum state !
The state has a 50% chance of collapsing to and a 50%
chance of collapsing to
47. Teleportation
Quantum teleportation is the process by which an unknown qbit
state is transferred from one location to another by means of
two other entangled qbits
You can transfer qbit states (cut & paste) but you cannot clone
them (copy & paste)
This comes from the No-cloning theorem
The teleportation is not faster-than-light, because some
classical information must be sent during the protocol
54. Further learning goals
Deutsch-Jozsa algorithm and Simon's periodicity problem
Former yields oracle separation between EQP(1)
and P(2)
, later
between BQP(3)
and BPP(4)
Shor's algorithm and Grover's algorithm
Quantum cryptographic key exchange and no cloning theorem
How qbits, gates, and measurement are actually implemented
Quantum error correction
Quantum programming language design (QISkit, Q#, ...)
(1)
: The class of decision problems solvable by a quantum computer which outputs the correct answer with probability 1 and runs in
polynomial time
(2)
: The class of decision problems solvable by a deterministic Turing machine in polynomial time
(3)
: The class of decision problems solvable by a quantum computer in polynomial time, with an error probability of at most 1/3 for all
instances
(4)
: The class of decision problems solvable by a probabilistic Turing machine in polynomial time with an error probability bounded away from
1/3 for all instances
55. Further reading
Nielsen, Michael A.; Chuang, Isaac L. (2010). Quantum
Computation and Quantum Information (2nd ed.). Cambridge:
Cambridge University Press. ISBN 978-1-107-00217-3.
Preskill, John (2018). Quantum Computing in the NISQ era and
beyond. arXiv:1801.00862v3
Fingerhuth, Mark; Babej, Tomáš; Wittek, Peter (2018). Open
source software in quantum computing. arXiv:1812.09167v1