Skip to content

Commit 756d777

Browse files
committed
Minor Fixes
1 parent cee79cd commit 756d777

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/mqt/predictor/rl/predictorenv.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,3 +722,14 @@ def _get_props(name: str, qargs: tuple[int, ...]) -> InstructionProperties | Non
722722
self._tbar = float(np.median(tmins)) if tmins else None
723723

724724
self._dev_avgs_cached = True
725+
726+
def _is_native_and_mapped(self, qc: QuantumCircuit) -> bool:
727+
check_nat_gates = GatesInBasis(basis_gates=self.device.operation_names)
728+
check_nat_gates(qc)
729+
only_nat_gates = check_nat_gates.property_set["all_gates_in_basis"]
730+
731+
check_mapping = CheckMap(coupling_map=CouplingMap(self.device.build_coupling_map()))
732+
check_mapping(qc)
733+
mapped = check_mapping.property_set["is_swap_mapped"]
734+
735+
return bool(only_nat_gates and mapped)

0 commit comments

Comments
 (0)