Skip to content

Commit a34df8c

Browse files
authored
Allow StandardRB to handle a V2 backend without a coupling map (#1293)
`StandardRB` handles directed two-qubit gates differently from bi-directional ones. For `BackendV2`, it used the `coupling_map` to check for directionality but did not handle the case where the coupling map was `None` which implies all to all connectivity. With this change, `StandardRB` treats gates with no coupling map as bidirectional. This issue first surfaced with qiskit-aer 0.13.0 which made `AerSimulator` a `BackendV2` backend (#1292).
1 parent 805d592 commit a34df8c

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

qiskit_experiments/library/randomized_benchmarking/standard_rb.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ def _get_basis_gates(self) -> Optional[Tuple[str, ...]]:
241241
return tuple(sorted(basis_gates)) if basis_gates else None
242242

243243
def is_bidirectional(coupling_map):
244+
if coupling_map is None:
245+
# None for a coupling map implies all-to-all coupling
246+
return True
244247
return len(coupling_map.reduce(self.physical_qubits).get_edges()) == 2
245248

246249
# 2 qubits case: Return all basis gates except for one-way directed 2q-gates.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
fixes:
3+
- |
4+
Changed :class:`.StandardRB` to treat two qubit operations in the
5+
:class:`qiskit.transpiler.Target` as having all-to-all connectivity if
6+
there is no set of specific pairs of coupled qubits. Most importantly, this
7+
change allows :class:`.StandardRB` to work with
8+
:class:`qiskit_aer.AerSimulator` for multi-qubit benchmarking after
9+
``qiskit-aer`` 0.13.0. Version 0.13.0 of ``qiskit-aer`` changed
10+
the default :class:`qiskit_aer.AerSimulator` to have such a
11+
:class:`qiskit.transpiler.Target` without specific coupled pairs.
12+
See `#1292 <https://github.com/Qiskit-Extensions/qiskit-experiments/issues/1292>`__.

0 commit comments

Comments
 (0)