Skip to main content
KetQat

Appearance

Lesson 140 min

Complex numbers and amplitudes

Why quantum states are complex vectors, and what amplitudes and phases mean.

After this lesson you can

  • Convert complex numbers between Cartesian and polar form and compute conjugates and moduli
  • Compute inner products and norms of vectors in C^n, conjugating the first argument
  • Normalise a vector and turn its amplitudes into outcome probabilities
  • Distinguish a global phase, which changes no prediction, from a relative phase, which can
  • Derive the outcome probability of a two-path interference experiment and explain why amplitudes, not probabilities, add

Why start with complex numbers?

A classical bit is in one of two states. A classical random bit is described by two non-negative numbers that add up to one: the probability of 0 and the probability of 1. It is tempting to guess that a qubit is a fancier version of the random bit. It is not, and the difference is the subject of this lesson.

A qubit is described by two complex numbers, called amplitudes. Outcome probabilities are obtained from them only at the very end, by taking squared magnitudes. Before that moment amplitudes can add, subtract and rotate against each other, so two routes to the same outcome can cancel. Probabilities cannot do that: adding non-negative numbers never gives zero unless every term is zero. This cancellation, called interference, is the resource every quantum algorithm in this course exploits. To use it you need a working command of complex arithmetic and of vectors with complex entries, which is what we build here. The treatment follows standard conventions, as in Nielsen and Chuang, Chapter 2.

Complex numbers in brief

A complex number is z=a+ibz = a + ib with real aa (the real part) and real bb (the imaginary part), where i2=−1i^2 = -1. Three operations matter constantly.

  • Conjugate: zˉ=a−ib\bar z = a - ib. Conjugation reflects zz across the real axis.
  • Modulus: ∣z∣=a2+b2\abs{z} = \sqrt{a^2+b^2}, the distance from the origin in the complex plane. A useful identity is ∣z∣2=zˉ z\abs{z}^2 = \bar z\, z, because (a−ib)(a+ib)=a2+b2(a-ib)(a+ib) = a^2 + b^2.
  • Polar form: every non-zero zz can be written z=reiθz = r e^{i\theta} with r=∣z∣>0r = \abs{z} > 0 and an angle θ\theta, the argument or phase.

The polar form rests on Euler's formula,

eiθ=cos⁡θ+isin⁡θ,e^{i\theta} = \cos\theta + i \sin\theta ,

which places eiθe^{i\theta} on the unit circle at angle θ\theta from the positive real axis. Two consequences are worth memorising: ∣eiθ∣=1\abs{e^{i\theta}} = 1 for every real θ\theta, and eiαeiβ=ei(α+β)e^{i\alpha}e^{i\beta} = e^{i(\alpha+\beta)}. Multiplying by eiθe^{i\theta} therefore rotates a complex number by θ\theta without changing its length, and multiplying r1eiθ1r_1 e^{i\theta_1} by r2eiθ2r_2 e^{i\theta_2} multiplies the lengths and adds the angles.

Example. z=1+iz = 1 + i has modulus 2\sqrt 2 and lies at 45∘45^\circ, so z=2 eiπ/4z = \sqrt2\, e^{i\pi/4}. Its conjugate is zˉ=1−i=2 e−iπ/4\bar z = 1 - i = \sqrt2\, e^{-i\pi/4}, and zˉz=2=∣z∣2\bar z z = 2 = \abs{z}^2. Also eiπ=−1e^{i\pi} = -1, eiπ/2=ie^{i\pi/2} = i and e−iπ/2=−ie^{-i\pi/2} = -i: a minus sign is a phase of π\pi, and a factor of ii is a phase of π/2\pi/2.

Vectors in Cn\C^n and the inner product

A vector in Cn\C^n is a column of nn complex numbers. Quantum mechanics writes such a vector as a ket, ∣ψ⟩\ket{\psi}, and the conjugate transpose of that column (a row) as a bra, ⟨ψ∣\bra{\psi}. For one qubit, n=2n = 2 and the two standard basis vectors are

