Skip to main content
Engineering LibreTexts

13.8.3: Quantum Gates

  • Page ID
    52463
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    In the first chapter of these notes, we explored all the possible functions of one and two input arguments and then singled out the most useful boolean functions \(NOT\), \(AND\), \(NAND\), \(NOR\), \(OR\), \(XOR\). Then, we associated it to a pictogram that we called gate, and reviewed the mechanisms to build logic circuits to do computations.

    In the previous section we did the same thing for qubits, we characterized all the operators that may transform the value of a single qubit: we defined Pauli’s matrices and explained how to do arbitrary rotations. By analogy with the classical case, Pauli matrices and arbitrary rotations are the gates of a quantum circuit. In more advanced treatises on quantum computing you would want to prove a variety of results about the quantum gates, such as the minimum set of gates necessary to do any quantum computation and various results on the generalization from 1 to n qubits. Here we will limit ourselves to summarizing the main details of the quantum algebra, its symbolic representation, and its properties.

    Elementary Quantum Gates

    The 5 elementary quantum gates are listed in Table 13.1. Their symbolic representation is much simpler

    Pauli X \(X=\left(\begin{array}{ll}
    0 & 1 \\
    1 & 0
    \end{array}\right) \equiv \sigma_{x}\)
    It is equivalent to doing a NOT or bit flip
    Pauli Y \(Y=\left(\begin{array}{cc}
    0 & -i \\
    i & 0
    \end{array}\right) \equiv \sigma_{y}\)
    Pauli Z \(Z=\left(\begin{array}{cc}
    1 & 0 \\
    0 & -1
    \end{array}\right) \equiv \sigma_{z}\)
    Changes the internal phase
    Hadamard \(H=\quad \frac{1}{\sqrt{2}}\left(\begin{array}{cc}
    1 & 1 \\
    1 & -1
    \end{array}\right)\)
    Phase \(S=\left(\begin{array}{ll}
    1 & 0 \\
    0 & i
    \end{array}\right)\)
    Table 13.1: Elementary quantum gates.

    than that of their classical counterparts, it is shown in Figure 13.5.

    Table 13.2 enumerates some of the properties of the elementary quantum gates from Table 13.1. These properties are the quantum counterpart to the properties of classical bit functions that we enumerated in

    Figure 13.5: Generic quantum gate. Where U is the name given to the generic unitary matrix that this gate represents.

    Chapter 1. These and other more advanced rules, help simplify quantum circuits much as deMorgan’s law helps in simplifying classical circuits.

    \(H=\frac{1}{\sqrt{2}}(X+Z)\) \(HXH = Z\)
    \(XYX = −Y\) \(HYH = −Y\)
    \(XZX = −Z\) \(HZH = X\)
    \(XR_y(\theta)X = R_y(−\theta)\) \(XR_z(\theta)X = R_y(−\theta)\)
    Table 13.2: Some of the main properties of single qubit gates.

    Two-qubit gates. Controlled Gates

    The first thing to note about multiple qubit gates is that the operators are unitary and square, and so unlike classical gates, quantum gates will always have the same number of inputs and outputs. Another way to say it is that all quantum gates are naturally reversible, as it should be expected from the fact that operators are unitary.

    The most important two qubit gates are the controlled gates. In a controlled gate the first input qubit is a control qubit, with the same meaning than the classical control bit. If it is in the \(|\; 1\rangle\) state, it will trigger the gate that acts on the second qubit, otherwise, it will not trigger it and the second qubit will remain unaltered. A generic example is shown in Figure 13.6, the gate in that example would be named C-U. There

    Figure 13.6: Generic quantum controlled gate (C-U). Where U is the name given to the generic unitary matrix that this gate represents.

    are two controlled gates that are very relevant to the algorithms we will describe later on, the C-X also known as C-NOT and the C-Z also known as C-Phase. The popularity of the CNOT gate has awarded it a symbol of its own, shown in Figure 13.7.

    Figure 13.7: CNOT gate.

    Finally, it is worth reviewing the matrix representation of the C-Z gate

    \[C-Z=\left(\begin{array}{cccc}
    1 & 0 & 0 & 0 \\
    0 & 1 & 0 & 0 \\
    0 & 0 & \mid 1 & 0 \mid \\
    0 & 0 & \mid 0 & -1 \mid
    \end{array}\right) \tag{13.63} \]

    where we have emphasized that the bottom right square is the Z matrix.


    This page titled 13.8.3: Quantum Gates is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Paul Penfield, Jr. (MIT OpenCourseWare) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.