Lean, informalized

Nielsen & Chuang · Chapter 10, Quantum error-correction · p. 491

Exercise 10.71 - How an ancilla reads out the eigenvalue of e−iπ/4SXe^{-i\pi/4}SX, and how phase flips behave in the transversal circuit

Measuring e−iπ/4SXe^{-i\pi/4}SX to prepare the π/8\pi/8 ancilla.

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

The circuit of Figure 10.25 applies the π/8\pi/8 gate TT to a qubit with the help of an extra qubit in the state |Θ⟩|\Theta\rangle. The exercise prepares that state by measuring the observable M=e−iπ/4SXM = e^{-i\pi/4}SX, where SS is the phase gate and XX the bit flip: |Θ⟩|\Theta\rangle is the eigenstate of MM of eigenvalue +1+1, and |Θ−⟩|\Theta^-\rangle its eigenstate of eigenvalue −1-1.

The measurement couples the data qubit, the one carrying the state to be measured, to an ancilla qubit prepared in |0⟩|0\rangle. The ancilla passes through a Hadamard gate HH, controls the gate MM on the data qubit, passes through a second Hadamard gate and is read in the computational basis. The exercise asks which outcome each eigenstate gives, and what a phase flip ZZ on the ancilla, between the controlled gate and the last Hadamard gate, does to it.

In the fault tolerant form of the measurement the ancilla is a cat state of several qubits, the equal superposition of the all zeros and the all ones states, each qubit paired with a data qubit and controlling a gate on it. Two more questions belong to this form: what the π/8\pi/8 gate on every qubit does to a cat state of seven qubits, and whether a phase flip on one ancilla qubit reaches the data through the controlled gates.

A Quantum System

A quantum system AA is a physical system whose state space is a finite dimensional complex Hilbert space.✦ A pure state ψ\psi of AA is a vector of unit norm in the state space of AA, ‖ψ‖=1\lVert\psi\rVert = 1.✦ A unitary UU of AA is an operator on the state space of AA with U†U=UU†=1U^\dagger U = UU^\dagger = 1.✦ The unitary UU applied to a pure state ψ\psi of AA is the pure state UψU\psi✦, and UU after a second unitary VV of AA is the unitary UVUV of AA, first VV then UU.✦

The composite system A⊗BA \otimes B of two systems AA and BB is the system whose state space is the tensor product of the state spaces of AA and BB.✦ Pure states ψ\psi of AA and φ\varphi of BB give the product state ψ⊗φ\psi \otimes \varphi, the pure state of A⊗BA \otimes B whose vector is the tensor product of their vectors.✦ Unitaries UU of AA and VV of BB give in the same way the product unitary U⊗VU \otimes V of A⊗BA \otimes B, whose operator is the tensor product of their operators.✦ With the identity evolution 11 of BB, the unitary whose operator is the identity, UU on the first wires of A⊗BA \otimes B is U⊗1U \otimes 1.✦

Gates on a Qubit

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 e0e_0 and e1e_1 of ℂ2\mathbb{C}^2.✦ A 2×22 \times 2 unitary matrix UU gives the single qubit gate of UU, the unitary of the qubit that acts on ℂ2\mathbb{C}^2 by the matrix UU in the computational basis.✦

The Hadamard gate HH and the phase flip ZZ are the single qubit gates of the matrices H=12(111−1),Z=(100−1),H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}, \qquad Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix},(1) and the bit flip XX, the phase gate SS and the π/8\pi/8 gate TT have the matrices X=(0110),S=(100i),T=(100eiπ/4).X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}, \qquad S = \begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix}, \qquad T = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix}.(2) The product SXSX, with XX acting first, is the matrix SX=(01i0).SX = \begin{pmatrix} 0 & 1 \\ i & 0 \end{pmatrix}.(3)✦

The gate MM is the single qubit gate of the matrix e−iπ/4SXe^{-i\pi/4}SX, M=(0e−iπ/4eiπ/40),M = \begin{pmatrix} 0 & e^{-i\pi/4} \\ e^{i\pi/4} & 0 \end{pmatrix},(4)✦ and the gate ZSXZSX is the single qubit gate of the product of ZZ with SXSX, ZSX=(01−i0).ZSX = \begin{pmatrix} 0 & 1 \\ -i & 0 \end{pmatrix}.(5)✦

The two eigenstates of MM are the pure states of the qubit |Θ⟩=12(|0⟩+eiπ/4|1⟩),|\Theta\rangle = \frac{1}{\sqrt{2}} \bigl( |0\rangle + e^{i\pi/4} |1\rangle \bigr),(6)✦ |Θ−⟩=12(|0⟩−eiπ/4|1⟩).|\Theta^-\rangle = \frac{1}{\sqrt{2}} \bigl( |0\rangle - e^{i\pi/4} |1\rangle \bigr).(7)✦

The Measurement Circuit

For a unitary UU of a system AA, the controlled gate C(U)C(U) is the unitary of the composite system of a control qubit and a target AA with operator C(U)=|0⟩⟨0|⊗1+|1⟩⟨1|⊗U.C(U) = |0\rangle\langle 0| \otimes 1 + |1\rangle\langle 1| \otimes U.(8)✦

