Transcript 1.01

Quantum Information Processing
QIP 2 – Quantum gates and circuits
Dan C. Marinescu
Computer Science Division, EECS Department
University of Central Florida
Email: [email protected]
Contents

Last time

Laws of physics and the limits of solid-state technology
 The mathematical model
 A bit or a qubit of history

Today









Classical gates
Quantum gates
Unitary transformations
One-qubit gates, two-qubit gates, CNOT
Three-qubit gates Fredkin and Toffoli gates
Universal quantum gates
Reversibility of quantum circuits
Decoherere; DiVincenzo’s criteria for realization of quantum circuits
A circuit for solving the balanced function problem posed by David Deutsch
The lectures are available at:
http://www.cs.ucf.edu/~dcm/Chile2012/ChileIndex.html
7/21/2015
UTFSM - June 2012
2
|
0
|
1
(a)
E
S
S
(b)
(c)
intensity = I
A
B
E
S
intensity = I/2
A
C
B
E
S
intensity = 0
(d)
7/21/2015
E
A
intensity = I/8
(e)
UTFSM - June 2012
3
Information, bits, and classical gates




There is a common expression of information, strings of bits, regardless
of the object/entity/process it describes. Bits are independent of their
physical embodiment.
Information is transformed using logic operations. Gates implement logic
operations and allow for automatic processing of information. The
usefulness of information increases if the physical embodiments of bits
and gates become smaller and we need less energy to process, store,
and transmit information.
Classical gates are not reversible (invertible); we cannot recover the input
knowing the output. This means that there is an irretrievable loss of
information and this has thermodynamic consequences.
Landauer’s Principle is a consequence of the second law of
thermodynamics: the minimum amount of energy required for erasing a
bit of information is
kT ln2
k is Boltzmann’s constant
7/21/2015
UTFSM - June 2012
4
NOT gate
x
x
0
1
y
1
0
x
0
0
1
1
y
0
1
0
1
z
0
0
0
1
x
0
0
1
1
y
0
1
0
1
z
1
1
z = (x) OR (y)
x
0
0
1
1
y
0
1
0
1
z
0
1
1
1
z = (x) NOR (y)
x
0
0
1
1
y
0
1
0
1
z
1
0
0
0
z = (x) XOR (y)
x
0
0
1
1
y
0
1
0
1
z
0
1
1
0
y = NOT(x)
x
AND gate
z = (x) AND (y)
y
x
NAND gate
z = (x) NAND (y)
y
x
OR gate
y
x
NOR gate
y
x
XOR gate
y
7/21/2015

1
0
UTFSM - June 2012
Classical gates implement
Boolean functions thus,
their actions can be
described by truth tables.
5
The mathematical model




Quantum gates are used to transform information encoded as the state of a
quantum system.
Quantum states are represented as vectors in an n-dimensional Hilbert
space Hn  a vector space over C the set of complex numbers.
A canonical orthonormal basis in Hn can be expressed as the ket vectors
|0>, |1>, |2>, ……|n-1> or as the bra vectors <0|, <1|, <2|, ……<n-1|
The matrix representations of these vectors are:
1
 
0
| 0   0  , | 1 
 
 ... 
0
 
0
0
 
 
1
0
 0  , | 2   1  ,....., | n  1 
 
 
 ... 
 ... 
0
0
 
 
0
 
0
0
 
 ... 
1
 
 0 | (1, 0 , 0 ,..., 0 ),  1 | ( 0 ,1, 0 ,..., 0 ),  2 | ( 0 , 0 ,1,..., 0 ),  n  1 | ( 0 , 0 , 0 ,..., 1)
7/21/2015
UTFSM - June 2012
6
Hermitian and unitary operators









Quantum transformation are described by linear operators which transform
vectors in Hn |   A |  
A linear operator A can be represented by a matrix A  [ a i , j ],1  i , j  n
The adjoint of a linear operator A is denoted by A+ . The matrix
representing the adjoint A+ is the transpose conjugate of the matrix A.
A is a normal operator if (AA+ )= (A+ A)
A is a Hermitian (self-adjoint) operator if A = A+
The transformations carried out by quantum gates are described by
Hermitian operators; sometimes we call the Hermitian operator the transfer
matrix of the gate.
One-qubit gate  transformation in H2  2 x 2 transfer matrix.
Two-qubit gate  transformation in H4  4 x 4 transfer matrix.
Three-qubit gate  transformation in H8  8 x 8 transfer matrix.
7/21/2015
UTFSM - June 2012
7
Quantum gates

