Closed rkxy01 closed 4 years ago
One thing that would be straightforward to add would be an AggregateComposite
, the benefit of that would be to make a "general" solution that would also apply to other Ocean samplers, e.g. TabuSampler.
That would make the flow
sampler = AggregateComposite(SimulatedAnnealingSampler())
sampleset = sampler.sample(bqm, answer_mode='histogram')
sampleset = sampler.sample(bqm, answer_mode='raw')
would this satisfy the use case you have in mind?
Oh, thank you for your quick and kind advice! I didn't know AggregateComposite, but this is what I'd like to do. I'd like to use this function from now.
Hi @Xiangyue-San , that composite does not yet exist! We'd love to get a PR to dimod for it, or we can add it ourselves (probably sometime in the next week or so). Let us know!
I'm sorry, I seem to have jumped to the conclusion :-o I'd like to ask you to add them into dimod because I'm not familiar with D-Wave Ocean's project... I'll add issue comment in dimod repository and study how to develop them by looking your source codes! Thank you very much.
@Xiangyue-San, @arcondello, you can also consider using D-Wave Hybrid, where the runnable (composite) for this already exists!
AggregatedSamples
was released in 0.4.0 and it allows you to aggregate or spread the input samples.
Report and pull request
Description SimulatedAnnealingSampler.sample responses the dimod.SampleSet object. In samplers such as EmbeddingComposites, answer_mode is set 'histogram' as its default value. https://docs.dwavesys.com/docs/latest/c_solver_1.html#answer-format However, in this repository, sampler doesn't return answers following histogram format even if we set answer_mode='histogram'. I modified this and added some tests. (If you consider this implementation bad, please ignore or edit.)
To Reproduce
This outputs
Expected behavior
Environment:
Additional context I set default value of answer_mode 'raw'. This is because to avoid unexpected behavior in surrounding repositories related to this. If it is OK, please change this.