The measurement circuit of a unitary UU of a system AA is the unitary of the composite system of an ancilla qubit and AA with operator (H⊗1)C(U)(H⊗1).(H \otimes 1)\, C(U)\, (H \otimes 1).(9)✦

Theorem 1. With the ancilla in |0⟩|0\rangle and the data qubit in |Θ⟩|\Theta\rangle, the measurement circuit of MM returns the ancilla to |0⟩|0\rangle, (H⊗1)C(M)(H⊗1)(|0⟩⊗|Θ⟩)=|0⟩⊗|Θ⟩,(H \otimes 1)\, C(M)\, (H \otimes 1) \bigl( |0\rangle \otimes |\Theta\rangle \bigr) = |0\rangle \otimes |\Theta\rangle,(10)✦ and with the data qubit in |Θ−⟩|\Theta^-\rangle it turns the ancilla to |1⟩|1\rangle, (H⊗1)C(M)(H⊗1)(|0⟩⊗|Θ−⟩)=|1⟩⊗|Θ−⟩.(H \otimes 1)\, C(M)\, (H \otimes 1) \bigl( |0\rangle \otimes |\Theta^-\rangle \bigr) = |1\rangle \otimes |\Theta^-\rangle.(11)✦

For a unitary UU of a system AA, the measurement circuit of UU with a ZZ error on the ancilla is the unitary of the composite system of an ancilla qubit and AA with operator (H⊗1)(Z⊗1)C(U)(H⊗1).(H \otimes 1)(Z \otimes 1)\, C(U)\, (H \otimes 1).(12)✦

Theorem 2. With the ancilla in |0⟩|0\rangle and the data qubit in |Θ⟩|\Theta\rangle, the measurement circuit of MM with a ZZ error turns the ancilla to |1⟩|1\rangle, (H⊗1)(Z⊗1)C(M)(H⊗1)(|0⟩⊗|Θ⟩)=|1⟩⊗|Θ⟩.(H \otimes 1)(Z \otimes 1)\, C(M)\, (H \otimes 1) \bigl( |0\rangle \otimes |\Theta\rangle \bigr) = |1\rangle \otimes |\Theta\rangle.(13)✦

The Transversal Circuit

A register of nn qubits, one for each of the nn elements of a finite set ι\iota, is the system whose state space has an orthonormal basis |w⟩|w\rangle, its computational basis, with one vector for each bit string ww over ι\iota.✦ The cat vector of the register is the unnormalized sum |0⋯0⟩+|1⋯1⟩|0\cdots0\rangle + |1\cdots1\rangle of its all zeros and all ones basis vectors.✦ The transversal TT gate of the register is the unitary that is diagonal in the computational basis with T⊗n|w⟩=eiπwt⁡(w)/4|w⟩,T^{\otimes n}\, |w\rangle = e^{i\pi \operatorname{wt}(w)/4}\, |w\rangle,(14)✦ where wt⁡(w)\operatorname{wt}(w) is the number of ones in ww.

Theorem 3. On a register of seven qubits, the transversal TT gate takes the cat vector to T⊗7(|0000000⟩+|1111111⟩)=|0000000⟩+e−iπ/4|1111111⟩.T^{\otimes 7} \bigl( |0000000\rangle + |1111111\rangle \bigr) = |0000000\rangle + e^{-i\pi/4}\, |1111111\rangle.(15)✦

For a unitary UU of a data system DD, the transversal coupling of UU is the unitary of three pairs, each an ancilla qubit with a copy of DD, that applies C(U)C(U) to every pair with the ancilla as control, C(U)⊗3=C(U)⊗C(U)⊗C(U)C(U)^{\otimes 3} = C(U) \otimes C(U) \otimes C(U).✦ For i=0,1,2i = 0, 1, 2, the ZZ error on ancilla ii is the unitary ZiZ_i of the three pairs that applies ZZ to the ancilla of pair ii and the identity to its data and to the other two pairs.✦

Theorem 4. Let each of three pairs consist of an ancilla qubit and a data qubit, coupled by C(ZSX)C(ZSX). For i=0,1,2i = 0, 1, 2, the ZZ error on ancilla ii commutes with the coupling, C(ZSX)⊗3Zi=ZiC(ZSX)⊗3.C(ZSX)^{\otimes 3}\, Z_i = Z_i\, C(ZSX)^{\otimes 3}.(16)✦

What Is Checked

The claims on a single ancilla are stated over the measurement circuit (9) of the gate MM and its form (12) with a ZZ error, acting on the product state of the ancilla in |0⟩|0\rangle with the data qubit in |Θ⟩|\Theta\rangle or |Θ−⟩|\Theta^-\rangle. The transversal claims are stated over the transversal TT gate on seven qubits acting on the cat vector, and over the coupling of three pairs of qubits by C(ZSX)C(ZSX) with the ZZ errors on its ancillas.

About these constructions the library proves that the matrices MM and ZSXZSX are unitary and that the controlled gate C(U)C(U) of every unitary UU is unitary✦; the product unitary U⊗VU \otimes V and UU after VV are unitary, and so is the transversal TT gate. It proves as well that |Θ⟩|\Theta\rangle and |Θ−⟩|\Theta^-\rangle have unit norm, and that a unitary applied to a pure state, like the product of two pure states, is again a pure state.