chapter four

4 Superposition

 

This chapter covers:

  • we introduce the term "superposition"
  • we explain why superposition allows for much more (exponentially more) data in quantum system to be processed
  • we explain that processing is done via quantum gates
  • we show that quantum gates can be represented by matrix operations
  • we introduce the Hadamard gate, which brings a qubit in a superposition state.
  • we show code that applies the Hadamard gate, and measure the resulting value

In the previous chapter, we briefly mentioned superposition. It is one of the most fundamental concepts of Quantum Computing, and it is one of the reasons why Quantum Computers are expected to be able to run some applications much faster than classical computers.

In this chapter you will learn what superposition is, and how it is relevant in creating quantum algorithms. We will talk about a specific gate that brings a qubit in a superposition state, and we show a simple but very relevant sample that demonstrates superposition.

We try to keep the physical explanations to a minimal. 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 knowledgable persons Quantum Computing and its concepts are very difficult to grasp, so do not worry when the physical concepts behind superposition are not clear. What matters to the developer 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.2  A matrix that works for all gates

4.4  The Hadamard Gate, the gate to superposition

4.5  Java code using the Hadamard gate

4.6  Summary