Skip to content

Commit

Permalink
🚨 fix new ruff warnings
Browse files Browse the repository at this point in the history
Signed-off-by: burgholzer <burgholzer@me.com>
  • Loading branch information
burgholzer committed Feb 28, 2023
1 parent 475ab9b commit 893f84a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mqt/qmap/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def extract_initial_layout_from_qasm(qasm: str, qregs: list[QuantumRegister]) ->
for line in qasm.split("\n"):
if line.startswith("// i "):
# strip away initial part of line
line = line[5:]
stripped_line = line[5:]
# split line into tokens
tokens = line.split(" ")
tokens = stripped_line.split(" ")
# convert tokens to integers
int_tokens = [int(token) for token in tokens]
# create an empty layout
Expand Down
4 changes: 2 additions & 2 deletions mqt/qmap/subarchitectures.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,8 +374,8 @@ def __compute_desirable_subarchitectures(self) -> None:
des.sort()
new_des: set[tuple[int, int]] = set()
for j, (n_prime, i_prime) in enumerate(reversed(des)):
j = len(des) - j - 1
if not any((n_prime, i_prime) in self.subarch_order[k] for k in des[:j]):
idx = len(des) - j - 1
if not any((n_prime, i_prime) in self.subarch_order[k] for k in des[:idx]):
new_des.add((n_prime, i_prime))

self.desirable_subarchitectures[(n, i)] = new_des
Expand Down

0 comments on commit 893f84a

Please sign in to comment.