Skip to content

Commit f8f69de

Browse files
Apply suggestions from code review
Co-authored-by: Alessandro Candido <candido.ale@gmail.com>
1 parent aa92440 commit f8f69de

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/qibocal/auto/transpile.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ def get_natives(platform):
109109
This function assumes the native gates to be the same for each
110110
qubit and pair.
111111
"""
112-
pairs = list(platform.pairs.values())[0]
113-
qubit = list(platform.qubits.values())[0]
112+
pairs = next(iter(platform.pairs.values()))
113+
qubit = next(iter(platform.qubits.values()))
114114
two_qubit_natives = list(pairs.native_gates.raw)
115115
single_qubit_natives = list(qubit.native_gates.raw)
116116
# Solve Qibo-Qibolab mismatch
@@ -122,8 +122,7 @@ def get_natives(platform):
122122
"MZ": "M",
123123
}
124124
new_single_natives = [replacements.get(i, i) for i in single_qubit_natives]
125-
natives = new_single_natives + two_qubit_natives
126-
return natives
125+
return new_single_natives + two_qubit_natives
127126

128127

129128
def set_compiler(backend, natives):
@@ -154,7 +153,7 @@ def dummy_transpiler(backend: Backend) -> Passes:
154153
platform = backend.platform
155154
native_gates = get_natives(platform)
156155
set_compiler(backend, native_gates)
157-
native_gates = list(map(lambda x: getattr(gates, x), native_gates))
156+
native_gates = [getattr(gates, x) for x in native_gates]
158157
unroller = Unroller(NativeGates.from_gatelist(native_gates))
159158
return Passes(connectivity=platform.topology, passes=[unroller])
160159

0 commit comments

Comments
 (0)