∣0⟩=(10),∣1⟩=(01),\ket{0} = \begin{pmatrix}1\\0\end{pmatrix},\qquad \ket{1} = \begin{pmatrix}0\\1\end{pmatrix},

so a general vector is ∣ψ⟩=α∣0⟩+β∣1⟩\ket{\psi} = \alpha\ket0 + \beta\ket1 with complex α,β\alpha, \beta.

The inner product of ∣ϕ⟩=(ϕ1,…,ϕn)T\ket{\phi} = (\phi_1,\dots,\phi_n)^T and ∣ψ⟩=(ψ1,…,ψn)T\ket{\psi} = (\psi_1,\dots,\psi_n)^T is

⟨ϕ∣ψ⟩=∑k=1nϕk‾ ψk.\braket{\phi}{\psi} = \sum_{k=1}^{n} \overline{\phi_k}\,\psi_k .

The entries of the first vector are conjugated. This convention (linear in the second argument) is used throughout the course; some mathematics texts conjugate the second argument instead, so check when you read elsewhere. The conjugation is what makes ⟨ψ∣ψ⟩=∑k∣ψk∣2\braket{\psi}{\psi} = \sum_k \abs{\psi_k}^2 a non-negative real number, so we can define the norm ∥ψ∥=⟨ψ∣ψ⟩\norm{\psi} = \sqrt{\braket{\psi}{\psi}}. Without conjugation, the vector (1,i)(1, i) would have "squared length" 1+i2=01 + i^2 = 0, which is useless.

Three properties follow directly from the definition and are checked in the exercise:

  1. Conjugate symmetry: ⟨ϕ∣ψ⟩=⟨ψ∣ϕ⟩‾\braket{\phi}{\psi} = \overline{\braket{\psi}{\phi}}.
  2. Linearity in the second argument: ⟨ϕ∣(a∣ψ⟩+b∣χ⟩)=a⟨ϕ∣ψ⟩+b⟨ϕ∣χ⟩\bra{\phi}\big(a\ket{\psi} + b\ket{\chi}\big) = a\braket{\phi}{\psi} + b\braket{\phi}{\chi}.
  3. Antilinearity in the first: scaling ∣ϕ⟩\ket\phi by aa scales ⟨ϕ∣ψ⟩\braket{\phi}{\psi} by aˉ\bar a.

Two vectors are orthogonal when their inner product is zero. A basis of mutually orthogonal unit vectors is orthonormal; {∣0⟩,∣1⟩}\{\ket0, \ket1\} is one, and so is {∣+⟩,∣−⟩}\{\ket+, \ket-\} with ∣±⟩=(∣0⟩±∣1⟩)/2\ket\pm = (\ket0 \pm \ket1)/\sqrt2, since ⟨+∣−⟩=(1⋅1+1⋅(−1))/2=0\braket{+}{-} = (1\cdot 1 + 1\cdot(-1))/2 = 0.

States, amplitudes and probabilities

A pure quantum state of a system with nn perfectly distinguishable outcomes is a unit vector ∣ψ⟩∈Cn\ket{\psi} \in \C^n. Its components in an orthonormal basis are the amplitudes of the corresponding outcomes. When we measure in the computational basis, outcome kk occurs with probability

Pr⁡[k]=∣ψk∣2=∣⟨k∣ψ⟩∣2.\Pr[k] = \abs{\psi_k}^2 = \abs{\braket{k}{\psi}}^2 .

This is the Born rule, which the measurement lesson treats in full. Here we need only its consequence for normalisation: probabilities must add up to one, so ∑k∣ψk∣2=∥ψ∥2=1\sum_k \abs{\psi_k}^2 = \norm{\psi}^2 = 1. That is why states are unit vectors. Any non-zero vector can be turned into a state by dividing by its norm.

Worked example: normalising and reading off probabilities

