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())
 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)
 def test_degree0(self):
     poly = BinaryPolynomial.from_hising({}, {}, 0)
     self.assertEqual(poly.degree, 0)