1
- # Copyright 2021 Google
1
+ # Copyright 2022 Google
2
2
#
3
3
# Licensed under the Apache License, Version 2.0 (the "License");
4
4
# you may not use this file except in compliance with the License.
12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- from typing import Sequence , Tuple , List
15
+ from typing import Sequence , Tuple , List , Iterator
16
16
17
17
import cirq
18
18
import functools
@@ -167,7 +167,7 @@ def simulate_dtc_circuit_list_sweep(
167
167
circuit_list : Sequence [cirq .Circuit ],
168
168
param_resolvers : Sequence [cirq .ParamResolver ],
169
169
qubit_order : Sequence [cirq .Qid ],
170
- ):
170
+ ) -> Iterator [ np . ndarray ] :
171
171
"""Simulate a dtc circuit list over a sweep of param_resolvers
172
172
173
173
Args:
@@ -245,7 +245,7 @@ def get_polarizations(
245
245
return polarizations
246
246
247
247
248
- def signal_ratio (zeta_1 : np .ndarray , zeta_2 : np .ndarray ):
248
+ def signal_ratio (zeta_1 : np .ndarray , zeta_2 : np .ndarray ) -> np . ndarray :
249
249
"""Calculate signal ratio between two signals
250
250
251
251
Args:
@@ -266,7 +266,7 @@ def simulate_for_polarizations(
266
266
circuit_list : Sequence [cirq .Circuit ],
267
267
autocorrelate : bool = True ,
268
268
take_abs : bool = False ,
269
- ):
269
+ ) -> np . ndarray :
270
270
"""Simulate and get polarizations for a single DTCExperiment and circuit list
271
271
272
272
Args:
@@ -324,7 +324,7 @@ def run_comparison_experiment(
324
324
autocorrelate : bool = True ,
325
325
take_abs : bool = False ,
326
326
** kwargs ,
327
- ):
327
+ ) -> Iterator [ np . ndarray ] :
328
328
"""Run comparison experiment
329
329
330
330
Args:
0 commit comments