예제 #1
0
 def test_spin(self):
     poly = BinaryPolynomial({'abc': 1, 'bc': 1, 'ab': -1}, 'SPIN')
     h, J, off = poly.to_hising()
     new = BinaryPolynomial.from_hising(h, J, off)
     self.assertEqual(poly, new)
예제 #2
0
 def test_binary(self):
     poly = BinaryPolynomial({'abc': 1, 'bc': 1, 'ab': -1}, 'BINARY')
     h, J, off = poly.to_hising()
     new = BinaryPolynomial.from_hising(h, J, off)
     self.assertEqual(poly, new.to_binary())