def __init__(self, operations: Iterable[raw_types.Operation] = ()) -> None:
        """Constructs a moment with the given operations.

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

        Raises:
            ValueError: A qubit appears more than once.
        """
        self.operations = tuple(operations)

        # Check that operations don't overlap.
        affected_qubits = [q for op in self.operations for q in op.qubits]
        self.qubits = frozenset(affected_qubits)
        if len(affected_qubits) != len(self.qubits):
            raise ValueError(
                'Overlapping operations: {}'.format(self.operations))
def __init__ ( self , operations : Iterable [ raw_types . Operation ] = ( ) ) -> None : self . operations = tuple ( operations ) affected_qubits = [ q for op in self . operations for q in op . qubits ] self . qubits = frozenset ( affected_qubits ) if len ( affected_qubits ) != len ( self . qubits ) : raise ValueError ( 'Overlapping operations: {}' . format ( self . operations ) )
Constructs a moment with the given operations.

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

        Raises:
            ValueError: A qubit appears more than once.