dwave.system.composites.FixedEmbeddingComposite.sample¶
-
FixedEmbeddingComposite.
sample
(bqm, **kwargs)[source]¶ Sample from the provided binary quadratic model.
Parameters: - bqm (
dimod.BinaryQuadraticModel
) – Binary quadratic model to be sampled from. - chain_strength (float, optional, default=1.0) – Magnitude of the quadratic bias (in SPIN-space) applied between variables to create chains. Note that the energy penalty of chain breaks is 2 * chain_strength.
- **parameters – Parameters for the sampling method, specified by the child sampler.
Returns: Examples
This example uses
FixedEmbeddingComposite
to instantiate a composed sampler that submits an unstructured Ising problem to a D-Wave solver, selected by the user’s default D-Wave Cloud Client configuration_ file, while minor-embedding the problem’s variables to physical qubits on the solver.>>> from dwave.system.samplers import DWaveSampler >>> from dwave.system.composites import FixedEmbeddingComposite >>> import dimod >>> sampler = FixedEmbeddingComposite(DWaveSampler(), {'a': [0, 4], 'b': [1, 5], 'c': [2, 6]}) >>> resp = sampler.sample_ising({'a': .5, 'c': 0}, {('a', 'c'): -1})
- bqm (