cirq.linalg.num_cnots_required

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”. https://arxiv.org/abs/quant-ph/0308045

u a two-qubit unitary

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