Take the unnormalised vector v=(1+i, 2)Tv = (1+i,\ 2)^T.

  1. Squared moduli: ∣1+i∣2=12+12=2\abs{1+i}^2 = 1^2+1^2 = 2 and ∣2∣2=4\abs{2}^2 = 4, so ∥v∥=6\norm{v} = \sqrt6.
  2. The state is ∣ψ⟩=16((1+i)∣0⟩+2∣1⟩)\ket\psi = \frac{1}{\sqrt6}\big((1+i)\ket0 + 2\ket1\big).
  3. Computational-basis probabilities: Pr⁡[0]=2/6=1/3\Pr[0] = 2/6 = 1/3 and Pr⁡[1]=4/6=2/3\Pr[1] = 4/6 = 2/3.
  4. Overlap with ∣+⟩\ket+: ⟨+∣ψ⟩=12⋅16((1+i)+2)=3+i12\braket{+}{\psi} = \frac{1}{\sqrt2}\cdot\frac{1}{\sqrt6}\big((1+i) + 2\big) = \frac{3+i}{\sqrt{12}}, so ∣⟨+∣ψ⟩∣2=9+112=56\abs{\braket{+}{\psi}}^2 = \frac{9+1}{12} = \frac56.

The last number is the probability of the outcome "+" if we measured in the {∣+⟩,∣−⟩}\{\ket+,\ket-\} basis instead. Notice that it depends on the phase of 1+i1+i relative to 22, not only on the moduli. Replace 1+i1+i by 2\sqrt2 (same modulus, phase zero) and the overlap becomes ∣2+2∣2/12≈0.971\abs{\sqrt2+2}^2/12 \approx 0.971. The computational-basis probabilities, by contrast, did not change. Phases are invisible in one basis and decisive in another.

You can check every number with NumPy (complex literals use j):

import numpy as np

v = np.array([1 + 1j, 2])
psi = v / np.linalg.norm(v)
plus = np.array([1, 1]) / np.sqrt(2)

print(np.round(np.abs(psi) ** 2, 6))                 # [0.333333 0.666667]
print(round(abs(np.vdot(plus, psi)) ** 2, 6))        # 0.833333  (= 5/6)
w = np.array([np.sqrt(2), 2]) / np.sqrt(6)
print(round(abs(np.vdot(plus, w)) ** 2, 6))          # 0.971405

np.vdot(a, b) conjugates its first argument, matching our convention. a @ b and np.dot(a, b) do not conjugate anything.

Global phase and relative phase

Multiply a state by a number of modulus one, ∣ψ⟩↦eiγ∣ψ⟩\ket{\psi} \mapsto e^{i\gamma}\ket{\psi}. Every amplitude is rotated by the same angle, so every probability ∣⟨ϕ∣ψ⟩∣2\abs{\braket{\phi}{\psi}}^2, in every basis ∣ϕ⟩\ket\phi, is unchanged: ∣eiγ∣2=1\abs{e^{i\gamma}}^2 = 1. Because no measurement can detect it, a global phase has no physical meaning, and two state vectors that differ only by one represent the same physical state. For unit vectors this is easy to test: ∣ϕ⟩\ket\phi and ∣ψ⟩\ket\psi differ by a global phase exactly when ∣⟨ϕ∣ψ⟩∣=1\abs{\braket{\phi}{\psi}} = 1 (the equality case of the Cauchy–Schwarz inequality).

A relative phase is different. Compare

∣+⟩=12(∣0⟩+∣1⟩),∣−⟩=12(∣0⟩−∣1⟩).\ket{+} = \tfrac{1}{\sqrt2}\big(\ket0 + \ket1\big), \qquad \ket{-} = \tfrac{1}{\sqrt2}\big(\ket0 - \ket1\big).

