openjij
Framework for the Ising model and QUBO.
Loading...
Searching...
No Matches
openjij.sampler.sampler.BaseSampler Class Reference
Inheritance diagram for openjij.sampler.sampler.BaseSampler:
Collaboration diagram for openjij.sampler.sampler.BaseSampler:

Public Member Functions

 sample (self, bqm, **parameters)
 
 sample_ising (self, h, J, **parameters)
 
 sample_qubo (self, Q, **parameters)
 

Public Attributes

 sample_ising
 
 sample_qubo
 

Static Public Attributes

 parameters = dict()
 
 properties = dict()
 

Protected Member Functions

 _set_params (self, **kwargs)
 
 _sampling (self, **kwargs)
 
 _cxxjij_sampling (self, model, init_generator, algorithm, system, reinitialize_state=None, seed=None, offset=None)
 
 _get_result (self, system, model)
 

Detailed Description

Base sampler class of python wrapper for cxxjij simulator.

Member Function Documentation

◆ _cxxjij_sampling()

openjij.sampler.sampler.BaseSampler._cxxjij_sampling (   self,
  model,
  init_generator,
  algorithm,
  system,
  reinitialize_state = None,
  seed = None,
  offset = None 
)
protected
Basic sampling function: for cxxjij sampling.

Args:
    model (openjij.BinaryQuadraticModel): model has a information of instaunce (h, J, Q)
    init_generator (callable): return initial state, must have argument structure
    algorithm (callable): system algorithm of cxxjij
    system (:obj:): [description]
    reinitialize_state (bool, optional): [description]. Defaults to None.
    seed (int, optional): seed for algorithm. Defaults to None.
    offset (float): an offset which is added to the calculated energy

Returns:
    :class:`openjij.sampler.response.Response`: results

Referenced by openjij.sampler.sa_sampler.SASampler._sample_hubo_old(), openjij.sampler.sqa_sampler.SQASampler.sample(), and openjij.sampler.csqa_sampler.CSQASampler.sample_ising().

Here is the caller graph for this function:

◆ _get_result()

openjij.sampler.sampler.BaseSampler._get_result (   self,
  system,
  model 
)
protected

◆ _sampling()

openjij.sampler.sampler.BaseSampler._sampling (   self,
**  kwargs 
)
protected

◆ _set_params()

◆ sample()

openjij.sampler.sampler.BaseSampler.sample (   self,
  bqm,
**  parameters 
)
Sample from a binary quadratic model.

Args:
    bqm (openjij.BinaryQuadraticModel):
        Binary Qudratic Model
    **parameters:
        See the implemented sampling for additional keyword definitions.

Returns:
    :class:`openjij.sampler.response.Response`: results

Reimplemented in openjij.sampler.sa_sampler.SASampler, and openjij.sampler.sqa_sampler.SQASampler.

Referenced by openjij.sampler.sampler.BaseSampler.sample_ising(), and openjij.sampler.sampler.BaseSampler.sample_qubo().

Here is the caller graph for this function:

◆ sample_ising()

openjij.sampler.sampler.BaseSampler.sample_ising (   self,
  h,
  J,
**  parameters 
)
Sample from an Ising model using the implemented sample method.

Args:
    h (dict): Linear biases
    J (dict): Quadratic biases

Returns:
    :class:`openjij.sampler.response.Response`: results

Reimplemented in openjij.sampler.csqa_sampler.CSQASampler.

References openjij.sampler.sampler.BaseSampler.sample(), openjij.sampler.sa_sampler.SASampler.sample(), and openjij.sampler.sqa_sampler.SQASampler.sample().

Here is the call graph for this function:

◆ sample_qubo()

openjij.sampler.sampler.BaseSampler.sample_qubo (   self,
  Q,
**  parameters 
)
Sample from a QUBO model using the implemented sample method.

Args:
    Q (dict or numpy.ndarray): Coefficients of a quadratic unconstrained binary optimization

Returns:
    :class:`openjij.sampler.response.Response`: results

References openjij.sampler.sampler.BaseSampler.sample(), openjij.sampler.sa_sampler.SASampler.sample(), and openjij.sampler.sqa_sampler.SQASampler.sample().

Here is the call graph for this function:

Member Data Documentation

◆ parameters

openjij.sampler.sampler.BaseSampler.parameters = dict()
static

◆ properties

openjij.sampler.sampler.BaseSampler.properties = dict()
static

◆ sample_ising

openjij.sampler.sampler.BaseSampler.sample_ising

◆ sample_qubo

openjij.sampler.sampler.BaseSampler.sample_qubo

The documentation for this class was generated from the following file: