Quantum Computing / Guide
Quantum fundamentals
The concepts you need to build circuits and make sense of their outputs.
Qubits and amplitudes
A pure qubit state is α|0⟩ + β|1⟩, where |α|² + |β|² = 1. The complex amplitudes determine measurement probabilities. They are not themselves probabilities.
An n-qubit pure state has 2ⁿ computational-basis amplitudes. Exact state simulation therefore grows rapidly with circuit width, even when the circuit diagram looks small.
Gates, superposition and phase
X exchanges |0⟩ and |1⟩. H maps |0⟩ to (|0⟩ + |1⟩)/√2. Z changes the sign of the |1⟩ amplitude. Rotation gates apply angle-dependent transformations.
Relative phase affects how amplitudes combine in later gates. The states |+⟩ and |−⟩ both give equally likely 0/1 outcomes when measured directly in the computational basis. Applying H before measurement distinguishes them: |+⟩ becomes |0⟩ and |−⟩ becomes |1⟩.
Entanglement and correlations
Some joint states cannot be written as separate pure states for each qubit. The Bell state (|00⟩ + |11⟩)/√2 is an example. Measuring either bit gives a random outcome; measuring both in this basis gives agreeing results.
An agreeing 00/11 histogram alone does not establish coherent entanglement: a classical mixture can have the same histogram. Other measurement bases or state information are needed to distinguish them.
Measurement and shots
A computational-basis measurement yields a classical outcome according to the state’s probabilities and changes the state conditioned on that outcome. Measuring in the middle of a circuit can therefore change its later behavior.
A shot is one repetition of the circuit and its measurement process. For a sampled result, estimated probability is count divided by total shots. More shots usually reduce sampling uncertainty, but do not remove gate noise or repair a wrong circuit.
Read the right register and bit order
In a complete classical register, labels place the highest-index bit on the left: c3c2c1c0 for four bits. Check each measurement mapping before interpreting a string as a binary integer.
An algorithm may measure only an ancilla, a counting register or a selected output. Follow that guide’s register definition. Displayed qubit order and the order in which you enter a parameter are not always identical; use the labels in the configuration dialog.
From circuit to algorithm
An algorithm combines state preparation, transformations and measurement with assumptions about its inputs. A teaching oracle encodes a selected problem instance; seeing its gates does not demonstrate the cost of building an oracle for a real data source.
Ideal probabilities, sampled frequencies and hardware observations answer different questions. Check the circuit, assumptions and backend before comparing them.