OctoInform Beta

the paper · §I. Single-qubit gates, XY interaction, and iSWAP · §I.C, (S19)

Equation (S19): SWAP from iSWAP and CZ: The two-qubit SWAP\text{SWAP} gate factors as (S†⊗S†)iSWAPCZ(S^\dagger \otimes S^\dagger)\,\text{iSWAP}\,\text{CZ}, and the iSWAP\text{iSWAP} and CZ\text{CZ} gates commute

Decomposing SWAP into iSWAP, CZ, and phase gates.

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 setting

In quantum circuits, the two-qubit SWAP\text{SWAP} gate exchanges the quantum states of two qubits. Architectures whose native two-qubit operations include the iSWAP\text{iSWAP} gate and the controlled-ZZ gate (CZ\text{CZ}) need to express SWAP\text{SWAP} in terms of those entangling gates and single-qubit phase gates, and to know whether iSWAP\text{iSWAP} and CZ\text{CZ} can be applied in either order.

The gates

Single-qubit operators are represented as 2×22 \times 2 complex matrices in the computational basis |0⟩,|1⟩|0\rangle, |1\rangle, and two-qubit operators as 4×44 \times 4 complex matrices in the ordered computational basis |00⟩,|01⟩,|10⟩,|11⟩|00\rangle, |01\rangle, |10\rangle, |11\rangle.

The phase gate SS is the 2×22 \times 2 complex diagonal matrix S=diag⁡(1,i)S = \operatorname{diag}(1, i), where ii is the imaginary unit, and S†S^\dagger denotes its conjugate transpose.✦ For two 2×22 \times 2 complex matrices AA and BB, the Kronecker product A⊗BA \otimes B is the 4×44 \times 4 complex matrix defined in 2×22 \times 2 block form by (1): A⊗B=(A00BA01BA10BA11B),A \otimes B = \begin{pmatrix} A_{00} B & A_{01} B \\ A_{10} B & A_{11} B \end{pmatrix},(1)✦ where AjkA_{jk} denotes the (j,k)(j, k) entry of AA for j,k∈{0,1}j, k \in \{0, 1\}.

The controlled-ZZ gate CZ\text{CZ} is the 4×44 \times 4 complex diagonal matrix CZ=diag⁡(1,1,1,−1)\text{CZ} = \operatorname{diag}(1, 1, 1, -1).✦ The iSWAP\text{iSWAP} gate is the 4×44 \times 4 complex matrix given by (2), which fixes |00⟩|00\rangle and |11⟩|11\rangle and swaps |01⟩|01\rangle and |10⟩|10\rangle with a phase factor of ii: iSWAP=(100000i00i000001).\text{iSWAP} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & i & 0 \\ 0 & i & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}.(2)✦ The SWAP\text{SWAP} gate is the 4×44 \times 4 complex matrix given by (3), which fixes |00⟩|00\rangle and |11⟩|11\rangle and exchanges |01⟩|01\rangle and |10⟩|10\rangle: SWAP=(1000001001000001).\text{SWAP} = \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}.(3)✦

The claim

Theorem. The two-qubit gates SWAP\text{SWAP}, iSWAP\text{iSWAP}, and CZ\text{CZ} and the phase gate SS satisfy the decomposition SWAP=(S†⊗S†)iSWAPCZ.\text{SWAP} = (S^\dagger \otimes S^\dagger)\,\text{iSWAP}\,\text{CZ}.(4)✦ Moreover, iSWAP\text{iSWAP} and CZ\text{CZ} commute: iSWAPCZ=CZiSWAP.\text{iSWAP}\,\text{CZ} = \text{CZ}\,\text{iSWAP}.(5)✦

What is checked

In the Lean library, the decomposition (4) and the commutation relation (5) are stated as identities of 4×44 \times 4 complex matrices built from the phase gate SS, the Kronecker product (1), and the two-qubit gates CZ\text{CZ}, iSWAP\text{iSWAP} in (2), and SWAP\text{SWAP} in (3).