One-qubit gates 
X - transposes the components of a qubit;
Y – changes the phase of a qubit
Z - flips the sign of a qubit;
Hadamard - creates a superposition state.
Two-qubit gates  CNOT
Three-qubit gates  Toffoli

Quantum gates are reversible  in principle no power dissipation.


7/21/2015
UTFSM - June 2012
8
7/21/2015
UTFSM - June 2012
9
One qubit gates


Transform an input qubit into an output qubit
Characterized by a 2 x 2 matrix with complex coefficients
   0 0  1 1
One-qubit gate
  0  1
'
0
7/21/2015
UTFSM - June 2012
'
1
10
The transfer matrix of one-qubit gates
 g 11
G  
 g 21
g 12 

g 22 
 g 11
G  
 g 12
*
*

g
g

g
g

11 11
21 21
G G  *
 g g  g* g
22 21
 12 11
7/21/2015
g 21 

g 22 
T
*

g

11
G  *
g
 12
g 21 

* 
g 22 
*
*
*
g 11 g 12  g 21 g 22 
I
*
*
g 12 g 12  g 22 g 22 
UTFSM - June 2012
11
Identity transformation, Pauli matrices, Hadamard with
input a qubit in state    0 0   1 1
1
 0  I  
0
0

1
   0 0  1 1
0
 1  X  
1
1

0
  1 0   0 1
0
 2  Y  
i
 i

0 
   i 1 0  i 0 1
1
 3  Z  
0
0 

 1
   0 0  1 1
1 1 1 


H 
2 1  1
7/21/2015
  0
0  1
2
UTFSM - June 2012
 1
0  1
2
12
Tensor products and “outer” products
1
 
1 1 0
00  | 0  | 0          
0 0 0
0
 
1
 
0
00 00    1 0
0
 
0
 
7/21/2015
0
1

0
0  
0

0

UTFSM - June 2012
0
0
0
0
0
0
0
0
0

0
0

0 
13



CNOT a two-qubit gate
Two inputs
 Control
 Target
The control qubit is transferred to the output as is.
The target qubit
 Unaltered if the control qubit is 0
 Flipped if the control qubit is 1.
Control input


Target input


+
O
7/21/2015
UTFSM - June 2012
+ 
O
addition modulo 2
14
V CNOT
   
CNOT
W CNOT
G CNOT
7/21/2015
1

0

0

0

0
0
1
0
0
0
0
1
 G CNOT V CNOT
0

0
1

0 
UTFSM - June 2012
15
The input of a two-qubit gates is the tensor product
of the two qubits
   0 0  1 1
   0 0  1 1
V CNOT
7/21/2015
 0 0 


 0    0    0 1 
           





 1  1  1 0
  
 1 1
UTFSM - June 2012
16
Two transfer matrix of a CNOT gate
7/21/2015
G CNOT
 00 00  01 01  10 11  11 10
G CNOT
1

0

0

0

0
0
1
0
0
0
0
1
0

0
1

0 
UTFSM - June 2012
17
The output of a CNOT two-qubit gate
W CNOT
W CNOT
 G CNOT V CNOT
1

0

0

0

0
0
1
0
0
0
0
1
0   0  0    0  0 

 

0   0  1    0  1 




 11 
1  1 0

 





0    1  1    1  0 
W CNOT
  0  0 00   0  1 01   1  1 10   1  0 11
W CNOT
  0 0 ( 0 0  1 1 )   1 1 (1 0   0 1 )
7/21/2015
UTFSM - June 2012
18
The transformations carried out by the CNOT gate


CNOT preserves the control qubit (the first and the second component
of the input vector are replicated in the output vector)
Flips the target qubit (the third and fourth component of the input vector
become the fourth and respectively the third component of the output
vector).
W CNOT

  0 0 (  0 0   1 01 )   1 1 (  1 0   0 1 )
