building a quantum key distribution system › sites › phy.duke.edu › files › file... · the...

124
Building a Quantum Key Distribution System by Yu-Po Wong Department of Physics Duke University Date: Approved: Dr. Daniel J. Gauthier, Advisor Dr. Henry Greenside Dr. Jungsang Kim Dr. Stephen W. Teitsworth Thesis submitted in partial fulfillment of the requirements for graduation with distinction in the degree of Bachelor of Science in the Department of Physics at Trinity College of Duke University 2012

Upload: others

Post on 29-May-2020

2 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Building a Quantum Key Distribution System

by

Yu-Po Wong

Department of PhysicsDuke University

Date:Approved:

Dr. Daniel J. Gauthier, Advisor

Dr. Henry Greenside

Dr. Jungsang Kim

Dr. Stephen W. Teitsworth

Thesis submitted in partial fulfillment of the requirements for graduation withdistinction in the degree of Bachelor of Science in the Department of Physics

at Trinity College of Duke University2012

Page 2: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Copyright c� 2012 by Yu-Po WongAll rights reserved except the rights granted by the

Creative Commons Attribution-Noncommercial Licence

Page 3: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Abstract

One early and important application of the emerging field of quantum information is

quantum key distribution (QKD). QKD is a method to distribute cryptographic keys

through a quantum channel. The primary difference between quantum and classical

key distribution is that QKD uses a fundamental property of quantum mechanics,

known as wavefunction collapse, to increase its performance over existing classical

communication systems. Quantum key distribution has been proven to be funda-

mentally secure against eavesdropping, and may have important uses in securing

information communicated between parties, such as in the smart power grid or in

the financial industry. Another fundamental property of quantum mechanics, known

as quantum entanglement, is usually used to set up a QKD system without a single

photon source.

The main goal of this research project is to build a QKD system for an advanced

physics laboratory course. In this project, I use the entanglement of the polarization

of photons to store and to transmit information. The polarization-entangled pho-

tons are created from a nonlinear optical process known as spontaneous parametric

down-conversion (SPDC). Experimentally, I send a strong laser beam (pump) into

a nonlinear crystal where there is a small probability that the pump photon is an-

nihilated and two lower-energy photons with correlated polarizations are created. I

characterize the quality of quantum entanglement from SPDC and study the meth-

iii

Page 4: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

ods to improve the quality of the entanglement, which is important for generating a

key with the highest fidelity and rate. The way I quantify the quality of quantum

entanglement is tangle $ (T%), where it is 100% if the state is fully entangled and

it is 0% if the state if fully un-entangled. Finally, I get the T% of the quantum

entangled photon pairs up to 72.6% with temporal compensation technique. This

value can be further improved with spatial compensation technique.

For my QKD system, I developed the high-speed electronics with field-programmable

gate array (FPGA) with Verilog hardware description language and a PC with Lab-

View program. The FPGA and PC is communicated through RS-232 interface.

Using this system, I achieve a data rate of 0.936 bit/s with 10.9% error rate. The

bit rate is limited by the speed of our FPGA board and can be improved with a

faster FPGA board. The error rate can also be improved with with a faster FPGA

board since most of the errors come from the accidental coincidence counts in the

large coincidence window (1 µs) set by the 1 MHz time-bin clock.

iv

Page 5: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Contents

Abstract iii

List of Tables ix

List of Figures xi

Acknowledgements xiii

1 Introduction 1

1.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Quantum Key Distribution . . . . . . . . . . . . . . . . . . . . . . . . 2

1.2.1 BB84 Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.3 Quantum Entanglement and Bell’s Inequality . . . . . . . . . . . . . 7

1.3.1 Definition of Quantum Entanglement . . . . . . . . . . . . . . 8

1.3.2 Hidden Variable Theory . . . . . . . . . . . . . . . . . . . . . 8

1.3.3 Bell’s Inequality . . . . . . . . . . . . . . . . . . . . . . . . . . 8

1.4 Spontaneous Parametric Down Conversion . . . . . . . . . . . . . . . 9

1.5 Quantum Key Distribution with Quantum Entanglement . . . . . . . 13

1.5.1 E91 Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

1.5.2 Our Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

2 Experimental Apparatus 19

2.1 Part I: Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

2.1.1 Laser . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

v

Page 6: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

2.1.2 Down-conversion Crystals . . . . . . . . . . . . . . . . . . . . 21

2.2 Part II: Detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

2.2.1 Half Wave-plates . . . . . . . . . . . . . . . . . . . . . . . . . 25

2.2.2 Polarizing Beam Splitter . . . . . . . . . . . . . . . . . . . . . 27

2.2.3 Bandpass Filter . . . . . . . . . . . . . . . . . . . . . . . . . . 28

2.2.4 Multi-mode Fiber . . . . . . . . . . . . . . . . . . . . . . . . . 29

2.2.5 Single Photon Counting Module . . . . . . . . . . . . . . . . . 29

2.3 Part III: Electronics . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

2.3.1 Field-programmable Gate Array . . . . . . . . . . . . . . . . . 30

2.3.2 LabView Program . . . . . . . . . . . . . . . . . . . . . . . . 31

3 Theory 33

3.1 Phase-matching of SPDC in Nonlinear Crystal . . . . . . . . . . . . . 33

3.1.1 Degenerate Perfect Phase-matching and Calculation of the Crys-tal Cut Angle . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

3.1.2 General Phase-matching . . . . . . . . . . . . . . . . . . . . . 36

3.2 Quantum Entanglement with SPDC with Type-I Phase-matching . . 37

3.2.1 Temporal Decoherence and Compensation . . . . . . . . . . . 38

3.2.2 Spatial Decoherence and Compensation . . . . . . . . . . . . . 39

3.3 Characterization of Quality of Quantum Entanglement . . . . . . . . 41

3.3.1 Simplified Model for Quantum State from SPDC . . . . . . . 41

3.3.2 Characterization of Quantum Entanglement . . . . . . . . . . 42

3.3.3 Measure Tangle from Experiment by Using Simplified Model . 43

3.3.4 Measure Tangle from Quantum State Tomography . . . . . . . 44

3.4 Characterization of the Efficiency of the Detector Part of the System 44

3.4.1 Theoretical Estimation . . . . . . . . . . . . . . . . . . . . . . 44

3.4.2 Experimental Characterization of Heralding Efficiency . . . . 45

vi

Page 7: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

3.4.3 Possible Explanations of Difference between Theoretical andExperimental Result . . . . . . . . . . . . . . . . . . . . . . . 47

3.5 Selection of the Size of the Time-bin . . . . . . . . . . . . . . . . . . 48

4 Experiment Procedures 50

4.1 Preparation of Entangled Photon Pair Source and Set up the DetectionOptics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

5 Results 54

5.1 Quality of Polarization Entangled Photon Pair Source . . . . . . . . . 54

5.1.1 With Temporal Compensation . . . . . . . . . . . . . . . . . . 54

5.1.2 Without Temporal Compensation . . . . . . . . . . . . . . . . 56

5.1.3 Separating Spatial Decoherence . . . . . . . . . . . . . . . . . 56

5.2 Density Matrix for the State from SPDC and the Imperfect Polariza-tion Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

5.2.1 Using the Simplified Model . . . . . . . . . . . . . . . . . . . . 58

5.2.2 Quantum State Tomography . . . . . . . . . . . . . . . . . . . 59

5.3 Bell’s Inequality Measurement . . . . . . . . . . . . . . . . . . . . . . 60

5.4 QKD System Performance and Data . . . . . . . . . . . . . . . . . . 61

5.5 Discussion on the QKD Performance . . . . . . . . . . . . . . . . . . 64

6 Conclusion 67

A Verilog HDL Codes for QKD Circuit on FPGA 69

A.1 QKD.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69

A.2 pulse shortener.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

A.3 gate chain 13.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

A.4 gate chain 19.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

A.5 gate chain 23.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

A.6 inverter.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

vii

Page 8: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

A.7 buffer.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87

A.8 mux4to1.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

A.9 time bin counter.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

A.10 data counter.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

A.11 sift.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88

A.12 byte counter.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89

A.13 word counter.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

A.14 Trigger.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90

A.15 trigger counter.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

A.16 baud counter.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

A.17 data out.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92

A.18 coincidence pulse.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

A.19 data trigger counter.v . . . . . . . . . . . . . . . . . . . . . . . . . . 100

A.20 counter.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

A.21 BCD counter.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

A.22 bcd choose.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100

A.23 BCD C.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

A.24 BCD C C.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

A.25 science out.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103

A.26 BCD display.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

A.27 scale choose.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105

A.28 bar.v . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106

Bibliography 108

viii

Page 9: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

List of Tables

1.1 Example of BB84 QKD Protocol . . . . . . . . . . . . . . . . . . . . 6

1.2 Example of Our QKD Protocol . . . . . . . . . . . . . . . . . . . . . 16

2.1 Characterization Data for the Polarizing Beam-Splitters . . . . . . . . 28

3.1 Constants for Sellimeir Equations for BiBO Crystal . . . . . . . . . . 34

3.2 Efficiency of Optical Elements in Detector Part . . . . . . . . . . . . 44

3.3 Experiment Data to Calculate Heralding Efficiency . . . . . . . . . . 46

3.4 Experiment Data to More Carefully Estimate Total Efficiency . . . . 47

3.5 Possibility of Time-Bin with Different Arriving Photon Numbers withPoisson Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . 49

5.1 Experiment Data to Determine the Quality of Entangled Photon Pairswith Temporal Compensation . . . . . . . . . . . . . . . . . . . . . . 55

5.2 Experiment Data to Determine the Quality of Entangled Photon Pairswithout Temporal Compensation . . . . . . . . . . . . . . . . . . . . 56

5.3 Experiment Data and Result for the Quality of Entangled PhotonPairs with Temporal Compensation and Different Aperture Size . . . 57

5.4 Experiment Data for Quantum Tomography . . . . . . . . . . . . . . 59

5.5 Experiment Data for Bell’s Inequality Measurement . . . . . . . . . . 61

5.6 Experiment Data for our QKD System with Pump Laser Current =60mA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

5.7 Experiment Data for our QKD System with Pump Laser Current =80mA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

ix

Page 10: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

5.8 Experiment Data for our QKD System with Pump Laser Current =120mA. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

5.9 Experimental Performance for our QKD System with Different Setup. 64

5.10 Theoretical Performance for our QKD System with Different Setup. . 65

x

Page 11: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

List of Figures

1.1 Schematic of a QKD system for secure communication . . . . . . . . 3

1.2 Schematic of SPDC . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.3 Schematic of Phase-matching Conditions . . . . . . . . . . . . . . . . 10

1.4 Schematic of Down-conversion Cones . . . . . . . . . . . . . . . . . . 12

1.5 Schematic of Entangled Photon Pairs from Double-crystal SPDC withType-I Phase-matching . . . . . . . . . . . . . . . . . . . . . . . . . . 13

1.6 Schematic of Overlap of Down-conversion Cones from Double-crystalSPDC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

1.7 Examples of Valid and Invalid Time-bins . . . . . . . . . . . . . . . . 18

2.1 Experimental Setup for Source Part . . . . . . . . . . . . . . . . . . . 20

2.2 Relation between Input Current and Output Light Power . . . . . . . 21

2.3 Spectrum for our laser diode and a stabilized laser from a OpticalSpectrum Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2.4 Schematic of Geometry of Beams from Phase-matching with SingleCrystal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

2.5 Schematic of the Pump Direction in the Crystal Coordinate . . . . . 24

2.6 Experimental Setup for Detector Part . . . . . . . . . . . . . . . . . . 25

2.7 Ideal Experimental Setup for Detector Part . . . . . . . . . . . . . . 26

2.8 Polarizing Beam-Splitter . . . . . . . . . . . . . . . . . . . . . . . . . 28

2.9 Transmission Spectrum for Bandpass Filter . . . . . . . . . . . . . . . 29

2.10 Experimental Setup for Electronics Part . . . . . . . . . . . . . . . . 30

xi

Page 12: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

3.1 Schematic of the Signal Direction in the Pump Coordinate . . . . . . 35

4.1 Schematic of the Experimental Setup . . . . . . . . . . . . . . . . . . 51

xii

Page 13: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Acknowledgements

Many people have made my four years as undergraduate student fun and productive.

First, I would like to thank my advisor, Professor Daniel Gauthier, for his count-

less hours of patient guidance and support. He gave me the opportunity to work in

his research group and support me to get funding to do summer research at Duke

from my freshmen summer. He gave me lots of freedom to explore any topics in his

lab and the opportunity to be independent researcher that few other undergraduates

have access to. He also helped me a lot on improving writing and presentation skills.

I greatly appreciate his advice and support throughout my undergraduate career and

sincerely thank him.

Other Duke professors have also contributed to my accomplishments. My thanks

to my committee members, Professor Jungsang Kim, and the Director of Undergrad-

uate Studies, Professor Henry Greenside, and Professor Stephen Teitsworth. I would

like to thank Professor Jungsang Kim on formally introducing me to the field of

quantum information through his lectures and allowing me work in his lab through-

out my first summer. I would like to thank Professor Henry Greenside for giving me

lots of useful advices on life and academics at Duke.

I would also like to thank the other members of Professor Gauthier’s Quantum

xiii

Page 14: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Electronics Group. I’d like to thank Hannah Guilbert for guiding me through lots

of research problems and help me a lot on improving my writing skills. I’d like to

thank Hugo, Rui, Damien, Joel, Kristine, Seth, Rena, Bonnie, Mei for answering my

questions in lab and giving me a good environment to work in the group.

I would like to thank my girlfriend, Sharon, for supporting me throughout past

three years on many aspects of my life. I would like to thank my intramural volley-

ball team for helping me keep a balanced and health life style.

Most important, I would like to thank my parents for giving me the opportunity

to study abroad and supporting me to study any subjects I’m interested in.

Part of this project was made possible by funds from the Duke Deans’ Summer

Research Fellowship.

xiv

Page 15: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

1

Introduction

1.1 Background

Quantum key distribution (QKD) is an important application of quantum informa-

tion. QKD can distribute secret keys, which can be used as private key in cryp-

tography, between two parties. It was first proposed by Charles Bennett and Gilles

Brassard in 1984 (BB84) [1]. It utilize a fundamental property of quantum me-

chanics, known as wavefunction collapse, to increase performance over classical com-

munication system on security. It has been proven to be fundamentally secure to

eavesdropping attacks and could play an important role in the future communication

system [2, 3, 4]. Because of the lack of good single photon sources, another funda-

mental property of quantum mechanics, known as quantum entanglement, is usually

used to set up a QKD system.

The main goal of this research project is building up a QKD system and experi-

mentally demonstrating the practice of a QKD system. Error correction and privacy

amplification are applied on the data from the QKD system to show the entire steps

1

Page 16: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

of a complete QKD system. This experimental setup will be moved to the advanced

lab for undergraduate studies and serve as an experiment in “Advanced Physics Lab

and Seminar” course (PHY 217S).

Experimentally, I use spontaneous parametric down conversion (SPDC) to create

quantum entangled photon pairs. I study the properties of SPDC and optimize the

quality of the quantum entanglement by doing temporal compensation. I then use

the polarization entanglement of the photon pairs to do QKD with a scheme similar

to BB84 protocol. In order to physically implement the QKD protocol, I also set up

high-speed electronics with FPGA and a RS-232 interface to communicate between

FPGA and a PC.

1.2 Quantum Key Distribution

Quantum key distribution (QKD) is a way to securely distribute cryptographic pri-

vate keys between two parties. The private keys are very useful to act as one-time

pads in cryptography, where every bit information in the private keys is only used

once to encode the plaintext, but people were not able to find a good way to se-

curely distribute them before the proposal of QKD. In cryptography, the two parties

communicate with each other are usually called as “Alice” and “Bob”, and the eaves-

dropper trying to attack the system is usually called “Eve”. A schematic of a QKD

system for secure communication is in Fig. 1.1.

The secure communication will be executed in the following steps:

1. Alice uses QKD to send Bob private keys through the quantum channel with

some communication in the classical channel.

2. Bob uses the private keys to encrypt the messages and send the encrypted

2

Page 17: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Alice Bob

Quantum Channel

Classical Channel

Eve

Eavesdrop

Eavesdrop

Figure 1.1: Schematic of a QKD system for secure communication. Alice and Bobare the users of the system. Eve is an eavesdropper trying to attack the system.

messages to Alice through the classical channel.

3. Alice uses the private keys to decrypt the encrypted messages and get the

original message.

QKD has been proven to be fundamentally secure [2, 3, 4]. Its security is based

on the ability to detect the eavesdropping attacks by the fundamental properties of

quantum mechanics: wavefunction collapse. That is, Alice and Bob will find out

that the quantum states are disturbed if Eve is eavesdropping the system.

One of the popular secure classical communication protocols is RSA public-key

cryptographic algorithm developed by Ron Rivest, Adi Shamir, and Leonard Adle-

man in 1978 [5]. RSA algorithm is not fundamentally secure. It’s security is only

based on the difficulty of a mathematical problem: “factoring large numbers”. With

classical computers, there is no efficient algorithm to solve this problem, and the

time to factor a large number scales exponentially with the length of the number.

3

Page 18: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

In 2009, a group spent two years to finish factoring a 232-digit number(RSA-768),

which is a 768-bit binary number, with hundreds of classical computers. Our current

secure communication is usually based on 1024-bit or 4096-bit RSA protocol. This

protocol is not fundamentally secure, but “computationally” secure.

However, there is another way to counteract this problem and break the “compu-

tationally” secure protocols. Peter Shor showed that there is an efficient algorithm

to factor primes with a quantum computer [6]. With the development of quantum

computer, our current secure communication protocols would be easily broken. If

quantum computers existed, then the only way to realize a secure communication

system would be through QKD. It could be the key to the next generation secure

communication system.

A practical QKD protocol (BB84) is first proposed in 1984 by Charles Bennet and

Gilles Brassard [1]. The security of this protocol is based on a property of quantum

mechanics: the wavefunction collapse when someone performs a measurement. The

details about BB84 protocol will be in next section. There are several famous QKD

protocols, such as BB84, E91 protocol proposed by Artur Ekert in 1991 [7], and B92

protocol proposed by Charles Bennett in 1992 [8].

1.2.1 BB84 Protocol

The BB84 protocol proposes to encode information into the polarization of photons.

A bit of information is written into some basis of the polarization of a photon. For

example, Alice and Bob can choose to use horizontal/vertical (H/V) basis and assign

0 to H and 1 to V. The protocol is based on measurement with randomly chosen basis

from two mutually unbiased bases. People usually use horizontal/vertical (H/V) and

diagonal/anti-diagonal (D/A) for photon polarization, and let’s assign 0 to H, 1 to

4

Page 19: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

V in H/V basis and 0 to D, 1 to A in D/A basis. During the QKD, Alice randomly

sends one-bit information encoded in one of the polarization bases of the photon,

and Bob also randomly chooses a basis to measure the photon. The result of the

measurement will be exactly the same with Alice’s bit if they use the same basis,

and the result will be totally random if they use different bases.

