Returns the min number of CNOT/CZ gates required by a two-qubit unitary.

See Proposition III.1, III.2, III.3 in Shende et al. “Recognizing Small- Circuit Structure in Two-Qubit Operators and Timing Hamiltonians to Compute Controlled-Not Gates”.

u A two-qubit unitary.
atol The absolute tolerance used to make this judgement.

The number of CNOT or CZ gates required to implement the unitary.

ValueError If the shape of u is not 4 by 4.