def test_empty_coupling_class(self): coupling = CouplingMap() self.assertEqual(0, coupling.size()) self.assertEqual([], coupling.physical_qubits) self.assertEqual([], coupling.get_edges()) self.assertFalse(coupling.is_connected()) self.assertEqual("", str(coupling))
def test_coupling_distance(self): coupling_list = [(0, 1), (0, 2), (1, 2)] coupling = CouplingMap(coupling_list) self.assertTrue(coupling.is_connected()) physical_qubits = coupling.physical_qubits result = coupling.distance(physical_qubits[0], physical_qubits[1]) self.assertEqual(1, result)