Lean, informalized

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

Exercise 7.47 - Pulses on the target spin around a period of free coupling, corrected by zz rotations

Two coupled spins make a controlled NOT up to phases.

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 are carried by two coupled spins, as in nuclear magnetic resonance (NMR): each spin can be rotated on its own, and between rotations the pair evolves under its coupling. The controlled NOT (CNOT) flips the second qubit, the target, exactly when the first, the control, is |1⟩|1\rangle. The exercise is to show that a rotation of the target by π/2\pi/2 about yˆ\hat y, a period of free evolution under the coupling and a rotation of the target by π/2\pi/2 about xˆ\hat x perform the CNOT on the computational basis up to phases, and that rotations about zˆ\hat z and one global phase remove those phases.

The library states this for a coupling constant JJ and a coupling time tt, first on the basis states and then for the circuit with the added rotations about zˆ\hat z and the global phase, as an equality of unitaries and as an evolution of states.

Two Qubits

A quantum system SS is a physical system whose state space is a finite dimensional complex Hilbert space.✦ The qubit is the quantum system whose state space is ℂ2\mathbb{C}^2; its computational basis states |0⟩|0\rangle and |1⟩|1\rangle are the standard basis vectors e0e_0 and e1e_1. The composite system S⊗TS \otimes T of two systems SS and TT is the quantum system whose state space is the tensor product of their state spaces.✦ Two qubits thus form qubit⊗qubit\mathrm{qubit} \otimes \mathrm{qubit}, with basis states |a⟩|b⟩=|a⟩⊗|b⟩|a\rangle|b\rangle = |a\rangle \otimes |b\rangle for bits aa and bb.

A pure state ψ\psi of SS is a unit vector in the state space of SS, and the basis states of the qubit are pure states.✦ A state ρ\rho of SS is a positive operator of unit trace on the state space of SS.✦

A unitary UU of SS is an operator on the state space of SS with U†U=UU†=1U^\dagger U = U U^\dagger = 1.✦ It evolves a state ρ\rho of SS into the state UρU†U \rho U^\dagger.✦ The composite UVUV of unitaries UU and VV of SS is the unitary of SS that applies VV first and then UU.✦ Unitaries UU of SS and VV of TT have a product U⊗VU \otimes V, the unitary of S⊗TS \otimes T whose operator is the tensor product of the two.✦ A unitary UU of SS acts on the first system of S⊗TS \otimes T as U⊗1U \otimes 1, with 11 the identity unitary of TT; for a unitary VV of TT, the gate VV on the second system is the unitary 1⊗V1 \otimes V of S⊗TS \otimes T, with 11 the identity unitary of SS. For a real angle α\alpha, the global phase gate eiαe^{i\alpha} on a system SS is the unitary eiα1e^{i\alpha}\, 1 of SS, which multiplies every vector of the state space by eiαe^{i\alpha}.

Rotations and the Controlled NOT

The Pauli matrices are 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) For a real vector n→\vec n in three dimensions, n→⋅σ→=nxX+nyY+nzZ\vec n \cdot \vec\sigma = n_x X + n_y Y + n_z Z, and the rotation by a real angle θ\theta about n→\vec n is the 2×22 \times 2 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 rotations Rx(θ)R_x(\theta), Ry(θ)R_y(\theta) and Rz(θ)R_z(\theta) are those about xˆ=(1,0,0)\hat x = (1,0,0), yˆ=(0,1,0)\hat y = (0,1,0) and zˆ=(0,0,1)\hat z = (0,0,1); thus Rz(θ)=e−iθZ/2R_z(\theta) = e^{-i\theta Z/2}. The gate Rnˆ(θ)R_{\hat n}(\theta) is the unitary of the qubit whose matrix in the computational basis is Rnˆ(θ)R_{\hat n}(\theta).

The Pauli XX gate, the quantum NOT, is the unitary of the qubit whose matrix is XX.✦ For a unitary UU of a system SS, the controlled gate C(U)C(U) is the unitary of qubit⊗S\mathrm{qubit} \otimes S, a control qubit and the target SS, given by C(U)=|0⟩⟨0|⊗1+|1⟩⟨1|⊗U.C(U) = |0\rangle\langle 0| \otimes 1 + |1\rangle\langle 1| \otimes U .(3)✦ The CNOT gate is the controlled gate C(X)C(X) of the Pauli XX, a unitary of two qubits.✦

The Coupling

An observable AA on a system SS is a self adjoint operator on the state space of SS.✦ For a real vector n→\vec n in three dimensions, the Pauli observable n→⋅σ→\vec n \cdot \vec\sigma is the observable on the qubit whose operator has the matrix n→⋅σ→\vec n \cdot \vec\sigma; the observable ZZ is the Pauli observable for zˆ\hat z. The tensor product A⊗BA \otimes B of observables AA on SS and BB on TT is the observable on S⊗TS \otimes T whose operator is the tensor product of theirs.✦ The coupling Hamiltonian HH of two spins with real coupling constant JJ is the observable on two qubits, written with Z1=Z⊗1Z_1 = Z \otimes 1 and Z2=1⊗ZZ_2 = 1 \otimes Z, the observable ZZ on the first and on the second qubit, H=JZ1Z2=JZ⊗Z.H = J\, Z_1 Z_2 = J\, Z \otimes Z .(4)✦

