Chapter 2 Qubits: The building blocks

 

This chapter covers:

  • Why random numbers are an important resource.
  • What is a qubit?
  • What are the basic operations we can perform on a qubit?
  • How to program a quantum random number generator in Python.

In this chapter, we are going to start to get our feet wet with some quantum programming concepts. The main concept we will explore is the qubit, the quantum analogue of a classical bit. We use qubits as an abstraction or model to describe the new kinds of computing that are possible with quantum physics. To help learn about what qubits are and how we interact with them, we will use an example of how they are being used today: random number generation. While we can build up much more interesting devices from these qubits, the simple example of a quantum random number generator (QRNG) will be a good way to get familiar with the qubit!

Figure 2.1. In this Chapter, we will be covering topics in simulating quantum hardware and intrinsic operations for the quantum devices.

2.1 WHY DO WE NEED RANDOM NUMBERS?

Humans like certainty. We like it when we press a key on our keyboard and it does the same thing every time. However, there are some contexts in which we do want randomness.

2.1.1 Things some humans like to use randomness for

  • Playing games
  • Simulating complex systems (e.g.: stock market)
  • Picking secure secrets (e.g.: passwords and cryptographic keys)

2.1.2 Statements about probability

2.1.3 Quantum random number generator algorithm

2.2 WHAT ARE CLASSICAL BITS?

2.2.1 What Can We Do With Classical Bits?

2.2.2 Abstractions are our friend

2.3 QUBITS: STATES AND OPERATIONS

2.3.1 State of the qubit

2.3.2 The game of Operations

2.3.3 A mouthful of math

2.3.4 Measuring Qubits

2.3.5 Generalizing measurement: basis independence

2.3.6 Simulating qubits in code

2.4 PROGRAMMING A WORKING QRNG

2.4.1 QRNG

2.4.2 Quantum device interface requirements.

2.4.3 Qubit interface requirements.

2.5 SUMMARY