Both give Pr⁡[0]=Pr⁡[1]=1/2\Pr[0] = \Pr[1] = 1/2 in the computational basis. Yet they are orthogonal, so a measurement in the {∣+⟩,∣−⟩}\{\ket+,\ket-\} basis distinguishes them perfectly. The only difference is the phase eiπ=−1e^{i\pi} = -1 on ∣1⟩\ket1 relative to ∣0⟩\ket0. More generally, α∣0⟩+eiφβ∣1⟩\alpha\ket0 + e^{i\varphi}\beta\ket1 for different φ\varphi are genuinely different states. The next lesson turns this relative phase into a longitude on a sphere.

Interference: why amplitudes are not probabilities

Here is the smallest experiment in which amplitudes behave differently from probabilities. Prepare ∣0⟩\ket0 and apply three fixed 2×22\times 2 matrices in turn:

H=12(111−1),P(φ)=(100eiφ),H again.H = \frac{1}{\sqrt2}\begin{pmatrix}1 & 1\\ 1 & -1\end{pmatrix},\qquad P(\varphi) = \begin{pmatrix}1 & 0\\ 0 & e^{i\varphi}\end{pmatrix},\qquad H \text{ again}.

The gates lesson studies these matrices; for now they are simply operations we are allowed to perform. Read the first HH as a "beam splitter" that sends the system into an equal superposition of two paths, P(φ)P(\varphi) as a delay that gives path 1 an extra phase, and the second HH as a beam splitter that recombines the paths.

Quantum circuit on 1 wire (q). step 1: H on q. step 2: P(φ) on q. step 3: H on q. step 4: measure q.qHP(φ)H
Two-path interference: split, add a phase to one path, recombine, measure

Step by step:

∣0⟩→H∣0⟩+∣1⟩2→P(φ)∣0⟩+eiφ∣1⟩2→H(1+eiφ)∣0⟩+(1−eiφ)∣1⟩2.\ket0 \xrightarrow{H} \frac{\ket0+\ket1}{\sqrt2} \xrightarrow{P(\varphi)} \frac{\ket0+e^{i\varphi}\ket1}{\sqrt2} \xrightarrow{H} \frac{(1+e^{i\varphi})\ket0 + (1-e^{i\varphi})\ket1}{2}.

For the last arrow, use H∣0⟩=∣+⟩H\ket0 = \ket+ and H∣1⟩=∣−⟩H\ket1 = \ket- and collect terms. The amplitude of outcome 0 is a sum of two contributions, one for each path, each equal to 1/21/2 apart from the phase on path 1. Its squared modulus is

Pr⁡[0]=∣1+eiφ∣24=(1+cos⁡φ)2+sin⁡2φ4=1+cos⁡φ2.\Pr[0] = \frac{\abs{1+e^{i\varphi}}^2}{4} = \frac{(1+\cos\varphi)^2 + \sin^2\varphi}{4} = \frac{1+\cos\varphi}{2}.

At φ=0\varphi = 0 the two contributions are in phase and Pr⁡[0]=1\Pr[0] = 1 (constructive interference). At φ=π\varphi = \pi they cancel and Pr⁡[0]=0\Pr[0] = 0 (destructive interference). At φ=π/2\varphi = \pi/2, Pr⁡[0]=1/2\Pr[0] = 1/2.

Now reason as if each path had only a probability. After the first splitter each path has probability 1/21/2; at the second splitter each path sends the system to outcome 0 with probability 1/21/2. Adding the two routes gives 12⋅12+12⋅12=12\tfrac12\cdot\tfrac12 + \tfrac12\cdot\tfrac12 = \tfrac12, whatever φ\varphi is. A phase cannot enter a calculation that uses only probabilities, and a sum of non-negative terms cannot vanish. The observed dependence on φ\varphi, including the perfect cancellation at φ=π\varphi=\pi, is the signature of amplitudes. This is not a curiosity: quantum algorithms are arranged so that the paths leading to wrong answers cancel and those leading to right answers reinforce. You will see exactly this in the algorithms lesson.

