chapter three

3 Single-qubit state and gates

 

This chapter covers

  • Single-qubit quantum states and an introduction to state tables
  • Definitions of basic single-qubit quantum gates and an introduction to single-qubit quantum circuits
  • How to simulate single-qubit quantum systems in Python

In this chapter, we look at the state of a single-qubit system with programmatic and visual representations. We cover how a qubit functions as a computational tool and how to apply quantum programming instructions. In the next chapter, we will generalize these lessons to any number of qubits.

The simplest representation of a quantum state in code is a list of complex numbers. This list is called the state vector of the quantum system used in a computation. We will use state tables, like the ones introduced in chapter 2, to visualize quantum states.

This chapter also introduces the basics of applying programming instructions, called quantum gates, to a single-qubit system, and combining them into a quantum circuit. We will look at some ways to visualize gates and circuits. Finally, we will look at a few simple single-qubit circuits with practical applications.

tip

The source code, examples, and exercise answers can be found in the book’s GitHub repository: https://learnqc.github.io/code.

Figure 3.1 Concepts introduced in this chapter.
CH03 F01 gonciulea

3.1 Single-qubit state: a pair of complex numbers

3.1.1 Visualizing single-qubit states with tables

3.1.2 The general form of a single-qubit state

3.1.3 Programmatically encoding single-qubit states with lists

3.1.4 Writing a single-qubit quantum computing simulator in Python

3.2 Changing amplitudes with single-qubit gates

3.2.1 Rotation is multiplication

3.2.2 Basic single-qubit gates

3.2.3 The general form of a single-qubit gate

3.2.4 More basic single-qubit gates

3.2.5 Single-qubit gate inverses

3.3 Simulating changing amplitudes with gates

3.3.1 Printing and visualizing the state

3.3.2 Transforming a single-qubit state

3.3.3 Single-qubit circuits

3.4 Simulating measurement of single-qubit states

3.4.1 Encoding the uniform distribution in a single-qubit quantum state