dwave.system.samplers.DWaveSampler.sample_ising¶

DWaveSampler.
sample_ising
(h, J, **kwargs)[source]¶ Sample from the specified Ising model.
Parameters:  h (dict/list) – Linear biases of the Ising model. If a dict, should be of the form {v: bias, …} where v is a spinvalued variable and bias is its associated bias. If a list, it is treated as a list of biases where the indices are the variable labels, except in the case of missing qubits in which case 0 biases are ignored while a nonzero bias set on a missing qubit raises an error.
 J (dict[(int, int) – float]): Quadratic biases of the Ising model.
 **kwargs – Optional keyword arguments for the sampling method, specified per solver in
DWaveSampler.parameters
. DWave System Documentation’s solver guide describes the parameters and properties supported on the DWave system.
Returns: A dimod
SampleSet
object. In it this sampler also provides timing information in the info field as described in the DWave System Documentation’s timing guide.Return type: Examples
This example submits a twovariable Ising problem mapped directly to qubits 0 and 1 on a DWave system.
>>> from dwave.system.samplers import DWaveSampler >>> sampler = DWaveSampler() >>> sampleset = sampler.sample_ising({0: 1, 1: 1}, {}) >>> for sample in sampleset.samples(): # doctest: +SKIP ... print(sample) ... {0: 1, 1: 1}
See Ocean Glossary for explanations of technical terms in descriptions of Ocean tools.