dwavesystems / dwavesystems/dimod

SampleSet.from_samples_bqm should officially support BinaryPolynomials

Open
#422 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
143
Forks
91
Avg merge
1h 24m
Merged PRs (30d)
3

Description

`SampleSet.from_samples_bqm` accepts any object that has a `.energies` method and a `vartype` attribute instead of just BQMs, most notably `BinaryPolynomial`.

https://github.com/dwavesystems/dimod/blob/15e6f93638b937156e8f0fff008c3b63a451aa45/dimod/sampleset.py#L417

The docstring should mention this and tests should be added to check for backwards compatibility. I don't think the name of the method should be generalised, as this is just using python's duck typing.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.