Quantum Computing Tutorial
Learn Quantum Computing step by step: 39 lessons in 9 chapters with examples, quizzes, diagrams and projects.
Start learning →
of lessons completed
Getting Started
- What Is Quantum Computing? Learn what quantum computing is, how qubits differ from bits, what superposition, interference and entanglement mean, and what quantum computers can and cannot do.
- Complex Numbers and Vectors for Quantum Computing The math you need for qubits: complex numbers, magnitude, phase, conjugates, vectors, norms, inner products and Dirac bra-ket notation, all explained with Python and NumPy.
- Matrices and Unitaries Understand matrices as quantum operations: matrix-vector products, the adjoint, unitary and Hermitian matrices, projectors and eigenvalues, with runnable NumPy examples.
- Quantum Hardware Landscape Tour the physical qubit technologies (superconducting, trapped ion, neutral atom, photonic, spin), the DiVincenzo criteria, and the metrics that tell real devices apart.
Qubits and Superposition
- The Qubit and Its State Vector Learn how a qubit is described by two complex amplitudes, the computational and other bases, normalization, and how to build and inspect qubit states in Python.
- The Bloch Sphere Visualize any single-qubit state as a point on the Bloch sphere. Convert between amplitudes, angles theta and phi, and Bloch vectors with NumPy, and see what gates do geometrically.
- Measurement and the Born Rule Learn how measuring a qubit works: the Born rule, collapse, shots and counts, measuring in other bases, and how to simulate repeated measurements in NumPy.
- Multi-Qubit States and the Tensor Product Combine qubits with the tensor product, understand 2^n amplitudes, bit-string ordering, product versus entangled states, and measure a subset of qubits, all in NumPy.
Gates and Circuits
- Single-Qubit Gates Meet the essential single-qubit gates X, Y, Z, Hadamard, S and T. See their matrices, what they do to states and the Bloch sphere, and the identities that connect them.
- Rotation Gates and Phase Learn the continuous rotation gates Rx, Ry, Rz and the phase gate, the half-angle convention, the ZYZ decomposition of any single-qubit gate, and how to code them in NumPy.
- Controlled Gates: CNOT, CZ, SWAP and Toffoli Understand controlled gates: the CNOT matrix and truth table, CZ, SWAP, Toffoli, building any controlled-U, reversible classical logic and phase kickback, with NumPy code.
- Building a Circuit Simulator Build a small but complete state-vector quantum circuit simulator in about 40 lines of NumPy: apply gates to chosen qubits, read probabilities, sample shots and create GHZ states.
- Universal Gate Sets and Circuit Identities Learn what a universal gate set is, why Clifford+T works, how the Clifford group conjugates Paulis, how sequences of H and T approximate any rotation, and key circuit identities.
Entanglement
- Bell States and Entanglement Create the four Bell states with H and CNOT, see perfect correlations in every basis, understand what entanglement really means and what it does not, with NumPy simulations.
- Entanglement Measures and GHZ States Quantify entanglement with density matrices, partial trace, purity, the Schmidt decomposition and entanglement entropy, and compare GHZ and W states for three qubits using NumPy.
- CHSH and Bell's Inequality See why no hidden-variable theory can reproduce entanglement: play the CHSH game, compute the classical bound of 2 and the quantum value of 2 times sqrt(2) in NumPy simulations.
- Quantum Teleportation Learn the quantum teleportation protocol: how an unknown qubit state moves from Alice to Bob using a Bell pair and two classical bits, with a full NumPy simulation and corrections.
- Superdense Coding and No-Cloning Send two classical bits by transmitting one qubit using superdense coding, and learn why quantum states cannot be copied: the no-cloning theorem, shown with NumPy examples.
Quantum Algorithms
- Deutsch-Jozsa and Bernstein-Vazirani Algorithms Build the Deutsch-Jozsa and Bernstein-Vazirani circuits from scratch with a NumPy state-vector simulator and see how one query beats many.
- Grover's Search Algorithm Learn how Grover's algorithm finds a marked item among N in about sqrt(N) steps. Build the oracle and diffusion operator in a NumPy simulator.
- The Quantum Fourier Transform Understand the quantum Fourier transform, build its circuit from Hadamard and controlled-phase gates, and use it to detect periods.
- Quantum Phase Estimation Learn quantum phase estimation (QPE): how controlled unitaries and an inverse QFT read out an eigenvalue phase, with a runnable NumPy simulation.
- Shor's Algorithm: Factoring with Quantum Computers Follow Shor's factoring algorithm from number theory to quantum order finding, with a simulated run that factors 15 and a continued-fraction step.
Noise and Error Correction
- Noise and Decoherence in Quantum Computers Learn why real qubits fail: decoherence, T1 and T2 times, gate errors and noise channels, modeled with density matrices and Kraus operators in NumPy.
- Quantum Error Correction: Bit-Flip and Phase-Flip Codes Learn how quantum error correction works: the 3-qubit bit-flip and phase-flip codes, syndromes, and the Shor 9-qubit code, simulated in NumPy.
- Stabilizer Codes, the Steane Code and Surface Codes Learn the stabilizer formalism, decode the 7-qubit Steane code with Pauli syndromes, and see how surface codes scale error protection with distance.
- NISQ Devices and Error Mitigation Understand the NISQ era and learn practical error mitigation: readout calibration, zero-noise extrapolation, probabilistic error cancellation and more.
Quantum Programming Tools
- Qiskit Basics: Circuits, Samplers and Estimators Learn the core of Qiskit: QuantumCircuit, Statevector, Sampler and Estimator primitives, transpilation and qubit ordering, with runnable NumPy stand-ins.
- Cirq, PennyLane, Braket, Q# and Other Quantum SDKs Compare the main quantum programming frameworks (Cirq, PennyLane, Amazon Braket, Q#, CUDA-Q) and learn moments, parameter-shift gradients and how to choose.
- OpenQASM and Running Circuits on Real Quantum Hardware Learn OpenQASM 3 syntax, write a tiny QASM interpreter, and understand how a job travels to a quantum computer: transpiling, routing, queues and shots.
Applications and Outlook
- VQE and Variational Quantum Algorithms Learn how the variational quantum eigensolver finds ground-state energies of molecules: ansatz, cost function, classical optimizer, with a runnable H2 example.
- QAOA and Quantum Optimization (MaxCut) Learn the Quantum Approximate Optimization Algorithm: encode MaxCut as a cost Hamiltonian, build the QAOA circuit and optimize its angles in NumPy.
- Quantum Machine Learning: Kernels and Variational Classifiers Learn quantum machine learning basics: data encoding, quantum kernels and variational classifiers, with NumPy simulations on a circle dataset.
- Quantum Cryptography: BB84 Key Distribution Learn quantum key distribution and the BB84 protocol: how measurement disturbance reveals eavesdroppers, with a NumPy simulation and a post-quantum overview.
- The Outlook for Quantum Computing: Advantage, Roadmaps and Hype Where is quantum computing heading? Learn what quantum advantage means, how to estimate resources, which applications are likely, and how to spot hype.
Projects and Practice
- Project: A Grover SAT Solver Build a complete Grover solver for Boolean satisfiability problems: turn a formula into an oracle, count solutions, pick the iteration count and sample answers.
- Project: A Shor Factoring Simulator Build a complete factoring program around simulated quantum order finding: classical checks, QFT sampling, continued fractions and statistics over many numbers.
- Project: A Quantum Walk Simulator Build a discrete-time quantum walk on a line: coin and shift operators, ballistic spreading, interference patterns, and decoherence turning it classical.
- Quantum Computing Practice Problems with Worked Solutions Ten practice problems on algorithms, error correction, noise, cryptography and gradients, each with a worked solution and runnable verification code.