Lean, informalized

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

Exercise 7.41 - A zz rotation of each spin and a period of coupled evolution make the controlled Z gate, up to a phase

Controlled Z from a spin coupling 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

In nuclear magnetic resonance (NMR) the qubits are nuclear spins, and two of them are coupled by the Hamiltonian H=JZ1Z2H = J Z_1 Z_2, with JJ a real coupling constant and Z1Z_1, Z2Z_2 the Pauli ZZ of the first and of the second spin. Rotate each spin by Rz(−π/2)R_z(-\pi/2) about the zˆ\hat z axis, then let the pair evolve under HH for a time tt, in units with ℏ=1\hbar = 1. When Jt=π/4Jt = \pi/4 the result is the controlled ZZ gate up to the global phase eiπ/4e^{i\pi/4}, and so it acts on every state of the two spins as the controlled ZZ gate does.

The library states both conclusions as theorems, for all real JJ and tt with Jt=π/4Jt = \pi/4, over the definitions that follow.

Two Qubits

A quantum system SS is a physical system whose state space is a finite dimensional complex Hilbert space.✦ A pure state |ψ⟩|\psi\rangle of SS is a unit vector in the state space of SS.✦ A state ρ\rho of SS is a positive operator of unit trace on the state space of SS.✦

The qubit is the two level system whose state space is ℂ2\mathbb{C}^2.✦ The basis states |0⟩|0\rangle and |1⟩|1\rangle of the qubit, its computational basis, are the pure states whose vectors are the standard basis vectors (1,0)(1,0) and (0,1)(0,1) of ℂ2\mathbb{C}^2.✦ The composite system S⊗TS \otimes T of two systems SS and TT is the system whose state space is the tensor product of their state spaces.✦ The two spins form the composite system qubit⊗qubit\mathrm{qubit} \otimes \mathrm{qubit}.

Gates

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, and the identity evolution is the unitary 11. Under UU a state ρ\rho evolves to the state UρU†U \rho U^\dagger.✦ 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 unitary whose operator is the tensor product of those of UU and VV.✦ A gate UU on the first factor is U⊗1U \otimes 1, with the identity evolution on TT, and a gate VV on the last factor is 1⊗V1 \otimes V. For a real angle α\alpha, the global phase gate eiαe^{i\alpha} of SS is the unitary eiα1e^{i\alpha}\, 1.✦

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) and with the Pauli vector σ→=(X,Y,Z)\vec\sigma = (X, Y, Z), 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. The rotation Rn→(θ)R_{\vec n}(\theta) 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) for a unit vector nˆ\hat n, the rotation about nˆ\hat n. About zˆ=(0,0,1)\hat z = (0,0,1) it is Rz(θ)=e−iθZ/2R_z(\theta) = e^{-i\theta Z/2}.✦ The rotation gate Rz(θ)R_z(\theta) is the unitary of the qubit with this matrix in the computational basis, and the Pauli ZZ gate, the phase flip, is the unitary of the qubit with matrix ZZ.

For a unitary UU of 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, with operator C(U)=|0⟩⟨0|⊗1+|1⟩⟨1|⊗U.C(U) = |0\rangle\langle 0| \otimes 1 + |1\rangle\langle 1| \otimes U .(3)✦ The controlled ZZ gate is CZ=C(Z)CZ = C(Z) on two qubits, the first one the control; its matrix in the computational basis is diag(1,1,1,−1)\mathrm{diag}(1, 1, 1, -1).✦

The Coupling

An observable AA of SS is a self adjoint operator on the state space of SS, A†=AA^\dagger = A.✦ For observables AA of SS and BB of TT, the observable A⊗BA \otimes B of S⊗TS \otimes T has as operator the tensor product of theirs.✦ For a real vector n→\vec n, the Pauli observable n→⋅σ→\vec n \cdot \vec \sigma is the observable of the qubit with that matrix, and for nˆ=zˆ\hat n = \hat z it is the observable ZZ. The coupling Hamiltonian of the two spins with a real coupling constant JJ is the observable H=JZ1Z2=JZ⊗Z.H = J\, Z_1 Z_2 = J\, Z \otimes Z .(4)✦

The Hamiltonian propagator of an observable HH of SS, with Planck’s constant ℏ\hbar, from time t1t_1 to time t2t_2 is the unitary U(t1,t2)=exp⁡[−iH(t2−t1)/ℏ].U(t_1, t_2) = \exp\bigl[-iH(t_2 - t_1)/\hbar\bigr].(5)✦

For a real coupling constant JJ and a time tt, the NMR controlled ZZ sequence is the unitary of the two spins UNMR(J,t)=U(0,t)(Rz(−π/2)⊗1)(1⊗Rz(−π/2)),U_{\mathrm{NMR}}(J, t) = U(0, t)\, \bigl(R_z(-\pi/2) \otimes 1\bigr) \bigl(1 \otimes R_z(-\pi/2)\bigr),(6)✦ with U(0,t)=e−iJtZ⊗ZU(0, t) = e^{-iJt\, Z \otimes Z} the propagator of (4) from time 00 to time tt at ℏ=1\hbar = 1.

The Claim

Theorem 1. Let JJ and tt be real numbers with Jt=π/4Jt = \pi/4. Then the sequence (6) is the controlled ZZ gate up to a global phase: e−iπ/4UNMR(J,t)=CZ.e^{-i\pi/4}\, U_{\mathrm{NMR}}(J, t) = CZ .(7)✦

The phase eiπ/4e^{i\pi/4} cancels between UNMR(J,t)U_{\mathrm{NMR}}(J,t) and UNMR(J,t)†U_{\mathrm{NMR}}(J,t)^\dagger in the evolution of a state.

Theorem 2. Let JJ and tt be real numbers with Jt=π/4Jt = \pi/4. Then every state ρ\rho of the two spins evolves under the sequence as under the controlled ZZ gate: UNMR(J,t)ρUNMR(J,t)†=CZρCZ†.U_{\mathrm{NMR}}(J, t)\, \rho\, U_{\mathrm{NMR}}(J, t)^\dagger = CZ\, \rho\, CZ^\dagger .(8)✦

What Is Checked

About these constructions the library proves that every gate in them is unitary: C(U)C(U) for every unitary UU, the propagator (5) of every observable, the rotation gate Rz(θ)R_z(\theta), the Pauli ZZ gate and the global phase gate, and with UU and VV also UVUV and U⊗VU \otimes V. It proves that UρU†U \rho U^\dagger is again a state, and that n→⋅σ→\vec n \cdot \vec \sigma and A⊗BA \otimes B are self adjoint, which makes JZ⊗ZJ\, Z \otimes Z an observable.