dimod icon indicating copy to clipboard operation
dimod copied to clipboard

SampleSet.recalculate_energy method or similar

Open arcondello opened this issue 6 years ago • 1 comments

sampleset.recalculate_energy(bqm)

should change the sampleset's energy to that as calculated with the given bqm.

arcondello avatar Feb 05 '19 22:02 arcondello

For posterity, this can (as of 0.9.11) be done simply with

sampleset.record.energy = bqm.energies(sampleset)

It still might be worth implementing a method, but the one-liner isn't too bad.

arcondello avatar Nov 19 '20 23:11 arcondello