Search

What is a quantum gate and how does it manipulate a qubit?

Quantum Computing From Bits to Quantum Leaps cover image

Overview

Secondary School

Physics, Mathematics, Computer Science

Quantum Computing

English

Overview

Keywords: logic gate, quantum gate, bit, qubit
Age group: 14+
Required knowledge/skills: Basic knowledge of matrices and vector calculation
Time frame: 2 x 45 minutes

Author: Elena Vladescu (RO)

Content

Conceptual introduction
Quantum gates that act on a single qubit
Quantum gates that act on two qubits
Student activitives

Summary

This teaching unit introduces students to the basic building blocks of quantum computers—qubits and quantum gates—and shows how they differ from classical bits and logic gates. Through hands‑on activities with simulators, students explore superposition, entanglement, and the operation of common gates such as the Hadamard and CNOT.

Quantum Computing From Bits to Quantum Leaps teaser

Quantum computers differ from classical computers in that hey use qubits instead of bits to store and process information. They also use two specific properties of quantum physics – superposition and entanglement – to process huge amounts of data simultaneously. While a classical computer processes bits (0 and 1) sequentially, quantum computers can process all possible inputs simultaneously. This leads to an enormous speedup in computing time. However, quantum computers cannot solve every problem faster than a classical computer. 
In addition to qubits, quantum gates are another basic building block of quantum computers. Similarly to classical logic gates (see Classical Computing – Introduction to Logic Gates), quantum gates perform operations on qubits and manipulate them.

From bits to qubits and from logic gates to quantum gates

While classical bits can only take the values of 0 or 1, a qubit can exist simultaneously in a superposition of 0 and 1. This is the basis of the computational power of quantum computers.
Quantum gates are similar to classical logic gates. They act on one or more qubits and transform them. Below, we describe some quantum gates that act on one or two qubits. A list of quantum gates can be found here.
 

Materials

  • Paper and pencil
  • Tablets/computers and internet access

Learning outomes

In this unit, students learn

  • what a quantum gates are and how they act on one or more qubits;
  • about the matrix representation of quantum gates;
  • how to handle matrices and vectors to show mathematically how quantum gates manipulate qubit states.

Quantum gates that act on a single qubit

The Pauli gates

The Pauli gates X, Y and Z are among the most important gates that act on one qubit. 

The Pauli-X gate, also called quantum NOT gate or bit-flip, flips the qubit’s state from | 0 to | 1 , or from | 1 to | 0 . In other words: it swaps the probabilities of finding the qubit in one of the two basis states. 

If the students are not yet familiar with the ket notation ( | 0 and | 1 ) and need an introduction or refresher course in matrix calculation, you may want to go through the teaching unit Matrices and how they can be used in quantum computing with them. 

The ket | 0 can also be written as vector [10] and the ket | 1 as vector [01]. The ket notation and the vector notation are equivalent, however, the ket notation is usually clearer. 

The matrix representation for the Pauli X gate is:

X=[0110].

If we now apply a Pauli-X gate to a qubit in the state | 0 , we obtain:

X| 0 =[0110][10]=[01]=| 1 .

And similarly:

X| 1 =[0110][01]=[10]=| 0 .

This may also be written as: X| 0=| 1 and X| 1 =| 0

In a quantum circuit, a visual model of a programme for a quantum computer, the Pauli-X gate is represented by the following symbol:

See the list of quantum gates for the Pauli-Y and the Pauli-Z gates and further one-qubit gates.

The Hadamard gate

The Hadamard gate, named after the French mathematician Jacques Hadamard and denoted by H, brings a single-qubit into an equally probable superposition of the two basis states | 0 and | 1

H= 12 [ 11 11 ] .

Applying the Hadamard gate to the basis state | 0 results in:

H [ 1 0 ] = 1 2 [ 1 1 1 1 ] [ 1 0 ] = 1 2 [ 1 1 ] = 1 2 ( [ 1 0 ] + [ 0 1 ] ) .

Or written in ket notation:

H | 0 = 1 2 ( | 0 + | 1 ) .

And similarly:

H [ 0 1 ] = 1 2 [ 1 1 1 1 ] [ 0 1 ] = 1 2 [ 1 1 ] = 1 2 ( [ 1 0 ] [ 0 1 ] )

H | 1 = 1 2 ( | 0 | 1 )

The resulting superposition states are denoted by |+ and |-:

| + = 1 2 ( | 0 + | 1 ) and

| = 1 2 ( | 0 | 1 ) .

In a quantum circuit, the Hadamard gate is represented by the following symbol:

Quantum gates that act on two qubits

Controlled-NOT gate (CNOT)

The controlled-NOT (or CNOT) gate is a quantum gate that operates on two qubits. The first qubit is the so-called control qubit and the second qubit the target qubit. Depending on the state of the control qubit, the target qubit is flipped or left unchanged.

The effect of a CNOT gate is summarised in a table, where |a represents the control qubit and |b the target qubit.

|abCNOT |ab

 

|00

 

|00

 

|01

 

|01

 

|10

 

|11

 

|11

 

|10

Table: The CNOT quantum gate applied to two qubits. The state |00 describes the case where both the control qubit and the target qubit are in the state |0.

See the list of quantum gates for further two-qubit gates.

Student Activities

Three worksheets will familiarise the students with handling quantum gates and qubits, the basic building blocks of quantum computers.

Worksheet 1: Students explore different simulators for quantum circuits and create simple circuits themselves. Download it as PDF or docx.

Worksheet 2: Students use a quantum circuit simulator of their choice (e.g. the Quantum Machine) and apply a Hadamard gate to one qubit and/or a CNOT gate to two qubits. Download it as PDF or docx.

Worksheet 3: Students create a random number generator using the principle of superposition. Download it as PDF or docx.

The following teaching units of this project can deepen the students’ skills and understating of how quantum gates manipulate one or more qubits:

  1. Shoshany, B. (2018), "Thinking Quantum: Lectures on Quantum Theory". arXiv preprint arXiv:1803.07098. https://arxiv.org/pdf/1803.07098

  2. Satanassi, S. (2019), Quantum computers for high school: design of activities for an I SEE teaching module, University of Bologna, Supervisor: Levrini O., Co-supervisor: Giovanni Ravaioli. https://iseeproject.eu/wp-content/uploads/2017/04/Quantum-computers-for-high-school-_-SS.pdf 

  3. Barelli, E. (2017), Science of complex systems and future-scaffolding skills: a pilot study with secondary school students, University of Bologna, Supervisor: Levrini O., Co-supervisor: Tasquier G. and Laura Branchetti. https://iseeproject.eu/wp-content/uploads/2017/04/EB_Tesi.pdf 

  4. Quantum Logic Gates: Roots, Exponents, and Eigensystems — Wolfram Demonstrations Project. https://demonstrations.wolfram.com/QuantumLogicGatesRootsExponentsAndEigensystems/ 

  5. Classical computing versus quantum computing — IBM. https://www.ibm.com/topics/quantum-computing 

Close search