qbsolv icon indicating copy to clipboard operation
qbsolv copied to clipboard

QBSolv should be a composite

Open spakin opened this issue 5 years ago • 1 comments

Current Problem

It strikes me as inconsistent that the QBSolv class is not defined as a composite sampler. If I want to add auto-embedding support to a sampler, I pass the sampler to an AutoEmbeddingComposite. If I want to add reverse-annealing support to a sampler, I pass the sampler to a ReverseAdvanceComposite. If I want to add spin-reversal support to a sampler, I pass the sampler to a SpinReversalTransformComposite. But if I want to add QBSolv support to sampler to break up a large problem, I first create a QBSolv object with no child sampler. Only when I sample from the QBsolv object do I pass QBSolv.sample the sampler I want to use.

Proposed Solution I propose deriving QBSolv from dimod.Composite. That way, users can treat QBSolv as any other composite sampler, specifying the child at creation time, not at sampling time.

spakin avatar Jun 01 '20 21:06 spakin

I agree. QBSolve pre-dates the notion of a composite, but conceptually you are absolutely correct.

For another approach, I would check out dwave-hybrid's qbsolv-like which will give you more control.

arcondello avatar Jun 02 '20 16:06 arcondello