34
Quantum computing and cryptography

Computer Science Final Project

Embed Size (px)

Citation preview

Page 1: Computer Science Final Project

Quantum computing and cryptography

Page 2: Computer Science Final Project

“Quantum computing ranges an endless concept”

Page 3: Computer Science Final Project

Content we'll see over

● Motivation and goals

● Introduction to quantum computing

● Quantum computing basis

● Postulates overview

● Shor's algorithm

● Introduction to quantum cryptography and BB84

● BB84 protocol functioning

● Example of the protocol

● Explanation of BB-84 Web Simulator with a demonstration

● Future of the project

● Conclusions

Page 4: Computer Science Final Project

Motivation and goals

Motivation➢ Discover a little bit more

the quantum world

➢ Make out how is evolving the quantum computing from a computer engineer view

Goals➢ Comprehend the

principles of quantum computing

➢ Understand its most powerful algorithm

➢ Interpret the future cryptography which is based on quantum principles

Practical goals➢ Implementation of Shor's algorithm in QCL

➢ Development of a Web simulator based on BB-84 protocol

Page 5: Computer Science Final Project

Origins of quantum computing

● In 1980's decade several physicists, such as Paul Benioff and Richard Feynman, proposed the idea of using quantum laws in the field of computation in order to simulate quantum problems (or dilemmas)

● Moreover in a few years we will hit natural limits on the size of transistors

• Max out on the number of transistors per chip• Reach the minimum size for transistors

Page 6: Computer Science Final Project

What is quantum computing?

● Definition: Use of quantum phenomenon to perform computational operations

● Operations are done at an atomic level

● It allows the encoding of bits as physical states

– Direction of spin of an electron

– The direction of polarization of a photon

– The energy level of an excited atom

Page 7: Computer Science Final Project

What is a qubit?

● A qubit is a bit represented by a quantum system is governed by the laws of quantum physics.

● So a qubit (an electron, commonly used as a qubit, is always in one of two spin states) can take two distinct values:

– State 0 goes with the spin up

– State 1 goes with the spin down

Page 8: Computer Science Final Project

Quantum vs. Transistor

● In conventional computing, a bit is 0 or 1. Equivalent to switching a light switch on and off.

● But under a quantum basis, a qubit is 0 and/or 1.

● This superposition of states is what makes quantum computing fundamentally different and so powerful.

Page 9: Computer Science Final Project

Postulates

● A set of 4 mathematical postulates describes quantum computing:

– State Space

– Evolution

– Measurement

– Composite systems

Page 10: Computer Science Final Project

State Space Postulate

● Associated with any isolated physical system is a complex vector space with inner product (a Hilbert space) known as the state space of the system. The physical state of the system is completely described by its state vector, which is a unit vector in the system’s state space.

● The simplest quantum mechanical system is the qubit, which has a 2-d state space. With an orthonormal basis {|0⟩,|1⟩} the most general state vector of a qubit can be expressed as

|Ψ⟩ = α|0⟩ + β|1⟩,

where α,β Є C and IαI²+IβI² = 1.

Page 11: Computer Science Final Project

● The evolution of a closed quantum system is described by a unitary transformation. The state vector |Ψ⟩ of a system at time t₁ is related to its state vector |Ψ'⟩ at time t₂ by a unitary operator U which depends on t₁, t₂,

|Ψ'⟩ = U|Ψ⟩.● The Pauli matrices and the Hadamard gate (H) are all 2x2

unitary matrices, and so describe valid qubit transformations.

Evolution Postulate

Page 12: Computer Science Final Project

Measurement Postulate

● We cannot know the exact state of a quantum system because measuring implies disrupting.

● Regardless of a certain superposition α|0⟩ + β|1⟩, we get |0⟩ with a probability ||α||² or |1⟩ with a probability ||β||² as a result of the measure.

● Let's recall the first postulate where IαI²+IβI² = 1, which means the quantum state is unitary (normalized).

Page 13: Computer Science Final Project

System Composition Postulate

● The state |Ψ⟩ of a composite system is the tensor product of the quantum sub-systems:

U |Ψ ⟩⊗U |Ψ ⟩ = (U ⊗U )(|Ψ ⟩⊗|Ψ ⟩) ● A 2-qubit system example with |Ψ ⟩=α|0⟩+β|1⟩ and |Ψ ⟩=γ|0⟩+δ|1⟩ .

Page 14: Computer Science Final Project

Bloch Sphere

The Bloch Sphere is a representation of a qubit, the fundamental building block of quantum computers.

The most general state vector of a qubit can be expressed as

where θ is the polar angle and φ is the az-imuthal angle of the unit vector in 3-d real vector space.

Page 15: Computer Science Final Project

Important as well...

Quantum computing offers:

reversible computing which means we can recover the input data with the output data.

a framework based on quantum gates (similar to the logic gates) in order to design algorithms.

a Quantum Fourier Transform which is much more powerful than the classical Fast Fourier Transform. (Essential maths for factorizing)

Page 16: Computer Science Final Project

● The inner implementation of the QFT requires profound math concepts and prolonged understanding.

● QFT is vital to factorize numbers in Shor's algorithm in the same way as FFT in classical computing algorithms.

● Factorizing an N-bit number implies a 2^N-bit register on which a Fourier Transform is applied.

● Cost analysis:

– Classic way →

