示例#1
0
    def test_with_h_gain_schedule(self):
        sampler = self.qpu

        schedule = ramp(.5, .2, sampler.properties['default_annealing_time'])

        sampler.validate_anneal_schedule(schedule)

        h = {v: 1 for v in sampler.nodelist}

        sampleset = sampler.sample_ising(h, {}, h_gain_schedule=schedule)
        sampleset.record  # resolve the future
示例#2
0
 def test_width_exception(self):
     with self.assertRaises(ValueError):
         ramp(.1, .2, 1)  # curve would begin at (0, 0)
示例#3
0
 def test_s_exception(self):
     with self.assertRaises(ValueError):
         ramp(-1, 0, 1)
示例#4
0
 def test_typical(self):
     schedule = ramp(.5, .2, 1)
     self.assertEqual(schedule, [(0, 0), (.4, 0), (.6, 1), (1, 1)])