cirq.Moment

class cirq.Moment(operations: Iterable[cirq.ops.raw_types.Operation] = ())[source]

A simplified time-slice of operations within a sequenced circuit.

Note that grouping sequenced circuits into moments is an abstraction that
may not carry over directly to the scheduling on the hardware or simulator.
Operations in the same moment may or may not actually end up scheduled to
occur at the same time. However the topological quantum circuit ordering
will be preserved, and many schedulers or consumers will attempt to
maximize the moment representation.
__init__(operations: Iterable[cirq.ops.raw_types.Operation] = ()) → None[source]

Constructs a moment with the given operations.

Parameters

operations – The operations applied within the moment. Will be frozen into a tuple before storing.

Raises

ValueError – A qubit appears more than once.

Methods

operates_on(qubits)

Determines if the moment has operations touching the given qubits.

operates_on_single_qubit(qubit)

Determines if the moment has operations touching the given qubit.

transform_qubits(func)

Returns the same moment, but with different qubits.

with_operation(operation)

Returns an equal moment, but with the given op added.

without_operations_touching(qubits)

Returns an equal moment, but without ops on the given qubits.

Attributes

operations

qubits