Mathematically, we can see that |Dy “ 1?2p|Hy ` |V yq and |Ay “ 1?

2p|Hy ´ |V yq

by definition. And

|xH|Hy|2 “ |xV |V y|2 “ |xD|Dy|2 “ |xA|Ay|2 “ 1 (1.1)

|xH|V y|2 “ |xV |Hy|2 “ |xD|Ay|2 “ |xA|Dy|2 “ 0 (1.2)

|xH|Dy|2 “ |xH|Ay|2 “ |xV |Dy|2 “ |xV |Ay|2

“ |xD|Hy|2 “ |xD|V y|2 “ |xA|Hy|2 “ |xA|V y|2 “ 1

2(1.3)

The protocol is performed in the following steps:

1. Alice and Bob agree on how to assign 0/1 onto H/V and D/A basis. (H:

Horizontal, V: Vertical, D: Diagonal, A: Anti-diagonal)

2. For each bit, Alice randomly chooses a basis from H/V and D/A and randomly

chooses 0/1 to be the information to encode with a random number generator.

3. For each bit, Alice sends a single photon with specific polarization determined

in Step. 2 to Bob by a single photon source with some polarization optics.

4. For each arriving photon, Bob randomly chooses a basis from H/V and D/A

to measure the polarization of the photon.

5

Page 20: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Alice’s random bit 0 1 0 1 1 1 1 1 0 1Alice’s random basis + + + ˆ + + ˆ + ˆ +Photon polarization H V H A V V A V D VBob’s random basis + ˆ + + ˆ ˆ ˆ + + ˆBob’s measurement result H D H V A A A V H DKeep(�) or Discard(-) � - � - - - � � - -Shared Key 0 - 0 - - - 1 1 - -

*For basis: +: H/V, ˆ: D/A

Table 1.1: Example of BB84 QKD protocol.

5. They publicly announce the bases they use to prepare or measure each photon

and discard the results of measurement when they used different basis.

After these steps, Alice and Bob will share a private-key that can be used for

further encryption.

An example of BB84 QKD protocol is shown in Table 1.1.

For security of BB84, Alice and Bob can pick some of their shared key and an-

nounce it publicly to check with each other. Let’s assume they have a perfect QKD

system without loss. If there is no eavesdropper, they should find all of the key

they checked is correct. If there exists a eavesdropper (Eve) between them, we can

see that Eve has 50% chance to choose the wrong basis and change the polarization

state randomly onto one of the states in the wrong basis. When Bob measure it with

the correct basis after Eve disturbed the state, he will only have 50% chance to get

the correct measurement result. So when Eve is eavesdropping, Alice and Bob can

detect her existence by checking the correctness of part of their shared key. That

is, the probably to get a wrong bit in each bit is 50% ˆ 50% “ 25%. However, the

security of BB84 requires a good single photon source in Step. 3 of the protocol. It

is because if Alice sends multi-photons to Bob, Eve can do a photon-splitting attack,

6

Page 21: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

which steals one of the photons to do some measurement and keeps the other pho-

ton(s) to be undisturbed and distribute to Bob. In 2005, Lo et al. proposed a new

way to do QKD without worrying photon-splitting attack on multi-photons by using

decoy state [9]. In this project, I don’t implement the decoy state technique due to

its requirement of high-speed modulation of the intensity of the source.

Currently, BB84 protocol is not easy to implement due to the lack of good single

photon sources. Without a good single photon source, BB84 protocol can be attacked

by photon-splitting attack when the photon source emits more than one photon for

each bit. We’ll use quantum entangled photon pairs to replace the requirement of

single photon source in BB84.

1.3 Quantum Entanglement and Bell’s Inequality

In this section, I’ll briefly review the quantum entanglement property of quantum

mechanics. Quantum entanglement is one of the most counterintuitive properties of

quantum mechanics. In 1935, Albert Einstein, Boris Podolsky, and Nathan Rosen

(EPR) wrote a paper [10] on a thought experiment about quantum entanglement to

try to show some inadequacies of quantum mechanics. They also proposed another

point of view, called Hidden Variable Theory (HVT), to explain a way of thinking of

quantum mechanics different from the Copenhagen interpretation, and started a long

discussion with other supporters of Copenhagen interpretation. In 1964, John Bell

used quantum entanglement to design another thought experiment (Bell’s inequality)

which can show quantum mechanics violates the prediction of HVT. The experiments

on Bell’s inequality were carried out over the past thirty years, and the experiments

all show that the prediction by HVT is incorrect [11]. However, there are still some

loopholes in experiment that can let us explain the results with HVT. Scientists are

still working on closing all those loopholes to perfectly prove HVT is incorrect.

7

Page 22: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

1.3.1 Definition of Quantum Entanglement

For pure states of two noninteracting systems A and B, a state is an entangled

state if it is inseparable. That is, we cannot write the state into the following form:

|ΨyAbB “ |ψyA b |φyB.For mixed states, any density matrix can be written in the

form of ρ “ ři pi|ΨiyAbBxΨi|AbB by spectrum theorem. And a mixed state is an

entangled state if any of the component states in the ensemble is an entangled state.

That is, there exists some component |Ψiy of ρ, which is inseparable.

1.3.2 Hidden Variable Theory

In 1935, EPR wrote the famous paper “Can Quantum-Mechanical Description of

Physical Reality Be Considered Complete?”. They argued that there is an element

corresponding to each element of reality. Thus, there must be a hidden variable to

explain the non-local effect in quantum entanglement. They can’t agree with the

bizarre phenomena about information travels faster than speed of light in quantum

entanglement.

1.3.3 Bell’s Inequality

In 1964, Bell purposed his famous “Bell’s inequality”. The original Bell’s inequality

was further presented in a specific form (CHSH inequality) by John Clauser, Michael

Horne, Abner Shimony, and Richard Holt in 1969 [12]. The CHSH inequality is pur-

posed as followed:

Assume A, B are two entangled qubits. If hidden variable theory is true, then

´2 ď S ď 2, (1.4)

where

8

Page 23: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

S “ Epa, bq ´ Epa, b1q ` Epa1, bq ` Epa1, b1q, (1.5)

where Epa, bq is the quantum correlations of the particle pairs and a & a1 (b &

b1) are measured state for particle A (B).

By quantum mechanics, S can be as large as 2?2, which can prove that no hidden

variable theory is correct.

In 1981, Aspect et al. first used photon polarization to test CHSH inequality [13].

For the case of photon polarization, the quantum correlation is defined as:

Epa, bq “ Cpa, bq ` CpaK, bKq ´ CpaK, bq ´ Cpa, bKqCpa, bq ` CpaK, bKq ` CpaK, bq ` Cpa, bKq , (1.6)

where Cpa, bq are the coincidence count between A and B with polarization mea-

sured in a (b) state for A (B) particle, and aK is the orthogonal state to the a

state. And in order to achieve maximum value for S, pa, a1, b, b1q are usually set at

p0˝, 45˝,´22.5˝, 22.5˝q, where expectation value for S is 2?2.

Furthermore, CHSH inequality can also act as a security check for QKD system

with entangled photon pairs, see E91 protocol. It is because the existence of Eve

will destroy the quantum entanglement before Alice and Bob do measurement on

the photons.

1.4 Spontaneous Parametric Down Conversion

Spontaneous parametric down conversion (SPDC) is a nonlinear optical process,

during which a pump beam is incident onto a nonlinear crystal, and a pump pho-

ton is annihilated while creating two lower-frequency daughter photons, called signal

9

Page 24: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

pump signal

idler p , kp

s , ks

i , ki

Figure 1.2: Schematic of SPDC.ω:frequency, �k: wave vector

p kp

s

i

a) b)

ks ki

Figure 1.3: Schematic of phase-matching conditions. a) energy conservation, b)momentum conservation.

and idler. A schematic of SPDC is shown in Fig. 1.2 The frequencies and emission

angle of the daughter photons are determined by energy and momentum conser-

vation between the three photons. In nonlinear optics, the conservation laws are

usually called phase-matching conditions. A schematic of phase-matching conditions

is shown in Fig. 1.3. The photon pairs from SPDC have correlations in polarization,

emission angle, and energy by the phase-matching conditions. Furthermore, due to

the birefringent properties of nonlinear crystals, only pump photons with one specific

polarization can satisfy the phase-matching conditions.

Usually, there are three terms to classify the type of phase-matching conditions.

The first term is “collinear” or “non-collinear”. “Collinear” phase-matching means

10

Page 25: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

that the wave vectors of signal and idler photons are parallel to the wave vector

of pump photon. Phase-matching is “non-collinear” if they are not parallel to the

pump wave vector. The second is “type-I” or “type-II”. Phase-matching is type-I if

the polarization of signal and idler photons are the same and opposite to the pump

polarization. It is type-II if they are perpendicular to each other. The last term is

“degenerate” and “non-degenerate”. Phase-matching is “degenerate” if the signal

and idler photons have the same frequency, and it is “non-degenerate” if signal and

idler photons have different frequency.

By the properties of the nonlinear crystals, SPDC with non-collinear phase-

matching always emits signal and idler photons in every azimuthal directions, cre-

ating a down-conversion cone. The down-conversion cone is centered at the pump

beam direction in type-I non-collinear phase-matching, and is not centered at the

pump beam direction in type-II non-collinear phase-matching. The schematic of dif-

ferent down-conversion cones are shown in Fig. 1.4

SPDC can be used to create entangled photon pairs by using thin double-crystal

with different orientations, where one crystal interacts with horizontal-polarized pho-

ton, and the other crystal interacts with vertical-polarized photon. It is achieved by

using two very thin crystals to do SPDC, which the photon pairs from different

crystals cannot be distinguished due to the thinness of the crystals. At first, people

uses SPDC with type-II non-collinear phase-matching to create entangled photon

pairs [14]. However, due to the geometry of the down-conversion cones with type-II

phase-matching, entangled photon pairs only exist at the two directions where two

down-conversion cones intersect. Later, entangled photon pairs from SPDC with

degenerate type-I phase-matching was first proposed by Paul Kwiat [15]. The main

ideas of this scheme are:

11

Page 26: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

a) b)

c) d)

Figure 1.4: Schematic of Down-conversion Cones. a) 3D plot of a down-conversioncone with type-I non-collinear phase-matching, b) Cross-section plot of a down-conversion cone with type-I non-collinear phase-matching, c) 3D plot of a down-conversion cone with type-II non-collinear phase-matching, b) Cross-section plot ofa down-conversion cone with type-II non-collinear phase-matching.

1. Pump the double-crystal with diagonal-polarized pump beam (|Dy “ 1?2p|Hy`

|V yq).

2. Photon with horizontal polarization have some probability to have SPDC with

the first crystal and have the following interaction: |Hy Ñ |V V y.

3. Photon with vertical polarization have some probability to have SPDC with

the second crystal and have the following interaction: |V y Ñ |HHy.

4. The overall interaction is: 1?2p|Hy ` |V yq Ñ 1?

2p|HHy ` eiφ|V V yq, where φ is

the relative phase between down-conversion photon pairs from different crystal.

A schematic for this scheme is shown in Fig. 1.5, and the relative phase φ can be

12

Page 27: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

12( H + V ) 1

2( VV + e HH )

First Crystal: H VV  

Second Crystal: V HH  

Figure 1.5: Schematic of entangled photon pairs from double-crystal SPDC withtype-I phase-matching. φ is the relative phase between down-conversion photonsfrom two crystals. The thickness of the crystals is exaggerated.

adjusted by a birefringent plate, which is a quartz quarter-wave plate in our system.

We can make the down-conversion cones to overlap and get entangled photon pairs

from every directions on the cone in this scheme. A schematic of overlap of down-

conversion cones from double-crystal SPDC is shown in Fig. 1.6. This technique is

one of the most popular and easiest ways to create quantum entanglement.

The entangled photon pairs in every azimuthal direction from type-I phase-

matching double-crystal SPDC have application in high speed QKD, where peo-

ple can get many independent sources of entangled photon pairs with one down-

conversion setup. However, in our project, only one of those many possible sources

is used. I only use the signal and idler beams parallel to the optics table.

1.5 Quantum Key Distribution with Quantum Entanglement

The requirement of single photon source in a QKD system can be replaced by us-

ing the property of quantum entanglement. The first QKD protocol with quantum

entanglement was proposed by Ekert in 1991 (E91 protocol) [7].

13

Page 28: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

a) b)

c) d)

Figure 1.6: Schematic of overlap of down-conversion cones from double-crystalSPDC. For type-II phase-matching, only two direction on the down-conversion conecan get entangled photon pairs. a) 3D plot for type-I phase-matching, b) Cross-section plot for type-I phase-matching, c) 3D plot for type-II phase-matching, b)Cross-section for type-II phase-matching.

1.5.1 E91 Protocol

In the original paper by Artur Ekert in 1991, he proposed the protocol as following

steps:

1. Create pairs of spin-12 particles in singlet states.

2. Distribute one particle to Alice, the other one to Bob.

