liveBook · Manning

Gate application

As explained in Quantum Programming in Depth

The programming operation of applying a quantum gate to one or more qubits.

Gate application transforms a quantum state by multiplying its state vector by the gate’s matrix. For X acting on γ|0⟩ + δ|1⟩, the amplitudes swap, producing δ|0⟩ + γ|1⟩. section 2.1.1

Choose the operation by matching the required state transformation:

  • Use fixed gates such as I, X, Z, or H for standard transformations of single-qubit states. section 2.1.1
  • Use the parameterized rotation Ry(θ) when the desired transformation depends on state amplitudes or another parameter. section 2.1.1
  • Express gate application abstractly in quantum programming tools, leaving later software layers to decompose operations for hardware. section 1.3.3
Table 2.1 Commonly used single-qubit gates with real coefficients and their effects on an arbitrary state
Gate Matrix representation The result of applying the gate to \(\ket{\psi} = \gamma \ket{0} + \delta \ket{1}\)
\(I\) \(\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\) \(I\ket{\psi} = \gamma \ket{0} + \delta \ket{1}\)
\(X\) \(\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\) \(X\ket{\psi} = \delta \ket{0} + \gamma \ket{1}\)
\(Z\) \(\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\) \(Z\ket{\psi} = \gamma \ket{0} - \delta \ket{1}\)
\(H\) \(\frac1{\sqrt2}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\) \(H\ket{\psi} = \frac1{\sqrt2} (\gamma + \delta) \ket{0} + \frac1{\sqrt2} (\gamma - \delta) \ket{1}\)
\(Ry(\theta)\) \(\begin{pmatrix} \cos \frac{\theta}{2} & -\sin \frac{\theta}{2} \\ \sin \frac{\theta}{2} & \cos \frac{\theta}{2} \end{pmatrix}\) \(Ry(\theta)\ket{\psi} = (\gamma \cos \frac{\theta}{2} - \delta \sin \frac{\theta}{2}) \ket{0} + (\gamma \sin \frac{\theta}{2} + \delta \cos \frac{\theta}{2}) \ket{1}\)

Compare common single-qubit gates through their matrices and their effects on an arbitrary state. section 2.1.1

How Quantum Programming in Depth covers it

How deep it goes
Works through single-qubit matrix multiplication and parameterized rotations, while deferring complex coefficients to later treatment.
Examples
Uses I, X, Z, H, and Ry(θ), including an X transformation and a parameterized rotation of |0⟩.
What it assumes
Assumes basic quantum-state notation, column vectors, matrices, and Dirac notation for basis states.
What you can do after
Evaluate/understand gate effects by multiplying state vectors by gate matrices and selecting suitable built-in operations.
How it connects
Connects quantum states, single-qubit gates, quantum algorithms, quantum programming languages, and quantum hardware.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quantum Programming in Depth. The section links point to the parts of the book it draws on.