Lean, informalized

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

Exercise 7.49 - Pulses about xˆ\hat x and yˆ\hat y and the coupling of two spins compose to the swap of two qubits

A SWAP gate from rotations and a spin coupling.

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

In nuclear magnetic resonance, two qubits are two coupled spins, and two kinds of operation act on them. A pulse rotates one qubit about the xx axis or the yy axis by any angle. Between pulses the pair evolves under the coupling Hamiltonian JZ1Z2J Z_1 Z_2, with JJ the coupling constant and Z1Z_1, Z2Z_2 the Pauli ZZ operators of the two qubits.

The exercise is to build the SWAP gate, which exchanges the states of the two qubits, from these operations alone: a sequence of pulses and periods of coupled evolution, each period lasting a time tt with Jt=π/4Jt = \pi/4, that acts on every state of the pair as SWAP does.

Two Qubits

A quantum system SS has as its state space a finite dimensional complex Hilbert space.✦ The qubit is the system whose state space is ℂ2\mathbb{C}^2, with computational basis |0⟩|0\rangle, |1⟩|1\rangle.✦ The composite system S⊗TS \otimes T of two systems SS and TT has as its state space the tensor product of theirs; in the pair of qubits, qubit 1 is the first factor and qubit 2 the second.✦

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.✦ Under a unitary UU of SS, a state ρ\rho of SS evolves into the state ρ↦UρU†.\rho \longmapsto U \rho\, U^\dagger .(1)✦

For two unitaries UU and VV of SS, UU after VV is the unitary UVUV: first VV, then UU.✦ For a unitary UU of SS and a unitary VV of TT, the product unitary U⊗VU \otimes V of S⊗TS \otimes T is the tensor product of the two operators.✦ With the identity evolution 11 on the other factor, a gate UU on the first factor is U⊗1U \otimes 1 and a gate VV on the second is 1⊗V1 \otimes V.

The SWAP of two copies of a system SS is the unitary of S⊗SS \otimes S given by the isometry of its state space onto itself that exchanges the two factors: for vectors xx and yy of the state space of SS, SWAP(x⊗y)=y⊗x.\mathrm{SWAP}\,(x \otimes y) = y \otimes x .(2)✦

Pulses and the Coupling

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}.(3) For a real vector n→=(nx,ny,nz)\vec n = (n_x, n_y, n_z) in three dimensions, n→⋅σ→=nxX+nyY+nzZ\vec n \cdot \vec\sigma = n_x X + n_y Y + n_z Z, and the rotation about n→\vec n by an angle θ\theta is the 2×22 \times 2 matrix Rn→(θ)=exp⁡(−iθ2n→⋅σ→),R_{\vec n}(\theta) = \exp\!\left( -\frac{i\theta}{2}\, \vec n \cdot \vec\sigma \right),(4) written Rnˆ(θ)R_{\hat n}(\theta) when the axis is a unit vector nˆ\hat n.

The pulses are the rotation gates Rx(θ)R_x(\theta) and Ry(θ)R_y(\theta), the unitaries of the qubit whose matrices in the computational basis are Rxˆ(θ)=e−iθX/2R_{\hat x}(\theta) = e^{-i\theta X/2} and Ryˆ(θ)=e−iθY/2R_{\hat y}(\theta) = e^{-i\theta Y/2}, with xˆ=(1,0,0)\hat x = (1, 0, 0) and yˆ=(0,1,0)\hat y = (0, 1, 0).

An observable AA of a system SS is a self adjoint operator on the state space of SS.✦ For observables AA of SS and BB of TT, the tensor product A⊗BA \otimes B is an observable of S⊗TS \otimes T.✦ On the qubit every n→⋅σ→\vec n \cdot \vec\sigma is an observable, the Pauli observable along n→\vec n, and along zˆ=(0,0,1)\hat z = (0, 0, 1) it is the observable zˆ⋅σ→=Z\hat z \cdot \vec\sigma = Z. The coupling Hamiltonian of the two spins, with a real coupling constant JJ, is the observable of the pair ℋJ=JZ⊗Z=JZ1Z2.\mathcal{H}_J = J\, Z \otimes Z = J Z_1 Z_2 .(5)✦

A Hamiltonian ℋ\mathcal{H} of a system generates its propagator from time t1t_1 to time t2t_2, the unitary U(t1,t2)=exp⁡[−iℋ(t2−t1)ℏ]U(t_1, t_2) = \exp\!\left[ -\frac{i \mathcal{H} (t_2 - t_1)}{\hbar} \right](6)✦ that takes the state at t1t_1 to the state at t2t_2. Here ℏ\hbar is the reduced Planck constant; in units with ℏ=1\hbar = 1, the coupling acting from time 00 to time tt is e−iJtZ1Z2e^{-iJt Z_1 Z_2}.

The Circuit

Pulses alone give a Hadamard gate and a rotation about zz, H=Rx(π)Ry(π/2),Rz(θ)=HRx(θ)H,H = R_x(\pi)\, R_y(\pi/2), \qquad R_z(\theta) = H\, R_x(\theta)\, H ,(7) with products read from right to left, so that Ry(π/2)R_y(\pi/2) acts first. Up to a global phase, which the evolution (1) of a state does not see, these are the Hadamard gate of the book and the rotation e−iθZ/2e^{-i\theta Z/2}.

The coupling, run for a time tt after a rotation Rz(−π/2)R_z(-\pi/2) of each qubit, gives CZ=e−iJtZ1Z2(Rz(−π/2)⊗1)(1⊗Rz(−π/2)).\mathrm{CZ} = e^{-iJt Z_1 Z_2} \big( R_z(-\pi/2) \otimes 1 \big) \big( 1 \otimes R_z(-\pi/2) \big).(8)✦ For Jt=π/4Jt = \pi/4 this is the controlled ZZ gate, up to the phase eiπ/4e^{i\pi/4}. Hadamards on the target turn it into a controlled NOT gate, with the control on qubit 1 or on qubit 2, CNOT12=(1⊗H)CZ(1⊗H),CNOT21=(H⊗1)CZ(H⊗1),\mathrm{CNOT}_{12} = (1 \otimes H)\, \mathrm{CZ}\, (1 \otimes H), \qquad \mathrm{CNOT}_{21} = (H \otimes 1)\, \mathrm{CZ}\, (H \otimes 1),(9) the first index naming the control. The circuit WW is built from three controlled NOT gates, the middle one with control and target reversed, W=CNOT12CNOT21CNOT12,W = \mathrm{CNOT}_{12}\, \mathrm{CNOT}_{21}\, \mathrm{CNOT}_{12},(10)✦ a unitary of the pair for every JJ and tt, which enter it through the three controlled ZZ gates.

The Claim

Theorem 1. Let JJ and tt be real numbers with Jt=π/4Jt = \pi/4, and let WW be the circuit (10) with coupling constant JJ and coupling time tt. Then every state ρ\rho of two qubits evolves under WW as under the SWAP: WρW†=SWAPρSWAP†.W \rho\, W^\dagger = \mathrm{SWAP}\, \rho\, \mathrm{SWAP}^\dagger .(11)✦

What Is Checked

The claim is stated over the circuit WW of (10) and the SWAP (2) of two qubits, each acting on a state of the pair by (1).

For a unitary UU and a state ρ\rho, the operator UρU†U \rho\, U^\dagger is again a state.