3. Alice randomly choose a basis from (H{V,D{A,`22.5˝{ `112.5˝) and measure

her particle with the chosen basis.

4. Bob randomly choose a basis from (D{A,`22.5˝{ ` 112.5˝,´22.5˝{ ` 67.5˝)

and measure his particle with the chosen basis.

14

Page 29: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

5. Alice and Bob publicly announce the basis they used for each pair of particles.

6. They keep the measurement result secret when they used the same basis, and

they publicly announce the measurement result when they used different bases.

7. With the measurement results with different bases, they can run a Bell’s in-

equality test. For which, they should get S “ 2?2 if there’s no Eve disturbing

the quantum states in the QKD system.

In this protocol, Ekert proposed to use a set of four bases (H{V,D{A,`22.5˝{ `112.5˝,´22.5˝{ ` 67.5˝) so Alice and Bob can run a Bell’s inequality test during the

QKD process. However, doing high-speed bases changing between three bases is more

expensive than doing high-speed bases changing between two bases. We combined

the BB84 protocol and E91 protocol to create a protocol that is most suitable for

our experimental setup.

1.5.2 Our Protocol

Here is the protocol we are going to use. I created an experimental setup that

implements a combination of BB84 and E91 protocols and specifically designed for

photon polarization states assuming perfect efficiency of the QKD system:

1. Create polarization entangled photon pairs, which have the state: |Ψy “1?2p|HyA|HyB ` |V yA|V yBq

2. Distribute one photon from each pair to Alice, the other one to Bob.

3. Alice and Bob both use a random number generator to determine which basis

he/she will use to measure each single photon polarization between H/V basis

and D/A basis.

15

Page 30: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Alice’s random basis + + + ˆ + + ˆ + ˆ +Bob’s random basis + ˆ + + ˆ ˆ ˆ + + ˆAlice’s measurement result H V H D H H A V A VBob’s measurement result H D H V A A A V H DKeep(�) or Discard(-) � - � - - - � � - -Shared Key 0 - 0 - - - 1 1 - -

*For basis: +: H/V, ˆ: D/A

Table 1.2: Example of our QKD protocol.

4. After a data-exchange session, they publicly announce the basis they use to

measure each photon and discard the results of measurement when they used

different basis.

After these steps, Alice and Bob will share a private-key that can be used for

further encryption purpose. An example of our QKD protocol is shown in Table 1.2.

For security checking, this is similar to the BB84 protocol. If Eve’s eavesdropping

on the system, she will disturb the quantum state when she does the measurement.

Alice and Bob can find our her existence by publicly checking part of their secret

key.

Modification of the Protocol for Non-perfect Experimental Apparatus

Due to the non-perfect efficiency of the detector part of the setup, Alice and Bob

can’t detect every arriving photon. They have to do a sifting process on their data

between Step3 and Step4 of our protocol. That is, they disclose the arriving time

of each photon they detect to each other and discard the photon pair information

when one of the photon is missing, which is when only one of Alice and Bob detects

a photon at the time.

16

Page 31: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

However, this original sifting process requires using a clock to do high-speed time-

stamping, which requires us to record the time information about each photon with

plenty of memory. I use the idea of time-bin to simplify the sifting process. Here is

the description about using time-bin to do sifting:

Alice and Bob both have a master clock synchronized to each other. Then, they

set up another synchronized clock with longer period, which called time-bin clock.

The period of the time-bin clock is called time-bin size and is set based on the

properties of the source part of a QKD system for security reason. I’ll discuss how to

set the time-bin size and source intensity to match each other for my QKD system in

Ch.3. So in each time-bin, Alice and Bob both use counters to do photon counting in

both of their detectors. For a time-bin to be valid, Alice and Bob both should only

get one count in one of their counters (Fig. 1.7). After each time-bin, Alice and Bob

will talk to each other and discard the information in that time bin if it’s not exactly

one counter having one count and the other having no count for both of Alice and

Bob.

There’s one more requirement for QKD with non-perfect experimental apparatus.

The error rate of the data from QKD system has to be smaller than 25% in order to

maintain the security of the system [16]. This is because the security of this protocol

is based on the increase of error rate (ě25%) when Eve is eavesdropping the system.

Furthermore, Bourennane et al studied another type of eavesdropping attack, called

coherent attack. By their analysis, the error rate has to be smaller than „11% in

order to keep the system secure against coherent attack [17].

17

Page 32: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Alice_1 (A)

Bob_1 (B)

Valid Time-bins

Invalid Time-bins

Figure 1.7: Examples of valid and invalid time-bins. The first four time-bins arethe only possible valid time-bins. The last three time-bins are examples of threecategories of invalid time-bins: single arm no-photon, single arm multi-photon, andsingle port multi-photon.

18

Page 33: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

2

Experimental Apparatus

The experiment apparatus of this project is based on and improved from the ex-

periment designed by Dehlinger and Mitchell at Reed College for Bell’s inequality

measurement in undergraduate lab [18, 19]. I constructed the experiment and further

modified it for QKD purpose and improved the quality of quantum entanglement.

There are three main sections in the experiment setup. The first part is the

optics to create polarization entangled photon pairs with SPDC. The second part is

the optics and mechanical parts to choose random bases to measure the photons and

to do single photon detection. And the last part is the high-speed electronics and

computer interface to do counting in short interval and to do automatic acquisition.

2.1 Part I: Source

For the source part, Fig. 2.1 shows a schematic of the experimental setup. This setup

can produce polarization entangled photon pairs with SPDC. A laser source produces

120 mW beam at 410 nm. The pump frequency is chosen in this wavelength in

order to match the most sensitive range of our single photon detectors (700 nm 800

19

Page 34: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Laser

HWP QWP CC DC BB

Figure 2.1: The source part of the experimental setup. Symbols: (HWP) half-waveplate, (QWP) quarter-wave plate, (CC) compensation crystal, (DC) down-conversioncrystal, (BB) beam block.

nm) after down-conversion. The beam passes through a half-wave plate, and its

polarization is changed to diagonal (|Dy “ 1?2p|Hy ` |V yq). Then, the combination

of a quarter-wave plate and a thick quartz plate (temporal compensation crystal)

adjusts the relative phase (φ) between photon pairs from different crystals (Fig. 1.5)

and does the temporal pre-compensation job for the SPDC. Finally, the beam passes

through a double 0.6 mm BiBO crystals and create the down-conversion beams with

entangled photon pairs.

2.1.1 Laser

The laser is using a continuous InGaN laser diode (Sanyo model ML320G2-11) and

a temperature controlled laser diode mount (Thorlabs model TCLDM9) to produce

power up to 120 mW at 410 nm. The relation between input current and output

light power is shown in Figure 2.2. The temperature and the current for the laser

diode is controlled by a dual current/temperature controller (Thorlabs model ITC-

502), and the light from the laser diode is collimated into a beam by a fixed-focus

lens (Thorlabs model C610TM-A). The laser diode does not have a single peak in its

spectrum. I measured the spectrum for the diode with a optical spectrum analyzer

(Ando model AQ-6315E) and compared the spectrum with a stabilized laser source.

I found that the spectrum for our laser diode has three peaks and a wide overall

20

Page 35: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Figure 2.2: Relation between input current and output light power.

bandwidth (Fig. 2.3). The wide bandwidth can affect the quantum entanglement

quality with a system without temporal compensation [20].

2.1.2 Down-conversion Crystals

The down-conversion crystals in our system are Bismuth Triborate (BiB3O6, BiBO).

This crystal is a quite new type of down-conversion crystal. It was first studied by

Hellwig, Liebertz, and Bohaty in 1999 [21]. Before using BiBO for down-conversion,

people usually use another type of crystal, Barium Borate (BaB2O4, BBO), to do

down-conversion. BiBO (deff ą 3pm{V ) has a higher effective nonlinear coefficient

than BBO crystal (deff „ 1.75pm{V ). BiBO also has a useful physical property of

21

Page 36: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

(a) Our laser diode.

(b) A stabilized Laser.

Figure 2.3: a) The spectrum for our laser diode from a optical spectrum analyzer.There are three peaks in the spectrum. b) The spectrum for a stabilized laser. Theoverall bandwidth for our laser diode is quite large compared to the stabilized lasersource.

22

Page 37: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

3

3

Figure 2.4: Schematic of geometry of beams from phase-matching with singlecrystal. The pump beam is at 405 nm, and the outside open angle of signal and idlerbeams are 3˝.

inertness to moisture, which BBO doesn’t have. However, BiBO is a biaxial crystal

and BBO is a uniaxial crystal.

Our down-conversion crystals are double crystals with 0.6 mm-thickness for each

crystal. The two crystals are both cut for phase-matching condition with normal

incident pump beam at 405 nm and 3˝ outside-open angle signal and idler beams

(Fig. 2.4). That is, pump beam direction, which is equivalent to the direction per-

pendicular to the crystal surface, is in θp “ 151.1˝ and φp “ 90˝ in the coordinate

system of the three major axis of the index ellipsoid of BiBO crystal (Fig. 2.5). The

orientations of the two crystals are set for horizontal polarized photon and vertical

polarized photon to be phase matched, respectively. That is, the crystals are rotated

90˝ with respect to each other around the pump beam direction. The two crystals

are optical contact bonded, and both surfaces have anti-reflection coating at 405 and

810 nm.

23

Page 38: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

z

y

x

p=90

p=151.1

(nz)

(nx)

(ny)

pump

Figure 2.5: Schematic of the pump direction in the crystal coordinate. The coor-dinate system is based on the index ellipsoid.

2.2 Part II: Detector

For the detector part, each of the down conversion beams pass through a set of half-

wave plate (CVI Melles Griot model QWPO-810-05-2-R10) and polarizing beam-

splitter (Newport model 05FC16PB.5), which can let us measure the polarization in

any linear-polarization basis. The half-wave plate is set on a computer-controlled

motorized rotation mount (Thorlabs model PRM1Z8) with a DC servo contoller

(Thorlabs model TDC001) to let us do automatic data acquisition for QKD. Then,

the beam passes through a set of aperture and bandpass filter centered at 810 nm

with a 12 nm bandwidth (Semrock model FF01-820/12-25) to filter out the un-

wanted spatial and frequency modes. Finally, the beam is coupled into a multi-mode

optical fiber (PerkinElmer model SPCM-QC9) by a fixed-focus fiber coupler (Thor-

labs model F220FC-B)and guided to a single-photon-counting module (PerkinElmer

model SPCM-AQ4C), where arriving photons are transformed into electronic signals.

This setup is installed on both sides of the down conversion beams. Figure 2.6 shows

a schematic of the experimental setup of one side of the detector part.

24

Page 39: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

HWP+RM PBS

AP

AP

FC

BPF

BPF FC

Figure 2.6: One side of the detector part of the experimental setup. The randombases selection is based on computer-controlled rotational mount. Symbols: (HWP)half-wave plate, (RM) rotation mount, (PBS) polarizing beam-splitter, (AP) aper-ture, (BPF) bandpass filter, (FC) fiber coupler.

The major drawback of this setup is the motorized rotation mounts need 1 s to

rotate between two bases. Ideally, we should use a 50/50 beam-splitter to do the

high-speed random bases selection. (Fig. 2.7). However, that would require 8 single

photon detectors, which are too expensive for this project.

2.2.1 Half Wave-plates

We also have non-perfect wave-plates since our wave plates are designed for 800 nm

instead of 820 nm. For our half wave-plates, it creates a 0.487042-wavelength phase

shift instead of a half-wavelength shift. Mathematically, we can describe the action

of the half wave-plates by Jones Calculus [22] for polarization optics:

Mpθq “ˆ

eiφx cos2 θ ` eiφy sin2 θ peiφx ´ eiφyq cos θ sin θpeiφx ´ eiφyq cos θ sin θ eiφx sin2 θ ` eiφy cos2 θ

˙, (2.1)

where φx is the phase change for the x-component of the electric field in the wave

25

Page 40: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

HWP  

PBS

AP

AP

FC

BPF

FC

50/50BS HWP

BPF

AP BPF

FC AP BPF

FC

Figure 2.7: One side of the ideal detector part of the experimental setup. Therandom bases selection is based on a 50/50 beam-splitter. Symbols: (50/50BS)50/50 beam-splitter, (HWP) half-wave plate, (PBS) polarizing beam-splitter, (AP)aperture, (BPF) band-pass filter, (FC) fiber coupler.

plate, φy is the phase change for the y-component of the electric field in the wave

plate, and θ is the orientation of the fast axis of the half-wave plate with respect to

the x-axis with the assumption of light traveling in z-direction.

Ignoring the global phase, φx “ 0 and φy “ 0.487042 ˆ 2π for our half-wave

plates. And we have:

Mp0q “ˆ

1 00 ´0.997 ` 0.0813i

˙(2.2a)

Mpπ{4q “ˆ

0.00166 ` 0.0407i 0.998 ´ 0.0407i0.998 ´ 0.407i 0.00166 ` 0.0407i

˙(2.2b)

26

Page 41: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Mp˘π{8q “ˆ

0.708 ` 0.0119i ˘0.706 ¯ 0.0288i˘0.0706 ¯ 0.0288i ´0.704 ` 0.0694i

˙, (2.2c)

where the Jones matrix for ideal half wave-plate with φx “ 0 and φy “ π2 is:

Midealp0q “ˆ

1 00 ´1

˙(2.3a)

Midealpπ{4q “ˆ

0 11 0

˙(2.3b)

Midealp˘π{8q “˜

1?2

˘ 1?2

˘ 1?2

´ 1?2

¸, (2.3c)

The non-perfect wave-plates are also going to hurt the efficiency of our QKD

system. I’ll use this information to calculate the entanglement state of our SPDC

setup from experiment data in Chapter 5.

2.2.2 Polarizing Beam Splitter

The polarizing beam-splitter (PBS) in this experiment is a thin film polarizing beam-

splitter cube. The thin film PBS cube reflects light with polarization parallel to the

thin film interface (vertical relative to the cube) and transmits light with polarization

in the other direction perpendicular to the reflected light’s (horizontal relative to the

cube). The schematic of the function of PBS cube is shown in Fig. 2.8. However,

the thin film PBS cube is not perfect. It has a poor performance on suppressing the

horizontal polarization in the reflected direction. I characterized the PBS cubes for

the experiment with a high performance Glan-Taylor calcite polarizer, and the result

is in Table. 2.1. The non-perfect polarizing beam splitters will affect the performance

of our QKD system. I’ll also use this information to calculate the entanglement state

of our SPDC setup from experiment data in Chapter 5.

27

Page 42: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Figure 2.8: Schematic of the function of polarizing beam splitter.

Horizontal VerticalTransmitted 95.4 ˘ 0.2% p2.17 ˘ 1.21q ˆ 10´3%Reflected 0.957 ˘ 0.074% 97.6 ˘ 0.8%

Table 2.1: Characterization data for the polarizing beam-splitters with Glan-Taylorcalcite polarizer.

2.2.3 Bandpass Filter

The bandpass filters are single-band interference filters with transmission band be-

tween 814„826 nm with average transmission of 93% (Fig. 2.9). The center wave-

length is at 820 nm. The center wavelength of interference bandpass filters are

sensitive to the incident angle of the light. Within small incidence angle, the relation

between center wavelength (λ) and incident angle (φ) is:

λ “ λ0

c1 ´ pn0

neq2 sin2 φ, (2.4)

where λ0 is the center wavelength for normal incidence, n0 is refractive index of

air, and ne is effective refractive index of the filter.

28

Page 43: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Figure 2.9: Transmission spectrum for bandpass filter.

In my setup, the filters are held by the slots in front of the fiber-couplers, and the

slots are not exactly the same size with the filters and without tightening screws. I

estimate there could be 5˝ degrees uncertainty for the incident angle. That is equiv-

alent to „1 nm shift in the center wavelength.

This information is going to be used in Chapter 3 to calculate the efficiency of

the detector part of the QKD system.

2.2.4 Multi-mode Fiber

The multi-mode fiber used for guiding the photon to the fiber-coupled single photon

counting module has 100 µm core diameter. And I measured its efficiency, and it is

99%.

2.2.5 Single Photon Counting Module

The single photon detectors in this setup are based on avalanche photodiode (APD).

It has 35 ns dead time after a photon is detected and has „60% photon detection

efficiency at 820 nm wavelength. The output electronic signal is 15 ns wide TTL

29

Page 44: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

SPCM FPGA VD

PC

SC RM

5V TTL

RS232

3.3V TTL

USB

Figure 2.10: Experimental setup for electronics part. Red Words represent thesignal types. Symbols: (SPCM) Single Photon Counting Module, (VD) Voltage Di-visor, (FPGA) Field-programmable Gate Array, (RM) Rotation Mount, (SC) ServoController, (PC) Personal Computer.

pulse. It also has a dark count rate at 400 counts/second.

2.3 Part III: Electronics

The high-speed electronics is based on a field-programmable gate array (FPGA)

(Altera model DE2). The schematic of this part of the setup is in Fig. 2.10. The

signals from single photon counting module first pass through a voltage divisor to

lower the TTL amplitude from 5V to 3.3V, which is the input standard for the

FPGA board. Then, the FPGA board counts the signals and sends the results to

the computer through RS-232 interface into LabView program. On the other side,

the rotation mounts are also controlled by the LabView program so we can have

automatic data acquisition for our QKD system.

2.3.1 Field-programmable Gate Array

The FPGA board is modified from the design by an undergraduate student in Whit-

man College as his thesis [23]. The original design is written in VHSIC hardware

30

Page 45: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

description language (VHDL) and has the following functions:

1. Shorten the incoming 15 ns TTL pulses into 3 ns, 5 ns, or 7 ns.

2. Count the single count from 4 inputs in 4 single count counters in 0.1 s intervals.

3. User can select any combination of the 4 inputs to do coincidence count in 4

coincidence count counters in 0.1 s intervals.

4. Transfer the data of the 4 single count and 4 coincidence count counters to a

personal computer by RS-232 interface.

The FPGA board I designed is based on the design described above. I rewrite

the program in Verilog hardware description language (Verilog HDL) and add the

following extra functions:

1. User can select any two of the 8 counter’s count to be shown in scientific

notation on the 7-segment displays on the FPGA board.

2. Count the single counts in each time-bin (1µs intervals) from 4 inputs.

3. Do a basic pre-sifting process for each time-bin, use a specific notation to label

the time-bin instead of recording the actual count number if there’s not exactly

one photon in each side of the down-conversion beam, and record the data if

there’s exactly one count in both side of the down conversion beam.

4. Wait for trigger signal from PC end (LabView) and then transfer the data

through RS232 after each trigger.

2.3.2 LabView Program

The LabView program’s RS232 communication function is based on the design from

the Bell’s Inequality vi from Beck and Lord [24]. I designed the functions other than

31

Page 46: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

RS232 communication part. The LabView program has the following functions:

1. Randomly pick bases for the detectors by rotating the computer-controlled

rotation mounts.

2. Send a trigger to FPGA through RS232 when the bases are set.

3. Receive the information from FPGA and decode its back to the useful format.

4. Do the actual sifting process. Record the valid time-bin data and write it into

a .txt file.

5. Do a statistics on the different type of time-bins (valid, double-photon, no-

photon).

32

Page 47: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

3

Theory

3.1 Phase-matching of SPDC in Nonlinear Crystal

I study the phase-matching conditions for SPDC inside our nonlinear crystal to cal-

culate the cut angle of the crystal in order to let down-conversion crystal to output

signal and idler beams in a certain outside open angle. The calculation is modified

from the results of Boeuf et al [25]. I change the coordinate system to simplify and

speed up the numerical calculation.

3.1.1 Degenerate Perfect Phase-matching and Calculation of the Crystal Cut Angle

First, the refractive indexes for three major axes in the BiBO are given by Sellimeier

equations:

nipλq “cAi ` Bi

λ2 ´ Ci´ Di ˆ λ2, (3.1)

where i is one of x-, y-, or z- axis, and A, B, C, and D are the constants for the

Sellimeier equations. I get the constants from “Linear optical properties of the mon-

33

Page 48: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

A B C Dx 3.0740 0.0323 0.0316 0.01337y 3.1685 0.0373 0.0346 0.01750z 3.6545 0.0511 0.0371 0.0226

Table 3.1: Constants for Sellimeir equations for three major axes in BiBO crystal.

oclinic bismuth borate BiB3O6” [21]. The constants are shown in the Table. 3.1.1.

By refractive index ellipsoid, the slow and fast refractive indexes in arbitrary di-

rection in polar coordinate with optical axes in the crystal as three axes (Fig.2.4) can

be expressed as some function of θp, φp, and λp: nslowpθp,φp,λpq and nfastpθp,φp,λpq,where θp and φp are the polar coordinate and λp is the pump wavelength.

And for our down-conversion crystal (BiBO), the type-I phase-matching can only

be achieved with pump beam as fast ray, and signal and idler beams as slow ray

(e-ray).

Then, for signal and idler beams, it’s simpler to describe their beam direction

with respect to the pump beam direction (Fig. 3.1). And we have the slow index of

refraction in the signal (idler) direction as a function: ns,slowpθp,φp, θs,φs,λsq.

Since we’re using degenerate phase-matching, energy conservation part of the

phase-matching conditions gives us λs “ λi “ λp

2 . The amplitude of momentums for

pump, signal, and idler beams can written as:

|ÝÑpp| “ hωpnfastpθp,φp,λpq

2πc(3.2)

34

Page 49: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

pump

signal

s

s x y

z

Figure 3.1: Schematic of the signal direction in the pump coordinate. Same ruleswork for idler beam.

|ÝÑps | “ hωsns,slowpθp,φp, θs,φs,λsq

2πc(3.3)

|ÝÑpi | “ hωini,slowpθp,φp, θi,φi,λiq

2πc(3.4)

With perfect phase-matching, the momentum conservation of three components

in the pump coordinate gives us:

2 ˆ nfastpθp,φp,λpq “ ns,slowpθp,φp, θs,φs, 2λpq cos θs ` ni,slowpθp,φp, θi,φi, 2λpq cos θi(3.5)

ns,slowpθp,φp, θs,φs, 2λpq sin θs cosφs “ ni,slowpθp,φp, θi,φi, 2λpq sin θi cosφi (3.6)

ns,slowpθp,φp, θs,φs, 2λpq sin θs sinφs “ ni,slowpθp,φp, θi,φi, 2λpq sin θi sinφi (3.7)

.

For these three equations, θp, φp, λp, φs, and φi are input parameters, and θs

and θi are the unknowns to be solved. And since φs “ φi ` π is also required by the

35

Page 50: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

momentum conservation, one of the three equations are redundant. However, this set

of equations can’t be solved analytically. I can only use numerical methods to solve it.

Another important fact is: in order to be used as a double-crystal entangled pho-

ton source, the crystal can only be cut at φp “ 0o or φp “ 90o. It is because the

directions of photon polarization for fast-ray and slow-ray (the major- and minor-

axes of the cross section of index ellipsoid) are not going to be the same for different

wavelengths if φp ‰ 0˝ or 90˝. That is, the requirement of parallel or perpendicular

between pump and signal/idler polarizations in phase-matching conditions cannot

be satisfied.

Finally, I can calculate the outside open angle for signal and idler beams by a

refraction through the crystal-air interface, and use iteration methods to find the

crystal cut angle, which can produce the outside open angle I’d like to use.

By the calculation above, I get the crystal cut angle has to be θp “ 151.1o and

φp “ 90o in order to create 3o outside open angle.

3.1.2 General Phase-matching

Degenerate perfect phase-matching is just one of the cases of general phase-matching.

Actually, there are photons with different frequencies and wavevectors generated from

SPDC since SPDC can allow some phase mismatch in phase-matching conditions and

still generates down-conversion photons. That is, the photons can slight violates fre-

quency and momentum conservations since there can be some energy or momentum

transferred into the crystal. However, phase mismatch is only allowed in the pump

direction.

36

Page 51: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

The phase mismatch is defined as:

∆ “ kp ´ ks cos θs ´ ki cos θi (3.8)

And the output photon amplitude is proportional to sincp∆L2 q2, where L is the

crystal length. Therefore, SPDC not only emits signal and idler photons with perfect

degenerate phase-matching, it also emits photons with general phase-matching with

some phase-mismatch. The output photons have a wide range of frequencies and

wavevectors. Experimentally, apertures and bandpass filters are used to select the

signal and idler photons with a set range of frequencies and wavevectors.

3.2 Quantum Entanglement with SPDC with Type-I Phase-matching

Quantum entanglement with SPDC with type-I phase-matching was first proposed

by Kwiat in 1991 [15]. At that time, people didn’t study the spatial and temporal

decoherence properties in this quantum entanglement source. Later, Nambu and et

al. studied the temporal decoherence and temporal compensation technique to im-

prove the quantum entanglement quality in 2002 [26]. In 2005, Altepeter, Jeffrey, and

Kwiat studied the spatial decoherence and spatial compensation technique to fur-

ther improve the quality of the quantum entangled photon pairs [27]. I theoretically

studied the temporal and spatial compensation techniques for our system. However,

due to the budget for our project, I only implement the temporal compensation on

our system.

37

Page 52: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

3.2.1 Temporal Decoherence and Compensation

Temporal Decoherence

Temporal decoherence is caused by the difference of the photon traveling time through

the double crystal with different polarization. It is because the time difference can

reveal the information about which crystal produces the entangled photon pairs. The

origin of this time difference is from the dispersion and group velocity properties of

the crystal. For a ideal setup, this time difference should be zero, and it will reveal

no such information to lower the quality of the quantum entanglement.

We can assume the SPDC happens at the center of each of the crystals. The

length of time for a photon to pass through the double-crystal and have SPDC in

one of the crystals are:

T1 “ d

2

ˆ1

Vfastpωpq ` 1

Vslowpωs,iq` 2

Vfastpωs,iq

˙(3.9)

T2 “ d

2

ˆ2

Vslowpωpq ` 1

Vfastpωpq ` 1

Vslowpωs,iq

˙, (3.10)

where T1 and T2 are the time for a photon to have SPDC in first or second crystal

traveling through the double-crystal, and Vfast and Vslow are the group velocity for

a photon with polarization for fast or slow refractive index with certain propagation

direction in the crystal and certain wavelength, where the definition of group velocity

is: Vg “ BωBk “ c

n´λ0Bn

Bλ0. Since the inside open angle for our down-conversion crystal

is really small („ 1˝), I set the propagation direction for all group velocity to be

the pump beam direction in this calculation. Then, the time difference between two

cases is:

38

Page 53: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

τ “ d

ˆ1

Vslowpωpq ´ 1

Vfastpωs,iq

˙(3.11)

By calculation, for our experiment setup with 0.6 mm double-crystal, 410 nm

pump wavelength, and θp “ 151.1˝ and φp “ 90˝, the time difference between two

cases is 584 fs.

Temporal Compensation

In order to counteract the temporal decoherence, a temporal pre-compensation crys-

tal can be added into the experimental setup before the down-conversion double-

crystal. The temporal pre-compensation crystal adds a time delay between horizontal-

polarized and vertical-polarized light, and this time delay will balance out the time

difference from dispersion. By calculation, a 15.49 mm silica crystal quartz with

optics axis perpendicular to the length of the crystal can bring 584 fs time delay

between two polarizations.

3.2.2 Spatial Decoherence and Compensation

Spatial Decoherence

Spatial decoherence is caused by the relative phase between photons from first crystal

and from second crystal are different for different spatial modes. Mathematically,

the quantum states of the signal and idler photons can be written as:

ρ “ij

iris

Apks, kiq|ψks,kiyxψks,ki

|dksdki, (3.12)

where ks and ki are the unit vectors describing the direction of signal and idler

beams, |ψks,kiy “ 1?

2

´|HsHiy ` eipφpksq`φpkiqq|VsViy

¯is the quantum state for specific

39

Page 54: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

signal and idler directions, and Apks, kiq is the amplitude for different signal and idler

directions from phase mismatch.

Altepeter et al. studied the pφpksq`φpkiqq for different signal and idler directions

and found that the phase is different for different signal and idler directions [27].

Therefore, after the integral for all the signal and idler directions, the final quantum

state have a poor quantum entanglement quality due to the non-constant relative

phase for different components of the density matrix.

The spatial decoherence can be suppressed by using a small aperture in front

of the fiber coupler. However, using a small aperture will also lower the counts of

down-conversion photons for the QKD system. And small down-conversion photon

counts can make the dark counts from the detectors to be a more serious problem.

Spatial Compensation

The quarter-wave plate in our setup can only fix the constant relative phase between

photon pairs from different crystals. It cannot fix the non-constant phase discussed

in previous section. Altepeter et al. come up with a technique to add a crystal with

same material and same cut angle with the down-conversion crystal in the signal and

idler beam after the down-conversion crystal. They found that this technique can fix

the non-constant phase and further improve the quantum entanglement quality.

However, since the temporal compensation already significantly improves the

quantum entanglement quality and the spatial compensation crystals are too ex-

pensive, spatial compensation is not applied in our experimental setup.

40

Page 55: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

3.3 Characterization of Quality of Quantum Entanglement

If there is no decoherence in our experiment, the quantum state from SPDC should

be a perfect entangled state, which is |ψy “ 1?2p|HHy ` |V V yq. And the density

matrix of this state is:

ρ1 “

¨

˚˝

12 0 0 1

20 0 0 00 0 0 012 0 0 1

2

˛

‹‹‚, (3.13)

with the basis: |HHy, |HV y, |V Hy, and |V V y. However, the entangled photon

pairs from our SPDC is not perfect, and I’m going to show a way to describe and

characterize a non-perfect quantum entanglement state from our SPDC setup.

3.3.1 Simplified Model for Quantum State from SPDC

There’s another quantum state similar to the quantum state above, but having no

entanglement. This state is a mixed state with: p1 “ p2 “ 12 , |ψ1y “ |HHy, and

|ψ2y “ |V V y. The density matrix for this state is:

ρ2 “ÿ

i

pi|ψiyxψi| “

¨

˚˝

12 0 0 00 0 0 00 0 0 00 0 0 1

2

˛

‹‹‚. (3.14)

(3.15)

For a non-perfect quantum entanglement state, I describe it as a mixture of ρ1

and ρ2. That is, p1 “ p, p2 “ p3 “ 1´p2 , |ψ1y “ 1?

2p|HHy ` |V V yq, |ψ2y “ |HHy, and

|ψ3y “ |V V y. The density matrix for this state is:

ρppq “

¨

˚˝

12 0 0 p

20 0 0 00 0 0 0p2 0 0 1

2

˛

‹‹‚. (3.16)

41

Page 56: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

For p=1, it’s a perfect entangled state. And for p=0, it’s a state with no quantum

entanglement. I’m going to use this model to describe the non-perfect quantum

entangle state from our setup.

3.3.2 Characterization of Quantum Entanglement

Concurrence

There are several quantities to describe the quality of quantum entanglement. A

formal term to describe the quality of quantum entanglement of two qubits system

is “concurrence” (C). It is first proposed by Wootters in 1998 [28]. It is defined as:

Cpρq “ maxt0,λ1 ´ λ2 ´ λ3 ´ λ4u, (3.17)

where λi are the eigenvalues, in decreasing order, of the Hermitian matrix R “a?

ρrρ?ρ and rρ “ pσy b σyq ρ˚ pσy b σyq is the spin-flipped state of ρ.

For our state in (3.17), its four eigenvalues are`1`p2 , 1´p

2 , 0, 0˘, and its concurrence

is p. That is, a perfect entangled state as in (3.15) has C=1, and a state with no

quantum entanglement as in (3.16) has C = 0.

Tangle

Tangle is another popular term to characterize quantum entanglement. It was pro-

posed by Coffman et al. in 2000 and is the first way to characterize multi-particle

quantum entanglement [29]. For our case with two particles, the definition of tangle

is: T% “ C2. And I’ll use this way to characterize quantum entanglement through-

out my thesis. And for the state in (3.17), we have T% “ p2.

42

Page 57: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

3.3.3 Measure Tangle from Experiment by Using Simplified Model

One way to get tangle % for entangled photon pairs from our system is measuring

the “visibility” of the probability of measuring the state with one particle in a state

in mutually unbiased bases (D/A in our case) and varying the state to measure the

other particle. That is, using |Dy to measure the first particle and varying the state

|ψy to measure the second particle. The probabilities can be measured by counting

the coincidence counts with half-wave plate setting in different bases. This method

uses the simplified model and only measures the parameter p in the simplified model.

Mathematically, the probability of measuring the state in |Dy for first particle

and |ψy for second particle is:

P pp,ψq “ xD1| b xψ2|qρppqp|D1y b |ψ2y, (3.18)

with |Dy “ 12p|Hy ` |V yq, and |ψy is some linear polarized state.

Assuming ψpθq “ cos θ|Hy ` sin θ|V y, we have

P pp, θq “ 1

4p1 ` p sin 2θq (3.19)

.

And by the definition of visibility, the visibility of this value as a function of θ is:

V ppq “ maxθ P pp, θq ´ minθ P pp, θqmaxθ P pp, θq ` minP pp, θq “

1`p4 ´ 1´p

41`p4 ` 1´p

4

“ p (3.20)

.

Finally, I have an experimental way to measure the tangle % by measuring the

visibility of the coincidence count in (D/A) basis, which is:

43

Page 58: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Element HWP PBS BF FC MF SPCMEfficiency 99.5˘0.5% 96.8˘1.3% 89.2˘4.5% 94˘1% 99.0˘0.1% 61.8˘3.0%

Table 3.2: Efficiency of Optical Elements in Detector Part.

Vexp “ CCp|Dy, |Dyq ´ CCp|Dy, |AyqCCp|Dy, |Dyq ` CCp|Dy, |Ayq , (3.21)

where CCp|αy, |βyq is the coincidence count measured within state |αy for first

particle and state |βy for second particle in a set time interval. And the tangle %

can be calculated by: T% “ V 2exp.

3.3.4 Measure Tangle from Quantum State Tomography

Quantum state tomography is the formal way to construct the density matrix of a

quantum state. James et al studied the method to do quantum tomography on an

entangled photon polarization state for two photon [30]. The main idea is: using

6 different states to measure each particle and do a total of 16 measurements. By

having results for 16 special designed measurement, all 16 entries in the density

matrix can be solved.

3.4 Characterization of the Efficiency of the Detector Part of theSystem

3.4.1 Theoretical Estimation

It is important to know the efficiency of the detector part of our system, which I’ll

call it “total efficiency” (Efft). Theoretically, the total efficiency is the product of

the efficiency of all optical elements in detector part, i.e. half-wave plate (HWP),

polarizing beam splitter (PBS), bandpass filter (BF), fiber-coupler (FC), multi-mode

fiber (MF), and single photon detector (SPCM). A table of the efficiency of each

element is in Table 3.4.1.

44

Page 59: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

By multiplying them together, I get the Efft “ 49 ˘ 4%.

Efficiency of the Bandpass Filters

The efficiency of the bandpass filters for the QKD system is calculated by the fol-

lowing method:

EffBF “ş80 T rλs ˆ T rλ ´ 2λpsdλş8

0 T rλsdλ , (3.22)

where T rλs is the transmission spectrum and λp is the pump wavelength.

This method uses an approximation λp « λs`λi4 from the energy conservation

1λp

“ 1λs

` 1λi.

The efficiency is calculated considering the shift of center bandwidth from the

uncertainty of incident angle (Sec.2.2.3) and the difference of center wavelength from

manufacture.

3.4.2 Experimental Characterization of Heralding Efficiency

An Rough Estimation

There is a way to experimentally measure the total efficiency. It is based on measur-

ing the heralding efficiency of the system. Heralding efficiency is defined as:

Effh ““ ccA,B?scA ˆ scB

, (3.23)

where ccA,B is coincidence count between detector A and B and sci are the single

count from detector A. Here, we’ll set the HWP in front of the detectors to have the

45

Page 60: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Bases scA sc1A scB sc1

B ccA,B ccA,B1 ccA1,B ccA1,B1

H,H 1106049 1336608 1118360 1133408 249043 5362 6784 274425H, V 1097309 1344303 1103690 1151444 2565 250232 277621 11242V,H 1103499 1356418 1109770 1145059 2016 250734 277700 11666V, V 1101198 1359892 1103948 1158735 247242 6596 9021 278741D,D 1091453 1358731 1102448 1166985 237353 18621 24272 261261D,A 1094086 1358521 1117882 1135554 14854 238794 257216 26824A,D 1120229 1352874 1106365 1171376 15446 237824 267217 26285A,A 1121704 1354085 1119013 1137878 234064 19175 22932 264433BG 4668 6943 8264 9707 - - - -ACC - - - - 1266

Table 3.3: Experiment data to calculate heralding efficiency. The first column is thestate that transmits through polarizing beam splitter going into A and B detector.The other columns are the counts from for specific coincidence count. Symbols:sci: single count in detector i, cci,j: coincidence count between detector i and j,BG: background, ACC: accidental coincidence count. All measurements are for 10 sinterval.

same orientation.

In order to estimate the toatl efficiency from heralding efficiency. I made an

assumption that: if one photon of a entangled photon pair from SPDC is in the

spatial mode that can be coupled into the multi-mode fiber by fiber-coupler, then

the other photon of that photon pair is also in the spatial mode that can be coupled

into the multi-mode fiber by the other fiber-coupler. By this assumption and the

nature of quantum entanglement, I can get a roughly estimation of total efficiency

by Efft « Effh.

The experimental data is shown in Table 3.4.2. I calculate the Effh for all

16 combinations in the data and do an average on them. I got Efft « Effh “21.8 ˘ 0.7% by experiment.

46

Page 61: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

scA ccA,B ccA,B1

Count 146308 43080 821BG 5995 - -ACC - 128 156

Table 3.4: Experiment data to more carefully estimate total efficiency. The smallaperture is installed in front of the coupler A. Symbols: sci: single count in detectori, cci,j: coincidence count between detector i and j, BG: background, ACC: accidentalcoincidence count. All measurements are for 10 s interval.

More Precise Calculation

However, by doing computational simulation on phase-matching of SPDC, I show

that the assumption in previous section is not correct. Actually, some of the photon

pairs have one photon in the spatial mode that can be coupled and the other photon

in a spatial cannot be coupled into the fiber. There is a way to do to measure the total

efficiency without that assumption. That is, we can add a small aperture in front

of detector A. By doing this, I can make sure that almost all the down-conversion

photons coupled into detector A have its pair photon coupled into detector B. Then,

the total efficiency can be calculated by:

Efft “ ccA,B

scA, (3.24)

where there’s a small aperture in front of fiber-coupler for detector A and a big

aperture in front of fiber-coupler for detector B.

The experiment data is shown in Table 3.4.2, and I get 31.1˘0.7% efficiency.

3.4.3 Possible Explanations of Difference between Theoretical and Experimental Re-sult

There is a difference between theoretical estimation and experimental estimation of

the efficiency of the detector part (49˘4% and 31.1˘0.7%). There are some possi-

ble explanations for this difference. First, there could be some misalignment in the

47

Page 62: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

experimental setup that causing the modes coupling into the detector with small

aperture not centered at the corresponding modes coupling into the detector with

large aperture. Second, I could underestimate the possible tilt of the bandpass fil-

ter or the mismatch of center wavelength from manufacture. Furthermore, the shift

of the pump wavelength from 410 nm can also lower the efficiency since the pump

wavelength and center wavelength of the bandpass filter no longer match each other.

By assuming 3 nm shift in center wave length of bandpass filter (from manufacture

and tilt effect) and 1 nm shift in pump wavelength, the bandpass filter efficiency can

be as low as 66.0%. Third, since there are high photon flows into the detector with

large aperture, the detector could miss some of the photons due to the deadtime

effect in addition to the loss from quantum efficiency.

The first explanation needs many numerical integration which I don’t have time

to finish it. The second and third explanations can make the theoretical estimation

down to 36.2˘4%, which is close to the 31.1˘0.7% from experiment.

3.5 Selection of the Size of the Time-bin

The time-bin size is very important for a QKD system. If the time-bin size is too big,

there will be an non-negligible chance that two photon pairs are created in the same

time-bin, which would make the system attackable by photon splitting attack. And

if the time-bin size is too small, most of the time-bins will have no photon, which

makes the system to be inefficient. In this section, I’ll discuss how to determine the

most efficient time-bin size with tolerable security.

By the coherent nature of laser and the random nature of SPDC, the photon pairs

from SPDC pumped by a laser beam has Poissonian statistics. Mathematically, the

probability of having n photons in a time-bin with time-bin size t seconds is:

48

Page 63: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

λt P r0,λts P r1,λtsř

ną1 P rn,λts0.01 0.990 9.90 ˆ 10´3 4.97 ˆ 10´5

0.1 0.905 0.0905 4.68 ˆ 10´3

1 0.368 0.368 0.264

Table 3.5: Possibility of time-bin with zero, one, and more than one arriving photonswith Poisson distribution with different parameters.

P rn,λts “ λnt e

´λt

n!, (3.25)

where λt “ λt is the average photon number per time bin, where λ is the average

number per second.

The λ value can be determined by λ “ scA ˆ Efft experimentally, where scA is

single photon count per second and Efft is the total efficiency of the detector part.

For security reason, we have to suppress the possibility that there’s two photon pairs

coming from SPDC source in a time-bin to avoid photon-splitting attack by Eve. In

the QKD community, people usually set λt “ min p0.1, Efftq to make P rn,λts verysmall for all n ą 1 and to make P r1,λts with a value not too small [ref??]. Since

Efft ą 0.1 for our system, I set λt “ 0.1. A list of probabilities of having zero, one,

and more than one photons is shown in Table 3.5. From this table, I show that the

probability for one photon in a time-bin is quite small for λt “ 0.01 and the probabil-

ity for more than one photon in a time-bin is quite big for λt “ 1. The probabilities

of both cases are both in an acceptable range for λt “ 0.1. Therefore, λt “ 0.1 is the

standard used by most people in the QKD field. Later in the experiment, I’ll set the

value of λt “ λt “ 0.1.

49

Page 64: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

4

Experiment Procedures

The experiment procedures are mainly on setting up the entangled photon pair source

with SPDC and the detection optics.

4.1 Preparation of Entangled Photon Pair Source and Set up theDetection Optics

The schematic of the complete experimental setup is in Fig. 4.1 and the procedures

are listed as followed:

Set up the Source

Starting with a collimated laser beam, I roughly measure the orientation of the opti-

cal axis for the half-wave plate (HWP) for 410 nm (pump beam) with sheet polarizer

and install the HWP into the optical path to make the pump beam to have hori-

zontal polarization. Then, I install the down-conversion double-crystal with surface

perpendicular to the pump beam.

50

Page 65: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Laser

HWP QWP CC

DC BB

HWP+RM

PBS

AP AP

FC-

BPF

BPF

FC-B

MR

MR

HWP+RM

PBS

AP BPF FC-A AP

FC-

BPF

Figure 4.1: Schematic of the experimental setup. Symbols: (HWP) half-waveplate, (QWP) quarter-wave plate, (CC) compensation crystal, (MR) mirror, (DC)down-conversion crystals, (RM) rotation mount, (PBS) polarizing beam-splitter,(AP) aperture, (BPF) bandpass filter, (FC) fiber coupler.

51

Page 66: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Roughly Set up the First Two Detectors

I place two fiber couplers (FC-A and FC-B) at 3˝ direction and 90 cm away from the

crystal and use a HeNe laser to align them to point toward the crystals. These fiber

couplers are connected to single photon counting module (SPCM) with multi-mode

fibers. In order to select our down-conversion wavelengths, I put narrow bandpass

filters at 810 nm in the two arms of the down-conversion setup. Then, I adjust the

position and direction of the one of the fiber-coupler (FC-A) to maximize the single

count from this coupler. After this, I adjust the position and direction of the other

fiber-coupler (FC-B) to maximize the coincidence count between FC-A and FC-B.

Carefully Align the First Two Detectors

Optimize the locations and directions of FC-A and FC-B by maximizing the heralding

efficiency between them. The definition of heralding efficiency is: Eff. “ ccA,B?scAˆscB

,

where ccA,B is coincidence count between FC-A and FC-B and sci is the single count

from FC-i (the definition of cc and sc are only for the case without HWP and PBS).

Furthermore, the location and direction of FC-A and FC-B should be symmetric to

the pump beam.

Adjust the Crystal

Change the pump polarization into vertical direction by rotating the HWP for 410

nm. Then, maximize scA and scB by tilting the double-crystal a little bit in vertical

direction to optimize the phase-matching angle for vertical pump direction so that

two down-conversion cones overlap at the positions of the detectors.

Set up the Polarization Optics

Install polarizing beam splitters (PBS) before FC-A and FC-B. Then, by the PBS,

the orientation of the HWP for 410 nm can be measured with more precision. That

52

Page 67: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

is, the single count in FC-A and FC-B is minimized when pump beam has horizontal

polarization. Install HWP for 820 nm before the PBS and measure the orientation

of those HWP by setting the pump beam to have horizontal or vertical polarization.

Set the pump beam to have diagonal polarization after this measurement.

Set up the other Two Detectors

With the help of the HeNe laser, roughly set up two more fiber couplers (FC-A’

and FC-B’) on the other arms of the PBS to let them have same optical path with

FC-A and FC-B after the PBS. First, adjust the locations and positions of them

by maximizing SCA1p0˝q and SCB1p0˝q, where SCipθq is the single count from FC-

i when the HWP on its arm set at θ direction. Then optimize the locations and

positions by maximizing CCA,B1p0˝, 45˝q and CCA,B1p0˝, 45˝q, where CCi,jpθi, θjq is

the coincidence count between FC-i and FC-j when the HWP are set at θi and θj

directions.

Balance the pump polarization

Adjust the HWP for 410 nm so that SCip0˝q and SCip45˝q are almost the same for

all FC-i.

Set up Temporal Compensation

Install the temporal compensation crystal and quarter-wave plate (QWP) into the

pump beam. Optimize the relative phase between photon pairs from different crystals

by tilting the QWP. That is, minimize CCA,Bp22.5˝,´22.5˝q by tilting the QWP.

Final Adjustment

Optimize the fiber-couplers again since the tilt of QWP makes the beam to deviate.

53

Page 68: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

5

Results

In this chapter, I’ll present my experiment result on the quality of polarization en-

tangled photon pair source, the Bell’s inequality measurement from our setup, and

the QKD system performance and data.

5.1 Quality of Polarization Entangled Photon Pair Source

In this section, I’ll show both the quality of polarization entangled photon pairs from

SPDC setup with temporal compensation crystal and without temporal compensa-

tion crystal. I’ll also show the quality of entanglement without spatial decoherence

by using small aperture in front of the fiber-couplers.

5.1.1 With Temporal Compensation

For the case with temporal compensation crystal, the data to determine the quality

of polarization entangled photon pair source is in Table 5.1. In this measurement,

there’s no aperture in front of fiber-coupler. The diameter of the effective aperture

of fiber-coupler is 4 mm. I measured the single counts and coincidence counts for

54

Page 69: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Bases SCA SCA1 SCB SCB1 CCA,B CCA,B1 CCA1,B CCA1,B1

H,H 1106049 1336608 1118360 1133408 249043 5362 6784 274425H,V 1097309 1344303 1103690 1151444 2565 250232 277621 11242V,H 1103499 1356418 1109770 1145059 2016 250734 277700 11666V,V 1101198 1359892 1103948 1158735 247242 6596 9021 278741D,D 1091453 1358731 1102448 1166985 237353 18621 24272 261261D,A 1094086 1358521 1117882 1135554 14854 238794 257216 26824A,D 1120229 1352874 1106365 1171376 15446 237824 267217 26285A,A 1121704 1354085 1119013 1137878 234064 19175 22932 264433BG 4668 6943 8264 9707 - - - -ACC - - - - 1266

Table 5.1: Experiment data to determine the quality of polarization entangled pho-ton pairs from SPDC setup with temporal compensation. The first column is thestate that transmits through polarizing beam splitter going into A and B detector.The other columns are the counts for specific single count and coincidence count.Symbols: SCi: single count in detector i, CCi,j: coincidence count between detectori and j, BG: background, ACC: accidental coincidence count. All measurements arefor 10s interval.

different detectors and different measurement bases. The background counts are

measured by turning the laser off. The accidental coincidence counts are measured

by adding a long delay between signals for coincidence measurement.

By section 3.3.2, Vexp “ CCpD,Dq´CCpD,AqCCpD,Dq`CCpD,Aq and T% “ V 2

exp. I averaged all four

measurement results from four different configurations in the experiment to get an

average of Vexp and get Vexp “ 0.852˘0.033 and T% “ 72.6˘5.6%. The error comes

from the statistics of 4 measurements with different experiment configurations.

For reference, Rangarajan et al got a Tangle % of „79% with only temporal

compensation and 4 mm diameter aperture. They also got a Tangle % of „96% with

both temporal and spatial compensation.

55

Page 70: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Bases CCA,B CCA,B1 CCA1,B CCA1,B1

H,H 235140 5287 6634 339558H,V 2831 219287 306968 11786V,H 2197 281213 244247 12796V,V 298361 6080 9128 264369D,D 171683 96871 104040 192719D,A 100354 162732 177533 119601A,D 98028 161487 180014 121601A,A 169956 94963 106809 197248ACC 1266

Table 5.2: Experiment data to determine the quality of polarization entangled photonpairs from SPDC setup without temporal compensation. The first column is thestate that transmits through polarizing beam splitter going into A and B detector.The other columns are the counts for specific coincidence count. Symbols: CCi,j:coincidence count between detector i and j, ACC: accidental coincidence count. Allmeasurements are for 10s interval.

5.1.2 Without Temporal Compensation

For the case without temporal compensation crystal, the data is shown in Table 5.2.

In this measurement, there’s also no aperture in front of fiber-coupler.

By the same calculation in previous section, I get Vexp “ 0.255 ˘ 0.04 and T% “6.52 ˘ 0.20%. This shows that temporal compensation does substantially improve

the quality of quantum entanglement.

5.1.3 Separating Spatial Decoherence

I do another set of visibility measurements with temporal compensation crystals

and with different size of apertures in front of fiber-couplers to study the quality

of entanglement without spatial decoherence. The experiment data and results are

shown in Table 5.1.3. The error comes from the uncertainty of the coincidence

count in the data, where I assume the uncertainty for a coincidence count CC is

∆CC “?CC.

From the result, the Tangle % is going up to 1 when I close down the aperture.

56

Page 71: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Bases 1 mm 2 mm 3 mm 4 mmD,D 340 1260 3620 5740D,A 8 40 210 410A,D 6 37 210 390A,A 360 1310 3725 5880ACC 1 6 16 40

Vexp 0.966˘0.010 0.950˘0.006 0.899˘0.005 0.882˘0.004T % 93.3˘1.9% 90.2˘1.1% 80.8˘0.9% 77.8˘0.7%

Table 5.3: Experiment data and result for the quality of entangled photon pairswith temporal compensation and different aperture size. In this experiment, I onlyhave two detectors and only the transmitted states are measured. Symbols: ACC:accidental coincidence count. All measurements are for 1s interval. The aperturesize is in diameter.

Theoretically, the Tangle % should extrapolate up to 1 when the aperture size is

infinitely small. This is because our temporal compensation crystal compensates

the temporal decoherence, and spatial decoherence no longer exists when only one

spatial mode is coupled.

5.2 Density Matrix for the State from SPDC and the Imperfect Po-larization Components

The formal method to determine the density matrix of a quantum state is using

quantum state tomography. However, I don’t have quarter-wave plates for exact 820

nm to do precise quantum state tomography. First, I use a simplified model where all

entries other than four entries at the corner are zero. For this model, I can determine

the state by measuring the visibility.

I also use quarter-wave plates for 780 nm to do a quantum state tomography and

adjust the deviation from the wave-length mismatch. By this way, I can measure all

the entries of the density matrix. However, there’s a big uncertainty on the Tangle%

from this state from the error propagation through the process of finding eigenvalues.

57

Page 72: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

5.2.1 Using the Simplified Model

From the simplified model in Section 3.3 and the experimental result in previous

section with the assumption of perfect efficiency for polarization optical components,

the entries in upper-right corner and lower-left corner is just half of visibility, and I

can write the density matrix for the entangled state from SPDC as:

ρexp,est “

¨

˚˝

0.5 0 0 0.426 ˘ 0.0170 0 0 00 0 0 0

0.426 ˘ 0.017 0 0 0.5

˛

‹‹‚, (5.1)

where the perfect entangled state is:

ρp “

¨

˚˝

12 0 0 1

20 0 0 00 0 0 012 0 0 1

2

˛

‹‹‚. (5.2)

However, the polarization optical components are not perfect and are discussed

in Section 2.2. Considering this effect, I assume a state in the form in the simplified

model, multiply the matrices discussed in Section 2.2 for the imperfect components,

do a theoretical visibility measurement on the state, and solve for the parameter

in the simplified model to make the visibility equal to our experimental result. By

going through the calculations, the state from the SPDC source is as followed, and

the error is based on both the error for the visibility measurement and the systematic

error from the uncertainty of the parameters of the experiment setup:

ρexp “

¨

˚˝

0.5 0 0 0.429 ˘ 0.0170 0 0 00 0 0 0

0.429 ˘ 0.017 0 0 0.5

˛

‹‹‚. (5.3)

58

Page 73: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Basis A Basis B CCA,B

H H 239531H V 2036V V 246930V H 2853R H 141756R V 99543D V 130096D H 114335D R 127359D D 228590R D 94383H D 127933V D 115255V L 116894H L 124796R L 236731

Table 5.4: Experiment data for quantum tomography. The accidental coincidencecount is 1202 count/10 s. Symbol: H: horizontal, V: vertical, D: diagonal, A: anti-diagonal, R: right circular, L: left circular. All measurements are for 10s interval.

That is, with consideration on the imperfect polarization components, the visi-

bility of the state is V “ 0.858 ˘ 0.034 and the Tangle % is T% “ 73.6 ˘ 5.8%

5.2.2 Quantum State Tomography

The formal way to determine the density matrix of a quantum state is using quantum

state tomography. James et al studied the method to do quantum tomography on

an entangled photon polarization state for two photon [30] (Sec. 3.3.4.). I followed

their method to do a quantum tomography for my state, and the result is in Table

5.4.

By the data in Table 5.3, the density matrix of the state can be determined

in Equation 5.5. In order to get Equation 5.5, I do a backward calculation of the

state similar to the method in previous section. That is, I set up an unknown state

and make it go through the operator for imperfect waveplates and beam-splitters

59

Page 74: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

and solve the unknown state to let it match the result I get from experiment. The

errors in the density matrix come from both statistical error from experiment and

systematic error. For the systematic error in tomography, I use the uncertainty of

performance of the experimental components given by their specification sheets.

ρQT “

¨

˚˝

0.509 ˘ 0.002 ´0.00585 ˘ 0.00281 0.0616 ˘ 0.0037 0.496 ˘ 0.005´0.00585 ˘ 0.00281 0.00151 ˘ 0.00007 0.0488 ˘ 0.0038 ´0.0948 ˘ 0.00860.0616 ˘ 0.0037 0.0488 ˘ 0.0038 ´0.00244 ˘ 0.00167 ´0.0248 ˘ 0.00180.496 ˘ 0.005 ´0.0948 ˘ 0.0086 ´0.0248 ˘ 0.0018 0.535 ˘ 0.003

˛

‹‹‚

(5.4)

`i

¨

˚˝

0 0.0159 ˘ 0.0006 ´0.0205 ˘ 0.0009 ´0.0928 ˘ 0.0054´0.0159 ˘ 0.0006 0 0.0700 ˘ 0.0006 0.0184 ˘ 0.00100.0205 ˘ 0.0009 ´0.0700 ˘ 0.0038 0 ´0.0153 ˘ 0.00100.0928 ˘ 0.0054 ´0.0184 ˘ 0.0010 0.0153 ˘ 0.0010 0

˛

‹‹‚.

(5.5)

From this density matrix, I can also calculate the Tangle % of the state. The

result is T% “ 89.4 ˘ 54.1%. The big error here comes from the error propagation

going through the process of calculating eigenvalues.

5.3 Bell’s Inequality Measurement

The experiment data for a Bell’s inequality measurement is in Table 5.3. By section

1.3.3, I calculate the S value for Bell’s inequality measurement. For uncertainty, I

assume the uncertainty for counts to be their own square root. With 10 s window for

each measurement, I get S “ 2.55784˘0.00105, which is a 533´σ violation of Bell’s

inequality. For reference, Dehlinger et al set up an experiment for undergraduate

lab and have S value measurement with 15 s measurement window which gives

9 ´ σ violation in 2001 [18]. Altepeter et al did a S value measurement with 1.75 s

measurement window which gives 1239 ´ σ violation [27]. However, in Altepeter et

al’s work, they implement both temporal and spatial compensation techniques and

60

Page 75: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Bases CCA,B CCA,B1 CCA1,B CCA1,B1

´45˝,´22.5˝ 200441 50335 57912 22750945˝,´22.5˝ 47558 206264 224002 60228´45˝, 67.5˝ 47886 205879 229035 6260245˝, 67.5˝ 204324 51864 58045 227489

´45˝, 22.5˝ 47064 206801 231097 6064345˝, 22.5˝ 206548 49767 58081 227604

´45˝, 112.5˝ 203797 51763 59696 23094745˝, 112.5˝ 48153 207889 223073 637930˝,´22.5˝ 216547 40592 43707 24043490˝,´22.5˝ 35903 217213 240775 494860˝, 67.5˝ 37653 220717 241729 4702490˝, 67.5˝ 216728 39790 46207 2431760˝, 22.5˝ 214534 43721 50209 23667390˝, 22.5˝ 41350 214230 238717 530750˝, 112.5˝ 40589 215978 234349 5497390˝, 112.5˝ 211368 44803 50169 239227

ACC 1266

Table 5.5: Experiment data for Bell’s inequality measurement. The first column isthe state that transmits through polarizing beam splitter going into A and B de-tector. The other columns are the counts from for specific coincidence count. Sym-bols: CCi,j: coincidence count between detector i and j, ACC: accidental coincidencecount. All measurements are for 10s interval.

use pump beam with more intensity and larger coupler to collect single photons.

This result shows that our QKD system can also be used to implement E91 pro-

tocol (Sec. 1.5.1), which uses Bell’s inequality as its security check.

5.4 QKD System Performance and Data

For taking QKD data, I made an assumption that our setup has the extra polariza-

tion beam-splitters (PBS) to do high-speed random basis selection (Fig. 2.6). In this

case, the performance of our QKD system won’t be limited by the speed of the rota-

tion mounts to do random basis selection, which needs 1 s to change the basis. With

this assumption, I took the experimental data for each bases configuration without

61

Page 76: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Bases (H,H) (H,D) (D,H) (D,D)Valid Time Bin

(0,0) 25 9 12 28(0,1) 0 8 14 1(1,0) 5 6 15 4(1,1) 13 10 11 15

Invalid Time BinSingle Arm No-Photon 32032 32046 32019 32031

Single Arm Multi-Photon 1 0 0 0Single Port Multi-Photon 3 3 8 1

Table 5.6: Experiment data for our QKD system with pump laser diode current =60 mA. Each column is the statistics over 32080 time-bins with different half-waveplate setup. The state that transmits through polarizing beam splitter going into Aand B detector is specified in first row. Symbol: Single Arm No-Photon: there is nophotons in both of the detectors in any one of the arm, Single Arm Multi-Photon:there is one photon in both of the detectors in any one of the arm, Single PortMulti-Photon: there is more than one photon in any one of the four detectors.

doing random basis changes between them.

By the performance limit of our FPGA board, the fastest time-bin clock I can

achieve is 1 MHz. By Section 3.5, people usually set λt “ λt “ 0.1 for efficiency and

security reason [9]. With 1 MHz time-bin clock, that requires us to set λ “ 100000

counts/s. By assuming our system has a 31.1% (experimental estimation), the single

count we measure should be 31100 count/s in each arm. Since the laser diode has

a linear relation between laser diode current and laser output power (Fig. 2.2), the

laser diode current should be set at ILD “ 56.3mA by linear interpolation.

To test the QKD system, I take QKD data with ILD “ 60, 80, and 120mA. The

data from our QKD system with different power setup is shown in Table 5.6, 5.7,

and 5.8. By analyzing those data, the performance of those setup is shown in Table.

5.9.

62

Page 77: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Bases (H,H) (H,D) (D,H) (D,D)Valid Time Bin

(0,0) 230 134 112 224(0,1) 15 116 113 24(1,0) 55 143 138 78(1,1) 224 137 130 202

Invalid Time BinSingle Arm No-Photon 31411 31407 31444 31393

Single Arm Multi-Photon 64 50 61 60Single Port Multi-Photon 77 85 78 88

Table 5.7: Experiment data for our QKD system with pump laser diode current =80 mA. Each column is the statistics over 32080 time-bins with different half-waveplate setup. The state that transmits through polarizing beam splitter going into Aand B detector is specified in first row. Symbol: Single Arm No-Photon: there is nophotons in both of the detectors in any one of the arm, Single Arm Multi-Photon:there is one photon in both of the detectors in any one of the arm, Single PortMulti-Photon: there is more than one photon in any one of the four detectors.

Bases (H,H) (H,D) (D,H) (D,D)Valid Time Bin

(0,0) 548 395 370 602(0,1) 104 325 352 134(1,0) 203 383 473 264(1,1) 599 367 333 554

Invalid Time BinSingle Arm No-Photon 29694 29782 29659 29610

Single Arm Multi-Photon 416 349 354 394Single Port Multi-Photon 459 440 493 478

Table 5.8: Experiment data for our QKD system with pump laser diode current =120mA. Each column is the statistics over 32080 time-bins with different half-waveplate setup. The state that transmits through polarizing beam splitter going into Aand B detector is specified in first row. Symbol: Single Arm No-Photon: there is nophotons in both of the detectors in any one of the arm, Single Arm Multi-Photon:there is one photon in both of the detectors in any one of the arm, Single PortMulti-Photon: there is more than one photon in any one of the four detectors.

63

Page 78: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Current Laser Power Photon Flow Error Rate Bit Rate60.0 mA 22.5 mW 0.133 10.9˘3.6% 0.936˘0.098 bit/s80.0 mA 52.5 mW 0.310 16.3˘1.4% 16.1˘0.5 bit/s120.0 mA 112.5 mW 0.664 23.4˘1.0% 66.0˘1.2 bit/s

Table 5.9: Experimental performance for our QKD system with different laser outputpower setup. The unit for photon flow is count/time-bin in each arm.

5.5 Discussion on the QKD Performance

The performance of this QKD system is mostly limited by the speed of the high-speed

electronics with FPGA. The high error rates in Table 5.7 are caused by the high acci-

dental coincidence counts in the large coincidence window (1 µs) set by the time-bin

clock speed limit (1 MHz). That is, if the average photon number per time-bin is

not small, there will be a considerable chance that two photon pairs arrive in the

same time-bin with some photons lost in the system due to the non-perfect efficiency.

Unfortunately, I cannot directly measure the accidental coincidence count with 1

µs window since it’s really difficult to delay electric signal by 1 µs.

Mathematically, I calculate the probability of getting a “true” valid time-bin

(PTV ) and the probability of getting a “fake” valid-time bin (PFV ) up to second

term in the Poisson distribution, where

PTV “ P r1,λts ˆ pEfftq2 ` 6 ˆ P r2,λts ˆ pEfftq2 ˆ p1 ´ Efftq2 (5.6)

PFV “ 2 ˆ P r2,λts ˆ pEfftq2 ˆ p1 ´ Efftq2, (5.7)

where Efft is the total efficiency of the detector part, P rk,λts is the probability of

getting k photons in one arm with average λt photons per time-bin. Note: P rk,λts

64

Page 79: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Current Laser Power Theo. Error Rate Exp. Error Rate60.0 mA 22.5 mW 12.4% 10.9˘3.6%80.0 mA 52.5 mW 16.8% 16.3˘1.4%120.0 mA 112.5 mW 21.5% 23.4˘1.0%

Table 5.10: Theoretical estimation of the performance for our QKD system withdifferent laser output power setup.

is a Poisson distribution (Sec. 3.5).

The probability of getting error in a time-bin from the accidental coincidence

counts is:

Erracc “ PFV

PTV ` PFV. (5.8)

The error caused by the imperfect quantum entanglement of the source is:

Errsource “ 1 ´ V

2, (5.9)

where V is the visibility of the quantum entanglement.

The total error rates for different laser output power are in Table 5.10.

The theoretical and experimental results are close to each other. The difference

can be explained by the deadtime effect or multi-photons in one time-bin when the

photon flow is high.

In order to lower the error rate caused by accidental coincidence count, I have to

sacrifice the bit rate by attenuating the pump power. However, if there’s a FPGA

board that can implement a faster time-bin clock, the performance of the QKD sys-

tem can be improved. For example, by estimation, a QKD system with 10.3% error

65

Page 80: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

rate and 5 bit/s bit rate can be achieved by using 120 mA pump power with a 5

MHz time-bin clock.

Furthermore, this QKD system is secure since its error rate can be lower than

11% (Sec. 1.5). People can further apply error correction and privacy amplification

to further improve the security and correctness of the data from this QKD system.

66

Page 81: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

6

Conclusion

In this project, I constructed a quantum key distribution (QKD) system with po-

larization entangled photon source from spontaneous parametric down-conversion

(SPDC). I theoretically studied the phase-matching conditions for SPDC with uni-

axial and biaxial crystals, the quantum entangled photon pairs produced by SPDC,

the temporal and spatial compensation techniques to improved the quantum entan-

glement quality, the different protocols for QKD, and the techniques to optimize the

QKD system. Experimentally, I constructed the optical setup to produce entangled

photon source with SPDC, the polarization optics to analyze the polarization states,

and the high-speed electronics for the QKD system. For the electronics part, I ac-

quired the programming skills for LabView, VHDL, and Verilog HDL in order to

construct the high-speed coincidence counter with time-bin and pre-sifting function

with FPGA and use RS-232 interface to setup communication between FPGA and

LabView in the PC end.

For the quantum entangled photon source, I implement the temporal compensa-

tion technique and experimentally measure the Tangle % up to 73.6˘5.8% with a

67

Page 82: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

simplified model of density matrix. I also do a quantum state tomography to mea-

sure the complete density matrix and get Tangle % = 89.4˘54.1%. The huge error

in quantum state tomography method is caused by the error propagation through

the process of finding eigenvalues. The efficiency of the detector part of the setup

is „31.1˘0.7%, which is mostly limited by the efficiency of the single photon count-

ing module (SPCM). With a QKD protocol similar to BB84 protocol with quantum

entanglement, the performance of the QKD system is 0.936˘0.098 bit/s rate with

10.9˘3.6% error rate. The bit rate is mostly limited by the speed of the time-bin

clock on the FPGA board (1 MHz). This result shows that this QKD system is

secure since its error rate is below 11%. The low bit rate is caused by the slow

time-bin clock and the low error rate and security requirement. I also do a Bell’s

inequality measurement with this system and get S “ 2.55784 ˘ 0.00105, which is a

533 ´ σ violation of Bell’s inequality. This result shows that the E91 protocol can

be implemented on the QKD system.

This system can be further improved by: 1) implement the spatial compensation

technique to improve the quality of the entanglement, 2) use a faster FPGA board

on the system to increase the bit rate, and 3) implement a decoy state QKD protocol

to increase the bit rate. By estimation, a data rate of 5 bit/s with 10.9% error rate

can be achieved with a 5 MHz time-bin clock. Furthermore, people can implement

error correction and privacy amplification techniques to further improve the security

and correctness of the data from this QKD system.

68

Page 83: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Appendix A

Verilog HDL Codes for QKD Circuit on FPGA

A.1 QKD.v

//Œ

Ñ/////////////////////////////////////////////////////////////////////////////////////Œ

Ñ

//QKD. v crea t ed by Yu Po (Ken) Wong Œ

Ñ ////Last modi f ied : Mar . 23 2012 Œ

Ñ Œ

Ñ//// Or i g ina l co inc idence count ing func t i on and RS´232 Œ

Ñ f unc t i on in VHDL by Jesse Lord . ////Delay l i n e in Ver i l og HDL by Dr . Hugo Cavalcante . Œ

Ñ ////Œ

Ñ/////////////////////////////////////////////////////////////////////////////////////Œ

Ñ

module QKD (UARTRXD, UARTTXD, CLOCK 50, SW, GPIO 0 , KEY, Œ

ÑGPIO 1 , LEDR, LEDG, HEX0, HEX1, HEX2, HEX3, HEX4, HEX5, Œ

ÑHEX6, HEX7) ;// The input t r i g g e r s i g n a l from RS´232 por t .input UARTRXD;// The output s i g n a l to the RS´232 por t .output UARTTXD;

69

Page 84: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

// The 50 MHz c l o c k t ha t i s prov ide on the DE2 Board .input CLOCK 50 ;// The sw i t ch e s 0 through 17 on the DE2 Board .input [ 1 7 : 0 ] SW;// The 40 pin expansion header GPIO 0 pins . Input s i g n a l Œ

Ñfrom S ing l e Photon Counting Module .input [ 1 6 : 0 ] GPIO 0 ;// The keys 0 through 3 on the DE2 Board .input [ 3 : 0 ] KEY;// The 40 pin expansion header GPIO 1 pins . Output s i g n a lŒ

Ñ f o r debug purpose .output [ 3 5 : 0 ] GPIO 1 ;// The red LED l i g h t s 0 through 17 on the DE2 Board .output [ 1 7 : 0 ] LEDR;// The green LED l i g h t s 0 through 7 on the DE2 Board f o r Œ

Ñdebug purpose .output [ 7 : 0 ] LEDG;// The 7´segment d i s p l a y s 0 through 7 on the DE2 Board .output [ 0 : 6 ] HEX0, HEX1, HEX2, HEX3, HEX4, HEX5, HEX6, Œ

ÑHEX7;

/////////////////////////////////////////Nets and Var iab l e s f o r QKD Function /////////////////////////////////////////

// These ne t s r ep r e s en t the four input pu l s e s from the Œ

Ñphoton d e t e c t o r s .wire A,B,C,D;// These ne t s r ep r e s en t the four d i f f e r e n t shor tened Œ

Ñpu l s e s f o r each o f the four input pu l s e s . They w i l l be Œ

Ñchoosen by mux4to1 .wire [ 3 : 0 ] A inte rna l , B in te rna l , C inte rna l , D in t e rna l ;// These ne t s r ep r e s en t the shor tened pu l s e s output Œ

Ñchosen by the mux4to1 s u b c i r c u i t .wire A s , B s , C s , D s ;// This net counts the 50MHz c l o c k u n t i l i t reaches 50 , Œ

Ñwhich occurs every micro´second .wire [ 7 : 0 ] t ime b in count ;// These v a r i a b l e are turned on in 1MHz frequency f o r oneŒ

Ñ 50MHz c l o c k pu l s e and r e s e t the time´b in counter and Œ

Ñac t as t r i g g e r f o r data proce s s ing .reg t ime b i n t r i g g e r , t ime b i n t r i g g e r 2 , Œ

Ñ t im e b i n t r i g g e r 3 ;

70

Page 85: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

// These ne t s r ep r e s en t the top l e v e l des i gn e n t i t y Œ

Ñ i n s t a n t i a t i o n o f the count f o r each time´b in .wire [ 1 : 0 ] A data top , B data top , C data top , D data topŒ

Ñ ;// These v a r i a b l e s are the count f o r each time´b in .reg [ 1 : 0 ] A data , B data , C data , D data ;// This net i s the 3´ b i t data f o r each time´b in a f t e r pre Œ

Ñ´s i f t i n g proces s .wire [ 2 : 0 ] t ime b in data ;// This net counts the time´b in s u n t i l i t reaches 10.wire [ 4 : 0 ] byte count ;// This v a r i a b l e i s turned on every 10 time´b in f o r one Œ

Ñt ime bin l en g t h .reg by t e t r i g g e r ;// This v a r i a b l e i s an in t e rmed ia t e s t ep f o r c r e a t i n g Œ

Ñou tpu t da ta .reg [ 1 5 : 0 ] byte 0 , byte 1 , byte 2 ;// This v a r i a b l e i s the 4´by t e word output f o r every 10 Œ

Ñtime´b in .reg [ 3 1 : 0 ] byte data ;// This wire counts the 4´by t e words u n t i l i t s reaches 8 .wire [ 3 : 0 ] word count ;// This v a r i a b l e i s turned on every 8 4´by t e words to Œ

Ñ t r i g g e r the output proces s .reg word re se t ;// These ne t s are the o r i g i n a l and shor tened t r i g g e r fromŒ

Ñ RS´232.wire t r i g g e r , t r i g g e r f ;// This v a r i a b l e i s the f i n a l t r i g g e r a f t e r a t r i g g e r Œ

Ñfrom RS´232 and a f t e r 8´by t e words are c o l l e c t e d .reg t r i g g e r 2 ;// This v a r i a b l e i s a con t r o l f o r t r i g g e r 2 .reg t r i g g e r 2 c r l ;// These v a r i a b l e s r ep r e s en t the top l e v e l des i gn e n t i t y Œ

Ñ i n s t a n t i a t i o n o f the 4´by t e words .reg [ 3 1 : 0 ] f i n a l ou tpu t 0 t op , f i n a l ou tpu t 1 t op , Œ

Ñ f i n a l ou tpu t 2 t op , f i n a l ou tpu t 3 t op , Œ

Ñ f i n a l ou tpu t 4 t op , f i n a l ou tpu t 5 t op , Œ

Ñ f i n a l ou tpu t 6 t op , f i n a l o u t pu t 7 t o p ;// These v a r i a b l e s r ep r e s en t the 4´by t e words .reg [ 3 1 : 0 ] f i n a l ou tpu t 0 , f i n a l ou tpu t 1 , f i n a l ou tpu t 2 Œ

Ñ , f i n a l ou tpu t 3 , f i n a l ou tpu t 4 , f i n a l ou tpu t 5 , Œ

Ñ f i n a l ou tpu t 6 , f i n a l o u t pu t 7 ;

71

Page 86: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

// These v a r i a b l e s are the f i n a l 4´by t e words to output .reg [ 3 1 : 0 ] Count f ina l 0 , Count f ina l 1 , Count f ina l 2 , Œ

ÑCount f ina l 3 , Count f ina l 4 , Count f ina l 5 , Count f ina l 6 , Œ

ÑCount f i na l 7 ;// This v a r i a b l e a c t s as a c l o c k to output data at the Œ

Ñbaud ra t e o f 19200 b i t s / second .reg baud ra t e c l k ;// This net counts the 50 MHz c l o c k pu l s e s u n i t l i t Œ

Ñreaches 2604 in order to time the baud c l o c k .wire [ 1 2 : 0 ] baud rate count ;

///////////////////////////////////////////////////////////Nets and Var iab l e s f o r Extra Counts on FPGA Functions ///////////////////////////////////////////////////////////

// This net counts the baud c l o c k u n t i l i t reaches 1920 , Œ

Ñwhich occurs every 1/10 th o f a second .wire [ 1 4 : 0 ] d a t a t r i g g e r c oun t ;// This v a r i a b l e i s turned on every 1/10 th o f a second Œ

Ñ f o r one 50MHz c l o c k pu l s e and r e s e t s the photon Œ

Ñd e t e c t i on counters .reg d a t a t r i g g e r r e s e t ;// This v a r i a b l e i s turned on every 1/10 th o f a second Œ

Ñand beg in s the onboard data stream out .reg da t a t r i g g e r ;// These ne t s r ep r e s en t the output o f the four Œ

Ñ co i n c i d enc e pu l s e s u b c i r c u i t s t h a t d e t e c t co inc idence s .wire Coinc idence 0 , Coinc idence 1 , Coinc idence 2 , Œ

ÑCoinc idence 3 ;// These ne t s r ep r e s en t the top l e v e l des i gn e n t i t y Œ

Ñ i n s t a n t i a t i o n o f the number o f s i n g l e counts .wire [ 3 1 : 0 ] A top , B top , C top , D top ;// These v a r i a b l e s r ep r e s en t the number o f s i n g l e counts .reg [ 3 1 : 0 ] A out , B out , C out , D out ;// These ne t s r ep r e s en t the top l e v e l des i gn e n t i t y Œ

Ñ i n s t a n t i a t i o n o f the number o f co inc i d en t counts .wire [ 3 1 : 0 ] Count top 0 , Count top 1 , Count top 2 , Œ

ÑCount top 3 ;// These v a r i a b l e s r ep r e s en t the number o f co inc i d en t Œ

Ñcounts .reg [ 3 1 : 0 ] Count out 0 , Count out 1 , Count out 2 , Œ

ÑCount out 3 ;// This net counts the bcd c l o c k u n t i l i t reaches 10 , Œ

72

Page 87: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Ñwhich occurs every second .wire [ 3 : 0 ] bcd count ;// This v a r i a b l e i s turned on every second and r e s e t s theŒ

Ñ photon d e t e c t i on bcd counters .reg bcd r e s e t ;// This v a r i a b l e i s turned on every second and beg in s Œ

Ñoutput to the 7´seg d i s p l a y .reg b cd t r i g g e r ;// These ne t s r ep r e s en t the name o f the input sources to Œ

Ñ the bcd counters .wire [ 4 : 0 ] bcd option0 , bcd opt ion1 ;// These v a r i a b l e s r ep r e s en t s the input sources to the Œ

Ñbcd counters .reg bcd data0 , bcd data1 ;// These ne t s r ep r e s en t the top l e v e l des i gn e n t i t y Œ

Ñ i n s t a n t i a t i o n o f the number o f bcd counts 0 .wire [ 3 : 0 ] bcd count top 0 [ 1 2 : 1 ] ;// These ne t s r ep r e s en t the top l e v e l des i gn e n t i t y Œ

Ñ i n s t a n t i a t i o n o f the number o f bcd counts 1 .wire [ 3 : 0 ] bcd count top 1 [ 1 2 : 1 ] ;// These v a r i a b l e s r ep r e s en t the number o f bcd counts 0 .reg [ 3 : 0 ] bcd count out 0 [ 1 2 : 1 ] ;// These v a r i a b l e s r ep r e s en t the number o f bcd counts 1 .reg [ 3 : 0 ] bcd count out 1 [ 1 2 : 1 ] ;// These ne t s r ep r e s en t s the output to the 7´seg d i s p l a y sŒ

Ñ .wire [ 3 : 0 ] one0 , one1 , dec0 , dec1 , exp0 , exp1 ;//This net i s the s c a l e f o r bar i n d i c a t o r .wire [ 3 : 0 ] s c a l e ;//This net i s the er ror s i g n a l when the bar i n d i c a t o r Œ

Ñ s c a l e goes out o f bound .wire e r r o r ;

//////////////////QKD Function //////////////////

// Assign the input s i g n a l s from GPIO 0 to the ne t s .assign A = GPIO 0 [ 1 0 ] ,

B = GPIO 0 [ 1 2 ] ,C = GPIO 0 [ 1 4 ] ,

D = GPIO 0 [ 1 6 ] ;

73

Page 88: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

// The pu l s e s h o r t e n e r s u b c i r c u i t de layed the input Œ

Ñ s i g n a l s and shor tened the s i g n a l s by AND gate in four Œ

Ñ d i f f e r e n t pu l s e l e n g t h .pu l s e s h o r t en e r PA (A, A in t e rna l [ 3 : 0 ] ) ;pu l s e s h o r t en e r PB (B, B in t e rna l [ 3 : 0 ] ) ;pu l s e s h o r t en e r PC (C, C in t e rna l [ 3 : 0 ] ) ;pu l s e s h o r t en e r PD (D, D in t e rna l [ 3 : 0 ] ) ;

// The mux4to1 s u b c i r c u i t choose one o f the shor tened Œ

Ñ s i g n a l s from pu l s e ander s u b c i r c u i t by Swi tches 16 and Œ

Ñ17 and output the choosen s i g n a l to A(BCD) s .mux4to1 MA ( A in t e rna l [ 1 ] , A in t e rna l [ 2 ] , A in t e rna l [ 3 ] ,A, Œ

ÑSW[ 1 7 : 1 6 ] , A s ) ;mux4to1 MB ( B in t e rna l [ 1 ] , B in t e rna l [ 2 ] , B in t e rna l [ 3 ] ,B, Œ

ÑSW[ 1 7 : 1 6 ] , B s ) ;mux4to1 MC ( C in t e rna l [ 1 ] , C in t e rna l [ 2 ] , C in t e rna l [ 3 ] ,C, Œ

ÑSW[ 1 7 : 1 6 ] , C s ) ;mux4to1 MD ( D in t e rna l [ 1 ] , D in t e rna l [ 2 ] , D in t e rna l [ 3 ] ,D, Œ

ÑSW[ 1 7 : 1 6 ] , D s ) ;

// The counter to t r i g g e r the time´b in in 1MHz.t imeb in counte r C8 ( t ime b i n t r i g g e r , CLOCK 50, Œ

Ñ t ime b in count ) ;always @( t ime b in count )begin

i f ( t ime b in count==8’b00110010 )begin

t im e b i n t r i g g e r = 1 ’ b1 ;t im e b i n t r i g g e r 2 = 1 ’ b0 ;t im e b i n t r i g g e r 3 = 1 ’ b0 ;end

else i f ( t ime b in count==8’b00000000 )begin

t im e b i n t r i g g e r = 1 ’ b0 ;t im e b i n t r i g g e r 2 = 1 ’ b1 ;t im e b i n t r i g g e r 3 = 1 ’ b0 ;end

else i f ( t ime b in count==8’b00000001 )begin

t im e b i n t r i g g e r = 1 ’ b0 ;t im e b i n t r i g g e r 2 = 1 ’ b0 ;t im e b i n t r i g g e r 3 = 1 ’ b1 ;end

74

Page 89: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

else

begin

t im e b i n t r i g g e r = 1 ’ b0 ;t im e b i n t r i g g e r 2 = 1 ’ b0 ;t im e b i n t r i g g e r 3 = 1 ’ b0 ;end

end

//Two b i t s counters to count the s i n g l e count in every Œ

Ñtime´b in .data counter C9 ( t ime b i n t r i g g e r , A s , A data top ) ;data counter C10 ( t ime b i n t r i g g e r , B s , B data top ) ;data counter C11 ( t ime b i n t r i g g e r , C s , C data top ) ;data counter C12 ( t ime b i n t r i g g e r , D s , D data top ) ;

//Transfer the time´b in count to another r e g i s t e r a f t e r Œ

Ñeach time´b in .always @(posedge t im e b i n t r i g g e r )begin

A data <= A data top ;B data <= B data top ;C data <= C data top ;D data <= D data top ;

end

// s i f t s u b c i r c u i t does a pre´s i f t p roces s f o r each time´Œ

Ñb in . Produce a 3´ b i t data f o r each time´b in .s i f t SI1 ( t ime b i n t r i g g e r 2 , A data , B data , C data , Œ

ÑD data , t ime b in data ) ;

// by t e coun t e r s u b c i r c u i t counts the number o f time´b in s Œ

Ñ t i l l 10 f o r each 4´by t e word .byte counte r C13 ( by t e t r i g g e r , t ime b i n t r i g g e r 3 , Œ

Ñbyte count , t ime b in data ) ;always @( byte count )begin

i f ( byte count == 5 ’ b01010 )begin

byte 0 [ byte count ] = t ime b in data [ 0 ] ;byte 1 [ byte count ] = t ime b in data [ 1 ] ;byte 2 [ byte count ] = t ime b in data [ 2 ] ;b y t e t r i g g e r = 1 ’ b1 ;end

75

Page 90: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

else

begin

byte 0 [ byte count ] = t ime b in data [ 0 ] ;byte 1 [ byte count ] = t ime b in data [ 1 ] ;byte 2 [ byte count ] = t ime b in data [ 2 ] ;b y t e t r i g g e r = 1 ’ b0 ;end

end

// wr i t e 10 3´ b i t datas in t o a 4´by t e word .always @(posedge by t e t r i g g e r )begin

byte data = {1 ’b1 , 1 ’ b1 , byte 2 [ 9 ] , byte 1 [ 9 ] , byte 0 [ 9 ] , Œ

Ñbyte 2 [ 8 ] , byte 1 [ 8 ] , byte 0 [ 8 ] , byte 2 [ 7 ] , byte 1 [ 7 ] , Œ

Ñbyte 0 [ 7 ] , byte 2 [ 6 ] , byte 1 [ 6 ] , byte 0 [ 6 ] , byte 2 [ 5 ] , Œ

Ñbyte 1 [ 5 ] , byte 0 [ 5 ] , byte 2 [ 4 ] , byte 1 [ 4 ] , byte 0 [ 4 ] , Œ

Ñbyte 2 [ 3 ] , byte 1 [ 3 ] , byte 0 [ 3 ] , byte 2 [ 2 ] , byte 1 [ 2 ] , Œ

Ñbyte 0 [ 2 ] , byte 2 [ 1 ] , byte 1 [ 1 ] , byte 0 [ 1 ] , byte 2 [ 0 ] , Œ

Ñbyte 1 [ 0 ] , byte 0 [ 0 ] } ;end

//word counter s u b c i r c u i t counts 4´by t e words t i l l 8 .word counter C14 ( word reset , by t e t r i g g e r , word count ) ;always @( word count )begin

i f ( word count==4’b0000 )begin

f i n a l o u t pu t 0 t o p=byte data ;word re se t = 1 ’ b0 ;

end

else i f ( word count==4’b0001 )begin

f i n a l o u t pu t 1 t o p=byte data ;word re se t = 1 ’ b0 ;

end

else i f ( word count==4’b0010 )begin

f i n a l o u t pu t 2 t o p=byte data ;word re se t = 1 ’ b0 ;

end

else i f ( word count==4’b0011 )begin

f i n a l o u t pu t 3 t o p=byte data ;

76

Page 91: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

word re se t = 1 ’ b0 ;end

else i f ( word count==4’b0100 )begin

f i n a l o u t pu t 4 t o p=byte data ;word re se t = 1 ’ b0 ;

end

else i f ( word count==4’b0101 )begin

f i n a l o u t pu t 5 t o p=byte data ;word re se t = 1 ’ b0 ;

end

else i f ( word count==4’b0110 )begin

f i n a l o u t pu t 6 t o p=byte data ;word re se t = 1 ’ b0 ;

end

else i f ( word count==4’b0111 )begin

f i n a l o u t pu t 7 t o p=byte data ;word re se t = 1 ’ b1 ;

end

end

// t r an s f e r the 4´by t e words in t o another r e g i s t e r s .always @ (posedge word re se t )begin

f i n a l o u t pu t 0 <= f i n a l o u t pu t 0 t o p ;f i n a l o u t pu t 1 <= f i n a l o u t pu t 1 t o p ;f i n a l o u t pu t 2 <= f i n a l o u t pu t 2 t o p ;f i n a l o u t pu t 3 <= f i n a l o u t pu t 3 t o p ;f i n a l o u t pu t 4 <= f i n a l o u t pu t 4 t o p ;f i n a l o u t pu t 5 <= f i n a l o u t pu t 5 t o p ;f i n a l o u t pu t 6 <= f i n a l o u t pu t 6 t o p ;f i n a l o u t pu t 7 <= f i n a l o u t pu t 7 t o p ;

end

//Receive the t r i g g e r c r ea t e by Trigger . v and send out Œ

Ñanother t r i g g e r a f t e r the next 8 4´by t e words are ready .always @(posedge t r i g g e r , posedge word re se t )begin

i f ( t r i g g e r==1’b1 )begin

77

Page 92: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

t r i g g e r 2 <= 1 ’ b0 ;t r i g g e r 2 c r l <= 1 ’ b1 ;

end

else i f ( word re se t==1’b1 && t r i g g e r 2 c r l== 1 ’ b1 )begin

t r i g g e r 2 <= 1 ’ b1 ;t r i g g e r 2 c r l <= 1 ’ b0 ;

end

else

begin

t r i g g e r 2 <= 1 ’ b0 ;t r i g g e r 2 c r l <= 1 ’ b0 ;

end

end

//The Trigger s u b c i r c u i t r e c e i v e the t r i g g e r from RS´232 Œ

Ñand shor ten the s i g n a l to c r ea t e a t r i g g e r f o r FPGA.Trigger T0 (CLOCK 50, UARTRXD, t r i g g e r , t r i g g e r f ) ;always@ (posedge t r i g g e r 2 )begin

Count f i na l 0 <= f i n a l o u t pu t 0 ;Count f i na l 1 <= f i n a l o u t pu t 1 ;Count f i na l 2 <= f i n a l o u t pu t 2 ;Count f i na l 3 <= f i n a l o u t pu t 3 ;Count f i na l 4 <= f i n a l o u t pu t 4 ;Count f i na l 5 <= f i n a l o u t pu t 5 ;Count f i na l 6 <= f i n a l o u t pu t 6 ;Count f i na l 7 <= f i n a l o u t pu t 7 ;

end

// The counter to t r i g g e r the b a u d r a t e c l k in every Œ

Ñ1/19200 th o f a second .baud counter C1 ( baud rate c lk ,CLOCK 50, baud rate count ) ;always @( baud rate count )begin

i f ( baud rate count==13’b0101000101100 )baud ra t e c l k = 1 ’ b1 ;

else

baud ra t e c l k = 1 ’ b0 ;end

// The da ta ou t s u b c i r c u i t ou tpu t s the s i n g l e and Œ

Ñco inc idence counts through RS´232 every 1/10 th o f a Œ

78

Page 93: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Ñsecond .data out D0 ( Count f ina l 0 , Count f ina l 1 , Count f ina l 2 , Œ

ÑCount f ina l 3 , Count f ina l 4 , Count f ina l 5 , Count f ina l 6 , Œ

ÑCount f ina l 7 , baud rate c lk , t r i g g e r 2 ,UARTTXD) ;

////////////////////////////////////Extra Counts on FPGA Functions ////////////////////////////////////

// The co in c i d enc e pu l s e s u b c i r c u i t uses four AND gate toŒ

Ñ t e s t co inc idence counts between shor tened s i g n a l s . We Œ

Ñcan use the sw i t ch e s to turn o f f some s i g n a l s .c o i n c i d en c e pu l s e CP0 (A s , B s , C s , D s ,SW[ 0 ] ,SW[ 1 ] ,SW[ 2 ] , Œ

ÑSW[ 3 ] , Co inc idence 0 ) ;c o i n c i d en c e pu l s e CP1 (A s , B s , C s , D s ,SW[ 4 ] ,SW[ 5 ] ,SW[ 6 ] , Œ

ÑSW[ 7 ] , Co inc idence 1 ) ;c o i n c i d en c e pu l s e CP2 (A s , B s , C s , D s ,SW[ 8 ] ,SW[ 9 ] ,SWŒ

Ñ [ 1 0 ] ,SW[ 1 1 ] , Co inc idence 2 ) ;c o i n c i d en c e pu l s e CP3 (A s , B s , C s , D s ,SW[ 1 2 ] ,SW[ 1 3 ] ,SWŒ

Ñ [ 1 4 ] ,SW[ 1 5 ] , Co inc idence 3 ) ;

// The counter to t r i g g e r d a t a t r i g g e r r e s e t and Œ

Ñ d a t a t r i g g e r in every 1/10 th o f a second .da t a t r i g g e r c oun t e r C0 ( d a t a t r i g g e r r e s e t , baud rate c lk Œ

Ñ , d a t a t r i g g e r c oun t ) ;always @( da t a t r i g g e r c oun t )begin

i f ( d a t a t r i g g e r c oun t==15’b000011110000000 )begin

d a t a t r i g g e r r e s e t =1’b1 ;d a t a t r i g g e r = 1 ’ b1 ;end

else i f ( d a t a t r i g g e r c oun t==15’b000000000000000 )begin

d a t a t r i g g e r r e s e t =1’b0 ;d a t a t r i g g e r = 1 ’ b1 ;end

else i f ( d a t a t r i g g e r c oun t==15’b000000000000001 )begin

d a t a t r i g g e r r e s e t =1’b0 ;d a t a t r i g g e r = 1 ’ b1 ;end

else

79

Page 94: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

begin

d a t a t r i g g e r r e s e t =1’b0 ;d a t a t r i g g e r = 1 ’ b0 ;end

end

// 32 b i t s counters to count the s i n g l e and co inc i d en t Œ

Ñcounts in every 1/10 th o f a second .counter C4 ( d a t a t r i g g e r r e s e t , Coinc idence 0 , Count top 0 )Œ

Ñ ;counter C5 ( d a t a t r i g g e r r e s e t , Coinc idence 1 , Count top 1 )Œ

Ñ ;counter C6 ( d a t a t r i g g e r r e s e t , Coinc idence 2 , Count top 2 )Œ

Ñ ;counter C7 ( d a t a t r i g g e r r e s e t , Coinc idence 3 , Count top 3 )Œ

Ñ ;counter CA ( d a t a t r i g g e r r e s e t , A s , A top ) ;counter CB ( d a t a t r i g g e r r e s e t , B s , B top ) ;counter CC ( d a t a t r i g g e r r e s e t , C s , C top ) ;counter CD ( d a t a t r i g g e r r e s e t , D s , D top ) ;

// Set the s i n g l e and co inc idence photon count output Œ

Ñarrays every 1/10 th o f a second .always @(posedge d a t a t r i g g e r r e s e t )begin

A out <= A top ;B out <= B top ;C out <= C top ;D out <= D top ;Count out 0 <= Count top 0 ;Count out 1 <= Count top 1 ;Count out 2 <= Count top 2 ;Count out 3 <= Count top 3 ;

end

// The counter to t r i g g e r b c d r e s e t and b c d t r i g g e r in Œ

Ñevery second .bcd counter C2 ( bcd re se t , d a t a t r i g g e r r e s e t , bcd count ) ;always @( bcd count )begin

i f ( bcd count==4’b1010 )begin

bcd r e s e t = 1 ’ b1 ;

80

Page 95: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

b cd t r i g g e r = 1 ’ b1 ;end

else i f ( bcd count==4’b0000 )begin

bcd r e s e t = 1 ’ b0 ;b cd t r i g g e r = 1 ’ b1 ;end

else

begin

bcd r e s e t = 1 ’ b0 ;b cd t r i g g e r = 1 ’ b0 ;end

end

// The bcd choose s u b c i r c u i t chooses the s i g n a l to count Œ

Ñ in bcd counters and d i s p l a y the s i g n a l names in 7´seg Œ

Ñd i s p l a y 3 and 7 .bcd choose B0 (KEY[ 1 ] ,HEX7, bcd opt ion0 ) ;bcd choose B1 (KEY[ 0 ] ,HEX3, bcd opt ion1 ) ;

// Assign the choosen s i g n a l s to the bcd counter inpu t s Œ

Ñ0 .always @( bcd opt ion0 )begin

case ( bcd opt ion0 )3 ’ b000 : bcd data0<=A s ;3 ’ b001 : bcd data0<=B s ;3 ’ b010 : bcd data0<=C s ;3 ’ b011 : bcd data0<=D s ;3 ’ b100 : bcd data0<=Coinc idence 0 ;3 ’ b101 : bcd data0<=Coinc idence 1 ;3 ’ b110 : bcd data0<=Coinc idence 2 ;3 ’ b111 : bcd data0<=Coinc idence 3 ;

endcase

end

// Assign the choosen s i g n a l s to the bcd counter inpu t s Œ

Ñ1 .always @( bcd opt ion1 )begin

case ( bcd opt ion1 )3 ’ b000 : bcd data1<=A s ;3 ’ b001 : bcd data1<=B s ;

81

Page 96: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

3 ’ b010 : bcd data1<=C s ;3 ’ b011 : bcd data1<=D s ;3 ’ b100 : bcd data1<=Coinc idence 0 ;3 ’ b101 : bcd data1<=Coinc idence 1 ;3 ’ b110 : bcd data1<=Coinc idence 2 ;3 ’ b111 : bcd data1<=Coinc idence 3 ;

endcase

end

// The BCD C su b c i r c u i t counts the input s i g n a l and Œ

Ñoutput the counts in 12 d i g i t s BCD.BCD C BC0 ( bcd data0 , bcd count top 0 [ 1 ] , bcd count top 0Œ

Ñ [ 2 ] , bcd count top 0 [ 3 ] , bcd count top 0 [ 4 ] , Œ

Ñbcd count top 0 [ 5 ] , bcd count top 0 [ 6 ] , bcd count top 0Œ

Ñ [ 7 ] , bcd count top 0 [ 8 ] , bcd count top 0 [ 9 ] , Œ

Ñbcd count top 0 [ 1 0 ] , bcd count top 0 [ 1 1 ] , bcd count top 0Œ

Ñ [ 1 2 ] , b cd r e s e t ) ;BCD C BC1 ( bcd data1 , bcd count top 1 [ 1 ] , bcd count top 1Œ

Ñ [ 2 ] , bcd count top 1 [ 3 ] , bcd count top 1 [ 4 ] , Œ

Ñbcd count top 1 [ 5 ] , bcd count top 1 [ 6 ] , bcd count top 1Œ

Ñ [ 7 ] , bcd count top 1 [ 8 ] , bcd count top 1 [ 9 ] , Œ

Ñbcd count top 1 [ 1 0 ] , bcd count top 1 [ 1 1 ] , bcd count top 1Œ

Ñ [ 1 2 ] , b cd r e s e t ) ;

// Set the BCD count output arrays every second .always @(posedge bcd r e s e t )begin

bcd count out 0 [ 1 ] <= bcd count top 0 [ 1 ] ;bcd count out 0 [ 2 ] <= bcd count top 0 [ 2 ] ;bcd count out 0 [ 3 ] <= bcd count top 0 [ 3 ] ;bcd count out 0 [ 4 ] <= bcd count top 0 [ 4 ] ;bcd count out 0 [ 5 ] <= bcd count top 0 [ 5 ] ;bcd count out 0 [ 6 ] <= bcd count top 0 [ 6 ] ;bcd count out 0 [ 7 ] <= bcd count top 0 [ 7 ] ;bcd count out 0 [ 8 ] <= bcd count top 0 [ 8 ] ;bcd count out 0 [ 9 ] <= bcd count top 0 [ 9 ] ;bcd count out 0 [ 1 0 ] <= bcd count top 0 [ 1 0 ] ;bcd count out 0 [ 1 1 ] <= bcd count top 0 [ 1 1 ] ;bcd count out 0 [ 1 2 ] <= bcd count top 0 [ 1 2 ] ;bcd count out 1 [ 1 ] <= bcd count top 1 [ 1 ] ;bcd count out 1 [ 2 ] <= bcd count top 1 [ 2 ] ;bcd count out 1 [ 3 ] <= bcd count top 1 [ 3 ] ;bcd count out 1 [ 4 ] <= bcd count top 1 [ 4 ] ;

82

Page 97: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

bcd count out 1 [ 5 ] <= bcd count top 1 [ 5 ] ;bcd count out 1 [ 6 ] <= bcd count top 1 [ 6 ] ;bcd count out 1 [ 7 ] <= bcd count top 1 [ 7 ] ;bcd count out 1 [ 8 ] <= bcd count top 1 [ 8 ] ;bcd count out 1 [ 9 ] <= bcd count top 1 [ 9 ] ;bcd count out 1 [ 1 0 ] <= bcd count top 1 [ 1 0 ] ;bcd count out 1 [ 1 1 ] <= bcd count top 1 [ 1 1 ] ;bcd count out 1 [ 1 2 ] <= bcd count top 1 [ 1 2 ] ;

end

// The s c i en c e ou t s u b c i r c u i t reads the 12 b i t s BCD countŒ

Ñ and ou tpu t s t h r e e b i t s BCD in s c i e n t i f i c no ta t i on .s c i e n c e ou t S0 ( bcd count out 0 [ 1 ] , bcd count out 0 [ 2 ] , Œ

Ñbcd count out 0 [ 3 ] , bcd count out 0 [ 4 ] , bcd count out 0Œ

Ñ [ 5 ] , bcd count out 0 [ 6 ] , bcd count out 0 [ 7 ] , Œ

Ñbcd count out 0 [ 8 ] , bcd count out 0 [ 9 ] , bcd count out 0Œ

Ñ [ 1 0 ] , bcd count out 0 [ 1 1 ] , bcd count out 0 [ 1 2 ] , one0 , dec0 , Œ

Ñ exp0 ) ;s c i e n c e ou t S1 ( bcd count out 1 [ 1 ] , bcd count out 1 [ 2 ] , Œ

Ñbcd count out 1 [ 3 ] , bcd count out 1 [ 4 ] , bcd count out 1Œ

Ñ [ 5 ] , bcd count out 1 [ 6 ] , bcd count out 1 [ 7 ] , Œ

Ñbcd count out 1 [ 8 ] , bcd count out 1 [ 9 ] , bcd count out 1Œ

Ñ [ 1 0 ] , bcd count out 1 [ 1 1 ] , bcd count out 1 [ 1 2 ] , one1 , dec1 , Œ

Ñ exp1 ) ;

// The BCD display s u b c i r c u i t a s s i gn the s c i e n t i f i c Œ

Ñno ta t i on BCD nota t ion to the 7´seg d i s p l a y .BCD display BCD2 ( bcd t r i g g e r , one0 , HEX6) ;BCD display BCD3 ( bcd t r i g g e r , dec0 , HEX5) ;BCD display BCD4 ( bcd t r i g g e r , exp0 , HEX4) ;BCD display BCD5 ( bcd t r i g g e r , one1 , HEX2) ;BCD display BCD6 ( bcd t r i g g e r , dec1 , HEX1) ;BCD display BCD7 ( bcd t r i g g e r , exp1 , HEX0) ;

// The s ca l e c hoo s e s u b c i r c u i t chooses the exponent , b , Œ

Ñ to expre s s the count , C, in the form a , where C = a∗10ˆŒ

Ñb .s c a l e c h o o s e B2 (KEY[ 3 : 2 ] , s ca l e , e r r o r ) ;

// The bar s u b c i r c u i t tranform the count in t o a bar Œ

Ñ i n d i c a t o r by red LEDs .bar S2 ( bcd t r i g g e r , one0 , dec0 , exp0 , s ca l e , e r ro r , LEDRŒ

Ñ) ;

83

Page 98: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

// as s i gn s i g n a l s to green LEDs fo r debug purpose .assign LEDG[ 0 ] = t r i g g e r ;assign LEDG[ 1 ] = word re se t ;assign LEDG[ 2 ] = t r i g g e r 2 ;assign LEDG[ 3 ] = word count [ 1 ] ;assign LEDG[ 4 ] = 1 ’ b1 ;

// Connect the s i g n a l s and ground to the debug por t s in Œ

ÑGPIO 1 .assign GPIO 1 [ 1 0 ] = 1 ’b0 ,

GPIO 1 [ 1 2 ] = 1 ’b0 ,GPIO 1 [ 1 4 ] = 1 ’b0 ,GPIO 1 [ 1 6 ] = 1 ’b0 ,GPIO 1 [ 1 8 ] = 1 ’b0 ,GPIO 1 [ 2 0 ] = 1 ’b0 ,GPIO 1 [ 2 2 ] = 1 ’b0 ,GPIO 1 [ 2 4 ] = 1 ’b0 ,GPIO 1 [ 2 6 ] = 1 ’b0 ,GPIO 1 [ 2 8 ] = 1 ’b0 ,GPIO 1 [ 3 0 ] = 1 ’b0 ,GPIO 1 [ 3 2 ] = 1 ’b0 ,GPIO 1 [ 3 4 ] = 1 ’b0 ,GPIO 1 [ 3 5 ] = A,GPIO 1 [ 3 3 ] = B,GPIO 1 [ 3 1 ] = C,GPIO 1 [ 2 9 ] = D,GPIO 1 [ 2 7 ] = A s ,GPIO 1 [ 2 5 ] = B s ,GPIO 1 [ 2 3 ] = C s ,GPIO 1 [ 2 1 ] = D s ,GPIO 1 [ 1 9 ] = Coinc idence 0 ,GPIO 1 [ 1 7 ] = Coinc idence 1 ,GPIO 1 [ 1 5 ] = Coinc idence 2 ,GPIO 1 [ 1 3 ] = Coinc idence 3 ,GPIO 1 [ 1 1 ] = da t a t r i g g e r ;

endmodule

A.2 pulse shortener.v

module pu l s e s h o r t en e r ( pulse , pu l s e ou t ) ;// This i s the input pu l s e .

84

Page 99: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

input pu l s e ;// This i s the shor tened output pu l s e s .output reg [ 3 : 0 ] pu l s e ou t ;// These ne t s r ep r e s en t the de layed pu l s e s .wire [ 2 : 0 ] d e l ayed pu l s e ;

// The gate cha in X s u b c i r c u i t d e l a y s the s i g n a l by Œ

Ñpass ing i t through X in v e r t e r or b u f f e r ga t e s .ga t e cha in 13 GC13( pulse , d e l ayed pu l s e [ 0 ] ) ;g a t e cha in 19 GC19( pulse , d e l ayed pu l s e [ 1 ] ) ;g a t e cha in 23 GC23( pulse , d e l ayed pu l s e [ 2 ] ) ;

// Create the shor tened pu l s e by AND gate .always @∗

begin

pu l s e ou t [ 3 ] = pu l s e & (˜ de l ayed pu l s e [ 2 ] ) ;pu l s e ou t [ 2 ] = pu l s e & (˜ de l ayed pu l s e [ 1 ] ) ;pu l s e ou t [ 1 ] = pu l s e & (˜ de l ayed pu l s e [ 0 ] ) ;end

endmodule

A.3 gate chain 13.v

// non´i n v e r t i n g chain o f 13 ga t e s// 12 i n v e r t e r s + 1 b u f f e rmodule ga t e cha in 13 (A,B) ;

// Input undelayed pu l s e .input A;// Output de layed pu l s e .output B;// s yn t h e s i s keep = 1;wire [ 1 1 : 0 ] i n t e r n a l w i r e /∗ s yn t h e s i s p re s e rve = 1 ∗/ ;

// twe l v e i n v e r t e r s in chaini n v e r t e r INV 0 (A, i n t e r n a l w i r e [ 0 ] ) ;i n v e r t e r INV 1 ( i n t e r n a l w i r e [ 0 ] , i n t e r n a l w i r e [ 1 ] ) ;i n v e r t e r INV 2 ( i n t e r n a l w i r e [ 1 ] , i n t e r n a l w i r e [ 2 ] ) ;i n v e r t e r INV 3 ( i n t e r n a l w i r e [ 2 ] , i n t e r n a l w i r e [ 3 ] ) ;i n v e r t e r INV 4 ( i n t e r n a l w i r e [ 3 ] , i n t e r n a l w i r e [ 4 ] ) ;i n v e r t e r INV 5 ( i n t e r n a l w i r e [ 4 ] , i n t e r n a l w i r e [ 5 ] ) ;i n v e r t e r INV 6 ( i n t e r n a l w i r e [ 5 ] , i n t e r n a l w i r e [ 6 ] ) ;i n v e r t e r INV 7 ( i n t e r n a l w i r e [ 6 ] , i n t e r n a l w i r e [ 7 ] ) ;

85

Page 100: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

i n v e r t e r INV 8 ( i n t e r n a l w i r e [ 7 ] , i n t e r n a l w i r e [ 8 ] ) ;i n v e r t e r INV 9 ( i n t e r n a l w i r e [ 8 ] , i n t e r n a l w i r e [ 9 ] ) ;i n v e r t e r INV 10 ( i n t e r n a l w i r e [ 9 ] , i n t e r n a l w i r e [ 1 0 ] ) ;i n v e r t e r INV 11 ( i n t e r n a l w i r e [ 1 0 ] , i n t e r n a l w i r e [ 1 1 ] ) ;// one b u f f e rbu f f e r BUF 0( i n t e r n a l w i r e [ 1 1 ] ,B) ;

endmodule

A.4 gate chain 19.v

// non´i n v e r t i n g chain o f 13 ga t e s// 12 i n v e r t e r s + 1 b u f f e rmodule ga t e cha in 13 (A,B) ;

// Input undelayed pu l s e .input A;// Output de layed pu l s e .output B;// s yn t h e s i s keep = 1;wire [ 1 1 : 0 ] i n t e r n a l w i r e /∗ s yn t h e s i s p re s e rve = 1 ∗/ ;

// twe l v e i n v e r t e r s in chaini n v e r t e r INV 0 (A, i n t e r n a l w i r e [ 0 ] ) ;i n v e r t e r INV 1 ( i n t e r n a l w i r e [ 0 ] , i n t e r n a l w i r e [ 1 ] ) ;i n v e r t e r INV 2 ( i n t e r n a l w i r e [ 1 ] , i n t e r n a l w i r e [ 2 ] ) ;i n v e r t e r INV 3 ( i n t e r n a l w i r e [ 2 ] , i n t e r n a l w i r e [ 3 ] ) ;i n v e r t e r INV 4 ( i n t e r n a l w i r e [ 3 ] , i n t e r n a l w i r e [ 4 ] ) ;i n v e r t e r INV 5 ( i n t e r n a l w i r e [ 4 ] , i n t e r n a l w i r e [ 5 ] ) ;i n v e r t e r INV 6 ( i n t e r n a l w i r e [ 5 ] , i n t e r n a l w i r e [ 6 ] ) ;i n v e r t e r INV 7 ( i n t e r n a l w i r e [ 6 ] , i n t e r n a l w i r e [ 7 ] ) ;i n v e r t e r INV 8 ( i n t e r n a l w i r e [ 7 ] , i n t e r n a l w i r e [ 8 ] ) ;i n v e r t e r INV 9 ( i n t e r n a l w i r e [ 8 ] , i n t e r n a l w i r e [ 9 ] ) ;i n v e r t e r INV 10 ( i n t e r n a l w i r e [ 9 ] , i n t e r n a l w i r e [ 1 0 ] ) ;i n v e r t e r INV 11 ( i n t e r n a l w i r e [ 1 0 ] , i n t e r n a l w i r e [ 1 1 ] ) ;// one b u f f e rbu f f e r BUF 0( i n t e r n a l w i r e [ 1 1 ] ,B) ;

endmodule

A.5 gate chain 23.v

// non´i n v e r t i n g chain o f 13 ga t e s// 12 i n v e r t e r s + 1 b u f f e r

86

Page 101: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

module ga t e cha in 13 (A,B) ;// Input undelayed pu l s e .input A;// Output de layed pu l s e .output B;// s yn t h e s i s keep = 1;wire [ 1 1 : 0 ] i n t e r n a l w i r e /∗ s yn t h e s i s p re s e rve = 1 ∗/ ;

// twe l v e i n v e r t e r s in chaini n v e r t e r INV 0 (A, i n t e r n a l w i r e [ 0 ] ) ;i n v e r t e r INV 1 ( i n t e r n a l w i r e [ 0 ] , i n t e r n a l w i r e [ 1 ] ) ;i n v e r t e r INV 2 ( i n t e r n a l w i r e [ 1 ] , i n t e r n a l w i r e [ 2 ] ) ;i n v e r t e r INV 3 ( i n t e r n a l w i r e [ 2 ] , i n t e r n a l w i r e [ 3 ] ) ;i n v e r t e r INV 4 ( i n t e r n a l w i r e [ 3 ] , i n t e r n a l w i r e [ 4 ] ) ;i n v e r t e r INV 5 ( i n t e r n a l w i r e [ 4 ] , i n t e r n a l w i r e [ 5 ] ) ;i n v e r t e r INV 6 ( i n t e r n a l w i r e [ 5 ] , i n t e r n a l w i r e [ 6 ] ) ;i n v e r t e r INV 7 ( i n t e r n a l w i r e [ 6 ] , i n t e r n a l w i r e [ 7 ] ) ;i n v e r t e r INV 8 ( i n t e r n a l w i r e [ 7 ] , i n t e r n a l w i r e [ 8 ] ) ;i n v e r t e r INV 9 ( i n t e r n a l w i r e [ 8 ] , i n t e r n a l w i r e [ 9 ] ) ;i n v e r t e r INV 10 ( i n t e r n a l w i r e [ 9 ] , i n t e r n a l w i r e [ 1 0 ] ) ;i n v e r t e r INV 11 ( i n t e r n a l w i r e [ 1 0 ] , i n t e r n a l w i r e [ 1 1 ] ) ;// one b u f f e rbu f f e r BUF 0( i n t e r n a l w i r e [ 1 1 ] ,B) ;

endmodule

A.6 inverter.v

// s imple i n v e r t e rmodule i n v e r t e r (A,Y) ;input A;output reg Y; // no t i c e output i s a v a r i a b l e ( reg )// as s i gn Y = ˜A;always @(∗ )begin

Y = ˜A;end

endmodule

A.7 buffer.v

// s imple b u f f e rmodule bu f f e r (A,B) ;

87

Page 102: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

input A;output reg B; // no t i c e output i s a v a r i a b l e ( reg )always @(∗ )begin

B = A;end

endmodule

A.8 mux4to1.v

module mux4to1 ( de layedpu l se 0 , de layedpu l se 1 , Œ

Ñde layedpu l se 2 , pulse , SW, pu l seout ) ;// Input four d i f f e r e n t shor tened pu l s e s .input de layedpu l se 0 , de layedpu l se 1 , de layedpu l se 2 , Œ

Ñpu l s e ;// Swi tches to p i ck the output shor tened pu l s e .input [ 1 : 0 ] SW;// The output f o r the chossen shor tened pu l s e .output reg pu l seout ;

always @∗begin

case (SW)2 ’ b00 : pu l s eout = pu l s e ;2 ’ b01 : pu l s eout = de l ayedpu l s e 2 ;2 ’ b10 : pu l s eout = de l ayedpu l s e 1 ;2 ’ b11 : pu l s eout = de l ayedpu l s e 0 ;

endcase

end

endmodule

A.9 time bin counter.v

8-bit lpm-counter with asynchronous reset created by MegaWizard Plugin Manager

A.10 data counter.v

2-bit lpm-counter with asynchronous reset created by MegaWizard Plugin Manager

A.11 sift.v

88

Page 103: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

module s i f t ( t r i g g e r , A, B, C, D, data ) ;// The time´b in t r i g g e r f o r every time´b in .input t r i g g e r ;// The counts f o r each time´b in .input [ 1 : 0 ] A, B, C, D;// The f i n a l 3´ b i t output f o r each time bin .output reg [ 2 : 0 ] data ;

// The th r e e checks f o r the v a l i d i t y o f the time´b in .reg check1 , check2 , check3 ;

always @(posedge t r i g g e r )begin

check1 = A [ 1 ] | |B [ 1 ] | |C [ 1 ] | |D[ 1 ] ;check2 = (A[0]&&B[ 0 ] ) | | (C[0]&&D[ 0 ] ) ;check3 = ( ( !A[ 0 ] ) &&(!B [ 0 ] ) ) | | ( ( ! C [ 0 ] ) &&(!D[ 0 ] ) ) ;i f ( check1 == 1)begin

data = 3 ’ b100 ;end

else i f ( check2 == 1)begin

data = 3 ’ b101 ;end

else i f ( check3 == 1)begin

data = 3 ’ b110 ;end

else

begin

data [ 2 ] = 1 ’ b0 ;data [ 1 ] = C [ 0 ] ;data [ 0 ] = A[ 0 ] ;

end

end

endmodule

A.12 byte counter.v

module byte counte r ( t r i g g e r , s i gna l , count , data ) ;

//Note : This s u b c i r c u i t to be modi f i ed so t ha t the s i f t i n g Œ

Ñproces s to be done at FPGA ins t eaad o f PC end .

89

Page 104: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

// The r e s e t f o r t h i s counter .input t r i g g e r ;// The input s i g n a l f o r t h i s counter .input s i g n a l ;// The count f o r t h i s counter .output reg [ 4 : 0 ] count ;// The input data to check i f the time´b in i s v a l i d .input [ 2 : 0 ] data ;

always @(posedge t r i g g e r or posedge s i g n a l )begin

i f ( t r i g g e r )count <= 5 ’ b00000 ;

else

begin

i f ( data [2]==0)begin

count <= count + 1 ’ b1 ;end

else

begin

count <= count +1’b1 ;end

end

end

endmodule

A.13 word counter.v

4-bit lpm-counter with asynchronous reset created by MegaWizard Plugin Manager

A.14 Trigger.v

module Trigger (CLOCK, UARTRXD, t r i g , t r i g f ) ;

// The 50MHz c l o c k .input CLOCK;// The t r i g g e r s i g n a l from RS´232.input UARTRXD;// The shor tened t r i g g e r 1 .output reg t r i g ;

90

Page 105: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

// The shor tened t r i g g e r 2 .output reg t r i g f ;// The counter c l e a r .reg t r i g g e r c l e a r ;// The two counter enab l e s .reg t r i g g e r en , t r i g g e r e n 1 ;// The count f o r the counter .wire [ 1 4 : 0 ] t r i g g e r c oun t ;

// A 15´ b i t counter wi th r e s e t and enab l e .t r i g g e r c o un t e r TC0( t r i g g e r c l e a r ,CLOCK, t r i g g e r e n | | Œ

Ñ t r i g g e r en1 , t r i g g e r c oun t ) ;

always@ ( t r i g g e r c oun t )begin

i f ( t r i g g e r c oun t==15’b110000110101000 )begin

t r i g g e r c l e a r = 1 ’ b1 ;t r i g g e r e n = 1 ’ b1 ;t r i g f = 1 ’ b1 ;

end

else i f ( t r i g g e r c oun t ==15’b000000000000000 )begin

t r i g g e r c l e a r = 1 ’ b0 ;t r i g g e r e n = 1 ’ b0 ;t r i g f = 1 ’ b0 ;

end

else

begin

t r i g g e r c l e a r = 1 ’ b0 ;t r i g g e r e n = 1 ’ b1 ;t r i g f = 1 ’ b0 ;

end

end

always@ (negedge UARTRXD)begin

i f ( t r i g g e r e n == 1 ’ b0 )begin

t r i g = 1 ’ b1 ;t r i g g e r e n 1 = 1 ’ b1 ;

end

else

91

Page 106: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

begin

t r i g = 1 ’ b0 ;t r i g g e r e n 1 = 1 ’ b0 ;

end

end

endmodule

A.15 trigger counter.v

15-bit lpm-counter with asynchronous reset and count enable port created by MegaWiz-

ard Plugin Manager

A.16 baud counter.v

13-bit lpm-counter with asynchronous reset created by MegaWizard Plugin Manager

A.17 data out.v

module data out (A,B,C,D, Coinc idence 0 , Coinc idence 1 , Œ

ÑCoinc idence 2 , Coinc idence 3 , c lk , d a t a t r i g g e r ,UARTTXD) ;// Input s i g n a l and co inc i d en t counts in 32 b i t s .input [ 3 1 : 0 ] A,B,C,D, Coinc idence 0 , Coinc idence 1 , Œ

ÑCoinc idence 2 , Co inc idence 3 ;// Input 19200Hz c l o c k and 10Hz c l o c k .input c lk , d a t a t r i g g e r ;// Output to RS´232.output reg UARTTXD;

// This v a r i a b l e counts the output time bin .reg [ 5 : 0 ] index ;// This v a r i a b l e s e l e c t s the count be ing output .reg [ 3 1 : 0 ] Output ;// This v a r i a b l e counts the count be ing output .reg [ 2 : 0 ] d a t a s e l e c t ;

always @(posedge c l k )begin

i f ( ( index==6’b111111 )&( d a t a t r i g g e r==1’b1 ) )begin

index=6’b000000 ;

92

Page 107: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

UARTTXD=1’b1 ;Output=A;d a t a s e l e c t =3’b000 ;

end

else i f ( index==6’b000000 )begin

index=6’b000001 ;UARTTXD=1’b0 ;

end

else i f ( index==6’b000001 )begin

index=6’b000010 ;UARTTXD=Output [ 0 ] ;

end

else i f ( index==6’b000010 )begin

index=6’b000011 ;UARTTXD=Output [ 1 ] ;

end

else i f ( index==6’b000011 )begin

index=6’b000100 ;UARTTXD=Output [ 2 ] ;

end

else i f ( index==6’b000100 )begin

index=6’b000101 ;UARTTXD=Output [ 3 ] ;

end

else i f ( index==6’b000101 )begin

index=6’b000110 ;UARTTXD=Output [ 4 ] ;

end

else i f ( index==6’b000110 )begin

index=6’b000111 ;UARTTXD=Output [ 5 ] ;

end

else i f ( index==6’b000111 )begin

index=6’b001000 ;UARTTXD=Output [ 6 ] ;

93

Page 108: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

end

else i f ( index==6’b001000 )begin

index=6’b001001 ;UARTTXD=1’b0 ;

end

else i f ( index==6’b001001 )begin

index=6’b001010 ;UARTTXD=1’b1 ;

end

else i f ( index==6’b001010 )begin

index=6’b001011 ;UARTTXD=1’b0 ;

end

else i f ( index==6’b001011 )begin

index=6’b001100 ;UARTTXD=Output [ 7 ] ;

end

else i f ( index==6’b001100 )begin

index=6’b001101 ;UARTTXD=Output [ 8 ] ;

end

else i f ( index==6’b001101 )begin

index=6’b001110 ;UARTTXD=Output [ 9 ] ;

end

else i f ( index==6’b001110 )begin

index=6’b001111 ;UARTTXD=Output [ 1 0 ] ;

end

else i f ( index==6’b001111 )begin

index=6’b010000 ;UARTTXD=Output [ 1 1 ] ;

end

else i f ( index==6’b010000 )begin

94

Page 109: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

index=6’b010001 ;UARTTXD=Output [ 1 2 ] ;

end

else i f ( index==6’b010001 )begin

index=6’b010010 ;UARTTXD=Output [ 1 3 ] ;

end

else i f ( index==6’b010010 )begin

index=6’b010011 ;UARTTXD=1’b0 ;

end

else i f ( index==6’b010011 )begin

index=6’b010100 ;UARTTXD=1’b1 ;

end

else i f ( index==6’b010100 )begin

index=6’b010101 ;UARTTXD=1’b0 ;

end

else i f ( index==6’b010101 )begin

index=6’b010110 ;UARTTXD=Output [ 1 4 ] ;

end

else i f ( index==6’b010110 )begin

index=6’b010111 ;UARTTXD=Output [ 1 5 ] ;

end

else i f ( index==6’b010111 )begin

index=6’b011000 ;UARTTXD=Output [ 1 6 ] ;

end

else i f ( index==6’b011000 )begin

index=6’b011001 ;UARTTXD=Output [ 1 7 ] ;

end

95

Page 110: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

else i f ( index==6’b011001 )begin

index=6’b011010 ;UARTTXD=Output [ 1 8 ] ;

end

else i f ( index==6’b011010 )begin

index=6’b011011 ;UARTTXD=Output [ 1 9 ] ;

end

else i f ( index==6’b011011 )begin

index=6’b011100 ;UARTTXD=Output [ 2 0 ] ;

end

else i f ( index==6’b011100 )begin

index=6’b011101 ;UARTTXD=1’b0 ;

end

else i f ( index==6’b011101 )begin

index=6’b011110 ;UARTTXD=1’b1 ;

end

else i f ( index==6’b011110 )begin

index=6’b011111 ;UARTTXD=1’b0 ;

end

else i f ( index==6’b011111 )begin

index=6’b100000 ;UARTTXD=Output [ 2 1 ] ;

end

else i f ( index==6’b100000 )begin

index=6’b100001 ;UARTTXD=Output [ 2 2 ] ;

end

else i f ( index==6’b100001 )begin

index=6’b100010 ;

96

Page 111: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

UARTTXD=Output [ 2 3 ] ;end

else i f ( index==6’b100010 )begin

index=6’b100011 ;UARTTXD=Output [ 2 4 ] ;

end

else i f ( index==6’b100011 )begin

index=6’b100100 ;UARTTXD=Output [ 2 5 ] ;

end

else i f ( index==6’b100100 )begin

index=6’b100101 ;UARTTXD=Output [ 2 6 ] ;

end

else i f ( index==6’b100101 )begin

index=6’b100110 ;UARTTXD=Output [ 2 7 ] ;

end

else i f ( index==6’b100110 )begin

index=6’b100111 ;UARTTXD=1’b0 ;

end

else i f ( index==6’b100111 )begin

index=6’b101000 ;UARTTXD=1’b1 ;

end

else i f ( index==6’b101000 )begin

index=6’b101001 ;UARTTXD=1’b0 ;

end

else i f ( index==6’b101001 )begin

index=6’b101010 ;UARTTXD=Output [ 2 8 ] ;

end

else i f ( index==6’b101010 )

97

Page 112: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

begin

index=6’b101011 ;UARTTXD=Output [ 2 9 ] ;

end

else i f ( index==6’b101011 )begin

index=6’b101100 ;UARTTXD=Output [ 3 0 ] ;

end

else i f ( index==6’b101100 )begin

index=6’b101101 ;UARTTXD=Output [ 3 1 ] ;

end

else i f ( index==6’b101101 )begin

index=6’b101110 ;UARTTXD=1’b0 ;

end

else i f ( index==6’b101110 )begin

index=6’b101111 ;UARTTXD=1’b0 ;

end

else i f ( index==6’b101111 )begin

index=6’b110000 ;UARTTXD=1’b0 ;

end

else i f ( index==6’b110000 )begin

index=6’b110001 ;UARTTXD=1’b0 ;

end

else i f ( ( index==6’b110001 )&( d a t a s e l e c t==3’b000 ) )begin

index=6’b000000 ;d a t a s e l e c t =3’b001 ;Output=B;UARTTXD=1’b1 ;

end

else i f ( ( index==6’b110001 )&( d a t a s e l e c t==3’b001 ) )begin

98

Page 113: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

index=6’b000000 ;d a t a s e l e c t =3’b010 ;Output=C;UARTTXD=1’b1 ;

end

else i f ( ( index==6’b110001 )&( d a t a s e l e c t==3’b010 ) )begin

index=6’b000000 ;d a t a s e l e c t =3’b011 ;Output=D;UARTTXD=1’b1 ;

end

else i f ( ( index==6’b110001 )&( d a t a s e l e c t==3’b011 ) )begin

index=6’b000000 ;d a t a s e l e c t =3’b100 ;Output=Coinc idence 0 ;UARTTXD=1’b1 ;

end

else i f ( ( index==6’b110001 )&( d a t a s e l e c t==3’b100 ) )begin

index=6’b000000 ;d a t a s e l e c t =3’b101 ;Output=Coinc idence 1 ;UARTTXD=1’b1 ;

end

else i f ( ( index==6’b110001 )&( d a t a s e l e c t==3’b101 ) )begin

index=6’b000000 ;d a t a s e l e c t =3’b110 ;Output=Coinc idence 2 ;UARTTXD=1’b1 ;

end

else i f ( ( index==6’b110001 )&( d a t a s e l e c t==3’b110 ) )begin

index=6’b000000 ;d a t a s e l e c t =3’b111 ;Output=Coinc idence 3 ;UARTTXD=1’b1 ;

end

else i f ( ( index==6’b110001 )&( d a t a s e l e c t==3’b111 ) )begin

index=6’b110010 ;

99

Page 114: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

UARTTXD=1’b1 ;end

else i f ( index==6’b110010 )begin

index=6’b111111 ;UARTTXD=1’b0 ;

end

else

begin

index=6’b111111 ;UARTTXD=1’b1 ;

end

end

endmodule

A.18 coincidence pulse.v

module c o i n c i d en c e pu l s e ( a , b , c , d , e , f , g , h , y ) ;// Input o f four shor tened s i g n a l s and the four sw i t ch e s Œ

Ñ to c on t r o l the co inc idence counter .input a , b , c , d , e , f , g , h ;// Coincident count s i g n a l .output y ;

assign y = ( a |˜ e )&(b |˜ f )&(c |˜ g )&(d |˜ h) ;endmodule

A.19 data trigger counter.v

15-bit lpm-counter with asynchronous reset created by MegaWizard Plugin Manager

A.20 counter.v

32-bit lpm-counter with asynchronous reset created by MegaWizard Plugin Manager

A.21 BCD counter.v

4-bit lpm-counter with asynchronous reset created by MegaWizard Plugin Manager

A.22 bcd choose.v

100

Page 115: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

module bcd choose (KEY,HEX, bcd opt ion ) ;// This input t r i g g e r to change the source f o r bcd Œ

Ñcounter .input [ 0 : 0 ] KEY;// This output d i s p l a y s the name o f the source on the bcdŒ

Ñ counter .output reg [ 6 : 0 ] HEX;// This output d i s p l a y s the code o f the source o f the bcdŒ

Ñ counter .output reg [ 2 : 0 ] bcd opt ion ;

always @(posedge KEY)case ( bcd opt ion )

3 ’ b000 : {bcd option , HEX}= 10 ’ b0010000000 ;3 ’ b001 : {bcd option , HEX}= 10 ’ b0100110001 ;3 ’ b010 : {bcd option , HEX}= 10 ’ b0110000001 ;3 ’ b011 : {bcd option , HEX}= 10 ’ b1001001111 ;3 ’ b100 : {bcd option , HEX}= 10 ’ b1010010010 ;3 ’ b101 : {bcd option , HEX}= 10 ’ b1100000110 ;3 ’ b110 : {bcd option , HEX}= 10 ’ b1111001100 ;3 ’ b111 : {bcd option , HEX}= 10 ’ b0000001000 ;

endcase

endmodule

A.23 BCD C.v

module BCD C ( data , bcd1 , bcd2 , bcd3 , bcd4 , bcd5 , bcd6 , Œ

Ñbcd7 , bcd8 , bcd9 , bcd10 , bcd11 , bcd12 , r e s e t ) ;// This input i s the s i g n a l to be counted .input data ;// This output i s the count in 12 d i g i t s BCD.output [ 3 : 0 ] bcd1 , bcd2 , bcd3 , bcd4 , bcd5 , bcd6 , bcd7 , Œ

Ñbcd8 , bcd9 , bcd10 , bcd11 , bcd12 ;// The r e s e t f o r the counter .input r e s e t ;// This net i s f o r carry to next d i g i t .wire [ 1 3 : 2 ] p ;

// The BCD C C su b c i r c u i t s i s a one d i g i t s BCD counter Œ

Ñwith carry and r e s e t .BCD C C bcd c1 ( data , bcd1 , p [ 2 ] , r e s e t ) ;BCD C C bcd c2 (p [ 2 ] , bcd2 , p [ 3 ] , r e s e t ) ;BCD C C bcd c3 (p [ 3 ] , bcd3 , p [ 4 ] , r e s e t ) ;

101

Page 116: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

BCD C C bcd c4 (p [ 4 ] , bcd4 , p [ 5 ] , r e s e t ) ;BCD C C bcd c5 (p [ 5 ] , bcd5 , p [ 6 ] , r e s e t ) ;BCD C C bcd c6 (p [ 6 ] , bcd6 , p [ 7 ] , r e s e t ) ;BCD C C bcd c7 (p [ 7 ] , bcd7 , p [ 8 ] , r e s e t ) ;BCD C C bcd c8 (p [ 8 ] , bcd8 , p [ 9 ] , r e s e t ) ;BCD C C bcd c9 (p [ 9 ] , bcd9 , p [ 1 0 ] , r e s e t ) ;BCD C C bcd c10 (p [ 1 0 ] , bcd10 , p [ 1 1 ] , r e s e t ) ;BCD C C bcd c11 (p [ 1 1 ] , bcd11 , p [ 1 2 ] , r e s e t ) ;BCD C C bcd c12 (p [ 1 2 ] , bcd12 , p [ 1 3 ] , r e s e t ) ;

endmodule

A.24 BCD C C.v

module BCD C C (C in , C out , C plus , r e s e t ) ;// This input i s the s i g n a l to be counted .input C in ;// This output i s on when the C out reaches 0 . Let the Œ

Ñnext d i g i t to count one .output reg C plus ;// This output i s the count in the current d i g i t .output reg [ 3 : 0 ] C out ;// The r e s e t f o r the counter .input r e s e t ;

always @(posedge C in , posedge r e s e t )begin

i f ( r e s e t==1)begin

C out<=4’b0000 ;C plus<=0;end

else

begin

i f ( C out==4’b1001 )begin

C out<=4’b0000 ;C plus<=1;

end

else

begin

C out<=C out+1;C plus<=0;

102

Page 117: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

end

end

end

endmodule

A.25 science out.v

module s c i e n c e ou t ( bcd1 , bcd2 , bcd3 , bcd4 , bcd5 , bcd6 , Œ

Ñbcd7 , bcd8 , bcd9 , bcd10 , bcd11 , bcd12 , one , dec , exp ) ;// These inpu t s are the 12 b i t s BCD to be conver t .input [ 3 : 0 ] bcd1 , bcd2 , bcd3 , bcd4 , bcd5 , bcd6 , bcd7 , Œ

Ñbcd8 , bcd9 , bcd10 , bcd11 , bcd12 ;// These ou tpu t s are the 3 b i t s BCD in s c i e n t i f i c Œ

Ñno ta t i on . ( a . b∗10ˆc )output reg [ 3 : 0 ] one , dec , exp ;

always @∗begin

i f ( bcd12 != 4 ’ b0000 )begin

one<=bcd12 ;dec<=bcd11 ;exp<=11;end

else i f ( bcd11 !=4 ’ b0000 )begin

one<=bcd11 ;dec<=bcd10 ;exp<=10;end

else i f ( bcd10 !=4 ’ b0000 )begin

one<=bcd10 ;dec<=bcd9 ;exp<=9;end

else i f ( bcd9 !=4 ’ b0000 )begin

one<=bcd9 ;dec<=bcd8 ;exp<=8;end

else i f ( bcd8 !=4 ’ b0000 )

103

Page 118: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

begin

one<=bcd8 ;dec<=bcd7 ;exp<=7;end

else i f ( bcd7 !=4 ’ b0000 )begin

one<=bcd7 ;dec<=bcd6 ;exp<=6;end

else i f ( bcd6 !=4 ’ b0000 )begin

one<=bcd6 ;dec<=bcd5 ;exp<=5;end

else i f ( bcd5 !=4 ’ b0000 )begin

one<=bcd5 ;dec<=bcd4 ;exp<=4;end

else i f ( bcd4 !=4 ’ b0000 )begin

one<=bcd4 ;dec<=bcd3 ;exp<=3;end

else i f ( bcd3 !=4 ’ b0000 )begin

one<=bcd3 ;dec<=bcd2 ;exp<=2;end

else

begin

one<=bcd2 ;dec<=bcd1 ;exp<=1;end

end

endmodule

104

Page 119: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

A.26 BCD display.v

module BCD display ( t r i g g e r , BCD in , BCD out ) ;// This input i s the BCD d i g i t to be d i s p l a y .input [ 3 : 0 ] BCD in ;// This input i s the c l o c k to t r i g g e r the d i s p l a y .input t r i g g e r ;// This output the d i g i t to the 7´seg d i s p l a y format .output reg [ 6 : 0 ] BCD out ;

always @ (posedge t r i g g e r )begin

case (BCD in )0 : BCD out<=7’b0000001 ;1 : BCD out<=7’b1001111 ;2 : BCD out<=7’b0010010 ;3 : BCD out<=7’b0000110 ;4 : BCD out<=7’b1001100 ;5 : BCD out<=7’b0100100 ;6 : BCD out<=7’b0100000 ;7 : BCD out<=7’b0001111 ;8 : BCD out<=7’b0000000 ;9 : BCD out<=7’b0000100 ;endcase

end

endmodule

A.27 scale choose.v

module s c a l e c h o o s e (KEY, s ca l e , e r r o r ) ;// This input t r i g g e r to change the source f o r bcd Œ

Ñcounter .input [ 1 : 0 ] KEY;// This output d i s p l a y s the name o f the source on the bcdŒ

Ñ counter .output reg [ 3 : 0 ] s c a l e ;// This output d i s p l a y s the code o f the source o f the bcdŒ

Ñ counter .output reg e r r o r ;

always @(posedge KEY)begin

105

Page 120: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

i f (KEY[1]==1)begin

i f ( s c a l e==4’b1111 )e r ro r <=1;

else

begin

s c a l e <=s c a l e +1;e r r o r <=0;

end

end

else i f (KEY[0]==1)begin

i f ( s c a l e==4’b0000 )e r ro r <=1;

else

begin

s c a l e <=sca l e ´1;e r r o r <=0;

end

end

end

endmodule

A.28 bar.v

module bar ( t r i g g e r , one , dec , exp , s ca l e , e r ro r , LEDR) ;

// The 1Hz t r i g g e r f o r bar i n d i c a t o r .input t r i g g e r ;// The number to be shown .input [ 3 : 0 ] one , dec , exp ;// The s c a l e f o r the bar i n d i c a t o r .input [ 3 : 0 ] s c a l e ;// The error s i g n a l i f s c a l e i s out o f bound .input e r r o r ;// The output f o r the bar i n d i c a t o r .output reg [ 1 7 : 0 ] LEDR;

always @ (posedge t r i g g e r )begin

i f ( exp>=s c a l e +1)LEDR=18’ b111111111111111111 ;

else i f ( exp<=sca l e ´2)

106

Page 121: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

LEDR=18’ b000000000000000000 ;else i f ( ( exp==s c a l e )&(one !=1) )LEDR=18’ b111111111111111111 ;

else i f ( ( exp==s c a l e )&(one==1))begin

case ( dec )4 ’ b0000 : LEDR=18’ b000000001111111111 ;4 ’ b0001 : LEDR=18’ b000000011111111111 ;4 ’ b0010 : LEDR=18’ b000000111111111111 ;4 ’ b0011 : LEDR=18’ b000001111111111111 ;4 ’ b0100 : LEDR=18’ b000011111111111111 ;4 ’ b0101 : LEDR=18’ b000111111111111111 ;4 ’ b0110 : LEDR=18’ b001111111111111111 ;4 ’ b0111 : LEDR=18’ b011111111111111111 ;4 ’ b1000 : LEDR=18’ b111111111111111111 ;4 ’ b1001 : LEDR=18’ b111111111111111111 ;

endcase

end

else i f ( exp==sca l e ´1)begin

case ( one )4 ’ b0000 : LEDR=18’ b000000000000000000 ;4 ’ b0001 : LEDR=18’ b000000000000000001 ;4 ’ b0010 : LEDR=18’ b000000000000000011 ;4 ’ b0011 : LEDR=18’ b000000000000000111 ;4 ’ b0100 : LEDR=18’ b000000000000001111 ;4 ’ b0101 : LEDR=18’ b000000000000011111 ;4 ’ b0110 : LEDR=18’ b000000000000111111 ;4 ’ b0111 : LEDR=18’ b000000000001111111 ;4 ’ b1000 : LEDR=18’ b000000000011111111 ;4 ’ b1001 : LEDR=18’ b000000000111111111 ;

endcase

end

end

endmodule

107

Page 122: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

Bibliography

[1] C. H. Bennett and G. Brassard. Quantum cryptography: public key distributionand coin tossing. In Proceeding of IEEE Internatinal Conference on Computers,Systems, and Signal Processing, page 175, Bangalore, India, 1984. IEEE, NewYork.

[2] D. Mayers. Quantum key distribution and string oblivious transfer in noisychannels. In Advances in Cryptography - Proceedings of Crypto ’96, pages 343–357, Berlin, 1996. Springer.

[3] D. Mayers. Unconditional security in quantum cryptography. Journal of ACM,2001.

[4] H. Inamori, N. Lutkenhaus, and D. Mayers. Unconditional security of practicalquantum key distribution. Eur. Phys. J. D, 41(3):599–627, 2007.

[5] R. L. Rivest, A. Shamir, and L. Adleman. A method for obtaining digitalsignatures and public-key cryptosystems. Communications of the ACM, 21(2):120–126, 1978.

[6] P. Shor. Algorithm for quantum computation: discrete logarithms and factor-ing. In Proc.35th Ann. Symp. Found. Comp. Sci., volume 124, Los Alamitos,California, 1994. IEEE Comp.Soc.Press.

[7] A. K. Ekert. Quantum cryptography based on bell’s theorem. Phy. Rev. Lett.,67(6):661–663, 1991.

[8] C. H. Bennett. Quantum cryptography using any two nonorthogonal states.Phy. Rev. Lett., 68(21):3121–3124, 1992.

[9] H. Lo, X. Ma, and K. Chen. Decoy state quantum key distribution. Phy. Rev.Lett., 94(230504), 2005.

[10] A. Einstein, B. Podolsky, and N. Rosen. Can quantum-mechanical descriptionof physical reality be considered complete? Phy. Rev., 47:777–780, 1935.

[11] J. S. Bell. On the einstein podolsky rosen paradox. Physics, 1:195–200, 1964.

108

Page 123: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

[12] J. F. Clauser, M. A. Horne, A. Shimony, and R. A. Holt. Proposed experimentto test local hidden-variable theories. Phy. Rev. Lett., 23(15):880–884, 1969.

[13] A. Aspect, P. Grangier, and G. Roger. Experimental tests of realistic localtheories via bell’s theorem. Phy. Rev. Lett., 47(7):460–463, 1981.

[14] P. G. Kwiat, K. Mattle, H. Weinfurter, and A. Zeilinger. New high-intensitysource of polarization-entangled photon pairs. Phy. Rev. Lett., 75(24):4337–4341, 1995.

[15] P. G. Kwiat, E. Waks, A. G. White, I. Appelbaum, and P. H. Eberhard. Ultra-bright source of polarization-entangled photons. Phy. Rev. A, 60(2):R773–R776,1999.

[16] C. H. Bennett, F. Bessette, G. Brassard, L. Salvail, and J. Smolin. Experimentalquantum cryptography. Journal of Cryptography, 5(1):3–28, 1992.

[17] M. Bourennane, A. Karlsson, G. Bjork, N. Gisin, and N. J. Cerf. Quantumkey distribution using multilevel encoding: security analysis. J. Phys. A: Math.Gen., 35:10065–10076, 2002.

[18] D. Dehlinger and M. W. Mitchell. Entangled photons, nonlocality, and bellinequalities in the undergraduate laboratory. Am. J. Phys., 70(9):903–910, 2002.

[19] D. Dehlinger and M. W. Mitchell. Entangled photon apparatus for the under-graduate laboratory. Am. J. Phys., 70(898-902):1016, 2002.

[20] R. Rangarajan, M. Goggin, and P. G. Kwiat. Optimizing type-I polarization-entangled photons. Opt. Express, 17(21):18920–18933, 2009.

[21] H. Hellwig, J. Liebertz, and L. Bohaty. Linear optical properties of the mono-clinic bismuth borate bib3o6. J. Appl. Phys., 88(1):240–244, 2000.

[22] R. C. Jones. A new calculus for the treatment of optical systems, i. descriptionand discussion of the calculus. J. Opt. Soc. Am., 31(7):488–493, 1941.

[23] J. W. Lord. Coincidence counting using a field programmable gate array(FPGA), 2008.

[24] Modern quantum mechanics experiments for undergraduates: Labview vi’s,2012. URL http://people.whitman.edu/~beckmk/QM/labview/labview.html.

[25] N. Boeuf, D. Branning, I. Chaperot, E. Dauler, S. Guerin, A. Muller, andA. Migdall. Calculating characteristics of non-collinear phase-matching in uni-axial and biaxial crystals. Opt. Eng., 39(4):1016, 2000.

109

Page 124: Building a Quantum Key Distribution System › sites › phy.duke.edu › files › file... · the financial industry. Another fundamental property of quantum mechanics, known as

[26] Y. Nambu, K. Usami, Y. Tsuda, K. Matsumoto, and K. Nakamura. Genera-tion of polarization-entangled photon pairs in a cascade of two type-I crystalspumped by femtosecond pulses. Phy. Rev. A, 66(033816), 2002.

[27] J. B. Altepeter, E. R. Jeffrey, and P. G. Kwiat. Phase-compensated ultra-brightsource of entangled photons. Opt. Express, 13(22):8951–8959, 2005.

[28] W. K. Wootters. Entanglement of formation of an arbitrary state of two qubits.Phy. Rev. Lett., 80(10):2245–2248, 1998.

[29] V. Coffman, J. Kundu, and W. K. Wootters. Distributed entanglement. Phy.Rev. A, 61(052306), 2000.

[30] D. F. V. James, P. G. Kwiat, W. J. Munro, and A. G. White. Measurement ofqubits. Phy. Rev. A, 64(052312), 2001.

110