cirq.linalg.extract_right_diag

Extract a diagonal unitary from a 3-CNOT two-qubit unitary.

Returns a 2-CNOT unitary D that is diagonal, so that U @ D needs only two CNOT gates in case the original unitary is a 3-CNOT unitary.

See Proposition V.2 in Minimal Universal Two-Qubit CNOT-based Circuits. https://arxiv.org/abs/quant-ph/0308033

u three-CNOT two-qubit unitary

diagonal extracted from U