The propagator U(t1,t2)U(t_1, t_2) of a Hamiltonian HH on SS from time t1t_1 to time t2t_2, with Planck’s constant ℏ\hbar, is the unitary exp⁡[−iH(t2−t1)/ℏ]\exp[-iH(t_2 - t_1)/\hbar] of SS, which carries the state vector |ψ(t1)⟩|\psi(t_1)\rangle of SS at time t1t_1 to the state vector |ψ(t2)⟩|\psi(t_2)\rangle at time t2t_2.✦ In units with ℏ=1\hbar = 1, the coupling acting from time 00 to time tt gives U(0,t)=e−iJtZ⊗ZU(0, t) = e^{-iJt\, Z \otimes Z}.

The Circuit

The NMR circuit UJ,tU_{J,t} is the unitary of two qubits that applies Ry(π/2)R_y(\pi/2) to the target, lets the coupling act for a time tt, and applies Rx(π/2)R_x(\pi/2) to the target: UJ,t=(1⊗Rx(π/2))e−iJtZ⊗Z(1⊗Ry(π/2)).U_{J,t} = \bigl(1 \otimes R_x(\pi/2)\bigr)\, e^{-iJt\, Z \otimes Z}\, \bigl(1 \otimes R_y(\pi/2)\bigr).(5)✦

The phases φ(a,b)\varphi(a,b) of the circuit, one for each pair of bits aa and bb, are the four complex numbers (φ(0,0)φ(0,1)φ(1,0)φ(1,1))=22(1−i1+i1−i−1−i)=(e−iπ/4eiπ/4e−iπ/4e−3iπ/4).\begin{pmatrix} \varphi(0,0) & \varphi(0,1) \\ \varphi(1,0) & \varphi(1,1) \end{pmatrix} = \frac{\sqrt 2}{2} \begin{pmatrix} 1 - i & 1 + i \\ 1 - i & -1 - i \end{pmatrix} = \begin{pmatrix} e^{-i\pi/4} & e^{i\pi/4} \\ e^{-i\pi/4} & e^{-3i\pi/4} \end{pmatrix}.(6)✦

The corrected circuit ŨJ,t\tilde U_{J,t} is the unitary of two qubits that applies UJ,tU_{J,t}, then the gate Rz(−π/2)R_z(-\pi/2) to the target and the gate Rz(π/2)R_z(\pi/2) to the control: ŨJ,t=(Rz(π/2)⊗1)(1⊗Rz(−π/2))UJ,t.\tilde U_{J,t} = \bigl(R_z(\pi/2) \otimes 1\bigr)\bigl(1 \otimes R_z(-\pi/2)\bigr)\, U_{J,t}.(7)

The Claim

Theorem 1. Let JJ and tt be real numbers with Jt=π/4Jt = \pi/4. For all bits aa and bb, with a⊕ba \oplus b their sum modulo 22, UJ,t|a⟩|b⟩=φ(a,b)|a⟩|a⊕b⟩.U_{J,t}\, |a\rangle|b\rangle = \varphi(a,b)\, |a\rangle|a \oplus b\rangle .(8)✦ With the global phase gate eiπ/4e^{i\pi/4}, eiπ/4ŨJ,t=CNOT,e^{i\pi/4}\, \tilde U_{J,t} = \mathrm{CNOT},(9)✦ and for every state ρ\rho of two qubits the corrected circuit alone evolves ρ\rho as the CNOT gate does: ŨJ,tρŨJ,t†=CNOTρCNOT†.\tilde U_{J,t}\, \rho\, \tilde U_{J,t}^\dagger = \mathrm{CNOT}\, \rho\, \mathrm{CNOT}^\dagger .(10)✦

What Is Checked

The claim is stated over the circuit UJ,tU_{J,t} of (5), built from the rotation gates Ry(π/2)R_y(\pi/2) and Rx(π/2)R_x(\pi/2) on the target and the propagator of the coupling Hamiltonian (4); over its phases (6), the corrected circuit (7) and the global phase gate; and over the CNOT gate C(X)C(X) and the evolution ρ↦UρU†\rho \mapsto U \rho U^\dagger of the states of two qubits.

The controlled gate C(U)C(U) of (3) is unitary for every unitary UU.✦ The same holds of the rotation gates, from the unitarity of their matrices, and of the propagator of an observable and the global phase gate. Products and tensor products of unitaries are again unitary, and a unitary carries a state to a state, so that ŨJ,tρŨJ,t†\tilde U_{J,t}\, \rho\, \tilde U_{J,t}^\dagger in (10) is a state of two qubits.