Skip to content

Commit

Permalink
Allow StandardRB to handle a V2 backend without a coupling map (#1293)
Browse files Browse the repository at this point in the history
`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).
  • Loading branch information
wshanks authored Oct 30, 2023
1 parent 805d592 commit a34df8c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ def _get_basis_gates(self) -> Optional[Tuple[str, ...]]:
return tuple(sorted(basis_gates)) if basis_gates else None

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

# 2 qubits case: Return all basis gates except for one-way directed 2q-gates.
Expand Down
12 changes: 12 additions & 0 deletions releasenotes/notes/rb-v2-none-coupling-fda2b22afdef507b.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
fixes:
- |
Changed :class:`.StandardRB` to treat two qubit operations in the
:class:`qiskit.transpiler.Target` as having all-to-all connectivity if
there is no set of specific pairs of coupled qubits. Most importantly, this
change allows :class:`.StandardRB` to work with
:class:`qiskit_aer.AerSimulator` for multi-qubit benchmarking after
``qiskit-aer`` 0.13.0. Version 0.13.0 of ``qiskit-aer`` changed
the default :class:`qiskit_aer.AerSimulator` to have such a
:class:`qiskit.transpiler.Target` without specific coupled pairs.
See `#1292 <https://github.com/Qiskit-Extensions/qiskit-experiments/issues/1292>`__.

0 comments on commit a34df8c

Please sign in to comment.