Commit ec9c48e2 authored by Adams, Austin Joel's avatar Adams, Austin Joel
Browse files

IBM: Make bidirectional couplings when server sends no coupling_map

In the IBM backend, we require [x, y] to exist in the coupling map to
execute CX x,y -- [y, x] in the coupling map is not enough. So when IBM
does not include a coupling_map for a given backend, we need to include
both [i,j] and [j,i] for all qubits i,j s.t. i != j in the coupling map
we create; currently, we only include [i,j] for all qubits i,j with i <
j, which will cause errors if a circuit includes CX j,i.

Signed-off-by: Adams, Austin Joel's avatarAustin Adams <>
parent f83e1825
......@@ -812,8 +812,7 @@ std::vector<std::pair<int, int>> IBMAccelerator::getConnectivity() {
auto nq = backend__["n_qubits"].get<int>();
for (int i = 0; i < nq; i++) {
for (int j = 0; j < nq; j++) {
if (i < j) {
// graph->addEdge(i, j);
if (i != j) {
graph.push_back({i, j});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment