dimod.SampleSet.record¶
-
SampleSet.record¶ numpy.recarraycontaining the samples, energies, number of occurences, and other sample data.Examples
>>> import dimod ... >>> sampler = dimod.ExactSolver() >>> sampleset = sampler.sample_ising({'a': -0.5, 'b': 1.0}, {('a', 'b'): -1.0}) >>> sampleset.record rec.array([([-1, -1], -1.5, 1), ([ 1, -1], -0.5, 1), ([ 1, 1], -0.5, 1), ([-1, 1], 2.5, 1)], dtype=[('sample', 'i1', (2,)), ('energy', '<f8'), ('num_occurrences', '<i8')]) >>> sampleset.record.sample array([[-1, -1], [ 1, -1], [ 1, 1], [-1, 1]], dtype=int8) >>> sampleset.record.energy array([-1.5, -0.5, -0.5, 2.5])