Skip to Content
New in v0.1.0 OpenQASM export: run fqkit circuits on real IBM hardware
DocumentationTutorialsOverview

Tutorials

Four lessons, in order. They teach the physics a circuit is made of. Algorithms that use those ideas: Deutsch, Bernstein-Vazirani, Grover, and variational methods: are a separate section, Algorithms, so each one can be developed from the problem statement through to applications.

You need Python, NumPy, and fqkit. If those are not installed yet, start with Installation and the Quick Start. Each lesson draws the circuit. The same programs can be run, and changed, in a Python notebook.

The path

LessonWhat you will be able to do
1SuperpositionPut one qubit into an equal mixture of 0 and 1, and read the probabilities.
2InterferenceUse a second Hadamard so amplitudes cancel or reinforce, and see why a phase changes the answer.
3The Bell stateEntangle two qubits so their measurements always match.
4The GHZ stateExtend that correlation to three qubits.

How a lesson is organized

  1. The idea: the concept, before any code.
  2. The code: a short program you can paste into a terminal.
  3. The output: what that program prints. Shot counts vary; amplitudes do not.
  4. The explanation: why the output has that shape.
  5. The math: the same circuit as vectors and matrices.
  6. Try it yourself: three changes that test whether the idea stuck.
ℹ️

FQkit uses big-endian ordering: qubit 0 is the leftmost bit. The state-vector index of a bitstring is 2q0+q12q_0 + q_1 for two qubits, and the same pattern for more.

Last updated on