dwave-hybrid icon indicating copy to clipboard operation
dwave-hybrid copied to clipboard

Workflow templates

Open randomir opened this issue 5 years ago • 0 comments

For more involved workflows from #138, it might make sense to create them (and/or) as templates that would accept some workflow bits (runnables or parameters), and would construct a workflow according to a template.

Motivating pseudo-code example (see examples/qbsolv-like-alt.py):

ParallelizedSubsampler = WorkflowTemplate<subsampler, initial_state=None> hybrid.Map(
    subsampler
) | hybrid.Reduce(
    hybrid.Lambda(merge_substates),
    initial_state=initial_state
) | hybrid.SplatComposer()

Later we could use it:

qpu = ParallelizedSubsampler(hybrid.QPUSubproblemAutoEmbeddingSampler())
random = ParallelizedSubsampler(hybrid.RandomSubproblemSampler(), initial_state=some)

randomir avatar May 07 '19 20:05 randomir