qubit
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| qubit [June 13, 2026 at 03:43] – external edit 127.0.0.1 | qubit [August 26, 2026 at 15:46] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| A general qubit state is a superposition over the two computational basis states, with the normalization condition saying the total probability must be 1: | A general qubit state is a superposition over the two computational basis states, with the normalization condition saying the total probability must be 1: | ||
| - | $$\lvert\psi\rangle = \begin{pmatrix}a\\b\end{pmatrix} = a\lvert 0\rangle + b\lvert 1\rangle, \qquad |a|^2 + |b|^2 = 1$$ | + | $$\lvert\psi\rangle = \begin{pmatrix}a\\b\end{pmatrix} = a\underbrace{\begin{pmatrix}1\\ 0\end{pmatrix}}_{\lvert 0\rangle} + b\underbrace{\begin{pmatrix}0\\1\end{pmatrix}}_{\lvert 1\rangle} = a\lvert 0\rangle + b\lvert 1\rangle, \qquad |a|^2 + |b|^2 = 1$$ |
| ## Basis states | ## Basis states | ||
| Line 75: | Line 75: | ||
| ```python | ```python | ||
| # Requires: pip install qiskit qiskit-aer | # Requires: pip install qiskit qiskit-aer | ||
| - | # Run: python | + | # Run: Python |
| # Prepares |+⟩ and samples 1000 shots; expect roughly equal counts of ' | # Prepares |+⟩ and samples 1000 shots; expect roughly equal counts of ' | ||
| from qiskit import QuantumCircuit | from qiskit import QuantumCircuit | ||
qubit.1781322188.md.gz · Last modified: by 127.0.0.1
