applying-gates-to-zero-state
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| applying-gates-to-zero-state [June 12, 2026 at 22:17] – created Ivan Janevski | applying-gates-to-zero-state [June 13, 2026 at 03:13] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 12: | Line 12: | ||
| | [[rz-gate|$R_z(\theta)$]] | $R_z(\theta) = \begin{pmatrix}e^{-i\theta/ | | [[rz-gate|$R_z(\theta)$]] | $R_z(\theta) = \begin{pmatrix}e^{-i\theta/ | ||
| | [[u-gate|$U(\theta, | | [[u-gate|$U(\theta, | ||
| + | |||
| + | |||
| + | ## Gates | ||
| + | ### 1-qubit | ||
| + | ^ 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)$]] | $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)$]] | $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/ | ||
| + | | [[rz-gate|$R_z(\theta)$]] | $R_z(\theta)\lvert 0\rangle = e^{-i\theta/ | ||
| + | | [[u-gate|$U(\theta, | ||
| + | |||
| + | ### 2-qubits | ||
| + | ^ Gate ^ Result ^ Comment ^ | ||
| + | | [[cx-gate|CX]] (as control) | $\text{CX}\lvert 0\rangle\lvert t\rangle = \lvert 0\rangle\lvert t\rangle$ | Control is off; target qubit $\lvert t\rangle$ is always left unchanged. | | ||
| + | | [[cx-gate|CX]] (as target) | $\text{CX}\lvert c\rangle\lvert 0\rangle = \lvert c\rangle\lvert c\rangle$ | Flipped to $\lvert 1\rangle$ only when the control qubit is $\lvert 1\rangle$. | | ||
| + | | [[swap-gate|SWAP]] | $\text{SWAP}\lvert 0\rangle\lvert\psi\rangle = \lvert\psi\rangle\lvert 0\rangle$ | Exchanges the two qubit states; the $\lvert 0\rangle$ moves to the second register. | | ||
| + | | [[iswap-gate|iSWAP]] | $\text{iSWAP}\lvert 00\rangle = \lvert 00\rangle$; $\text{iSWAP}\lvert 01\rangle = i\lvert 10\rangle$ | Adds a phase of $i$ when states are exchanged; trivial when both qubits are $\lvert 0\rangle$. | | ||
| + | |||
| + | ### 3-qubits | ||
| + | ^ Gate ^ Result ^ Comment ^ | ||
| + | | [[ccx-gate|Toffoli]] (as control) | $\text{CCX}\lvert 0\rangle\lvert c_2\rangle\lvert t\rangle = \lvert 0\rangle\lvert c_2\rangle\lvert t\rangle$ | Control is off; target is always unchanged regardless of the second control. | | ||
| + | | [[ccx-gate|Toffoli]] (as target) | $\text{CCX}\lvert 1\rangle\lvert 1\rangle\lvert 0\rangle = \lvert 1\rangle\lvert 1\rangle\lvert 1\rangle$ | Flipped to $\lvert 1\rangle$ only when both controls are $\lvert 1\rangle$. | | ||
| + | |||
| + | ## Reaching other states | ||
| + | ### 1-qubit | ||
| + | ^ State ^ Gates ^ Comment ^ | ||
| + | | $\lvert 0\rangle$ | $I\lvert 0\rangle = \lvert 0\rangle$ | The identity gate leaves $\lvert 0\rangle$ unchanged. | | ||
| + | | [[ket-1|$\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-plus-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. | | ||
| + | |||
| + | ### 2-qubits | ||
| + | ^ State ^ Gates ^ Comment ^ | ||
| + | | [[ket-phi-plus|$\lvert\Phi^+\rangle$]] | $\text{CX}(H\otimes I)\lvert 00\rangle = \lvert\Phi^+\rangle$ | H puts qubit 1 into superposition; | ||
| + | | [[ket-phi-minus|$\lvert\Phi^-\rangle$]] | $(Z\otimes I)\, | ||
| + | | [[ket-psi-plus|$\lvert\Psi^+\rangle$]] | $\text{CX}(H\otimes X)\lvert 00\rangle = \lvert\Psi^+\rangle$ | X first flips qubit 2 to $\lvert 1\rangle$; H and CX then entangle in the anti-correlated subspace $\tfrac{1}{\sqrt{2}}(\lvert 01\rangle + \lvert 10\rangle)$. | | ||
| + | | [[ket-psi-minus|$\lvert\Psi^-\rangle$]] | $(Z\otimes I)\, | ||
| + | |||
applying-gates-to-zero-state.1781302621.txt.gz · Last modified: by Ivan Janevski
