Sunteți pe pagina 1din 5

Introduction

Last lecture, we:


• discussed various properties of qubit states
Lecture 5: Quantum Logic
In this lecture we will:
Dr Iain Styles: I.B.Styles@cs.bham.ac.uk • Introduce some common quantum logic gates
• Describe some simple quantum circuits
• Analyse simple circuits

Lecture 5: Quantum Logic – p.1/17 Lecture 5: Quantum Logic – p.2/17

Basic Quantum Logic Quantum Logic Gates

• We all know that modern computers are built from networks of logic • The quantum analogue of the NOT gate is easy to picture
gates • The other classical gates that we known and “love” are not so easy to
• Quantum computing uses logic gates in a similar way: networks of them transfer to the quantum world
are constructed to perform certain operations • All quantum gates must be reversible: classical AND, OR etc are not!
• There are many more possible quantum gates (infinitely many) • We will not use these familiar gates as they require effort to be useful,
• They must all be reversible (due to unitarity) and do not do all that we require
• So we can represent them with a unitary matrix • We will introduce some new gates!
! !
• Example: Quantum NOT gate: a0 a1
7→
a1 a0
!
• The matrix which does this transformation is X = 0 1
:
1 0
! ! !
0 1 a0 a1
=
1 0 a1 a0
Lecture 5: Quantum Logic – p.3/17 Lecture 5: Quantum Logic – p.4/17
Controlled NOT (CNOT) Controlled-Controlled NOT

A B A’ B’ A B C A’ B’ C’
0 0 0 0 0 0 0 0 0 0
• Quantum CNOT gate: 0 1 0 1 0 0 1 0 0 1
0 1 0 0 1 0
1 0 1 1 Quantum CCN Gate: 0 1 1 0 1 1
1 1 1 0 1 0 0 1 0 0
1 0 1 1 0 1
1 1 0 1 1 1
   
a00 a00
a  a      1 1 1 11 0 
• The transformation is therefore  01   01 
  7→   a000 a000 1 0 0 0 0 0 0 0
a10  a11 
a001  a001  0 1 0 0 0 0 0 0
     
a11 a10     
0

a010 
 
a010 
   0 1 0 0 0 0 0

  0
1 0 0 0
a 
 011 
a 
 011  0 0 1 0 0 0 0
 7→   with matrix NCC =
 
0 0 0 0 1 0 0 0
0 1 0  
• and is represented by the matrix NC =  0
 a100 
 
a100 
   
0 0 0

1
 a101  a101  0 0 0 0 0 1 0 0
     
0 0 1 0 a a 0 0 0 0 0 0 0 1
     
 110   111 
a111 a110 0 0 0 0 0 0 1 0
Lecture 5: Quantum Logic – p.5/17 Lecture 5: Quantum Logic – p.6/17

Controlled Exchange Quantum Gates with no Classical Counterpart

A B C A’ B’ C’ • The NOT, CN, CCN and CEX gates are all gates which can exist in both
0 0 0 0 0 0 classical and quantum worlds
0 0 1 0 0 1 • There are many other gates with no classical analogue:
0 1 0 0 1 0
Quantum CEX Gate:
! !
0 1 1 0 1 1 • The Y and Z gates: Y = 0 −i 1 0
1 0 0 1 0 0 ,Z=
i 0 0 −1
1 0 1 1 1 0
1 1 0 1 0 1 • Together with the X, these are known as the Pauli matrices
1 1 1 1 1 1 !
    
• The Hadamard Gate: H = √1 1 1
a000 a000 1 0 0 0 0 0 0 0
2 1 −1
a001  a001  0 1 0 0 0 0 0 0
     

a010 
 
a010 
 
0 0 1 0 0 0 0

0 • H is one of the most useful quantum gates: it takes classical states
(|0i , |1i) to to states “halfway” between |0i and |1i:
     
a  a  0 0 0 1 0 0 0 0
 011   011 
 7→   with matrix XC = 
 
0 0 0 0 1 0 0 0
 
a100  a100  1
H |0i = √ (|0i + |1i)
     
a101  a110  0 0 0 0 0 0 1 0
      2
a110  a101  0 0 0 0 0 1 0 0
     
1
a111 a111 0 0 0 0 0 0 0 1 H |1i = √ (|0i − |1i)
2
Lecture 5: Quantum Logic – p.7/17 Lecture 5: Quantum Logic – p.8/17
More New Gates Analysing Quantum Circuits

• So far, we’ve represented quantum gates with matrices