– Quantum way →

Quantum vs. Fast

Page 17: Computer Science Final Project

Quantum vs. Fast (II)

As a sample of quantum computing potential, on the right and bottom are shown the cost representations of factorizing an RSA code of 170 decimal digits (563 bits):

Page 18: Computer Science Final Project

Quantum Computer Language

● QCL is the most advanced implemented quantum programming language.

● Its syntax resembles syntax of the C programming language and classical data types are similar to data types in C.

● A quantum programme example:qureg x1[2]; // 2-qubit quantum register x1

qureg x2[2]; // 2-qubit quantum register x2

H(x1); // Hadamard operation on x1

H(x2[1]); // Hadamard operation on the first qubit of the register x1

Page 19: Computer Science Final Project

Quantum Computer Language (II)

● Workbench goes by console.

Page 20: Computer Science Final Project

Shor's algorithm (N)

I. Pick a random number a < N.

II. Compute gcd(a, N) – greatest common divisor.

III. If gcd(a, N) ≠ 1, then there is a non-trivial factor of N, so we're done.

IV. Otherwise, use the period-finding function to find r, the period of the following function: f(x) = a^x mod N.

V. If r is odd, go back to step I.

VI. If a^(r /2) ≡ −1 (mod N), go back to step I.

VII. gcd(a^(r/2) ± 1, N) returns a nontrivial factor of N. We are done.

For instance: gcd(4 ± 1, 15) → 3 (factor of N)

Page 21: Computer Science Final Project

Quantum Cryptography

As of this slide, a slight hop in the same quantum world is done, from computing to cryptography.

Page 22: Computer Science Final Project

BB-84 Protocol

● History:

– Published in 1984

– Charles Bennett and Gilles Brassard● Resources:

– Same quantum mechanics postulates

– Utility of light particles (photons)

– Taking advantage of optical fiber

Page 23: Computer Science Final Project

BB-84 Essential Tips

● Each photon represents a bit of information

● Alphabet of communication extended:

● Two actors intervene in the protocol: Alice and Bob

● A third actor might be a spy

Basis 0 1

+ ↑ →

x ↘ ↗

Page 24: Computer Science Final Project

BB-84 Step by Step

1. Alice generates a random key

2. Alice codifies each bit into a qubit and then sends these over to Bob

3. She uses two alphabets to codify the key

4. Bob chooses randomly the alphabet to measure

0 1

Rectilinear basis 0º → |0⟩ 90º ↑ |1⟩

Diagonal basis 45º ↗ |0 +|1⟩ ⟩ 135º ↘ |0 -|1⟩ ⟩

Page 25: Computer Science Final Project

BB-84 Step by Step

5. Bob results

See whether basis coincides or not. In other words, check compatibility.

Page 26: Computer Science Final Project

BB-84 Estimation Error

To clarify how much error Bob produces to the global key:

Bob chooses qubit basis randomly

Wrong Correct50% 50%

Correct

100%

Reads qubit stateReads qubit state

CorrectWrong

50%50%

It is estimated that 25% of the key is wrong

Page 27: Computer Science Final Project

Example

Alice's bit 0 1 1 0 1 0 0 1

Alice's basis + + x + x x x +

Alice's polarization ↑ → ↘ ↑ ↘ ↗ ↗ →

Bob's basis + x x x + x + +

Bob's measurement ↑ ↗ ↘ ↗ → ↗ → →

Public discussion

Shared Secret Key 0 1 0 1

Page 28: Computer Science Final Project

BB-84 Security

● If Eve does the same as Bob:

Eve knows 75% of the bits Alice sent.

Bob knows 75% of the bits Alice sent.

● Nonetheless Alice and Bob are able to detect Eve.

● Eve causes an error of 25% in Bob's key.

Page 29: Computer Science Final Project

BB-84 Web Simulator

● Concept

– As BB-84 is quite unknown, it's been developed a Web simulator based on its cryptographic idea.

● Technology

– Ruby on Rails (Back-end)

– Twitter Bootstrap (Front-end)

– PostgreSQL (Data Base)

Page 30: Computer Science Final Project

Functionalities

Page 31: Computer Science Final Project

Demonstration

➔ Simulate a 32-bit key distribution between Alice and Bob

● Addition of a 10% communication error due to the channel physics

● Setting 50% digit proportion by which Eve is going to be detected (when simulating with an spy in the middle of the channel)

Let's start

Page 32: Computer Science Final Project

Time Planification

Research on Quantum Computing - 200 h

Understanding and implementation of Shor's algorithm - 100 h

Research on Quantum Cryptography - 100 h

Learning Ruby on Rails - 100 h

Web Simulator development - 100 h

Composition of report - 200 h

Page 33: Computer Science Final Project

Future of the project

● Detailing the Discrete Fourier Transform (QFT)

● Go deeper about the postulates

● Implement Deutsch and Grover's algorithms

● Explanation of the different technological attempts to build a quantum computer

Page 34: Computer Science Final Project

Conclusions

● Long experience on computer science is reflected to the evolution of the research on quantum computing. Many errors haven't been made and won't be made again.

● Quantum computers won't come true to a few years more. But quantum cryptography has been proved in several countries efficiently, which means that it won't take that long.

● Ruby on Rails is an excellent technology to work with. It permits build up consistent web applications in a few time once one knows how it works.