The CNOT gate is reversible. The control qubit is replicated at the
output and knowing it we can reconstruct the target input qubit.
7/21/2015
UTFSM - June 2012
19





7/21/2015
UTFSM - June 2012
Properties of the CNOT gate.
(a) Produces perfectly entangled states
from non-entangled states. When the
control qubit is in state (|0> - |1>)/ 2
(this state can be produced by a
Hadamard gate with input |1> and the
target qubit is in state |1> then the
output is in an EPR state
(|01> - |10>)/ 2
(b) It can be used for a “non-demolition
measurement” of the control qubit.
(c) A more sophisticated non-demolition
measurement M
(d) When both the control and the target
qubits are in a rotated basis,
((|0> + |1>)/ 2 , (|0> - |1>)/ 2
then the role of the control and target
qubit are reversed.
20
Three-qubit gates: 3 input and 3 output qubits

Fredkin gate
 One control qubit and two target qubits


When the control qubit is
 0  the target qubits are replicated to the output
 1  the target qubits are swapped
Toffoli gate:
 Two control qubits and one target

When both control qubits
 are 1  the target qubit is flipped
 otherwise the target qubit is not changed.
7/21/2015
UTFSM - June 2012
21
Toffoli gate is universal. Can emulate an AND and a
NOT gate
a
a
a
a
1
1
b
b
b
b
b
b
+ ab
c O
1
0
b
c
(a)
7/21/2015
NAND(ab)
(b)
UTFSM - June 2012
(c)
22
Controlled H gate
H
H
(a)
7/21/2015
(b)
UTFSM - June 2012
23
Generic one qubit controlled gate
|c>
|t>
|c>
U
|t>
A
(a)
7/21/2015
B
C
(b)
UTFSM - June 2012
24
Universal Quantum Gates




Any Boolean expression can be written as a sum (logical OR) of
products (logical AND) of Boolean variables and/or negation of
Boolean variables.
Thus, any classical logic circuit can be implemented using only
AND, OR, and NOT gates.
NAND and NOR are classical universal gates.
Similarly, we can simulate any complex n-qubit quantum circuit
using a small set of one-qubit and CNOT gates.
7/21/2015
UTFSM - June 2012
25
Schematic representation of a
reversible quantum gate array;
the circuit carries out
the unitary transformation Uf and
has two input registers one with n
qubits in state |x>(n) and the other
with m qubits in state |y>(m)
There are two output registers;
after the transformation one will
be in state |f(x)>(n)
and the other in state |g(x)>(m)
(a) We add two new registers one
for the result and the other for the
ancilla qubits, both in state |0>
(b) We add CNOT gates for
bitwise AND of y and f(x)
(c) We add CNOT gates to
reverse the computation and to
set the second
and third output registers to zero.
7/21/2015
UTFSM - June 2012
26
A reversible quantum circuit. The
input register x is in state
|x1 x2 x3 x4 x5 x6 >
Register y has m qubits.
The unitary transformation U is
applied to |y> only if the condition
x1  x 2  x 3  x 4  x 5  x 6  1
is satisfied.
There are five ancilla qubits used
to store partial results; initially
they are in state |0> and after the
transformation U they are
returned to state |0>.
The circuit uses ten Toffoli gates.
7/21/2015
UTFSM - June 2012
27
Decoherence


Decoherence  randomization of the internal state of a quantum
computer due to interactions with the environment.
Conceptually decoherence can be prevented using:
1. Quantum fault-tolerant circuits.
2. Quantum Error Correcting Codes.
3.
Entanglement Purification and Distillation extract a subset of
states of high entanglement and high purity from a large set of less
entangled states.
7/21/2015
UTFSM - June 2012
28
Reliable CNOT gate
7/21/2015
UTFSM - June 2012
29
Di Vicenzo’s Criteria for Physical
Implementation of a Quantum Computer
1.
2.
3.
4.
5.
Scalable physical system with well characterized qubits.
Initialize the qubits state as |000…00>.
Long decoherence times.
Universal set of quantum gates (operations).
Qubit specific measurements
7/21/2015
UTFSM - June 2012
30
Deutsch’s problem

Consider a black box characterized by a transfer function that maps
a single input bit x into an output, f(x). It takes the same amount of
time, T, to carry out each of the four possible mappings performed
by the transfer function f(x) of the black box:
f(0) = 0
f(0) = 1
f(1) = 0
f(1) = 1

The problem posed is to distinguish if
7/21/2015
f (0) 
f (1)
f (0) 
f (1)
UTFSM - June 2012
31
0
f(0)
1
0
f(0)
1
f(1)
f(1)
2T
(a)
T
(b)
|x>
|x>
Uf
|y>
| y > O+ f(x) >
T
(c)
7/21/2015
UTFSM - June 2012
32
A quantum circuit to solve Deutsch’s problem
|0>
H
|x>
|x>
H
Uf
|1>
H
0
7/21/2015
|y>
| y > +O f(x)
1
2
UTFSM - June 2012
3
33
0
0
 
1
0
    1
 0 1         
0 1 0
0
 
1 1

G1  H  H 
2 1
1
1
1

1 1
 G 1 0  
2 1

1

1 
1 1


 1 
2 1
1
1
1
1
1
1
1
1
1

1  1 1

 1  2  1

1

1
1
1
1
1
1
1
1
1 

 1
 1

1 
1  0 
 1 
 
 
 1  1  1   1 
  



1 0
2 1
 
 



  1
1  0 
 
 0  1  0  1 
 ( 00  01  10  11 )  


2
2 
2 

1
x 
0  1
2
7/21/2015
y 
0  1
2
UTFSM - June 2012
34
y  f (x) 
0  1
 f ( x)
2

0  f ( x)  1  f ( x)

2
y  f ( x )  (  1)
f (x)
f ( x)  1  f ( x)
2
0  1
2
 0  1


2
y  f ( x)  
0  1


2
7/21/2015
if
f ( x)  0
if
f ( x)  1
UTFSM - June 2012
35
x 
0  1

 1 
 

0  1




0

1
0

1
1   1

y 


  

2 
2  2 1
2

 

  1

 
 2  x  ( y  f ( x ))  
 1 

 
  0  1  0  1 
1   1
 

  
2 1
2 
2 
 
 
  1

 

2
2
7/21/2015

 1 
 





0

1
0

1
1   1




 
 
2
2


 2   1

 1 

 
 x  ( y  f ( x ))  
 1 

 
  0  1  0  1 
1   1
 

  
2 1
2 
2 
 
 
 1 

 

UTFSM - June 2012
if
f ( 0 )  f (1)  0
if
f ( 0 )  f (1)  1
if
f ( 0 )  0 , f (1)  1
if
f ( 0 )  1, f (1)  0
36
2
7/21/2015






 x  ( y  f ( x ))  






 1 
 
1   1
2 1 
 
  1
 
 1 
 
1   1
2   1
 
 1 
 
UTFSM - June 2012
if
f ( 0 )  f (1)
if
f ( 0 )  f (1)
37
1 1

G3  H  I 
2 1
3

1


 1  0


2 1


0


 G 3 2  
1


 1 0


2 1


0



7/21/2015
1  1
  
 1  0
1

0
1 0
 

1
2 1

0

0
1
1
0
0
1
1
0
0 

1 
0 

 1 
0   1 
 1 
  
 
1 0
1  1   1
0  1
1   1

0





0 1 0 2 1
2 0
2
  
 
 0 
1 0  1    1 
 
0 1
0   1 
 0 
  
 
1 0
1  1   1
0  1
1  0 

1





0 1 0 2 1
2 1
2
  
 
  1
1 0  1   1 
 
0
1
UTFSM - June 2012
if
f ( 0 )  f (1)
if
f ( 0 )  f (1)
38
Evrika!!

By measuring the first output qubit we are able to determine f ( 0 )  f (1)
performing a single evaluation.
 3   f ( 0 )  f (1)
0

f ( 0 )  f (1)  
 1
7/21/2015
0  1
2
if
f ( 0 )  f (1)
if
f ( 0 )  f (1)
UTFSM - June 2012
39
The next seminar: Tuesday June 11, 2012

Quantum computational models; quantum algorithms





The quantum circuit model
Deutsch-Josza algorithm
Bernastein-Vazirani algorithm
Amplitude amplification
Grover's quantum search algorithm
7/21/2015
UTFSM - June 2012
40