@@ -122,7 +122,7 @@ def moments(self) -> Sequence['cirq.Moment']:
122
122
123
123
@property
124
124
@abc .abstractmethod
125
- def device (self ) -> devices .Device :
125
+ def device (self ) -> 'cirq .Device' :
126
126
pass
127
127
128
128
def freeze (self ) -> 'cirq.FrozenCircuit' :
@@ -589,7 +589,7 @@ def findall_operations_until_blocked(
589
589
self ,
590
590
start_frontier : Dict ['cirq.Qid' , int ],
591
591
is_blocker : Callable [['cirq.Operation' ], bool ] = lambda op : False ,
592
- ) -> List [Tuple [int , ops .Operation ]]:
592
+ ) -> List [Tuple [int , 'cirq .Operation' ]]:
593
593
"""Finds all operations until a blocking operation is hit.
594
594
595
595
An operation is considered blocking if
@@ -740,7 +740,7 @@ def findall_operations(
740
740
741
741
def findall_operations_with_gate_type (
742
742
self , gate_type : Type [T_DESIRED_GATE_TYPE ]
743
- ) -> Iterable [Tuple [int , ops .GateOperation , T_DESIRED_GATE_TYPE ]]:
743
+ ) -> Iterable [Tuple [int , 'cirq .GateOperation' , T_DESIRED_GATE_TYPE ]]:
744
744
"""Find the locations of all gate operations of a given type.
745
745
746
746
Args:
@@ -852,7 +852,7 @@ def all_qubits(self) -> FrozenSet['cirq.Qid']:
852
852
"""Returns the qubits acted upon by Operations in this circuit."""
853
853
return frozenset (q for m in self .moments for q in m .qubits )
854
854
855
- def all_operations (self ) -> Iterator [ops .Operation ]:
855
+ def all_operations (self ) -> Iterator ['cirq .Operation' ]:
856
856
"""Iterates over the operations applied by this circuit.
857
857
858
858
Operations from earlier moments will be iterated over first. Operations
@@ -1162,7 +1162,7 @@ def to_text_diagram_drawer(
1162
1162
get_circuit_diagram_info : Optional [
1163
1163
Callable [['cirq.Operation' , 'cirq.CircuitDiagramInfoArgs' ], 'cirq.CircuitDiagramInfo' ]
1164
1164
] = None ,
1165
- ) -> TextDiagramDrawer :
1165
+ ) -> 'cirq. TextDiagramDrawer' :
1166
1166
"""Returns a TextDiagramDrawer with the circuit drawn into it.
1167
1167
1168
1168
Args:
@@ -1250,7 +1250,7 @@ def _to_qasm_output(
1250
1250
header : Optional [str ] = None ,
1251
1251
precision : int = 10 ,
1252
1252
qubit_order : 'cirq.QubitOrderOrList' = ops .QubitOrder .DEFAULT ,
1253
- ) -> QasmOutput :
1253
+ ) -> 'cirq. QasmOutput' :
1254
1254
"""Returns a QASM object equivalent to the circuit.
1255
1255
1256
1256
Args:
@@ -1273,7 +1273,7 @@ def _to_qasm_output(
1273
1273
1274
1274
def _to_quil_output (
1275
1275
self , qubit_order : 'cirq.QubitOrderOrList' = ops .QubitOrder .DEFAULT
1276
- ) -> QuilOutput :
1276
+ ) -> 'cirq. QuilOutput' :
1277
1277
qubits = ops .QubitOrder .as_qubit_order (qubit_order ).order_for (self .all_qubits ())
1278
1278
return QuilOutput (operations = self .all_operations (), qubits = qubits )
1279
1279
@@ -1697,23 +1697,23 @@ def __init__(
1697
1697
self .append (contents , strategy = strategy )
1698
1698
1699
1699
@property
1700
- def device (self ) -> devices .Device :
1700
+ def device (self ) -> 'cirq .Device' :
1701
1701
return self ._device
1702
1702
1703
1703
@device .setter
1704
1704
def device (self , new_device : 'cirq.Device' ) -> None :
1705
1705
new_device .validate_circuit (self )
1706
1706
self ._device = new_device
1707
1707
1708
- def __copy__ (self ) -> 'Circuit' :
1708
+ def __copy__ (self ) -> 'cirq. Circuit' :
1709
1709
return self .copy ()
1710
1710
1711
- def copy (self ) -> 'Circuit' :
1711
+ def copy (self ) -> 'cirq. Circuit' :
1712
1712
copied_circuit = Circuit (device = self ._device )
1713
1713
copied_circuit ._moments = self ._moments [:]
1714
1714
return copied_circuit
1715
1715
1716
- def _with_sliced_moments (self , moments : Iterable ['cirq.Moment' ]) -> 'Circuit' :
1716
+ def _with_sliced_moments (self , moments : Iterable ['cirq.Moment' ]) -> 'cirq. Circuit' :
1717
1717
new_circuit = Circuit (device = self .device )
1718
1718
new_circuit ._moments = list (moments )
1719
1719
return new_circuit
@@ -1793,7 +1793,7 @@ def __rmul__(self, repetitions: INT_TYPE):
1793
1793
return NotImplemented
1794
1794
return self * int (repetitions )
1795
1795
1796
- def __pow__ (self , exponent : int ) -> 'Circuit' :
1796
+ def __pow__ (self , exponent : int ) -> 'cirq. Circuit' :
1797
1797
"""A circuit raised to a power, only valid for exponent -1, the inverse.
1798
1798
1799
1799
This will fail if anything other than -1 is passed to the Circuit by
@@ -1819,7 +1819,7 @@ def with_device(
1819
1819
self ,
1820
1820
new_device : 'cirq.Device' ,
1821
1821
qubit_mapping : Callable [['cirq.Qid' ], 'cirq.Qid' ] = lambda e : e ,
1822
- ) -> 'Circuit' :
1822
+ ) -> 'cirq. Circuit' :
1823
1823
"""Maps the current circuit onto a new device, and validates.
1824
1824
1825
1825
Args:
@@ -2296,7 +2296,9 @@ def clear_operations_touching(
2296
2296
if 0 <= k < len (self ._moments ):
2297
2297
self ._moments [k ] = self ._moments [k ].without_operations_touching (qubits )
2298
2298
2299
- def _resolve_parameters_ (self , resolver : 'cirq.ParamResolver' , recursive : bool ) -> 'Circuit' :
2299
+ def _resolve_parameters_ (
2300
+ self , resolver : 'cirq.ParamResolver' , recursive : bool
2301
+ ) -> 'cirq.Circuit' :
2300
2302
resolved_moments = []
2301
2303
for moment in self :
2302
2304
resolved_operations = _resolve_operations (moment .operations , resolver , recursive )
@@ -2391,7 +2393,7 @@ def _draw_moment_annotations(
2391
2393
col : int ,
2392
2394
use_unicode_characters : bool ,
2393
2395
label_map : Dict ['cirq.LabelEntity' , int ],
2394
- out_diagram : TextDiagramDrawer ,
2396
+ out_diagram : 'cirq. TextDiagramDrawer' ,
2395
2397
precision : Optional [int ],
2396
2398
get_circuit_diagram_info : Callable [
2397
2399
['cirq.Operation' , 'cirq.CircuitDiagramInfoArgs' ], 'cirq.CircuitDiagramInfo'
@@ -2421,7 +2423,7 @@ def _draw_moment_in_diagram(
2421
2423
moment : 'cirq.Moment' ,
2422
2424
use_unicode_characters : bool ,
2423
2425
label_map : Dict ['cirq.LabelEntity' , int ],
2424
- out_diagram : TextDiagramDrawer ,
2426
+ out_diagram : 'cirq. TextDiagramDrawer' ,
2425
2427
precision : Optional [int ],
2426
2428
moment_groups : List [Tuple [int , int ]],
2427
2429
get_circuit_diagram_info : Optional [
@@ -2542,7 +2544,7 @@ def _formatted_phase(coefficient: complex, unicode: bool, precision: Optional[in
2542
2544
def _draw_moment_groups_in_diagram (
2543
2545
moment_groups : List [Tuple [int , int ]],
2544
2546
use_unicode_characters : bool ,
2545
- out_diagram : TextDiagramDrawer ,
2547
+ out_diagram : 'cirq. TextDiagramDrawer' ,
2546
2548
):
2547
2549
out_diagram .insert_empty_rows (0 )
2548
2550
h = out_diagram .height ()
@@ -2572,7 +2574,7 @@ def _draw_moment_groups_in_diagram(
2572
2574
2573
2575
2574
2576
def _apply_unitary_circuit (
2575
- circuit : AbstractCircuit ,
2577
+ circuit : 'cirq. AbstractCircuit' ,
2576
2578
state : np .ndarray ,
2577
2579
qubits : Tuple ['cirq.Qid' , ...],
2578
2580
dtype : Type [np .number ],
0 commit comments