It would be relatively straightforward to add a filter_feasible (or similar) keyword argument to the LeapHybridCQMSampler.sample_cqm() method. Something like
Need to decide what to do in the case that there are no feasible solutions. Probably return an empty sample set, but could consider raising an exception.
Would need to make SampleSet.filter() non-blocking, or handle this server-side. I don't think there is much performance benefit from doing it server-side though.
I personally feel like the existing syntax is explicit and unsurprising at the cost of one additional line of code, but perhaps some syntactic sugar here would be appreciated by users.
Currently this can be done with
see https://github.com/dwavesystems/dimod/blob/ec9c3b274ff4104c00fe702d680b320f0bffca25/dimod/sampleset.py#L1371
It would be relatively straightforward to add a
filter_feasible
(or similar) keyword argument to theLeapHybridCQMSampler.sample_cqm()
method. Something likeSome issues:
SampleSet.filter()
non-blocking, or handle this server-side. I don't think there is much performance benefit from doing it server-side though.I personally feel like the existing syntax is explicit and unsurprising at the cost of one additional line of code, but perhaps some syntactic sugar here would be appreciated by users.