cirq.Circuit.findall_operations_between¶
-
Circuit.findall_operations_between(start_frontier: Dict[cirq.ops.raw_types.QubitId, int], end_frontier: Dict[cirq.ops.raw_types.QubitId, int], omit_crossing_operations: bool = False) → List[Tuple[int, cirq.ops.raw_types.Operation]][source]¶ Finds operations between the two given frontiers.
If a qubit is instart_frontierbut notend_frontier, its end indexdefaults to the end of the circuit. If a qubit is inend_frontierbutnotstart_frontier, its start index defaults to the start of thecircuit. Operations on qubits not mentioned in either frontier are notincluded in the results.Parameters: - start_frontier – Just before where to start searching for operations, for each qubit of interest. Start frontier indices are inclusive.
- end_frontier – Just before where to stop searching for operations, for each qubit of interest. End frontier indices are exclusive.
- omit_crossing_operations – Determines whether or not operations that cross from a location between the two frontiers to a location outside the two frontiers are included or excluded. (Operations completely inside are always included, and operations completely outside are always excluded.)
Returns: A list of tuples. Each tuple describes an operation found between the two frontiers. The first item of each tuple is the index of the moment containing the operation, and the second item is the operation itself. The list is sorted so that the moment index increases monotonically.