dwave.system.samplers.DWaveSampler.validate_anneal_schedule¶
- DWaveSampler.validate_anneal_schedule(anneal_schedule)[source]¶
Raise an exception if the specified schedule is invalid for the sampler.
- Parameters
anneal_schedule (list) – An anneal schedule variation is defined by a series of pairs of floating-point numbers identifying points in the schedule at which to change slope. The first element in the pair is time t in microseconds; the second, normalized persistent current s in the range [0,1]. The resulting schedule is the piecewise-linear curve that connects the provided points.
- Raises
ValueError – If the schedule violates any of the conditions listed below.
RuntimeError – If the sampler does not accept the anneal_schedule parameter or if it does not have annealing_time_range or max_anneal_schedule_points properties.
As described in D-Wave System Documentation, an anneal schedule must satisfy the following conditions:
Time t must increase for all points in the schedule.
For forward annealing, the first point must be (0,0) and the anneal fraction s must increase monotonically.
For reverse annealing, the anneal fraction s must start and end at s=1.
In the final point, anneal fraction s must equal 1 and time t must not exceed the maximum value in the annealing_time_range property.
The number of points must be >=2.
The upper bound is system-dependent; check the max_anneal_schedule_points property. For reverse annealing, the maximum number of points allowed is one more than the number given by this property.
Examples
This example sets a quench schedule on a D-Wave system.
>>> from dwave.system import DWaveSampler >>> sampler = DWaveSampler() >>> quench_schedule=[[0.0, 0.0], [12.0, 0.6], [12.8, 1.0]] >>> DWaveSampler().validate_anneal_schedule(quench_schedule) >>>