Exemplo n.º 1
0
 def test_layout_swap(self):
     """swap() method"""
     layout = Layout()
     layout.add((self.qr, 0))
     layout.add((self.qr, 1))
     layout.swap(0, 1)
     self.assertDictEqual(layout.get_bits(), {
         (self.qr, 0): 1,
         (self.qr, 1): 0
     })
Exemplo n.º 2
0
 def test_layout_get_bits(self):
     """Get the map from the (qu)bits view"""
     layout_dict = {(self.qr, 0): 0, (self.qr, 1): 1, (self.qr, 2): 2}
     layout = Layout(layout_dict)
     self.assertDictEqual(layout_dict, layout.get_bits())