Common mistakes

  • Forgetting the conjugate. ⟨ϕ∣ψ⟩\braket{\phi}{\psi} conjugates the bra's entries. In NumPy use np.vdot(phi, psi), not phi @ psi; the latter gives ⟨ψ∣ψ⟩=0\braket{\psi}{\psi} = 0 for (1,i)/2(1, i)/\sqrt{2}, which is nonsense.
  • Treating amplitudes as probabilities. Amplitudes can be negative or complex and their moduli need not add to one; only their squared moduli do. Adding probabilities of paths ignores interference.
  • Squaring instead of taking the squared modulus. (1+i)2=2i(1+i)^2 = 2i, while ∣1+i∣2=2\abs{1+i}^2 = 2. Probabilities are ∣z∣2=zˉz\abs{z}^2 = \bar z z.
  • Thinking a phase never matters. A global phase never matters; a relative phase between components often decides everything.
  • Comparing states entry by entry. ∣ψ⟩\ket\psi and −∣ψ⟩-\ket\psi are the same physical state. Compare ∣⟨ϕ∣ψ⟩∣\abs{\braket{\phi}{\psi}} with 1 instead.

Summary

  • Complex numbers carry a modulus and a phase; eiθe^{i\theta} is a pure phase of modulus 1.
  • The inner product on Cn\C^n conjugates its first argument, which makes norms real and non-negative.
  • A pure state is a unit vector; outcome probabilities are squared moduli of amplitudes.
  • A global phase is unobservable; a relative phase changes predictions in other bases.
  • Amplitudes from different paths add before squaring, so they can cancel. The two-path experiment gives Pr⁡[0]=(1+cos⁡φ)/2\Pr[0] = (1+\cos\varphi)/2, whereas probability-only reasoning gives 1/21/2.

The exercise asks you to implement these definitions and to reproduce the interference curve numerically. Next, Qubits and the Bloch sphere turns the two complex amplitudes of a qubit into a point on a sphere.

Exercises

Run these on your own computer. Each comes with automated checks: python -m pytest test_exercise.py. Nothing you write is sent to KetQat.

Amplitudes, phases and two-path interference

introductory · about 25 min · needs numpy

In this exercise you turn the definitions of the lesson into five small NumPy functions. Everything works with plain complex arrays (numpy.ndarray with dtype=complex); no quantum library is needed.

Functions to implement (in starter.py)

Function Contract
normalize(v) Return v / ‖v‖ as a complex array. Raise ValueError for the zero vector.
inner_product(phi, psi) Return ⟨ϕ∣ψ⟩=∑kϕk‾ ψk\braket{\phi}{\psi} = \sum_k \overline{\phi_k}\,\psi_k, conjugating the first argument.
born_probabilities(psi) For a normalised state, return the array of outcome probabilities ∣ψk∣2\abs{\psi_k}^2. Raise ValueError if psi is not normalised (tolerance 1e-9).
equal_up_to_global_phase(psi, phi, atol=1e-9) Return True exactly when ∣ϕ⟩=eiγ∣ψ⟩\ket{\phi} = e^{i\gamma}\ket{\psi} for some real γ\gamma (both inputs normalised).
two_path_interference(phase) Simulate the two-path experiment of the lesson: start in ∣0⟩\ket{0}, apply HH, then P(phase)=diag(1,ei phase)P(\text{phase}) = \mathrm{diag}(1, e^{i\,\text{phase}}), then HH. Return the probability of outcome 0. Build it with matrices; do not type the closed-form answer.

What the checks verify

  • normalize returns a unit vector parallel to its input and rejects the zero vector.
  • inner_product is conjugate-symmetric, linear in its second argument and gives ∥ψ∥2\norm{\psi}^2 for ⟨ψ∣ψ⟩\braket{\psi}{\psi} (properties, not a copy of your code).
  • born_probabilities matches a hand-computed example and always sums to 1.
  • equal_up_to_global_phase accepts a global phase and rejects a relative phase.
  • two_path_interference agrees with the analytic result (1+cos⁡phase)/2(1+\cos\text{phase})/2 derived in the lesson for many phases, and differs from the "classical mixture" value 1/21/2 whenever cos⁡phase≠0\cos\text{phase}\neq 0.

