skip to content
Ivan's wiki
Site Tools
Search
Tools
Show pagesource
Backlinks
Recent Changes
Media Manager
Sitemap
>
Recent Changes
Media Manager
Sitemap
applying-gates-to-zero-state
This page is read only. You can view the source, but not change it.
## Applying gates to $\lvert 0\rangle$ (Zero state) | Gate | Matrix form | Derivation | | --- | --- | --- | | [I gate](/i-gate) | $I = \begin{pmatrix}1&0\\0&1\end{pmatrix}$ | $I\lvert 0\rangle = \begin{pmatrix}1&0\\0&1\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}1\\0\end{pmatrix} = \lvert 0\rangle$ | | [X gate](/x-gate) | $X = \begin{pmatrix}0&1\\1&0\end{pmatrix}$ | $X\lvert 0\rangle = \begin{pmatrix}0&1\\1&0\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}0\\1\end{pmatrix} = \lvert 1\rangle$ | | [Y gate](/y-gate) | $Y = \begin{pmatrix}0&-i\\i&0\end{pmatrix}$ | $Y\lvert 0\rangle = \begin{pmatrix}0&-i\\i&0\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}0\\i\end{pmatrix} = i\lvert 1\rangle$ | | [Z gate](/z-gate) | $Z = \begin{pmatrix}1&0\\0&-1\end{pmatrix}$ | $Z\lvert 0\rangle = \begin{pmatrix}1&0\\0&-1\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}1\\0\end{pmatrix} = \lvert 0\rangle$ | | [Hadamard gate](/h-gate) | $H = \tfrac{1}{\sqrt{2}}\begin{pmatrix}1&1\\1&-1\end{pmatrix}$ | $H\lvert 0\rangle = \tfrac{1}{\sqrt{2}}\begin{pmatrix}1&1\\1&-1\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix} = \tfrac{1}{\sqrt{2}}\begin{pmatrix}1\\1\end{pmatrix} = \lvert +\rangle$ | | [S gate](/s-gate) | $S = \begin{pmatrix}1&0\\0&i\end{pmatrix}$ | $S\lvert 0\rangle = \begin{pmatrix}1&0\\0&i\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}1\\0\end{pmatrix} = \lvert 0\rangle$ | | [T gate](/t-gate) | $T = \begin{pmatrix}1&0\\0&e^{i\pi/4}\end{pmatrix}$ | $T\lvert 0\rangle = \begin{pmatrix}1&0\\0&e^{i\pi/4}\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}1\\0\end{pmatrix} = \lvert 0\rangle$ | | [$R_x(\theta)$](/rx-gate) | $R_x(\theta) = \begin{pmatrix}\cos\tfrac{\theta}{2}&-i\sin\tfrac{\theta}{2}\\-i\sin\tfrac{\theta}{2}&\cos\tfrac{\theta}{2}\end{pmatrix}$ | $R_x(\theta)\lvert 0\rangle = \begin{pmatrix}\cos\tfrac{\theta}{2}&-i\sin\tfrac{\theta}{2}\\-i\sin\tfrac{\theta}{2}&\cos\tfrac{\theta}{2}\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}\cos\tfrac{\theta}{2}\\-i\sin\tfrac{\theta}{2}\end{pmatrix}$ | | [$R_y(\theta)$](/ry-gate) | $R_y(\theta) = \begin{pmatrix}\cos\tfrac{\theta}{2}&-\sin\tfrac{\theta}{2}\\\sin\tfrac{\theta}{2}&\cos\tfrac{\theta}{2}\end{pmatrix}$ | $R_y(\theta)\lvert 0\rangle = \begin{pmatrix}\cos\tfrac{\theta}{2}&-\sin\tfrac{\theta}{2}\\\sin\tfrac{\theta}{2}&\cos\tfrac{\theta}{2}\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}\cos\tfrac{\theta}{2}\\\sin\tfrac{\theta}{2}\end{pmatrix}$ | | [$R_z(\theta)$](/rz-gate) | $R_z(\theta) = \begin{pmatrix}e^{-i\theta/2}&0\\0&e^{i\theta/2}\end{pmatrix}$ | $R_z(\theta)\lvert 0\rangle = \begin{pmatrix}e^{-i\theta/2}&0\\0&e^{i\theta/2}\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix} = e^{-i\theta/2}\begin{pmatrix}1\\0\end{pmatrix}$ | | [$U(\theta,\phi,\lambda)$](/u-gate) | $U = \begin{pmatrix}\cos\tfrac{\theta}{2}&-e^{i\lambda}\sin\tfrac{\theta}{2}\\e^{i\phi}\sin\tfrac{\theta}{2}&e^{i(\phi+\lambda)}\cos\tfrac{\theta}{2}\end{pmatrix}$ | $U\lvert 0\rangle = \begin{pmatrix}\cos\tfrac{\theta}{2}&-e^{i\lambda}\sin\tfrac{\theta}{2}\\e^{i\phi}\sin\tfrac{\theta}{2}&e^{i(\phi+\lambda)}\cos\tfrac{\theta}{2}\end{pmatrix}\begin{pmatrix}1\\0\end{pmatrix} = \begin{pmatrix}\cos\tfrac{\theta}{2}\\e^{i\phi}\sin\tfrac{\theta}{2}\end{pmatrix}$ | ## Gates ### 1-qubit | Gate | Result | Comment | | --- | --- | --- | | [I gate](/i-gate) | $I\lvert 0\rangle = \lvert 0\rangle$ | The identity gate leaves $\lvert 0\rangle$ unchanged. | | [X gate](/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-gate) | $Y\lvert 0\rangle = i\lvert 1\rangle$ | Bit flip with an imaginary phase factor. | | [Z gate](/z-gate) | $Z\lvert 0\rangle = \lvert 0\rangle$ | $\lvert 0\rangle$ is an eigenstate of $Z$ with eigenvalue $+1$. | | [Hadamard gate](/h-gate) | $H\lvert 0\rangle = \lvert +\rangle$ | Rotates the north pole to the $+x$ equatorial point of the Bloch sphere. | | [S gate](/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-gate) | $T\lvert 0\rangle = \lvert 0\rangle$ | Phase only affects the $\lvert 1\rangle$ component; $\lvert 0\rangle$ is unchanged. | | [$R_x(\theta)$](/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. | | [$R_y(\theta)$](/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. | | [$R_z(\theta)$](/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(\theta,\phi,\lambda)$](/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)$. | ### 2-qubits | Gate | Result | Comment | | --- | --- | --- | | [CX](/cx-gate) (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](/cx-gate) (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](/swap-gate) | $\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](/iswap-gate) | $\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 | | --- | --- | --- | | [Toffoli](/ccx-gate) (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. | | [Toffoli](/ccx-gate) (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. | | [$\lvert 1\rangle$](/ket-1) | $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$. | | [$\lvert +\rangle$](/ket-plus) | $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)$. | | [$\lvert -\rangle$](/ket-minus) | $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)$. | | [$\lvert +i\rangle$](/ket-plus-i) | $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. | | [$\lvert -i\rangle$](/ket-minus-i) | $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 | | --- | --- | --- | | [$\lvert\Phi^+\rangle$](/ket-phi-plus) | $\text{CX}(H\otimes I)\lvert 00\rangle = \lvert\Phi^+\rangle$ | H puts qubit 1 into superposition; CX entangles qubit 2 conditionally. The simplest Bell state circuit, starting from two $\lvert 0\rangle$ qubits. | | [$\lvert\Phi^-\rangle$](/ket-phi-minus) | $(Z\otimes I)\,\text{CX}(H\otimes I)\lvert 00\rangle = \lvert\Phi^-\rangle$ | Same as $\lvert\Phi^+\rangle$ with a final $Z$ on qubit 1 to flip the relative sign between $\lvert 00\rangle$ and $\lvert 11\rangle$. | | [$\lvert\Psi^+\rangle$](/ket-psi-plus) | $\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)$. | | [$\lvert\Psi^-\rangle$](/ket-psi-minus) | $(Z\otimes I)\,\text{CX}(H\otimes X)\lvert 00\rangle = \lvert\Psi^-\rangle$ | Same as $\lvert\Psi^+\rangle$ with a final $Z$ to introduce the minus sign. The singlet state, antisymmetric under qubit exchange. |
Page Tools
Show pagesource
Backlinks
Back to top