def test_spin(self): poly = BinaryPolynomial({'abc': 1, 'bc': 1, 'ab': -1, '': 0}, 'SPIN') H, off = poly.to_hubo() new = BinaryPolynomial.from_hubo(H, off) self.assertEqual(poly, new.to_spin())
def test_binary(self): poly = BinaryPolynomial({'abc': 1, 'bc': 1, 'ab': -1, '': 0}, 'BINARY') H, off = poly.to_hubo() new = BinaryPolynomial.from_hubo(H, off) self.assertEqual(poly, new)