The setting
In quantum circuits, the two-qubit gate exchanges the quantum states of two qubits. Architectures whose native two-qubit operations include the gate and the controlled- gate () need to express in terms of those entangling gates and single-qubit phase gates, and to know whether and can be applied in either order.
The gates
Single-qubit operators are represented as complex matrices in the computational basis , and two-qubit operators as complex matrices in the ordered computational basis .
The phase gate is the complex diagonal matrix , where is the imaginary unit, and denotes its conjugate transpose.✦ For two complex matrices and , the Kronecker product is the complex matrix defined in block form by (1): (1)✦ where denotes the entry of for .
The controlled- gate is the complex diagonal matrix .✦ The gate is the complex matrix given by (2), which fixes and and swaps and with a phase factor of : (2)✦ The gate is the complex matrix given by (3), which fixes and and exchanges and : (3)✦
The claim
Theorem. The two-qubit gates , , and and the phase gate satisfy the decomposition (4)✦ Moreover, and commute: (5)✦
What is checked
In the Lean library, the decomposition (4) and the commutation relation (5) are stated as identities of complex matrices built from the phase gate , the Kronecker product (1), and the two-qubit gates , in (2), and in (3).