Site Tools


qubit

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
qubit [June 13, 2026 at 03:43] – external edit 127.0.0.1qubit [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 qubit.py+# Run: Python qubit.py
 # Prepares |+⟩ and samples 1000 shots; expect roughly equal counts of '0' and '1'. # Prepares |+⟩ and samples 1000 shots; expect roughly equal counts of '0' and '1'.
 from qiskit import QuantumCircuit from qiskit import QuantumCircuit
qubit.1781322188.md.gz · Last modified: by 127.0.0.1