Quantum Kickstart · Pre-course self-check

Ready for the Kickstart?

A readiness diagnostic, not an entrance exam. It tells you, and us, what to brush up before the first morning.

The Kickstart is hands-on from the first morning: every concept on the slides is followed by a short piece of code that you run and change yourself. That only works if your Python environment and a few basic Python and NumPy skills are in place before you arrive. No quantum knowledge is assumed.

Parts B to F are 17 multiple-choice questions about short pieces of code; work out the answer on paper first, then run the code if you want to check. Allow about 30 minutes for the questions. Part A, the environment, is a separate 15 to 25 minute installation described in the PDF; installation issues may take longer.

Required

Parts A, B, C

A working notebook, basic Python, and NumPy vectors and matrices. If one of these is missing, the first morning will be frustrating; we agree on preparation together.

Recommended

Parts D, E

Reading a decorator, complex numbers. The course introduces both, but you move faster if they are not new.

Nice to have

Part F

Polar form, Euler's formula, radians. Exactly that.

Read this first. Only Parts A to C gate anything. Parts D to F look ahead at the bits that cause friction during the course; a low score there means “spend an hour brushing up”, not “you are not ready for quantum computing”. A result like B 3/3 · C 4/4 · D 1/2 · E 2/4 · F 2/4 is a perfectly typical, well-prepared participant. Every wrong option is a mistake we see during the course, so the explanations after submitting are worth reading even for questions you got right.

Part AA working notebook

Required

The course is hands-on from the first minute, so the one thing we cannot work around is a laptop without a working Python environment. The installation is a 15 to 25 minute walkthrough in the PDF (Part A). Its test cell ends with a READY line; paste that line here.

Company laptop locked down? Use your private laptop. Everything installed is public open-source software from python.org and PyPI, nothing needs an account, and the course uses no corporate data of any kind. Bring the laptop the READY line came from.
Open the installation walkthrough (PDF) ↗

Part BPython basics

Required

Three questions. For each one, decide what the code prints.

B1What does this print?

values = [3, 1, 4, 1, 5]
total = 0
for i, v in enumerate(values):
    if i % 2 == 0:
        total += v
print(total, len(values) / 2)

B2A quantum computer returns its results as a dictionary of bitstrings and how often each one was observed. What does this print?

counts = {"000": 1012, "011": 988, "101": 4001, "110": 1999}
best = max(counts, key=counts.get)
print(best, int(best, 2), sum(counts.values()))

B3What does this print?

def scale(xs, factor=2):
    return [x * factor for x in xs if x > 1]

out = scale([1, 2, 3], 3)
print(f"{out} -> {sum(out):.1f}")

Part CNumPy: vectors and matrices

Required

Four questions; np is numpy throughout. A qubit state is a vector, a gate is a matrix, and applying a gate is a matrix product.

C1Two products that look alike and are not.

A = np.array([[1, 2], [3, 4]])
B = np.array([[0, 1], [1, 0]])
print(A * B)
print(A @ B)

C2A matrix applied to a vector, then applied twice.

M = np.array([[1, 1], [1, -1]])
v = np.array([1, 0])
print(M @ v, M @ M @ v)

C3Order matters. Z flips the sign of the second component; S swaps the two components.

Z = np.array([[1, 0], [0, -1]])
S = np.array([[0, 1], [1, 0]])
v = np.array([1, 0])
print(S @ Z @ v)
print(Z @ S @ v)

C4Transpose, identity and length.

A = np.array([[1, 2], [3, 4]])
I = np.eye(2)
v = np.array([3, 4])
print(A.T[0, 1], np.allclose(A @ I, A), np.linalg.norm(v))

Part DReading a decorator

Recommended

Two questions. Quantum frameworks such as PennyLane mark a function as a quantum circuit by writing @qml.qnode(dev) above it. You never have to write a decorator in this course, but you will read them.

D1What does this print?

def normalise(fn):
    def wrapper(*args):
        v = fn(*args)
        return v / np.linalg.norm(v)
    return wrapper

@normalise
def state(a, b):
    return np.array([a, b], dtype=float)

print(state(3, 4))

D2Which statement about the line @normalise in D1 is true?

Part EComplex numbers

Recommended

Four questions. In Python the imaginary unit is written 1j. Qubit amplitudes are complex numbers, and probabilities come from their squared magnitude, so the difference between z² and |z|² matters from the first morning.

E1(1 + i)² equals

E21 / i equals

E3What does this print?

z = 3 + 4j
print(z * z.conjugate(), z**2, abs(z))

E4A matrix U is a valid quantum gate when UU = I, where U is the conjugate transpose. What does this print?

U = np.array([[1, 1j], [1j, 1]]) / np.sqrt(2)
print(np.allclose(U.conj().T @ U, np.eye(2)), np.allclose(U.T @ U, np.eye(2)))

Part FPolar form, Euler and radians

Nice to have

Four questions. Every rotation gate in the course takes an angle in radians, and every phase is a complex number of the form e.

F1eiπ/2 · eiπ/2 equals

F2z₁ = 2eiπ/4 and z₂ = 3eiπ/4. Then z₁·z₂ equals

F3What does this print?

theta = np.pi / 2
c, s = round(np.cos(theta / 2), 3), round(np.sin(theta / 2), 3)
print(c, s, np.angle(1j) / np.pi)

F4np.abs(np.exp(1j * 0.73)) evaluates to

Your result

0 of 17 questions answered, no READY line yet. You can submit at any time; unanswered questions count as wrong, and you can change answers and submit again.

Showing the result sends an anonymous summary to qubit-lab.ch: your scores and verdict, browser, language, time zone and approximate location. No name, no e-mail, no individual answers; those are only sent if you choose to below.

Not required, in case you were wondering

Physics. Quantum mechanics. Bra-ket notation (the course introduces it and the handout has a dictionary). Probability theory beyond “probabilities add up to 1”. Writing your own classes. Machine learning (Session 5 uses scikit-learn as a black box). Any cloud account or hardware access.