dimod.SampleSet.first

SampleSet.first

Sample with the lowest-energy.

Raises:ValueError – If empty.

Example

>>> sampleset = dimod.ExactSolver().sample_ising({'a': 1}, {('a', 'b'): 1})
>>> sampleset.first
Sample(sample={'a': -1, 'b': 1}, energy=-2.0, num_occurrences=1)