|View source on GitHub|
Repacks avoiding simultaneous operations with different classes.
cirq.optimizers.stratified_circuit( circuit: "cirq.Circuit", *, categories: Iterable[
cirq.optimizers.stratify.Category] ) -> "cirq.Circuit"
Sometimes, certain operations should not be done at the same time. For example, the physical hardware may not be capable of doing certain operations at the same time. Or it may have worse noise characteristics when certain operations are done at the same time. In these cases, it would be good to rearrange the circuit so that these operations always occur in different moments.
(As a secondary effect, this may make the circuit easier to read.)
This methods takes a series of classifiers identifying categories of operations and then ensures operations from each category only overlap with operations from the same category. There is no guarantee that the resulting circuit will be optimally packed under this constraint.
||The circuit whose operations should be re-arranged.|
A list of classifiers picking out certain operations.
There are several ways to specify a classifier. You can pass
in a gate instance (e.g.
|A copy of the original circuit, but with re-arranged operations.|