def test_a_cx_to_map(self):
    "A single CX needs to be remapped.\n\n         q0:----------m-----\n                      |\n         q1:-[H]-(+)--|-m---\n                  |   | |\n         q2:------.---|-|-m-\n                      | | |\n         c0:----------.-|-|-\n         c1:------------.-|-\n         c2:--------------.-\n\n         CouplingMap map: [1]<-[0]->[2]\n\n        expected count: '000': 50%\n                        '110': 50%\n        "
    self.counts = {'000': 512, '110': 512}
    self.shots = 1024
    self.delta = 5
    coupling_map = [[0, 1], [0, 2]]
    qr = QuantumRegister(3, 'q')
    cr = ClassicalRegister(3, 'c')
    circuit = QuantumCircuit(qr, cr, name='a_cx_to_map')
    circuit.h(qr[1])
    circuit.cx(qr[1], qr[2])
    circuit.measure(qr, cr)
    result = self.create_passmanager(coupling_map).run(circuit)
    self.assertResult(result, circuit)
A single CX needs to be remapped.

 q0:----------m-----
              |
 q1:-[H]-(+)--|-m---
          |   | |
 q2:------.---|-|-m-
              | | |
 c0:----------.-|-|-
 c1:------------.-|-
 c2:--------------.-

 CouplingMap map: [1]<-[0]->[2]

expected count: '000': 50%
                '110': 50%
def test_a_cx_to_map(self):
    "A single CX needs to be remapped.\n\n         q0:----------m-----\n                      |\n         q1:-[H]-(+)--|-m---\n                  |   | |\n         q2:------.---|-|-m-\n                      | | |\n         c0:----------.-|-|-\n         c1:------------.-|-\n         c2:--------------.-\n\n         CouplingMap map: [1]<-[0]->[2]\n\n        expected count: '000': 50%\n                        '110': 50%\n        "
    self.counts = {'000': 512, '110': 512}
    self.shots = 1024
    self.delta = 5
    coupling_map = [[0, 1], [0, 2]]
    qr = QuantumRegister(3, 'q')
    cr = ClassicalRegister(3, 'c')
    circuit = QuantumCircuit(qr, cr, name='a_cx_to_map')
    circuit.h(qr[1])
    circuit.cx(qr[1], qr[2])
    circuit.measure(qr, cr)
    result = self.create_passmanager(coupling_map).run(circuit)
    self.assertResult(result, circuit)