EmbeddingComposite

class EmbeddingComposite(sampler)[source]

Composite to map unstructured problems to a structured sampler.

Parameters:sampler (dimod.TemplateSampler) – A structured dimod sampler to be wrapped.
sample_ising(h, J, **kwargs)[source]

Sample from the provided unstructured Ising model.

Parameters:
  • h (list/dict) – Linear terms of the model.
  • J (dict of (int, int) – float): Quadratic terms of the model.
  • **kwargs – Parameters for the sampling method, specified per solver.
Returns:

dimod.SpinResponse

accepted_kwargs

dict[strSamplerKeywordArg] – The keyword arguments accepted by the sample_ising and sample_qubo methods for this sampler.

my_kwargs()

The keyword arguments accepted by the sampler or the highest composite layer.

Returns:SamplerKeywordArg]: The keyword arguments accepted by the sample_ising and sample_qubo methods for this sampler or the top-level composite layer. For all accepted keyword arguments see accepted_kwargs.
Return type:dict[str

Note

This method is inherited from the TemplateSampler base class.

sample_qubo(Q, **kwargs)

Converts the given QUBO into an Ising problem, then invokes the sample_ising method.

See sample_ising documentation for more information.

Parameters:
  • Q (dict) – A dictionary defining the QUBO. Should be of the form {(u, v): bias} where u, v are variables and bias is numeric.
  • **kwargs – Any keyword arguments are passed directly to sample_ising.
Returns:

A BinaryResponse, converted from the SpinResponse return from sample_ising.

Return type:

BinaryResponse

Note

This method is inherited from the TemplateSampler base class.

structure

Structure for the sampler. None for unstructured samplers.