The setting
Two qubits coupled by an XY exchange interaction naturally swap single excitations between them, providing a physical route to the entangling gate. When the two qubits share the same transition frequency, the interaction unitary alone generates an excitation exchange whose off-diagonal phase differs in sign from that of at the shortest swap time, whereas the full laboratory-frame evolution also carries free local phase rotations. Two identities resolve this discrepancy for resonant XY evolution: either conjugating the interaction unitary by a local Pauli phase flip on the first qubit at the shortest swap time, or letting the full resonant Hamiltonian evolve for three times that duration so that the laboratory-frame unitary factors into the free rotation followed by .
Two-qubit operators and dynamics
The single-qubit Pauli matrices , , and are the complex matrices given by (1), (1) where is the imaginary unit, and denotes the identity matrix. The space of two-qubit operators consists of all complex matrices acting on the product of two single-qubit computational bases, ordered as ; tensor products of single-qubit operators are formed by the Kronecker product in this ordered basis.
Given real qubit frequencies and , the free Hamiltonian is the two-qubit operator defined by (2): (2)✦ For a real coupling , the XY interaction Hamiltonian is the two-qubit operator defined by (3): (3)✦ Adding the free and interaction terms yields the XY two-qubit Hamiltonian of (4): (4)✦
Unitary time evolution under these Hamiltonians is given by the matrix exponential. At real qubit frequencies and and real time , the rotating-frame unitary is the two-qubit operator in (5): (5)✦ Under the interaction alone, with real coupling and real time , the resonant evolution is the two-qubit operator in (6): (6)✦
In the ordered computational basis , the gate is the two-qubit operator given by (7): (7)✦
The claim
Theorem. For any nonzero real coupling , conjugating the resonant evolution at time by gives the gate: (8)✦ Furthermore, for any real frequency and any nonzero real coupling , when the two qubits are on resonance with , the laboratory-frame evolution under the XY two-qubit Hamiltonian at time satisfies (9)✦
What is checked
The Lean library states the local correction identity (8) and the resonant laboratory-frame factorization (9) over complex two-qubit operators for any nonzero real coupling and any real resonant qubit frequency , built directly from the Pauli matrices (1), the free Hamiltonian (2), the XY interaction Hamiltonian (3), the XY two-qubit Hamiltonian (4), the matrix-exponential evolutions (5) and (6), and the gate (7).