← Quantum Store · Guides · Lessons · Glossary · About · Türkçe
Preparation course: maths for quantum computing · Lesson 4 / 7 · 10 min
Complex numbers: meet i
The number i, whose square is −1, is the natural language of quantum amplitudes. Learn to picture complex numbers as points in a plane, compute their size and see why multiplying by i is a quarter turn.
The number whose square is −1
Among the numbers we know, no square is negative: 2² = 4, (−2)² = 4. Mathematicians defined a new number whose square is −1 and called it i: i² = −1.
Combining i with ordinary numbers gives complex numbers such as 3 + 2i or 0.6 + 0.8i. The first part is the real part, the part next to i the imaginary part. Despite the name, they are used in very real calculations, from electrical engineering to quantum physics.
A complex number is a point in a plane
You can draw a + bi as the point (a, b) in a plane: the real part on the horizontal axis, the imaginary part on the vertical one. The size of a complex number is then the distance of that point from the origin: √(a² + b²).
In quantum mechanics amplitudes are complex numbers and the probability is the size squared: a² + b². If the amplitude is 0.6 + 0.8i, for example, the probability is 0.36 + 0.64 = 1. This generalises the rule from the previous lesson.
Multiplying by i is a quarter turn
Multiplying a number by i turns its point a quarter turn (90°) around the origin: 1 becomes i, i becomes i² = −1, and −1 becomes −i. The size stays the same; only the direction changes.
That is exactly what the S gate does: it multiplies the amplitude of |1⟩ by i. Two S gates multiply by i × i = −1, which is the Z gate. The probabilities do not change, but the direction of the amplitude, its phase, does, and that decides the result once interference comes in.
Try it yourself
In the complex amplitude example open the state vector: the amplitude of |1⟩ is 0.707i and the probability is still 50%. Then switch to “İki çeyrek tur” (two quarter turns): two S gates multiply the amplitude by −1 and the final H turns that into a certain result of 1.
Open the circuit in your browserThe circuit playground is in Turkish. Button guide: “1000 kez ölç” = measure 1000 times, “Durum vektörünü göster” = show the state vector, “Bu devrenin Qiskit kodu” = this circuit’s Qiskit code, “Geri al” = undo, “Temizle” = clear. Click a gate in the circuit to remove it.
Key points
- i is the number whose square is −1; numbers of the form a + bi are complex numbers.
- A complex number is a point in a plane; its size is √(a² + b²).
- Quantum amplitudes are complex; the probability is a² + b².
- Multiplying by i is a quarter turn; the S gate multiplies the amplitude of |1⟩ by i and two S gates make a Z.
Test yourself
If a result has amplitude 0.3 + 0.4i, what is the probability of measuring it?
- 0.25
- 0.7
- 0.5
Show the answer
0.25. The probability is the size squared: 0.3² + 0.4² = 0.09 + 0.16 = 0.25.
← Amplitudes and probability: squaring · Matrices: every gate is a table →