Optimal exact 2-qubit Clifford+CS circuit synthesis

This program implements the algorithm in Theorem 4.15 from the paper Optimal Two-Qubit Circuits for Universal Fault-Tolerant Quantum Computation. Source code is here

Note: the algorithm implementation is completely generated by Claude Opus 4.6. I only coded hundreds of loc for translations and checking correctness. I am super impressed by Claude!!!

Since it is not easy to input a matrix, here you can input a 2-qubit Cliffortd+CS circuit, and the program first computes the matrix and then re-synthesizes a circuit, which equals the input upto a global phase. We use the following Clifford+CS gates:

Step 1. Input a 2-qubit Clifford+CS circuit

E.g., "[S1,X0,CZ,CS,H0,Ex,CS,H1,CS]"

For security reasons, there is a limit of 2000 on the size of the input circuit.

Step 2. Click Resynthesize button

See Also

Near-optimal exact 2-qubit Clifford+T circuit synthesis.

Opened on: 04/12/2026. Last edited on: 04/12/2026

IP Address