Read a statevector
Connect amplitudes, probabilities, and normalization.
Intuition
A statevector lists amplitudes in a fixed basis order. Square each amplitude's magnitude to get the probability of that basis outcome.
Amplitudes may be negative or complex; probabilities cannot. Normalization makes the probabilities sum to one. H on |0⟩ produces two amplitudes of 1/√2, not two amplitudes of 1/2.
The mathematics
Look a little deeper
For a complex amplitude a+ib, its squared magnitude is a²+b². Complex numbers let us describe phase as well as probability. The computational basis alone does not reveal relative phase.
Use it
Prepare |+⟩ using one gate. Inspect the two amplitudes and their probabilities.
This exercise uses the same server-side state and circuit checks as its linked practice problem.
Build your circuit
Click a gate to append it, or drag it onto a wire. CX uses the selected control; SWAP uses it as the second operand. Basis order: |qₙ … q₀⟩.
Returned logical circuit · before transpilation · q0 on top
Connect to code
from qiskit.quantum_info import Statevector state = Statevector.from_instruction(qc)
These operations go inside a circuit-building program. Practice problems provide a complete solve() template.
Check your understanding
First complete the circuit exercise successfully.