cirq.moment_by_moment_schedule(device: cirq.devices.device.Device, circuit: cirq.circuits.circuit.Circuit)[source]

Returns a schedule aligned with the moment structure of the Circuit.

This method attempts to create a schedule in which each moment of a circuit
is scheduled starting at the same time. Given the constraints of the
given device, such a schedule may not be possible, in this case the
the method will raise a ValueError with a description of the conflict.
The schedule that is produced will take each moments and schedule the
operations in this moment in a time slice of length equal to the maximum
time of an operation in the moment.

A Schedule for the circuit.


ValueError – if the scheduling cannot be done.