Quantum Computing 2 -- Quantum gates (single qubit)

Quantum gates are the elementary operations for the qubits of a quantum computer. They are comparable to the logic gates for classical bits. In contrast to the Boolean operators, all quantum gates are reversible, so there is always an inverse operation that can undo all computation steps. There is also a much wider variety of possible operations for qubits.

A quantum gate for a single qubit is described by a unitary matrix: U=(abcd)a,b,c,dC U = \left( \begin{array}{cc} a & b \\ c & d \end{array} \right)\, \quad a,b,c,d \in \mathbb{C} The operation on a state ψ=α0+β1| \psi \rangle = \alpha | 0 \rangle + \beta | 1 \rangle corresponds to the multiplication of the matrix UU with the state vector: Uψ=U(α0+β1)=(abcd)(αβ)=(aα+bβcα+dβ)=(aα+bβ)0+(cα+dβ)1\begin{aligned} U |\psi \rangle &= U (\alpha |0\rangle + \beta |1\rangle)\\ &= \left( \begin{array}{cc} a & b \\ c & d \end{array} \right) \left( \begin{array}{c} \alpha \\ \beta \end{array} \right) \\ &= \left( \begin{array}{c} a \alpha + b \beta \\ c \alpha + d \beta \end{array} \right) \\ &= (a \alpha + b \beta) |0\rangle + (c \alpha + d \beta) |1\rangle \end{aligned} Executing two operators UU and \ (V ) one after the other is equivalent to an operator resulting from the matrix multiplication of UU and VV : VU=(abcd)(abcd)=(aa+bcab+bdca+dccb+dd)\begin{aligned} V \cdot U &= \left( \begin{array}{cc} a' & b' \\ c' & d' \end{array} \right) \cdot \left( \begin{array}{cc} a & b \\ c & d \end{array} \right) \\ &= \left( \begin{array}{cc} a' a + b' c & a' b + b' d \\ c' a + d' c & c' b + d' d \end{array} \right) \end{aligned} Since the operators are unitary matrices UU , the adjoint matrix UU ^ \dagger corresponds to the inverse operator. (The quantum gate UU ^ \dagger thus reverses the effect of the gate UU .) U=(acbd)UU=I=(1001)\begin{aligned} U^\dagger &= \left( \begin{array}{cc} a^\ast & c^\ast \\ b^\ast & d^\ast \end{array} \right) \\ U^\dagger \cdot U &= I = \left( \begin{array}{cc} 1 & 0 \\ 0 & 1 \end{array} \right) \end{aligned} where II is the identity operator or unit matrix and zz^\ast denotes the complex conjungate of zz.


The Hadamard gate is one of the most fundamental operations in quantum computing. The Hadamard gate for single qubit is described in the {0,1}\{| 0 \rangle, | 1 \rangle \} basis by the following matrix:

H=12(1111)H0=12(0+1)+H1=12(01)\begin{aligned} H &= \frac{1}{\sqrt{2}} \left( \begin{array}{cc} 1 & 1 \\ 1 & - 1 \end{array} \right) \\ H|0\rangle &= \frac{1}{\sqrt{2}}(|0 \rangle + |1 \rangle) \equiv |+\rangle\\ H|1\rangle &= \frac{1}{\sqrt{2}}(|0 \rangle - |1 \rangle) \equiv |-\rangle \end{aligned} The basis states 0| 0 \rangle and 1| 1 \rangle are converted by the Hadamard gate into a superposition. You can also understand this operation as a transition between the bases {0,1}\{| 0 \rangle, | 1 \rangle \} and {+,}\{| + \rangle, | - \rangle \} . The Hadamard matrix is self-adjoint (H=HH ^ \dagger = H ), so that the two-time application of the Hadamard gate gives the identity (HH=HH=IH \cdot H = H ^ \dagger \cdot H = I ).


The phase-shift RϕR_ \phi is a whole family of single-qubit gates. It is described by the following matrix in the {0,1}\{| 0 \rangle, | 1 \rangle \} basis:

Rϕ=(100exp(iϕ))Rϕ0=0Rϕ1=exp(iϕ)1\begin{aligned} R_\phi &= \left( \begin{array}{cc} 1 & 0 \\ 0 & \exp(i \phi) \end{array} \right) \\ R_\phi|0\rangle &= |0\rangle \\ R_\phi|1\rangle &= \exp(i \phi) |1\rangle \end{aligned} where exp(iϕ)=cos(ϕ)+isin(ϕ)\exp (i \phi) = \cos (\phi) + i \sin (\phi) . This operation leaves the amplitudes of the state vector unchanged and only introduces a phase shift between the vector components by the angle ϕ[π,π]\phi \in [- \pi, \pi] . The adjoint matrix yields Rϕ=RϕR_ \phi ^ \dagger = R _ {- \phi} such that RϕRϕ=IR _ {- \phi} \cdot R_ \phi = I .

Of particular importance are the phase shift gates T=Rπ/4T = R _ {\pi / 4} , S=Rπ/2S = R _ {\pi / 2} and Z=RπZ = R_ \pi .


The Pauli gates are a family of three operators with the matrices X=(0110)Y=(0ii0)Z=(1001) \begin{aligned} X &= \left(\begin{array}{cc}0 & 1 \\ 1 & 0 \end{array}\right) \\ Y &= \left(\begin{array}{cc}0 & -i \\ i & 0 \end{array}\right) \\ Z &= \left(\begin{array}{cc}1 & 0 \\ 0 & -1 \end{array}\right) \end{aligned} The XX gate is the quantum mechanical equivalent to the classical NOT operator and interchanges the basis states so that X0=1X | 0 \rangle = | 1 \rangle and X1=0X | 1 \rangle = | 0 \rangle (bit-flip). The ZZ gate performs a special phase-shift operation around the angle π\pi (phase-flip). The YY gate is a combination of bit and phase flip. The Pauli matrices are self-adjoint and obey the algebra XX=YY=ZZ=iXYZ=IX \cdot X = Y \cdot Y = Z \cdot Z = -i X \cdot Y \cdot Z = I .

Note by Markus Michelmann
1 year, 4 months ago

No vote yet
1 vote

  Easy Math Editor

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

  • Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
  • Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
  • Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
  • Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
    # 4 spaces, and now they show
    # up as a code block.

    print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}


Sort by:

Top Newest

Thanks for posting these, as well as the problems. It's cool to realize that this stuff is actually somewhat accessible to non-specialists.

Steven Chase - 1 year, 4 months ago

Log in to reply

Can anyone please tell me the latex code to write example in notes as in wiki.

@Calvin Lin, @Markus Michelmann

Ram Mohith - 1 year, 1 month ago

Log in to reply


Problem Loading...

Note Loading...

Set Loading...