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_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())