Module: cirq.optimizers.transformer_primitives

Defines primitives for common transformer patterns.

Functions

map_moments(...): Applies local transformation on moments, by calling map_func(moment) for each moment.

map_operations(...): Applies local transformations on operations, by calling map_func(op) for each op.

map_operations_and_unroll(...): Applies local transformations via cirq.map_operations & unrolls intermediate circuit ops.

unroll_circuit_op(...): Unrolls (tagged) cirq.CircuitOperations while preserving the moment structure.

unroll_circuit_op_greedy_earliest(...): Unrolls (tagged) cirq.CircuitOperations by inserting operations using EARLIEST strategy.

unroll_circuit_op_greedy_frontier(...): Unrolls (tagged) cirq.CircuitOperations by inserting operations inline at qubit frontier.

CIRCUIT_TYPE Instance of typing.TypeVar
MAPPED_CIRCUIT_OP_TAG '<mapped_circuit_op>'
TYPE_CHECKING False