!
• We also have the Phase Gate: S = 1 0
0 i • It will often be useful to adopt a graphical representation:
!
• The T gate: T = 1 0 I1 Q1
π
0 ei 4 I2 Q2
! |Qi = U |Ii 7→ U
• and the Rk gate: Rk = 1 0
0 e 2πi/2k IN QN
• Note that S = R2 and T = R3
• Each I/O line represents one qubit, e.g, for the X gate:
• These seem a bit arbitrary, but all have been found to be useful in
various quantum algorithms. We’ll be using some of them later. I X Q
• The analysis of circuits made from quantum gates is quite
straightforward: all we have to do is apply the matrices in the right order.

Lecture 5: Quantum Logic – p.9/17 Lecture 5: Quantum Logic – p.10/17

A Simple Circuit Another Example

Example: NOT-NOT In this example, we will use the Controlled-Z gate:


 
I’ 1 0 0 0
I X X Q 0 1 0 0
|I> |Q> with matrix Zc = 
 
0 0 1 0

! ! ! ! Z
a0 0 1 a0 a1 0 0 0 −1
• Let |Ii = . Then |I ′ i = X |Ii = =
a1 1 0 a1 a0 Consider the circuit
! ! !
• We then have |Qi = X |I ′ i = 0 1 a1 a0 |I> |I’> |Q>
=
1 0 a0 a1 Z
• This is what we would expect from NOT-NOT: no change
It should be clear that |I ′ i = Zc |Ii, and |Qi = Nc |I ′ i.
• We write this as |Qi = X |I i = XX |Ii = X |Ii
′ 2 So |Qi = Nc Zc |Ii (note the order)
    
! ! ! 1 0 0 0 1 0 0 0 1 0 0 0
• Note that X =2 0 1 0 1 1 0
= , and we can express the 0 1 0 0 0 1 0 0  0 1 0 0
1 0 1 0 0 1 Then Nc Zc = 
 
=
  
0 0 0 1 0 0 1 0  0 0 0 −1
 
entire circuit with a single matrix!
0 0 1 0 0 0 0 −1 0 0 1 0
Lecture 5: Quantum Logic – p.11/17 Lecture 5: Quantum Logic – p.12/17
A Harder Example A Harder Example

• In the algorithms we will study next week, we will need to be able to • The basis states transform in the following way:
analyse circuits which contain both one- and two-input gate. This is a bit
more complicated. 1
|00i 7→ √ (|00i + |10i)
• Consider the circuit 2
1
H |01i 7→ √ (|01i + |11i)
2
|I> |I’> |Q> 1
|10i 7→ √ (|00i − |10i)
2
• Clearly |Qi = Nc |I ′ i, but how do we find matrix M such that |I ′ i = M |Ii? 1
|11i 7→ √ (|01i − |11i)
• The Hadamard gate H only acts on one bit of our state 2
• Its action on the first bit is H |0i = √1 (|0i + |1i), and H |1i = √1 (|0i − |1i)  
2 2 1 0 1 0
• |Ii is defined on the basis {|00i , |01i , |10i , |11i} 0 1 0 1
• The matrix for this is M = √1  
2 1 0 −1 0 
 

0 1 0 −1

Lecture 5: Quantum Logic – p.13/17 Lecture 5: Quantum Logic – p.14/17

A Harder Example Creating Bell States

• So |I ′ i = M |Ii and hence |Qi = M |I ′ i = Nc M |Ii. We need to calculate • The new states are all entangled pairs (Bell states): if one of the qubits is
measured, we automatically know what the other one is without
measuring it
    
1 0 0 0 1 0 1 0 1 0 1 0
1 0
 1 0 0  0
  1 0 1 1 0 1 0
 1 • Starting with an initially independent set of qubits, we can form a
Nc M = √  = √ 

2 0 0 0 1  1 0 −1 0 2 0 1 0 −1 composite state and pass it through this circuit in order to create
 

0 0 1 0 0 1 0 −1 1 0 −1 0 entangled pairs
H
• This is unitary, as required and expected
|I> |I’> |Q>
• This is actually quite an important quantum circuit: it acts on the basis
states in the following way:

1 1
|00i 7→ √ (|00i + |11i) |01i 7→ √ (|01i + |10i)
2 2
1 1
|10i 7→ √ (|00i − |11i) |11i 7→ √ (|01i − |10i)
2 2

Lecture 5: Quantum Logic – p.15/17 Lecture 5: Quantum Logic – p.16/17


Conclusions

In this lecture we have:


• Introduced some common quantum logic gates
• Shown how to analyse networks of quantum logic gates
• Shown how to create entangled pairs using quantum logic gates
Next lecture we will:
• Introduce the Quantum Fourier Transform

Lecture 5: Quantum Logic – p.17/17

S-ar putea să vă placă și