Lean, informalized

Nielsen & Chuang · Chapter 7, Quantum computers: physical realization · p. 324

Exercise 7.32 - The ion trap circuit equals CNOT followed by a phase flip on the control

CNOT, up to a phase flip, from controlled Z and two rotations.

Hover over a blue or green term in the text, or a node in the graph, to find it in the other. Select it to read its declaration both in Lean and in words.

The Exercise

Two qubits enter a circuit, the first as control and the second as target. The target is rotated by π/2\pi/2 about the yy axis, a controlled ZZ gate acts on the pair, and the target is rotated by −π/2-\pi/2 about the same axis. This is the ion trap construction of the controlled NOT (CNOT) gate. The exercise is to show that the three steps give a CNOT up to a relative phase on the control: the circuit is the CNOT followed by the phase flip ZZ, the Pauli matrix diag⁡(1,−1)\operatorname{diag}(1, -1), on the control qubit.

Qubits and Their Gates

A quantum system SS is given by its state space, a finite dimensional complex Hilbert space.✦ The composite system S⊗TS \otimes T of two quantum systems SS and TT is the quantum system whose state space is the tensor product of their state spaces.✦ The qubit QQ is the quantum system whose state space is ℂ2\mathbb{C}^2, and a pair of qubits is the composite system Q⊗QQ \otimes Q.

A pure state |ψ⟩\lvert\psi\rangle of SS is a unit vector of the state space of SS, ‖ψ‖=1\lVert\psi\rVert = 1.✦ The computational basis states |0⟩\lvert 0\rangle and |1⟩\lvert 1\rangle of the qubit are the pure states whose vectors are the standard basis vectors e0e_0 and e1e_1 of ℂ2\mathbb{C}^2.✦

A unitary UU of SS, a closed system evolution of SS, is an operator on the state space of SS with U†U=UU†=1U^\dagger U = U U^\dagger = 1.✦ The identity evolution of SS is the unitary whose operator is 11.✦ Two unitaries UU and VV of SS compose to the unitary UU after VV, with operator UVUV: first VV, then UU.✦ For unitaries UU of SS and VV of TT, the product unitary U⊗VU \otimes V is the unitary of S⊗TS \otimes T whose operator is the tensor product of the two operators.✦ A gate on one factor alone is its product with the identity evolution of the other: UU on the first factor of S⊗TS \otimes T, the first wires, is U⊗1U \otimes 1, and VV on the last factor, the last wires, is 1⊗V1 \otimes V.

Pauli Matrices and Rotations

The Pauli matrices are the complex 2×22 \times 2 matrices X=(0110),Y=(0−ii0),Z=(100−1).X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \qquad Y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}, \qquad Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}.(1) The Pauli vector is σ→=(X,Y,Z)\vec{\sigma} = (X, Y, Z); for a real vector n→=(nx,ny,nz)\vec{n} = (n_x, n_y, n_z) in three dimensions, the matrix n→⋅σ→\vec{n} \cdot \vec{\sigma} is the combination nxX+nyY+nzZn_x X + n_y Y + n_z Z of the Pauli matrices.✦ The rotation about the axis n→\vec{n} by a real angle θ\theta is the matrix Rn→(θ)=exp⁡(−iθ2n→⋅σ→),R_{\vec{n}}(\theta) = \exp\Bigl(-\frac{i\theta}{2}\, \vec{n} \cdot \vec{\sigma}\Bigr),(2)✦ written Rnˆ(θ)R_{\hat{n}}(\theta) when the axis is a unit vector nˆ\hat{n}. The rotation about the yy axis is Ry(θ)=Ryˆ(θ)=e−iθY/2R_y(\theta) = R_{\hat{y}}(\theta) = e^{-i\theta Y/2}, with yˆ=(0,1,0)\hat{y} = (0, 1, 0).✦

The yy rotation gate is the unitary of the qubit whose operator is the matrix Ry(θ)R_y(\theta) acting on ℂ2\mathbb{C}^2.✦ The Pauli XX gate of the qubit, the quantum NOT, is the unitary of the qubit whose operator is the matrix XX, and the Pauli ZZ gate of the qubit, the phase flip, is the unitary of the qubit whose operator is the matrix ZZ.

Controlled Gates

For a unitary UU of a system SS, the controlled gate C(U)C(U) is the unitary of Q⊗SQ \otimes S, a control qubit and a target SS, with operator C(U)=|0⟩⟨0|⊗1+|1⟩⟨1|⊗U.C(U) = \lvert 0\rangle\langle 0\rvert \otimes 1 + \lvert 1\rangle\langle 1\rvert \otimes U.(3)✦ The CNOT gate is C(X)C(X) on a pair of qubits; it flips the target exactly when the control is |1⟩\lvert 1\rangle.✦ The controlled ZZ gate is CZ=C(Z)CZ = C(Z), whose matrix in the computational basis is diag⁡(1,1,1,−1)\operatorname{diag}(1, 1, 1, -1).✦

The Claim

The ion trap circuit UionU_{\mathrm{ion}} of the exercise is the unitary of Q⊗QQ \otimes Q Uion=(1⊗Ry(−π2))CZ(1⊗Ry(π2)),U_{\mathrm{ion}} = \bigl(1 \otimes R_y(-\tfrac{\pi}{2})\bigr)\, CZ\, \bigl(1 \otimes R_y(\tfrac{\pi}{2})\bigr),(4)✦

Theorem 1. On a pair of qubits, the ion trap circuit equals the CNOT gate followed by the Pauli ZZ gate on the first wire, the control: Uion=(Z⊗1)CNOT.U_{\mathrm{ion}} = (Z \otimes 1)\, \mathrm{CNOT}.(5)✦

What Is Checked

The library proves that every controlled gate is unitary: for each unitary UU of a system SS, the operator (3) satisfies C(U)†C(U)=C(U)C(U)†=1C(U)^\dagger C(U) = C(U)\, C(U)^\dagger = 1.✦ It proves the same for the tensor product of two unitaries, for the composite UVUV of two unitaries, and for the operators that the matrices XX, ZZ and Ry(θ)R_y(\theta) define on ℂ2\mathbb{C}^2.