Site Tools


ket-zero

Differences

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

Link to this comparison view

Next revision
Previous revision
ket-zero [June 13, 2026 at 01:13] – created - external edit 127.0.0.1ket-zero [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1
Line 1: Line 1:
-# $\lvert 0 \rangle$ (Zero state) 
-The **zero state** $\lvert 0\rangle$ is one of the two computational basis states of a qubit. It is the quantum analogue of a classical `0` bit, and it is the standard initial state used in most quantum circuits. The other computational basis state is [[ket-one|$\lvert 1\rangle$]]. 
- 
-$$\lvert 0\rangle = \begin{pmatrix}1\\0\end{pmatrix}$$ 
- 
-On the [[bloch-sphere]], $\lvert 0\rangle$ corresponds to the north pole at coordinates $(0, 0, 1)$. It is an eigenstate of the Pauli-Z gate with eigenvalue $+1$, meaning $Z\lvert 0\rangle = \lvert 0\rangle$. Applying the [[h-gate|Hadamard gate]] to $\lvert 0\rangle$ produces the equal superposition state $\lvert +\rangle = (\lvert 0\rangle + \lvert 1\rangle)/\sqrt{2}$. 
- 
-## Applying gates 
-^ Gate ^ Result ^ Comment ^ 
-| [[i-gate]] | $I\lvert 0\rangle = \lvert 0\rangle$ | The identity gate leaves $\lvert 0\rangle$ unchanged. | 
-| [[x-gate]] | $X\lvert 0\rangle = \lvert 1\rangle$ | Flips $\lvert 0\rangle$ to $\lvert 1\rangle$; quantum analogue of classical NOT. | 
-| [[y-gate]] | $Y\lvert 0\rangle = i\lvert 1\rangle$ | Bit flip with an imaginary phase factor. | 
-| [[z-gate]] | $Z\lvert 0\rangle = \lvert 0\rangle$ | $\lvert 0\rangle$ is an eigenstate of $Z$ with eigenvalue $+1$. | 
-| [[h-gate]] | $H\lvert 0\rangle = \lvert +\rangle$ | Rotates the north pole to the $+x$ equatorial point of the Bloch sphere. | 
-| [[s-gate]] | $S\lvert 0\rangle = \lvert 0\rangle$ | Phase only affects the $\lvert 1\rangle$ component; $\lvert 0\rangle$ is unchanged. | 
-| [[t-gate]] | $T\lvert 0\rangle = \lvert 0\rangle$ | Phase only affects the $\lvert 1\rangle$ component; $\lvert 0\rangle$ is unchanged. | 
-| [[rx-gate]] | $R_x(\theta)\lvert 0\rangle = \cos\tfrac{\theta}{2}\lvert 0\rangle - i\sin\tfrac{\theta}{2}\lvert 1\rangle$ | Tilts the state from $\lvert 0\rangle$ toward $\lvert 1\rangle$ with an imaginary phase on the $\lvert 1\rangle$ component. | 
-| [[ry-gate]] | $R_y(\theta)\lvert 0\rangle = \cos\tfrac{\theta}{2}\lvert 0\rangle + \sin\tfrac{\theta}{2}\lvert 1\rangle$ | Real amplitudes; at $\theta=\pi/2$ gives $\lvert +\rangle$, the same result as the Hadamard gate up to global phase. | 
-| [[rz-gate]] | $R_z(\theta)\lvert 0\rangle = e^{-i\theta/2}\lvert 0\rangle$ | Global phase only; $\lvert 0\rangle$ is on the $z$-axis so a $z$-rotation has no observable effect. | 
-| [[u-gate]] | $U\lvert 0\rangle = \cos\tfrac{\theta}{2}\lvert 0\rangle + e^{i\phi}\sin\tfrac{\theta}{2}\lvert 1\rangle$ | $\lambda$ drops out; every single-qubit state is reachable from $\lvert 0\rangle$ with appropriate $(\theta,\phi)$. | 
- 
-## Reaching other states 
-^ State ^ Gates ^ Comment ^ 
-| $\lvert 0\rangle$ | $I\lvert 0\rangle = \lvert 0\rangle$ | The identity gate leaves $\lvert 0\rangle$ unchanged. | 
-| [[ket-one|$\lvert 1\rangle$]] | $X\lvert 0\rangle = \lvert 1\rangle$ | X flips the qubit; the quantum analogue of classical NOT. $X$ is its own inverse: $X^2 = I$. | 
-| [[ket-plus|$\lvert +\rangle$]] | $H\lvert 0\rangle = \lvert +\rangle$ | Hadamard rotates the north pole to the $+x$ equatorial point, creating the equal superposition $\tfrac{1}{\sqrt{2}}(\lvert 0\rangle + \lvert 1\rangle)$. | 
-| [[ket-minus|$\lvert -\rangle$]] | $ZH\lvert 0\rangle = \lvert -\rangle$ | H first produces $\lvert +\rangle$, then Z flips its relative phase to give $\tfrac{1}{\sqrt{2}}(\lvert 0\rangle - \lvert 1\rangle)$. | 
-| [[ket-i|$\lvert +i\rangle$]] | $SH\lvert 0\rangle = \lvert +i\rangle$ | H rotates to the $+x$ equatorial point, then S rotates 90° around $z$ to land on the $+y$ pole. | 
-| [[ket-minus-i|$\lvert -i\rangle$]] | $S^\dagger H\lvert 0\rangle = \lvert -i\rangle$ | Same as $\lvert +i\rangle$ but with the inverse phase rotation, landing on the $-y$ pole instead. | 
- 
-## Qiskit 
- 
-```python 
-# Run: python main.py X H S 
-# Prepare |0>, apply each named gate from argv in order, and print the statevector. 
-# Parametric gates (Rx, Ry, Rz, U) use a fixed demo angle of pi/2. 
- 
-import sys 
-import numpy as np 
-from qiskit import QuantumCircuit 
-from qiskit.quantum_info import Statevector 
- 
-qc = QuantumCircuit(1) 
- 
-for arg in sys.argv[1:]: 
-    name = arg.lower() 
-    if name == "i": 
-        qc.id(0) 
-    elif name == "x": 
-        qc.x(0) 
-    elif name == "y": 
-        qc.y(0) 
-    elif name == "z": 
-        qc.z(0) 
-    elif name == "h": 
-        qc.h(0) 
-    elif name == "s": 
-        qc.s(0) 
-    elif name == "sdg": 
-        qc.sdg(0) 
-    elif name == "t": 
-        qc.t(0) 
-    elif name == "tdg": 
-        qc.tdg(0) 
-    elif name == "rx": 
-        qc.rx(np.pi / 2, 0) 
-    elif name == "ry": 
-        qc.ry(np.pi / 2, 0) 
-    elif name == "rz": 
-        qc.rz(np.pi / 2, 0) 
-    elif name == "u": 
-        qc.u(np.pi / 2, 0, 0, 0) 
-    else: 
-        print(f"Unknown gate: {arg}") 
- 
-print(Statevector(qc).data) 
-``` 
- 
  
ket-zero.1781313205.txt.gz · Last modified: by 127.0.0.1