cirq.optimizers.map_moments

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

circuit Input circuit to apply the transformations on. The input circuit is not mutated.
map_func Mapping function from (cirq.Moment, moment_index) to a sequence of moments.

Copy of input circuit with mapped moments.