Exemple #1
0
 def to_list(self):
     """Test to_operator method."""
     labels = ['XI', 'YZ', 'YY', 'ZZ']
     coeffs = [-3, 4.4j, 0.2 - 0.1j, 66.12]
     op = SparsePauliOp(PauliTable.from_labels(labels), coeffs)
     target = list(zip(labels, coeffs))
     self.assertEqual(op.to_list(), target)
 def to_list(self):
     """Test to_operator method."""
     labels = ["XI", "YZ", "YY", "ZZ"]
     coeffs = [-3, 4.4j, 0.2 - 0.1j, 66.12]
     op = SparsePauliOp(labels, coeffs)
     target = list(zip(labels, coeffs))
     self.assertEqual(op.to_list(), target)