4 Superposition

 

This chapter covers

  • Understanding why superposition allows quantum systems to process exponentially more data
  • Processing data via quantum gates
  • Using the Hadamard gate

In the previous chapter, we briefly mentioned superposition, which is a fundamental concept of quantum computing. It is one of the reasons quantum computers are expected to be able to run some applications much faster than classical computers.

In this chapter, you learn what superposition is and how it is relevant in creating quantum algorithms. We talk about a specific gate that brings a qubit into a superposition state, and we show a simple but relevant example that demonstrates superposition. The flow of the chapter is explained in figure 4.1.

Figure 4.1 From superposition to the Hadamard gate

We try to keep the physical explanations to a minimum. The scientific work behind the physics is mind-boggling, but it requires different skills and is less relevant to software development. Keep in mind that even for the most knowledgeable people, quantum computing (QC) and its concepts are difficult to grasp, so do not worry if the physical concepts behind superposition are not clear. What matters to developers is how to use these concepts and write more suitable applications.

4.1 What is superposition?

4.2 The state of a quantum system as a probability vector

4.3 Introducing matrix gate operations

4.3.1 The Pauli-X gate as a matrix

4.3.2 Applying the Pauli-X gate to a qubit in superposition

4.3.3 A matrix that works for all gates

4.4 The Hadamard gate: The gate to superposition

4.5 Java code using the Hadamard gate

Summary