dwave.system.composites.LazyFixedEmbeddingComposite.sample¶
-
LazyFixedEmbeddingComposite.
sample
(bqm, **parameters)[source]¶ Sample the binary quadratic model.
On the first call of a sampling method, finds a minor-embedding for the given binary quadratic model (BQM). All subsequent calls to its sampling methods reuse this embedding.
Parameters: - bqm (
dimod.BinaryQuadraticModel
) – Binary quadratic model to be sampled from. - chain_strength (float/mapping/callable, optional, default=1.0) – Magnitude of the quadratic bias (in SPIN-space) applied between variables to form a chain, with the energy penalty of chain breaks set to 2 * chain_strength. If a mapping is passed, a chain-specific strength is applied. If a callable is passed, it will be called on chain_strength(bqm, embedding) and should return a float or mapping, to be interpreted as above. By default, chain_strength is scaled to the problem.
- chain_break_method (function, optional) – Method used to resolve chain breaks during sample unembedding.
See
unembed_sampleset()
. - chain_break_fraction (bool, optional, default=True) – Add a ‘chain_break_fraction’ field to the unembedded response with the fraction of chains broken before unembedding.
- embedding_parameters (dict, optional) – If provided, parameters are passed to the embedding method as keyword arguments. Overrides any embedding_parameters passed to the constructor. Only used on the first call.
- **parameters – Parameters for the sampling method, specified by the child sampler.
Returns: - bqm (