Tuesday, February 6, 2024

Some standard quantum gates

There appear to be some quantum states and gates that are more or less standard. I'm not sure what the theoretical or physical reason for this is, but I'll fill this post out as I learn more.

  • Plus and minus states for a qubit:
    $\lvert + \rangle = \displaystyle\frac{1}{\sqrt{2}}\left( \lvert 0 \rangle + \lvert 1 \rangle \right), \;\;\;\;\;\;\;\;\;\; \lvert-\rangle = \displaystyle\frac{1}{\sqrt{2}}\left( \lvert 0 \rangle - \lvert 1 \rangle \right).$
  • Bell states/basis on two qubits:
    $\lvert \phi^+ \rangle = \displaystyle\frac{1}{\sqrt{2}}\left( \lvert 00 \rangle + \lvert 11 \rangle \right)$
    $\lvert \phi^- \rangle = \displaystyle\frac{1}{\sqrt{2}}\left( \lvert 00 \rangle - \lvert 11 \rangle \right)$
    $\lvert \psi^+ \rangle = \displaystyle\frac{1}{\sqrt{2}}\left( \lvert 01 \rangle + \lvert 10 \rangle \right)$
    $\lvert \psi^- \rangle = \displaystyle\frac{1}{\sqrt{2}}\left( \lvert 01 \rangle - \lvert 10 \rangle \right)$
    These are essentially variants of entangled states. The Bell state $\lvert \phi^+ \rangle$ can be created from the qubit $\lvert 00 \rangle$ by applying the operator $XC \circ \mathbb{I}H$ (where $XC$ is the controlled NOT, with control on the right factor). The other bell states may be obtained by applying $X$ and $Z$ to this one.
  • The Hamamard gate, which acts on a single qubit
    $H = \displaystyle\frac{1}{\sqrt{2}}\begin{pmatrix}1 &1\\1&-1\end{pmatrix}$
    which transforms a qubit between the standard basis and the plus/minus basis. Note that $H^2 = \mathbb{I}$.
  • Phase operations:
    $P_\theta = \begin{pmatrix}1&0\\0&e^{i\theta}\end{pmatrix}, \;\;\;\;\; S = P_{\pi/2} = \begin{pmatrix}1&0\\0&i\end{pmatrix}, \;\;\;\;\; T = P_{\pi/4} = \begin{pmatrix}1&0\\0&(1+i)/\sqrt{2}\end{pmatrix}$
  • Pauli operations, which act on a single qubit
    $\mathbb{I} = \begin{pmatrix} 1&0\\0&1\end{pmatrix}, \;\;\;\;\;X = \begin{pmatrix} 0&1\\1&0\end{pmatrix}, \;\;\;\;\;Y = \begin{pmatrix} 0&-i\\i&0\end{pmatrix}, \;\;\;\;\;Z = \begin{pmatrix} 1&0\\0&-1\end{pmatrix}.$
    The operation $X$ is also called the NOT operation, and $Z = P_{\pi}$ is a phase operation. These have the relations
    $X^2 = Y^2 = Z^2 = \mathbb{I},$
    $XY = iZ, YZ = iX, ZX = iY,$
    $XZ = -iY, ZY = -iX, YX = -iZ.$
  • Rotations in the Bloch sphere. The Bloch sphere is the space of states for a qubit, modulo global phase, i.e. $S^3/S^1 \simeq S^2$. In spherical coordinates $\theta \in [0, \pi], \psi \in [0, 2\pi)$:
    $\cos(\theta/2) \lvert 0 \rangle + e^{i \psi} \sin(\theta/2) \lvert 1 \rangle.$
    That is, given a qubit $\alpha \lvert 0 \rangle + \beta \lvert 1 \rangle$, we can use the global phase change to make $\alpha$ a real positive number in $[0, 1]$, which we parameterize by $\cos(\theta/2)$. Then, $\beta$ has magnitude $\sin(\theta/2)$ and arbitrary phase. We can also embed the Bloch sphere in $\mathbb{R}^3$ using the usual spherical coordinates:
    $(\theta, \psi) \mapsto (\sin \theta \cos \phi, \sin\theta \sin \phi, \cos \theta).$
    The rotation about the three axes then can be interpreted as an action on qubits, giving rise to the rotation gates.
    • $R_x(\theta) = \begin{pmatrix} \cos(\theta/2) & -i \sin(\theta/2) \\ -i \sin(\theta/2) & \cos(\theta/2) \end{pmatrix}$
    • $R_y(\theta) = \begin{pmatrix} \cos(\theta/2) & -\sin(\theta/2) \\ \sin(\theta/2) & \cos(\theta/2) \end{pmatrix}$
    • $R_z(\theta) = \begin{pmatrix} e^{-\theta/2} & 0 \\ 0 & e^{\theta/2} \end{pmatrix}$
    We also have
    $X = iR_x(\pi), Y = iR_y(\pi), Z = iR_z(\pi),$

    $R_z(\theta) \sim P_\theta.$
  • The SWAP gate, which swaps tensor factors:
    $\text{SWAP}\lvert x \rangle \lvert y \rangle = \lvert y \rangle \lvert x \rangle$
  • Controlled operations: given a unitary operation $U$ on any quantum system $R$, the associated controlled operation $CU$ acts on $Q \otimes R$ where $Q$ is a single qubit by
    $CU = \lvert 0 \rangle \langle 0 \rvert \otimes \mathbb{I}_R + \lvert 1 \rangle \langle 1 \rvert \otimes U,$
    i.e. the qubit $Q$ controls whether or not (or with what probability) the operation $U$ is performed.
    • The controlled NOT operation $CX$ sends the standard basis to the Bell basis (with a slight sign difference):
      $CU\lvert 00 \rangle = \lvert \phi^+\rangle, \;\;\;\;\; CU\lvert 01 \rangle = \lvert \phi^- \rangle, \;\;\;\;\; CU\lvert 10 \rangle = \lvert \psi^+ \rangle, \;\;\;\;\; CU\lvert 11 \rangle = -\lvert \psi^- \rangle$

No comments:

Post a Comment

Shor's algorithm

Shor's algorithm is a quantum algorithm for factoring in polynomial time. For sources, I am using this Qiskit tutorial and Wikipedia ...