|
17 | 17 | Filename is a reference to multiplexing. |
18 | 18 | """ |
19 | 19 |
|
20 | | -from typing import cast, List, Optional, Sequence, TYPE_CHECKING, Union |
| 20 | +from typing import cast, List, Optional, Sequence, Type, TYPE_CHECKING, Union |
21 | 21 |
|
22 | 22 | import numpy as np |
23 | 23 |
|
@@ -53,7 +53,7 @@ def sample( |
53 | 53 | noise: 'cirq.NOISE_MODEL_LIKE' = None, |
54 | 54 | param_resolver: Optional['cirq.ParamResolver'] = None, |
55 | 55 | repetitions: int = 1, |
56 | | - dtype: 'DTypeLike' = np.complex64, |
| 56 | + dtype: Type[np.complexfloating] = np.complex64, |
57 | 57 | seed: 'cirq.RANDOM_STATE_OR_SEED_LIKE' = None, |
58 | 58 | ) -> 'cirq.Result': |
59 | 59 | """Simulates sampling from the given circuit. |
@@ -108,7 +108,7 @@ def final_state_vector( |
108 | 108 | param_resolver: 'cirq.ParamResolverOrSimilarType' = None, |
109 | 109 | qubit_order: 'cirq.QubitOrderOrList' = ops.QubitOrder.DEFAULT, |
110 | 110 | ignore_terminal_measurements: bool = False, |
111 | | - dtype: 'DTypeLike' = np.complex64, |
| 111 | + dtype: Type[np.complexfloating] = np.complex64, |
112 | 112 | seed: 'cirq.RANDOM_STATE_OR_SEED_LIKE' = None, |
113 | 113 | ) -> 'np.ndarray': |
114 | 114 | """Returns the state vector resulting from acting operations on a state. |
@@ -178,7 +178,7 @@ def sample_sweep( |
178 | 178 | *, |
179 | 179 | noise: 'cirq.NOISE_MODEL_LIKE' = None, |
180 | 180 | repetitions: int = 1, |
181 | | - dtype: 'DTypeLike' = np.complex64, |
| 181 | + dtype: Type[np.complexfloating] = np.complex64, |
182 | 182 | seed: 'cirq.RANDOM_STATE_OR_SEED_LIKE' = None, |
183 | 183 | ) -> Sequence['cirq.Result']: |
184 | 184 | """Runs the supplied Circuit, mimicking quantum hardware. |
@@ -224,7 +224,7 @@ def final_density_matrix( |
224 | 224 | initial_state: 'cirq.STATE_VECTOR_LIKE' = 0, |
225 | 225 | param_resolver: 'cirq.ParamResolverOrSimilarType' = None, |
226 | 226 | qubit_order: 'cirq.QubitOrderOrList' = ops.QubitOrder.DEFAULT, |
227 | | - dtype: 'DTypeLike' = np.complex64, |
| 227 | + dtype: Type[np.complexfloating] = np.complex64, |
228 | 228 | seed: Optional[Union[int, np.random.RandomState]] = None, |
229 | 229 | ignore_measurement_results: bool = True, |
230 | 230 | ) -> 'np.ndarray': |
|
0 commit comments