Beispiel #1
0
 def test_kwargs(self):
     poly = dimod.BinaryPolynomial({}, dimod.SPIN)
     with self.assertWarns(SamplerUnknownArgWarning):
         response = dimod.ExactPolySolver().sample_poly(poly, a=True, b=2)
Beispiel #2
0
    def test_sample_SPIN_empty(self):
        poly = dimod.BinaryPolynomial({}, dimod.SPIN)
        response = dimod.ExactPolySolver().sample_poly(poly)

        self.assertEqual(response.record.sample.shape, (0, 0))
        self.assertIs(response.vartype, poly.vartype)
Beispiel #3
0
 def test_isolated(self):
     poly = dimod.BinaryPolynomial({'a': 3, 'abc': 4, 'ac': 0.2}, dimod.SPIN)
     sampler = dimod.HigherOrderComposite(dimod.ExactSolver())
     sampleset = PolyCutOffComposite(sampler, 4.1).sample_poly(poly)