def _ccnot_congruent(c0: cirq.Qid, c1: cirq.Qid, target: cirq.Qid) -> list[cirq.Operation]:
    """Implements 3-qubit gate 'congruent' to CCNOT.

    Returns sequence of operations which is equivalent to applying
    CCNOT(c0, c1, target) and multiplying phase of |101> sate by -1.
    See lemma 6.2 in [1]."""
    return [
        ops.ry(-np.pi / 4).on(target),
        ops.CNOT(c1, target),
        ops.ry(-np.pi / 4).on(target),
        ops.CNOT(c0, target),
        ops.ry(np.pi / 4).on(target),
        ops.CNOT(c1, target),
        ops.ry(np.pi / 4).on(target),
    ]
Implements 3-qubit gate 'congruent' to CCNOT.

    Returns sequence of operations which is equivalent to applying
    CCNOT(c0, c1, target) and multiplying phase of |101> sate by -1.
    See lemma 6.2 in [1].
cirq-core/cirq/transformers/analytical_decompositions/controlled_gate_decomposition.py