cirq.contrib.acquaintance.replace_acquaintance_with_swap_network

Replace every rectified moment with acquaintance gates with a generalized swap network.

The generalized swap network has a partition given by the acquaintance gates in that moment (and singletons for the free qubits). Accounts for reversing effect of swap networks.

circuit The acquaintance strategy.
qubit_order The qubits, in order, on which the replacing swap network gate acts on.
acquaintance_size The acquaintance size of the new swap network gate.
swap_gate The gate used to swap logical indices.

Returns: Whether or not the overall effect of the inserted swap network gates is to reverse the order of the qubits, i.e. the parity of the number of swap network gates inserted.

TypeError circuit is not an acquaintance strategy.