Skip to content

Commit 39b2807

Browse files
committed
[FIX] Fixed mypy errors.
1 parent 02aa340 commit 39b2807

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

qbench/batching.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ def execute_in_batches(
8484
# for batch in batches
8585
# )
8686

87-
result_gen = (BatchJob(sampler.run(batch.circuits, shots=shots), batch.keys) for batch in batches)
87+
result_gen = (
88+
BatchJob(sampler.run(batch.circuits, shots=shots), batch.keys) for batch in batches
89+
)
8890

8991
# Declare the variable 'result'
9092
result: Iterable[BatchJob]

qbench/fourier/_components/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ def discrimination_probability_upper_bound(
1515
"""
1616
return 0.5 + 0.25 * np.abs(1 - np.exp(1j * phi))
1717

18+
1819
__all__ = ["discrimination_probability_upper_bound"]

qbench/fourier_certification/experiment_runner.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
from collections import Counter, defaultdict
44
from logging import getLogger
5-
from typing import Dict, Iterable, List, Optional, Tuple, Union, cast, Any, Generator
5+
from typing import Dict, Iterable, List, Optional, Tuple, Union, cast
66

77
import numpy as np
88
import pandas as pd
99
from mthree import M3Mitigation
1010
from qiskit import QiskitError, QuantumCircuit, transpile
1111
from qiskit.providers import JobV1
12-
from qiskit_ibm_runtime import RuntimeJobV2, RuntimeJob
12+
from qiskit_ibm_runtime import RuntimeJobV2
1313
from tqdm import tqdm
1414

1515
from qbench.batching import BatchJob, execute_in_batches
@@ -147,7 +147,7 @@ def _extract_result_from_job(
147147
return ResultForCircuit.parse_obj(result)
148148

149149

150-
CircuitKey = Tuple[int, int, str, float]
150+
CircuitKey = Tuple[int, int, str, float, float]
151151

152152

153153
def _collect_circuits_and_keys(
@@ -207,6 +207,7 @@ def _iter_batches(batches: Iterable[BatchJob]) -> Iterable[Tuple[int, CircuitKey
207207
for i, key in enumerate(tqdm(batch.keys, desc="Circuit", leave=False))
208208
)
209209

210+
210211
# def _iter_batches(batches: Iterable[BatchJob]) -> Generator[
211212
# tuple[int, tuple[int, Any], JobV1 | RuntimeJob | RuntimeJobV2], None, None]:
212213
# """Iterate batches in a flat manner.

0 commit comments

Comments
 (0)