Run the checks

python -m pip install numpy
python -m pytest test_exercise.py

The tests import starter.py from the same directory. They fail with NotImplementedError until you fill in the functions.

Terminal
python -m pip install numpy

starter.py

Python
"""Amplitudes, phases and two-path interference (KetQat Commons, Foundations).

Implement each function. Inputs are 1-D NumPy arrays of complex amplitudes.
"""
import numpy as np


def normalize(v):
    """Return v / ||v|| as a complex array; raise ValueError for the zero vector."""
    raise NotImplementedError


def inner_product(phi, psi):
    """Return <phi|psi> = sum_k conj(phi_k) * psi_k (conjugate the FIRST argument)."""
    raise NotImplementedError


def born_probabilities(psi):
    """Return |psi_k|^2 for a normalised state; raise ValueError if ||psi|| != 1 (tol 1e-9)."""
    raise NotImplementedError


def equal_up_to_global_phase(psi, phi, atol=1e-9):
    """Return True when phi = exp(i*gamma) * psi for some real gamma (inputs normalised)."""
    raise NotImplementedError


def two_path_interference(phase):
    """Probability of outcome 0 after H, then P(phase) = diag(1, e^{i phase}), then H on |0>.

    Build the state with matrix-vector products; do not type the closed form.
    """
    raise NotImplementedError

test_exercise.py

Python
"""Checks for the amplitudes-and-interference exercise. Run: python -m pytest test_exercise.py"""
import importlib.util
import os
from pathlib import Path

def _load_target():
    name = os.environ.get("KETQAT_COMMONS_TARGET", "starter")
    path = Path(__file__).with_name(f"{name}.py")
    spec = importlib.util.spec_from_file_location(f"{Path(__file__).parent.name}_{name}", path)
    module = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(module)
    return module

target = _load_target()

import numpy as np
import pytest

RNG = np.random.default_rng(2026)


def _random_vector(n):
    return RNG.normal(size=n) + 1j * RNG.normal(size=n)


def test_normalize_gives_unit_vector_parallel_to_input():
    for n in (1, 2, 3, 8):
        v = _random_vector(n)
        u = target.normalize(v)
        assert np.isclose(np.linalg.norm(u), 1.0)
        # parallel: u = v / c for a positive real c
        ratio = v / u
        assert np.allclose(ratio, ratio[0]) and abs(ratio[0].imag) < 1e-12 and ratio[0].real > 0


def test_normalize_rejects_zero_vector():
    with pytest.raises(ValueError):
        target.normalize(np.zeros(2, dtype=complex))


def test_inner_product_hand_example():
    # <phi|psi> with phi = (1, i)/sqrt2 and psi = (1, 1)/sqrt2: (1*1 + (-i)*1)/2 = (1 - i)/2
    phi = np.array([1, 1j]) / np.sqrt(2)
    psi = np.array([1, 1]) / np.sqrt(2)
    assert np.isclose(target.inner_product(phi, psi), (1 - 1j) / 2)


def test_inner_product_properties():
    a, b, c = _random_vector(4), _random_vector(4), _random_vector(4)
    alpha, beta = 0.3 - 1.2j, -2.0 + 0.5j
    # conjugate symmetry
    assert np.isclose(target.inner_product(a, b), np.conj(target.inner_product(b, a)))
    # linear in the second argument
    lhs = target.inner_product(a, alpha * b + beta * c)
    rhs = alpha * target.inner_product(a, b) + beta * target.inner_product(a, c)
    assert np.isclose(lhs, rhs)
    # antilinear in the first argument
    assert np.isclose(target.inner_product(alpha * a, b), np.conj(alpha) * target.inner_product(a, b))
    # <a|a> is the squared norm, real and positive
    assert np.isclose(target.inner_product(a, a), np.sum(np.abs(a) ** 2))


