:py:mod:`omnisolver.random.sampler` =================================== .. py:module:: omnisolver.random.sampler .. autoapi-nested-parse:: Simple implementation of dummy random sampler. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: omnisolver.random.sampler.RandomSampler .. py:class:: RandomSampler(prob) Bases: :py:obj:`dimod.Sampler` Implementation of simple random-sampler. This sampler assigns randomly chosen value to each variable, either from the set {0, 1} or the set {-1, 1}, depending on the vartype of BQM being solved. .. py:property:: properties Properties as a dict containing any additional information about the sampler. .. py:property:: parameters Parameters as a dict, where keys are keyword parameters accepted by the sampler methods and values are lists of the properties relevent to each parameter. .. py:attribute:: variable_samplers .. py:method:: get_random_sample(bqm) Get random assignment of variables in given BQM. .. py:method:: sample(bqm, num_reads=1, **parameters) Sample from a binary quadratic model. This method is inherited from the :class:`.Sampler` base class. Converts the binary quadratic model to either Ising or QUBO format and then invokes an implemented sampling method (one of :meth:`.sample_ising` or :meth:`.sample_qubo`). Args: bqm: A binary quadratic model. **parameters: See the implemented sampling for additional keyword definitions. Unknown keywords are accepted with a warning raised. Returns: Samples from the binary quadratic model. See also: :meth:`.sample_ising`, :meth:`.sample_qubo`