dwave-hybrid
dwave-hybrid copied to clipboard
Workflow templates
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)