def test_born_probabilities_hand_example():
    psi = np.array([3, 4j]) / 5
    assert np.allclose(target.born_probabilities(psi), [9 / 25, 16 / 25])


def test_born_probabilities_sum_to_one_and_reject_unnormalised():
    for n in (2, 4, 16):
        psi = _random_vector(n)
        psi = psi / np.linalg.norm(psi)
        p = target.born_probabilities(psi)
        assert np.all(p >= 0) and np.isclose(p.sum(), 1.0)
    with pytest.raises(ValueError):
        target.born_probabilities(np.array([1.0, 1.0]))


def test_global_phase_is_detected_and_relative_phase_is_not():
    psi = np.array([1, 1j]) / np.sqrt(2)
    assert target.equal_up_to_global_phase(psi, np.exp(0.7j) * psi)
    assert target.equal_up_to_global_phase(psi, -psi)
    # relative phase: |+i> vs |-i> are orthogonal, not equal up to phase
    assert not target.equal_up_to_global_phase(psi, np.array([1, -1j]) / np.sqrt(2))
    # a small relative phase is still a different state
    assert not target.equal_up_to_global_phase(np.array([1, 1]) / np.sqrt(2), np.array([1, np.exp(0.1j)]) / np.sqrt(2))


@pytest.mark.parametrize("phase", np.linspace(0, 2 * np.pi, 13))
def test_two_path_interference_matches_analytic_formula(phase):
    # Derived in the lesson: Pr[0] = |1 + e^{i phase}|^2 / 4 = (1 + cos phase) / 2.
    assert np.isclose(target.two_path_interference(phase), (1 + np.cos(phase)) / 2)


def test_interference_differs_from_classical_mixture():
    # Adding probabilities of the two paths (1/2 * 1/2 + 1/2 * 1/2) would always give 1/2.
    assert np.isclose(target.two_path_interference(0.0), 1.0)
    assert np.isclose(target.two_path_interference(np.pi), 0.0, atol=1e-12)
    assert np.isclose(target.two_path_interference(np.pi / 2), 0.5)

Check your understanding

7 questions. Pass with 70% of the points. Answers are checked on the server; retakes are allowed. Explanations appear once you pass or after three complete attempts.

  1. Let ∣ϕ⟩=(∣0⟩+i∣1⟩)/2\ket\phi = (\ket0 + i\ket1)/\sqrt2 and ∣ψ⟩=(∣0⟩+∣1⟩)/2\ket\psi = (\ket0 + \ket1)/\sqrt2. What is ⟨ϕ∣ψ⟩\braket{\phi}{\psi}?

    1 pt
  2. Which is the polar form of z=−1−iz = -1 - i?

    1 pt
  3. The unnormalised vector v=2∣0⟩+(1−i)∣1⟩v = 2\ket0 + (1-i)\ket1 is normalised to a state ∣ψ⟩\ket\psi. What is the probability of outcome 1 when ∣ψ⟩\ket\psi is measured in the computational basis?

    1 pt
  4. Which pairs of unit vectors describe the same physical state?

    1 pt

    Select all that apply.

  5. For ∣ψ⟩=(∣0⟩+i∣1⟩)/2\ket\psi = (\ket0 + i\ket1)/\sqrt2, compute ∣⟨+∣ψ⟩∣2\abs{\braket{+}{\psi}}^2.

    1 pt
  6. Run your two_path_interference from the exercise with phase = numpy.pi / 3. Enter the probability of outcome 0.

    1 pt

    Computed by running exercise “amplitudes-and-interference” on your computer.

  7. In the two-path experiment (HH, then P(φ)P(\varphi), then HH, then measure), what does a calculation that assigns each path only a probability predict for Pr⁡[0]\Pr[0]?

    1 pt

Sign in with GitHub to check answers and save progress. Reading stays free without an account.

References

  1. Michael A. Nielsen, Isaac L. Chuang (2010). Quantum Computation and Quantum Information (10th Anniversary Edition). Cambridge University Press. doi:10.1017/CBO9780511976667