def _decompose_single_ctrl(
    matrix: np.ndarray, control: cirq.Qid, target: cirq.Qid
) -> list[cirq.Operation]:
    """Decomposes controlled gate with one control.

    See [1], chapter 5.1.
    """
    a, b, c, delta = _decompose_abc(matrix)

    result = [
        ops.ZPowGate(exponent=delta / np.pi).on(control),
        ops.MatrixGate(c).on(target),
        ops.CNOT.on(control, target),
        ops.MatrixGate(b).on(target),
        ops.CNOT.on(control, target),
        ops.MatrixGate(a).on(target),
    ]

    # Remove no-ops.
    result = [g for g in result if not _is_identity(unitary(g))]

    return result
Decomposes controlled gate with one control.

    See [1], chapter 5.1.
    
cirq-core/cirq/transformers/analytical_decompositions/controlled_gate_decomposition.py