dwavesystems / dwavesystems/dwave-hybrid

Clarify/update `SplatComposer` behavior

Open
#281 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
90
Forks
54
PR merge metrics
No merged PRs in 30d

Description

Note:
- `hybrid.SplatComposer` **does not sort output samples** by energy
- subsequent `hybrid.ArgMin` with the default `key="samples.first.energy"` might not pick the best sample by energy
- easily fixed by sorting after compose, with e.g: `hybrid.SliceSamples()`, or a more explicit `hybrid.SliceSamples(sorted_by='energy')`.

- `hybrid.SplatComposer` **does not sort input subsamples** by energy before composing with a smaller samples set
- if subsamples generator does not produce sorted sampleset, and is seeded by, say, a single initial state, the output sampleset (containing just one sample) might not be the best
- easily "fixed" by sorting subsamples generator output
- but a better fix might be to explode the input sample with `hybrid.AggregatedSamples(aggregate=False)` before composing with Splat, followed by a truncate with `hybrid.SliceSamples(1)`. So, something like:

```
subsampler = (
hybrid.AggregatedSamples(aggregate=False)
| hybrid.SimulatedAnnealingProblemSampler()
| hybrid.SplatComposer()
| hybrid.SliceSamples(1, ordered_by='energy')
)
```
would make sure the best sample is generated, accounting for boundary conditions.

(Originally raised offline by @jackraymond)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the SplatComposer, ArgMin, SliceSamples, AggregatedSamples, and SimulatedAnnealingProblemSampler entry points named in the issue. Determine and document or implement the agreed ordering behavior for input subsamples and output samples, then verify that selecting one sample consistently accounts for energy and boundary conditions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.