Exemplo n.º 1
0
 def test_classicalregister_hash_upate_name(self):
     """Test ClassicalRegister hash changes on name update."""
     test_reg = ClassicalRegister(2)
     orig_hash = hash(test_reg)
     orig_bit_hashes = [hash(x) for x in test_reg]
     test_reg.name = 'test_classical'
     new_hash = hash(test_reg)
     new_bit_hashes = [hash(x) for x in test_reg]
     self.assertNotEqual(orig_hash, new_hash)
     for x in range(2):
         self.assertNotEqual(orig_bit_hashes[x], new_bit_hashes[x])