diff --git a/www/reference/openjij/index.html b/www/reference/openjij/index.html index 6fbf5b5..9b31897 100644 --- a/www/reference/openjij/index.html +++ b/www/reference/openjij/index.html @@ -1492,13 +1492,13 @@
beta (float) – Inverse temperature.
gamma (float) – Amplitude of quantum fluctuation.
schedule (list) – schedule list
step_num (int) – Number of Monte Carlo step.
schedule_info (dict) – Information about a annealing schedule.
num_reads (int) – Number of iterations.
num_sweeps (int) – number of sweeps
beta (float) – Inverse temperature.
gamma (float) – Amplitude of quantum fluctuation.
schedule (list) – schedule list
step_num (int) – Number of Monte Carlo step.
schedule_info (dict) – Information about a annealing schedule.
num_reads (int) – Number of iterations.
num_sweeps (int) – number of sweeps
schedule_info – Information about a annealing schedule.
Remove with warnings any keyword arguments not accepted by the sampler.
**kwargs – Keyword arguments to be validated.
Dict[str, Any]
+Returns: Updated kwargs dict.
Examples
@@ -1542,26 +1545,27 @@Sampling from the Ising model
bqm (openjij.BinaryQuadraticModel) –
beta (float, optional) – inverse tempareture.
gamma (float, optional) – strangth of transverse field. Defaults to None.
num_sweeps (int, optional) – number of sweeps. Defaults to None.
schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
trotter (int) – Trotter number.
num_reads (int, optional) – number of sampling. Defaults to 1.
initial_state (list[int], optional) – Initial state. Defaults to None.
updater (str, optional) – update method. Defaults to ‘single spin flip’.
reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
seed (int, optional) – Sampling seed. Defaults to None.
beta (float, optional) – inverse tempareture.
gamma (float, optional) – strangth of transverse field. Defaults to None.
num_sweeps (int, optional) – number of sweeps. Defaults to None.
schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
trotter (int) – Trotter number.
num_reads (int, optional) – number of sampling. Defaults to 1.
initial_state (list[int], optional) – Initial state. Defaults to None.
updater (str, optional) – update method. Defaults to ‘single spin flip’.
reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
seed (int, optional) – Sampling seed. Defaults to None.
sparse (Optional[bool]) –
ValueError –
+results
@@ -1593,17 +1597,17 @@h (dict) – linear biases
J (dict) – quadratic biases
beta (float, optional) – inverse temperature
gamma (float, optional) – strength of transverse field
num_sweeps (int, optional) – number of sampling.
schedule (list, optional) – schedule list
num_reads (int, optional) – number of iterations
h (dict) – linear biases
J (dict) – quadratic biases
beta (float, optional) – inverse temperature
gamma (float, optional) – strength of transverse field
num_sweeps (int, optional) – number of sampling.
schedule (list, optional) – schedule list
num_reads (int, optional) – number of iterations
initial_state (optional) – initial state of spins
updater (str, optional) – updater algorithm
reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
seed (int, optional) – Sampling seed.
updater (str, optional) – updater algorithm
reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
seed (int, optional) – Sampling seed.
Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
+Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
results
@@ -1659,11 +1663,11 @@record (numpy.recarray
) – A NumPy record array. Must have ‘sample’, ‘energy’ and ‘num_occurrences’ as fields.
+
record (numpy.recarray
) – A NumPy record array. Must have ‘sample’, ‘energy’ and ‘num_occurrences’ as fields.
The ‘sample’ field should be a 2D NumPy array where each row is a sample and each
column represents the value of a variable.
variables (iterable) – An iterable of variable labels, corresponding to columns in record.samples.
info (dict) – Information about the SampleSet
as a whole, formatted as a dict.
info (dict) – Information about the SampleSet
as a whole, formatted as a dict.
vartype (Vartype
/str/set) –
Variable type for the SampleSet
. Accepted input values:
Vartype.SPIN
, 'SPIN'
, {-1, 1}
inplace (bool, optional, default=True) – If True, the instantiated SampleSet
is updated; otherwise, a new
+
inplace (bool, optional, default=True) – If True, the instantiated SampleSet
is updated; otherwise, a new
SampleSet
is returned.
fields (list, optional, default=None) – If specified, only these fields are included in the yielded tuples. +
fields (list, optional, default=None) – If specified, only these fields are included in the yielded tuples. The special field name ‘sample’ can be used to view the samples.
sorted_by (str/None, optional, default='energy') – Selects the record field used to sort the samples. If None, the samples are yielded in record order.
name (str/None, optional, default='Sample') – Name of the yielded namedtuples or None to yield regular tuples.
reverse (bool, optional, default=False) – If True, yield in reverse order.
sample_dict_cast (bool, optional, default=True) – Samples are returned as dicts rather than +
reverse (bool, optional, default=False) – If True, yield in reverse order.
sample_dict_cast (bool, optional, default=True) – Samples are returned as dicts rather than
SampleView
, which requires heavy memory
usage. Set to False to reduce load on memory.
index (bool, optional, default=False) – If True, datum.idx gives the corresponding index of the +
index (bool, optional, default=False) – If True, datum.idx gives the corresponding index of the
SampleSet.record
.
dict
+Examples
@@ -1853,9 +1857,9 @@SampleSet.from_future()
.
Examples
-This example uses a Future
object directly. Typically
-a Executor
sets the result of the future
-(see documentation for concurrent.futures
).
This example uses a Future
object directly. Typically
+a Executor
sets the result of the future
+(see documentation for concurrent.futures
).
>>> from concurrent.futures import Future
...
>>> future = Future()
@@ -1878,17 +1882,20 @@ Attributes
-filter(pred: Callable[[Any], bool]) SampleSet #
+filter(pred: Callable[[Any], bool]) SampleSet #
Return a new sampleset with rows filtered by the given predicate.
- Parameters
-pred – A function that accepts a named tuple as returned by
-data()
and returns a bool
.
+pred (Callable[[Any], bool]) – A function that accepts a named tuple as returned by
+data()
and returns a bool
.
- Returns
A new sample set with only the data rows for which pred
returns
True
.
+- Return type
+SampleSet
+
Examples
>>> sampleset = dimod.SampleSet.from_samples(
@@ -1912,7 +1919,7 @@ Attributes
Raises
-ValueError – If empty.
+ValueError – If empty.
Example
@@ -1930,8 +1937,8 @@ Attributes
Parameters
-future (object) – Object that contains or will contain the information needed to construct a
-SampleSet
. If future has a done()
method,
+
future (object) – Object that contains or will contain the information needed to construct a
+SampleSet
. If future has a done()
method,
this determines the value returned by SampleSet.done()
.
result_hook (callable, optional) –
A function that is called to resolve the future. Must accept the future and return
a SampleSet
. If not provided, set to
@@ -1978,12 +1985,12 @@ AttributesSampleSet as a whole formatted as a dict.
+info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
num_occurrences (array_like, optional) – Number of occurrences for each sample. If not provided, defaults to a vector of 1s.
-aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
+
aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
with num_occurrences accounting for any duplicate samples in
samples_like.
-sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
+
sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
(unsortable) types, the given order is maintained.
**vectors (array_like) – Other per-sample data.
@@ -2016,12 +2023,12 @@ Attributesas_samples().
bqm (BinaryQuadraticModel
) – A binary quadratic model.
-info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
+info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
num_occurrences (array_like, optional) – Number of occurrences for each sample. If not provided, defaults to a vector of 1s.
-aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
+
aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
with num_occurrences accounting for any duplicate samples in
samples_like.
-sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
+
sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
(unsortable) types, the given order is maintained.
**vectors (array_like) – Other per-sample data.
@@ -2048,16 +2055,16 @@ Attributesas_samples().
cqm (ConstrainedQuadraticModel
) – A constrained quadratic model.
-rtol (float, optional, default=1e-6) – Relative tolerance for constraint violation.
+
rtol (float, optional, default=1e-6) – Relative tolerance for constraint violation.
See ConstrainedQuadraticModel.check_feasible()
for more information.
-atol (float, optional, default=1e-8) – Absolute tolerance for constraint violations.
+
atol (float, optional, default=1e-8) – Absolute tolerance for constraint violations.
See ConstrainedQuadraticModel.check_feasible()
for more information.
-info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
+info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
num_occurrences (array_like, optional) – Number of occurrences for each sample. If not provided, defaults to a vector of 1s.
-aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
+
aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
with num_occurrences accounting for any duplicate samples in
samples_like.
-sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
+
sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
(unsortable) types, the given order is maintained.
**vectors (array_like) – Other per-sample data.
@@ -2082,7 +2089,7 @@ AttributesSampleSet.
- Parameters
-obj (dict) – A SampleSet
serialized by to_serializable()
.
+obj (dict) – A SampleSet
serialized by to_serializable()
.
- Returns
SampleSet
@@ -2136,12 +2143,12 @@ Attributesnumpy.isclose() for additional details and caveats.
+See numpy.isclose()
for additional details and caveats.
- Parameters
-rtol (float, optional, default=1.e-5) – The relative tolerance (see above).
-atol (float, optional, default=1.e-8) – The absolute tolerance (see above).
+rtol (float, optional, default=1.e-5) – The relative tolerance (see above).
+atol (float, optional, default=1.e-8) – The absolute tolerance (see above).
- Returns
@@ -2183,7 +2190,7 @@ Attributes
-
property record#
-numpy.recarray
containing the samples, energies, number of occurences, and other sample data.
+numpy.recarray
containing the samples, energies, number of occurences, and other sample data.
Examples
>>> sampler = dimod.ExactSolver()
>>> sampleset = sampler.sample_ising({'a': -0.5, 'b': 1.0}, {('a', 'b'): -1.0})
@@ -2205,9 +2212,9 @@ Attributes
- Parameters
-mapping (dict) – Mapping from current variable labels to new, as a dict. If incomplete mapping is
+
mapping (dict) – Mapping from current variable labels to new, as a dict. If incomplete mapping is
specified, unmapped variables keep their current labels.
-inplace (bool, optional, default=True) – If True, the current SampleSet
is updated; otherwise, a new
+
inplace (bool, optional, default=True) – If True, the current SampleSet
is updated; otherwise, a new
SampleSet
is returned.
@@ -2245,7 +2252,7 @@ Attributes
- Parameters
-n (int, optional, default=None) – Maximum number of samples to return in the view.
+n (int, optional, default=None) – Maximum number of samples to return in the view.
sorted_by (str/None, optional, default='energy') – Selects the record field used to sort the samples. If None,
samples are returned in record order.
@@ -2294,9 +2301,9 @@ Attributes
- Parameters
-start (int, optional, default=None) – Start index for slice.
-stop (int) – Stop index for slice.
-step (int, optional, default=None) – Step value for slice.
+start (int, optional, default=None) – Start index for slice.
+stop (int) – Stop index for slice.
+step (int, optional, default=None) – Step value for slice.
sorted_by (str/None, optional, default='energy') – Selects the record field used to sort the samples before
slicing. Note that sorted_by determines the sample order in
the returned sample set.
@@ -2365,7 +2372,7 @@ Attributes
- Parameters
-sample_column (bool, optional, default=False) – If True, samples are
+
sample_column (bool, optional, default=False) – If True, samples are
represented as a column of type dict.
- Returns
@@ -2400,12 +2407,12 @@ Attributes
- Parameters
-use_bytes (bool, optional, default=False) – If True, a compact representation of the biases as bytes is used.
+use_bytes (bool, optional, default=False) – If True, a compact representation of the biases as bytes is used.
bytes_type (class, optional, default=bytes) – If use_bytes is True, this class is used to wrap the bytes
objects in the serialization. Useful for Python 2 using BSON
encoding, which does not accept the raw bytes type;
bson.Binary can be used instead.
-pack_samples (bool, optional, default=True) – Pack the samples using 1 bit per sample. Samples are never
+
pack_samples (bool, optional, default=True) – Pack the samples using 1 bit per sample. Samples are never
packed when SampleSet.vartype
is
~ExtendedVartype.DISCRETE.
@@ -2414,7 +2421,7 @@ AttributesObject that can be serialized.
- Return type
-dict
+-
Examples
@@ -2438,7 +2445,7 @@ Attributes
- Parameters
-n (int) – Maximum number of rows in the returned sample set. Does not return
+
n (int) – Maximum number of rows in the returned sample set. Does not return
any rows above this limit in the original sample set.
sorted_by (str/None, optional, default='energy') – Selects the record field used to sort the samples before
truncating. Note that this sort order is maintained in the
@@ -2491,7 +2498,7 @@
Attributes
-
-class openjij.SASampler(beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None)[source]#
+class openjij.SASampler(beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None)[source]#
-
@@ -837,12 +842,15 @@ Classes
-
-remove_unknown_kwargs(**kwargs) Dict[str, Any] #
+remove_unknown_kwargs(**kwargs) Dict[str, Any] #
Remove with warnings any keyword arguments not accepted by the sampler.
- Parameters
**kwargs – Keyword arguments to be validated.
+- Return type
+Dict[str, Any]
+
Returns: Updated kwargs dict.
Examples
@@ -861,26 +869,27 @@ Classes
-
-sample(bqm: Union[openjij.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None, num_reads: Optional[int] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response #
+sample(bqm: Union[openjij.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None, num_reads: Optional[int] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response #
Sampling from the Ising model
- Parameters
bqm (openjij.BinaryQuadraticModel) –
-beta (float, optional) – inverse tempareture.
-gamma (float, optional) – strangth of transverse field. Defaults to None.
-num_sweeps (int, optional) – number of sweeps. Defaults to None.
-schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
-trotter (int) – Trotter number.
-num_reads (int, optional) – number of sampling. Defaults to 1.
-initial_state (list[int], optional) – Initial state. Defaults to None.
-updater (str, optional) – update method. Defaults to ‘single spin flip’.
-reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
-seed (int, optional) – Sampling seed. Defaults to None.
+beta (float, optional) – inverse tempareture.
+gamma (float, optional) – strangth of transverse field. Defaults to None.
+num_sweeps (int, optional) – number of sweeps. Defaults to None.
+schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
+trotter (int) – Trotter number.
+num_reads (int, optional) – number of sampling. Defaults to 1.
+initial_state (list[int], optional) – Initial state. Defaults to None.
+updater (str, optional) – update method. Defaults to ‘single spin flip’.
+reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
+seed (int, optional) – Sampling seed. Defaults to None.
+sparse (Optional[bool]) –
- Raises
-ValueError –
+-
- Returns
results
@@ -912,17 +921,17 @@ Classes
- Parameters
-h (dict) – Linear term of the target Ising model.
-J (dict) – Quadratic term of the target Ising model.
-beta (float, optional) – inverse tempareture.
-gamma (float, optional) – strangth of transverse field. Defaults to None.
-num_sweeps (int, optional) – number of sweeps. Defaults to None.
-schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
-num_reads (int, optional) – number of sampling. Defaults to 1.
-initial_state (list[int], optional) – Initial state. Defaults to None.
-updater (str, optional) – update method. Defaults to ‘single spin flip’.
-reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
-seed (int, optional) – Sampling seed. Defaults to None.
+h (dict) – Linear term of the target Ising model.
+J (dict) – Quadratic term of the target Ising model.
+beta (float, optional) – inverse tempareture.
+gamma (float, optional) – strangth of transverse field. Defaults to None.
+num_sweeps (int, optional) – number of sweeps. Defaults to None.
+schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
+num_reads (int, optional) – number of sampling. Defaults to 1.
+initial_state (list[int], optional) – Initial state. Defaults to None.
+updater (str, optional) – update method. Defaults to ‘single spin flip’.
+reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
+seed (int, optional) – Sampling seed. Defaults to None.
- Returns
@@ -947,7 +956,7 @@ Classes
- Parameters
-Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
+Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
- Returns
results
@@ -962,8 +971,13 @@ Classes
property structure _Structure #
Structure of the structured sampler formatted as a
-namedtuple()
where the 3-tuple values are the
+namedtuple()
where the 3-tuple values are the
nodelist
, edgelist
and adjacency
attributes.
+
+- Return type
+_Structure
+
+
@@ -984,16 +998,19 @@ Classes
-
-valid_bqm_graph(bqm: dimod.BinaryQuadraticModel) bool #
+valid_bqm_graph(bqm: dimod.BinaryQuadraticModel) bool #
Validate that problem defined by dimod.BinaryQuadraticModel
matches the graph provided by the sampler.
- Parameters
-bqm – dimod.BinaryQuadraticModel
object to validate.
+bqm (dimod.BinaryQuadraticModel) – dimod.BinaryQuadraticModel
object to validate.
- Returns
Boolean indicating validity of BQM graph compared to sampler graph.
+- Return type
+-
+
diff --git a/www/reference/openjij/sampler/chimera_gpu/index.html b/www/reference/openjij/sampler/chimera_gpu/index.html
index 2dd1f79..b3fe8dc 100644
--- a/www/reference/openjij/sampler/chimera_gpu/index.html
+++ b/www/reference/openjij/sampler/chimera_gpu/index.html
@@ -950,21 +950,21 @@ Classes
- Parameters
-beta_min (float) – Minimum inverse temperature.
-beta_max (float) – Maximum inverse temperature.
-num_sweeps (int) – Length of Monte Carlo step.
-schedule_info (dict) – Information about a annealing schedule.
-num_reads (int) – Number of iterations.
-unit_num_L (int) – Length of one side of two-dimensional lattice in which chimera unit cells are arranged.
+beta_min (float) – Minimum inverse temperature.
+beta_max (float) – Maximum inverse temperature.
+num_sweeps (int) – Length of Monte Carlo step.
+schedule_info (dict) – Information about a annealing schedule.
+num_reads (int) – Number of iterations.
+unit_num_L (int) – Length of one side of two-dimensional lattice in which chimera unit cells are arranged.
- Raises
-ValueError – If variables violate as below.
+ValueError – If variables violate as below.
- trotter number is odd. –
- no input "unit_num_L" to an argument or this constructor. –
- given problem graph is incompatible with chimera graph. –
-AttributeError – If GPU doesn’t work.
+AttributeError – If GPU doesn’t work.
@@ -979,6 +979,11 @@ Classes
+- Return type
+Dict[dimod.typing.Variable, Set]
+
+
@@ -1003,12 +1008,15 @@ Classes
-
-remove_unknown_kwargs(**kwargs) Dict[str, Any] #
+remove_unknown_kwargs(**kwargs) Dict[str, Any] #
Remove with warnings any keyword arguments not accepted by the sampler.
- Parameters
**kwargs – Keyword arguments to be validated.
+- Return type
+Dict[str, Any]
+
Returns: Updated kwargs dict.
Examples
@@ -1027,21 +1035,22 @@ Classes
-
-sample(bqm: Union[openj.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response #
+sample(bqm: Union[openj.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response #
sample Ising model.
- Parameters
bqm (openjij.model.model.BinaryQuadraticModel) –
-beta_min (float) – minimal value of inverse temperature
-beta_max (float) – maximum value of inverse temperature
-num_sweeps (int) – number of sweeps
-num_reads (int) – number of reads
-schedule (list) – list of inverse temperature
-initial_state (dict) – initial state
-updater (str) – updater algorithm
-reinitialize_state (bool) – if true reinitialize state for each run
-seed (int) – seed for Monte Carlo algorithm
+beta_min (float) – minimal value of inverse temperature
+beta_max (float) – maximum value of inverse temperature
+num_sweeps (int) – number of sweeps
+num_reads (int) – number of reads
+schedule (list) – list of inverse temperature
+initial_state (dict) – initial state
+updater (str) – updater algorithm
+reinitialize_state (bool) – if true reinitialize state for each run
+seed (int) – seed for Monte Carlo algorithm
+sparse (Optional[bool]) –
- Returns
@@ -1069,21 +1078,23 @@ Classes
-
-sample_hubo(J: Union[dict, openj.model.model.BinaryPolynomialModel, cimod.BinaryPolynomialModel], vartype: Optional[str] = None, beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response #
+sample_hubo(J: Union[dict, openj.model.model.BinaryPolynomialModel, cimod.BinaryPolynomialModel], vartype: Optional[str] = None, beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response #
sampling from higher order unconstrainted binary optimization.
- Parameters
-J (dict) – Interactions.
-vartype (str, openjij.VarType) – “SPIN” or “BINARY”.
-beta_min (float, optional) – Minimum beta (initial inverse temperature). Defaults to None.
-beta_max (float, optional) – Maximum beta (final inverse temperature). Defaults to None.
-schedule (list, optional) – schedule list. Defaults to None.
-num_sweeps (int, optional) – number of sweeps. Defaults to None.
-num_reads (int, optional) – number of reads. Defaults to 1.
-init_state (list, optional) – initial state. Defaults to None.
-reinitialize_state (bool) – if true reinitialize state for each run
-seed (int, optional) – seed for Monte Carlo algorithm. Defaults to None.
+J (dict) – Interactions.
+vartype (str, openjij.VarType) – “SPIN” or “BINARY”.
+beta_min (float, optional) – Minimum beta (initial inverse temperature). Defaults to None.
+beta_max (float, optional) – Maximum beta (final inverse temperature). Defaults to None.
+schedule (list, optional) – schedule list. Defaults to None.
+num_sweeps (int, optional) – number of sweeps. Defaults to None.
+num_reads (int, optional) – number of reads. Defaults to 1.
+init_state (list, optional) – initial state. Defaults to None.
+reinitialize_state (bool) – if true reinitialize state for each run
+seed (int, optional) – seed for Monte Carlo algorithm. Defaults to None.
+
+updater (Optional[str]) –
- Returns
@@ -1119,18 +1130,18 @@ Classes
- Parameters
-h (dict) – linear biases
-J (dict) – quadratic biases
-beta_min (float) – minimal value of inverse temperature
-beta_max (float) – maximum value of inverse temperature
-num_sweeps (int) – number of sweeps
-num_reads (int) – number of reads
-schedule (list) – list of inverse temperature
-initial_state (dict) – initial state
-updater (str) – updater algorithm
-reinitialize_state (bool) – if true reinitialize state for each run
-seed (int) – seed for Monte Carlo algorithm
-unit_num_L (int) – number of chimera units
+h (dict) – linear biases
+J (dict) – quadratic biases
+beta_min (float) – minimal value of inverse temperature
+beta_max (float) – maximum value of inverse temperature
+num_sweeps (int) – number of sweeps
+num_reads (int) – number of reads
+schedule (list) – list of inverse temperature
+initial_state (dict) – initial state
+updater (str) – updater algorithm
+reinitialize_state (bool) – if true reinitialize state for each run
+seed (int) – seed for Monte Carlo algorithm
+unit_num_L (int) – number of chimera units
- Returns
@@ -1155,7 +1166,7 @@ Classes
- Parameters
-Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
+Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
- Returns
results
@@ -1170,8 +1181,13 @@ Classes
property structure _Structure #
Structure of the structured sampler formatted as a
-namedtuple()
where the 3-tuple values are the
+namedtuple()
where the 3-tuple values are the
nodelist
, edgelist
and adjacency
attributes.
+
+- Return type
+_Structure
+
+
@@ -1192,16 +1208,19 @@ Classes
-
-valid_bqm_graph(bqm: dimod.BinaryQuadraticModel) bool #
+valid_bqm_graph(bqm: dimod.BinaryQuadraticModel) bool #
Validate that problem defined by dimod.BinaryQuadraticModel
matches the graph provided by the sampler.
- Parameters
-bqm – dimod.BinaryQuadraticModel
object to validate.
+bqm (dimod.BinaryQuadraticModel) – dimod.BinaryQuadraticModel
object to validate.
- Returns
Boolean indicating validity of BQM graph compared to sampler graph.
+- Return type
+-
+
@@ -1222,22 +1241,22 @@ Classes
- Parameters
-beta (float) – Inverse temperature.
-gamma (float) – Amplitude of quantum fluctuation.
-trotter (int) – Trotter number.
-num_sweeps (int) – number of sweeps
-schedule_info (dict) – Information about a annealing schedule.
-num_reads (int) – Number of iterations.
-unit_num_L (int) – Length of one side of two-dimensional lattice in which chimera unit cells are arranged.
+beta (float) – Inverse temperature.
+gamma (float) – Amplitude of quantum fluctuation.
+trotter (int) – Trotter number.
+num_sweeps (int) – number of sweeps
+schedule_info (dict) – Information about a annealing schedule.
+num_reads (int) – Number of iterations.
+unit_num_L (int) – Length of one side of two-dimensional lattice in which chimera unit cells are arranged.
- Raises
-ValueError – If variables violate as below.
+ValueError – If variables violate as below.
- trotter number is odd. –
- no input "unit_num_L" to an argument or this constructor. –
- given problem graph is incompatible with chimera graph. –
-AttributeError – If GPU doesn’t work.
+AttributeError – If GPU doesn’t work.
@@ -1252,6 +1271,11 @@ Classes
+- Return type
+Dict[dimod.typing.Variable, Set]
+
+
@@ -1276,12 +1300,15 @@ Classes
-
-remove_unknown_kwargs(**kwargs) Dict[str, Any] #
+remove_unknown_kwargs(**kwargs) Dict[str, Any] #
Remove with warnings any keyword arguments not accepted by the sampler.
- Parameters
**kwargs – Keyword arguments to be validated.
+- Return type
+Dict[str, Any]
+
Returns: Updated kwargs dict.
Examples
@@ -1300,26 +1327,27 @@ Classes
-
-sample(bqm: Union[openjij.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None, num_reads: Optional[int] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response #
+sample(bqm: Union[openjij.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None, num_reads: Optional[int] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response #
Sampling from the Ising model
- Parameters
bqm (openjij.BinaryQuadraticModel) –
-beta (float, optional) – inverse tempareture.
-gamma (float, optional) – strangth of transverse field. Defaults to None.
-num_sweeps (int, optional) – number of sweeps. Defaults to None.
-schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
-trotter (int) – Trotter number.
-num_reads (int, optional) – number of sampling. Defaults to 1.
-initial_state (list[int], optional) – Initial state. Defaults to None.
-updater (str, optional) – update method. Defaults to ‘single spin flip’.
-reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
-seed (int, optional) – Sampling seed. Defaults to None.
+beta (float, optional) – inverse tempareture.
+gamma (float, optional) – strangth of transverse field. Defaults to None.
+num_sweeps (int, optional) – number of sweeps. Defaults to None.
+schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
+trotter (int) – Trotter number.
+num_reads (int, optional) – number of sampling. Defaults to 1.
+initial_state (list[int], optional) – Initial state. Defaults to None.
+updater (str, optional) – update method. Defaults to ‘single spin flip’.
+reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
+seed (int, optional) – Sampling seed. Defaults to None.
+sparse (Optional[bool]) –
- Raises
-ValueError –
+-
- Returns
results
@@ -1351,17 +1379,17 @@ Classes
- Parameters
-h (dict) – Linear term of the target Ising model.
-J (dict) – Quadratic term of the target Ising model.
-beta (float, optional) – inverse tempareture.
-gamma (float, optional) – strangth of transverse field. Defaults to None.
-num_sweeps (int, optional) – number of sweeps. Defaults to None.
-schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
-num_reads (int, optional) – number of sampling. Defaults to 1.
-initial_state (list[int], optional) – Initial state. Defaults to None.
-updater (str, optional) – update method. Defaults to ‘single spin flip’.
-reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
-seed (int, optional) – Sampling seed. Defaults to None.
+h (dict) – Linear term of the target Ising model.
+J (dict) – Quadratic term of the target Ising model.
+beta (float, optional) – inverse tempareture.
+gamma (float, optional) – strangth of transverse field. Defaults to None.
+num_sweeps (int, optional) – number of sweeps. Defaults to None.
+schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
+num_reads (int, optional) – number of sampling. Defaults to 1.
+initial_state (list[int], optional) – Initial state. Defaults to None.
+updater (str, optional) – update method. Defaults to ‘single spin flip’.
+reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
+seed (int, optional) – Sampling seed. Defaults to None.
- Returns
@@ -1386,7 +1414,7 @@ Classes
- Parameters
-Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
+Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
- Returns
results
@@ -1401,8 +1429,13 @@ Classes
property structure _Structure #
Structure of the structured sampler formatted as a
-namedtuple()
where the 3-tuple values are the
+namedtuple()
where the 3-tuple values are the
nodelist
, edgelist
and adjacency
attributes.
+
+- Return type
+_Structure
+
+
@@ -1423,16 +1456,19 @@ Classes
-
-valid_bqm_graph(bqm: dimod.BinaryQuadraticModel) bool #
+valid_bqm_graph(bqm: dimod.BinaryQuadraticModel) bool #
Validate that problem defined by dimod.BinaryQuadraticModel
matches the graph provided by the sampler.
- Parameters
-bqm – dimod.BinaryQuadraticModel
object to validate.
+bqm (dimod.BinaryQuadraticModel) – dimod.BinaryQuadraticModel
object to validate.
- Returns
Boolean indicating validity of BQM graph compared to sampler graph.
+- Return type
+-
+
diff --git a/www/reference/openjij/sampler/csqa_sampler/index.html b/www/reference/openjij/sampler/csqa_sampler/index.html
index 653ef3b..4fe09e0 100644
--- a/www/reference/openjij/sampler/csqa_sampler/index.html
+++ b/www/reference/openjij/sampler/csqa_sampler/index.html
@@ -723,13 +723,13 @@ Classes
- Parameters
-beta (float) – Inverse temperature.
-gamma (float) – Amplitude of quantum fluctuation.
-schedule (list) – schedule list
-step_num (int) – Number of Monte Carlo step.
-schedule_info (dict) – Information about a annealing schedule.
-num_reads (int) – Number of iterations.
-num_sweeps (int) – number of sweeps
+beta (float) – Inverse temperature.
+gamma (float) – Amplitude of quantum fluctuation.
+schedule (list) – schedule list
+step_num (int) – Number of Monte Carlo step.
+schedule_info (dict) – Information about a annealing schedule.
+num_reads (int) – Number of iterations.
+num_sweeps (int) – number of sweeps
schedule_info – Information about a annealing schedule.
@@ -749,12 +749,15 @@ Classes
-
-remove_unknown_kwargs(**kwargs) Dict[str, Any] #
+remove_unknown_kwargs(**kwargs) Dict[str, Any] #
Remove with warnings any keyword arguments not accepted by the sampler.
- Parameters
**kwargs – Keyword arguments to be validated.
+- Return type
+Dict[str, Any]
+
Returns: Updated kwargs dict.
Examples
@@ -773,26 +776,27 @@ Classes
-
-sample(bqm: Union[openjij.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None, num_reads: Optional[int] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response #
+sample(bqm: Union[openjij.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None, num_reads: Optional[int] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response #
Sampling from the Ising model
- Parameters
bqm (openjij.BinaryQuadraticModel) –
-beta (float, optional) – inverse tempareture.
-gamma (float, optional) – strangth of transverse field. Defaults to None.
-num_sweeps (int, optional) – number of sweeps. Defaults to None.
-schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
-trotter (int) – Trotter number.
-num_reads (int, optional) – number of sampling. Defaults to 1.
-initial_state (list[int], optional) – Initial state. Defaults to None.
-updater (str, optional) – update method. Defaults to ‘single spin flip’.
-reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
-seed (int, optional) – Sampling seed. Defaults to None.
+beta (float, optional) – inverse tempareture.
+gamma (float, optional) – strangth of transverse field. Defaults to None.
+num_sweeps (int, optional) – number of sweeps. Defaults to None.
+schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
+trotter (int) – Trotter number.
+num_reads (int, optional) – number of sampling. Defaults to 1.
+initial_state (list[int], optional) – Initial state. Defaults to None.
+updater (str, optional) – update method. Defaults to ‘single spin flip’.
+reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
+seed (int, optional) – Sampling seed. Defaults to None.
+sparse (Optional[bool]) –
- Raises
-ValueError –
+-
- Returns
results
@@ -824,17 +828,17 @@ Classes
- Parameters
-h (dict) – linear biases
-J (dict) – quadratic biases
-beta (float, optional) – inverse temperature
-gamma (float, optional) – strength of transverse field
-num_sweeps (int, optional) – number of sampling.
-schedule (list, optional) – schedule list
-num_reads (int, optional) – number of iterations
+h (dict) – linear biases
+J (dict) – quadratic biases
+beta (float, optional) – inverse temperature
+gamma (float, optional) – strength of transverse field
+num_sweeps (int, optional) – number of sampling.
+schedule (list, optional) – schedule list
+num_reads (int, optional) – number of iterations
initial_state (optional) – initial state of spins
-updater (str, optional) – updater algorithm
-reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
-seed (int, optional) – Sampling seed.
+updater (str, optional) – updater algorithm
+reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
+seed (int, optional) – Sampling seed.
- Returns
@@ -866,7 +870,7 @@ Classes
- Parameters
-Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
+Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
- Returns
results
diff --git a/www/reference/openjij/sampler/index.html b/www/reference/openjij/sampler/index.html
index fc46f20..9647735 100644
--- a/www/reference/openjij/sampler/index.html
+++ b/www/reference/openjij/sampler/index.html
@@ -1283,13 +1283,13 @@ Functions
- Parameters
-beta (float) – Inverse temperature.
-gamma (float) – Amplitude of quantum fluctuation.
-schedule (list) – schedule list
-step_num (int) – Number of Monte Carlo step.
-schedule_info (dict) – Information about a annealing schedule.
-num_reads (int) – Number of iterations.
-num_sweeps (int) – number of sweeps
+beta (float) – Inverse temperature.
+gamma (float) – Amplitude of quantum fluctuation.
+schedule (list) – schedule list
+step_num (int) – Number of Monte Carlo step.
+schedule_info (dict) – Information about a annealing schedule.
+num_reads (int) – Number of iterations.
+num_sweeps (int) – number of sweeps
schedule_info – Information about a annealing schedule.
@@ -1309,12 +1309,15 @@ Functions
-
-remove_unknown_kwargs(**kwargs) Dict[str, Any] #
+remove_unknown_kwargs(**kwargs) Dict[str, Any] #
Remove with warnings any keyword arguments not accepted by the sampler.
- Parameters
**kwargs – Keyword arguments to be validated.
+- Return type
+Dict[str, Any]
+
Returns: Updated kwargs dict.
Examples
@@ -1333,26 +1336,27 @@ Functions
-
-sample(bqm: Union[openjij.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None, num_reads: Optional[int] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response #
+sample(bqm: Union[openjij.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None, num_reads: Optional[int] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response #
Sampling from the Ising model
- Parameters
bqm (openjij.BinaryQuadraticModel) –
-beta (float, optional) – inverse tempareture.
-gamma (float, optional) – strangth of transverse field. Defaults to None.
-num_sweeps (int, optional) – number of sweeps. Defaults to None.
-schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
-trotter (int) – Trotter number.
-num_reads (int, optional) – number of sampling. Defaults to 1.
-initial_state (list[int], optional) – Initial state. Defaults to None.
-updater (str, optional) – update method. Defaults to ‘single spin flip’.
-reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
-seed (int, optional) – Sampling seed. Defaults to None.
+beta (float, optional) – inverse tempareture.
+gamma (float, optional) – strangth of transverse field. Defaults to None.
+num_sweeps (int, optional) – number of sweeps. Defaults to None.
+schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
+trotter (int) – Trotter number.
+num_reads (int, optional) – number of sampling. Defaults to 1.
+initial_state (list[int], optional) – Initial state. Defaults to None.
+updater (str, optional) – update method. Defaults to ‘single spin flip’.
+reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
+seed (int, optional) – Sampling seed. Defaults to None.
+sparse (Optional[bool]) –
- Raises
-ValueError –
+-
- Returns
results
@@ -1384,17 +1388,17 @@ Functions
- Parameters
-h (dict) – linear biases
-J (dict) – quadratic biases
-beta (float, optional) – inverse temperature
-gamma (float, optional) – strength of transverse field
-num_sweeps (int, optional) – number of sampling.
-schedule (list, optional) – schedule list
-num_reads (int, optional) – number of iterations
+h (dict) – linear biases
+J (dict) – quadratic biases
+beta (float, optional) – inverse temperature
+gamma (float, optional) – strength of transverse field
+num_sweeps (int, optional) – number of sampling.
+schedule (list, optional) – schedule list
+num_reads (int, optional) – number of iterations
initial_state (optional) – initial state of spins
-updater (str, optional) – updater algorithm
-reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
-seed (int, optional) – Sampling seed.
+updater (str, optional) – updater algorithm
+reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
+seed (int, optional) – Sampling seed.
- Returns
@@ -1426,7 +1430,7 @@ Functions
- Parameters
-Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
+Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
- Returns
results
@@ -1450,11 +1454,11 @@ Functions
- Parameters
-record (numpy.recarray
) – A NumPy record array. Must have ‘sample’, ‘energy’ and ‘num_occurrences’ as fields.
+
record (numpy.recarray
) – A NumPy record array. Must have ‘sample’, ‘energy’ and ‘num_occurrences’ as fields.
The ‘sample’ field should be a 2D NumPy array where each row is a sample and each
column represents the value of a variable.
variables (iterable) – An iterable of variable labels, corresponding to columns in record.samples.
-info (dict) – Information about the SampleSet
as a whole, formatted as a dict.
+info (dict) – Information about the SampleSet
as a whole, formatted as a dict.
vartype (Vartype
/str/set) –
Variable type for the SampleSet
. Accepted input values:
Vartype.SPIN
, 'SPIN'
, {-1, 1}
@@ -1531,7 +1535,7 @@ FunctionsSampleSet.record.
-inplace (bool, optional, default=True) – If True, the instantiated SampleSet
is updated; otherwise, a new
+
inplace (bool, optional, default=True) – If True, the instantiated SampleSet
is updated; otherwise, a new
SampleSet
is returned.
@@ -1570,16 +1574,16 @@ Functions
- Parameters
-fields (list, optional, default=None) – If specified, only these fields are included in the yielded tuples.
+
fields (list, optional, default=None) – If specified, only these fields are included in the yielded tuples.
The special field name ‘sample’ can be used to view the samples.
sorted_by (str/None, optional, default='energy') – Selects the record field used to sort the samples. If None, the samples are yielded
in record order.
name (str/None, optional, default='Sample') – Name of the yielded namedtuples or None to yield regular tuples.
-reverse (bool, optional, default=False) – If True, yield in reverse order.
-sample_dict_cast (bool, optional, default=True) – Samples are returned as dicts rather than
+
reverse (bool, optional, default=False) – If True, yield in reverse order.
+sample_dict_cast (bool, optional, default=True) – Samples are returned as dicts rather than
SampleView
, which requires heavy memory
usage. Set to False to reduce load on memory.
-index (bool, optional, default=False) – If True, datum.idx gives the corresponding index of the
+
index (bool, optional, default=False) – If True, datum.idx gives the corresponding index of the
SampleSet.record
.
@@ -1619,7 +1623,7 @@ FunctionsReturn type
-dict
+-
Examples
@@ -1644,9 +1648,9 @@ FunctionsSampleSet is constructed with SampleSet.from_future()
.
Examples
-This example uses a Future
object directly. Typically
-a Executor
sets the result of the future
-(see documentation for concurrent.futures
).
+This example uses a Future
object directly. Typically
+a Executor
sets the result of the future
+(see documentation for concurrent.futures
).
>>> from concurrent.futures import Future
...
>>> future = Future()
@@ -1669,17 +1673,20 @@ Functions
-
-filter(pred: Callable[[Any], bool]) SampleSet #
+filter(pred: Callable[[Any], bool]) SampleSet #
Return a new sampleset with rows filtered by the given predicate.
- Parameters
-pred – A function that accepts a named tuple as returned by
-data()
and returns a bool
.
+pred (Callable[[Any], bool]) – A function that accepts a named tuple as returned by
+data()
and returns a bool
.
- Returns
A new sample set with only the data rows for which pred
returns
True
.
+- Return type
+SampleSet
+
Examples
>>> sampleset = dimod.SampleSet.from_samples(
@@ -1703,7 +1710,7 @@ Functions
- Raises
-ValueError – If empty.
+ValueError – If empty.
Example
@@ -1721,8 +1728,8 @@ Functions
- Parameters
-future (object) – Object that contains or will contain the information needed to construct a
-SampleSet
. If future has a done()
method,
+
future (object) – Object that contains or will contain the information needed to construct a
+SampleSet
. If future has a done()
method,
this determines the value returned by SampleSet.done()
.
result_hook (callable, optional) –
A function that is called to resolve the future. Must accept the future and return
a SampleSet
. If not provided, set to
@@ -1769,12 +1776,12 @@ FunctionsSampleSet as a whole formatted as a dict.
+info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
num_occurrences (array_like, optional) – Number of occurrences for each sample. If not provided, defaults to a vector of 1s.
-aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
+
aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
with num_occurrences accounting for any duplicate samples in
samples_like.
-sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
+
sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
(unsortable) types, the given order is maintained.
**vectors (array_like) – Other per-sample data.
@@ -1807,12 +1814,12 @@ Functionsas_samples().
bqm (BinaryQuadraticModel
) – A binary quadratic model.
-info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
+info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
num_occurrences (array_like, optional) – Number of occurrences for each sample. If not provided, defaults to a vector of 1s.
-aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
+
aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
with num_occurrences accounting for any duplicate samples in
samples_like.
-sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
+
sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
(unsortable) types, the given order is maintained.
**vectors (array_like) – Other per-sample data.
@@ -1839,16 +1846,16 @@ Functionsas_samples().
cqm (ConstrainedQuadraticModel
) – A constrained quadratic model.
-rtol (float, optional, default=1e-6) – Relative tolerance for constraint violation.
+
rtol (float, optional, default=1e-6) – Relative tolerance for constraint violation.
See ConstrainedQuadraticModel.check_feasible()
for more information.
-atol (float, optional, default=1e-8) – Absolute tolerance for constraint violations.
+
atol (float, optional, default=1e-8) – Absolute tolerance for constraint violations.
See ConstrainedQuadraticModel.check_feasible()
for more information.
-info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
+info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
num_occurrences (array_like, optional) – Number of occurrences for each sample. If not provided, defaults to a vector of 1s.
-aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
+
aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
with num_occurrences accounting for any duplicate samples in
samples_like.
-sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
+
sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
(unsortable) types, the given order is maintained.
**vectors (array_like) – Other per-sample data.
@@ -1873,7 +1880,7 @@ FunctionsSampleSet.
- Parameters
-obj (dict) – A SampleSet
serialized by to_serializable()
.
+obj (dict) – A SampleSet
serialized by to_serializable()
.
- Returns
SampleSet
@@ -1927,12 +1934,12 @@ Functionsnumpy.isclose() for additional details and caveats.
+See numpy.isclose()
for additional details and caveats.
- Parameters
-rtol (float, optional, default=1.e-5) – The relative tolerance (see above).
-atol (float, optional, default=1.e-8) – The absolute tolerance (see above).
+rtol (float, optional, default=1.e-5) – The relative tolerance (see above).
+atol (float, optional, default=1.e-8) – The absolute tolerance (see above).
- Returns
@@ -1974,7 +1981,7 @@ Functions
-
property record#
-numpy.recarray
containing the samples, energies, number of occurences, and other sample data.
+numpy.recarray
containing the samples, energies, number of occurences, and other sample data.
Examples
>>> sampler = dimod.ExactSolver()
>>> sampleset = sampler.sample_ising({'a': -0.5, 'b': 1.0}, {('a', 'b'): -1.0})
@@ -1996,9 +2003,9 @@ Functions
- Parameters
-mapping (dict) – Mapping from current variable labels to new, as a dict. If incomplete mapping is
+
mapping (dict) – Mapping from current variable labels to new, as a dict. If incomplete mapping is
specified, unmapped variables keep their current labels.
-inplace (bool, optional, default=True) – If True, the current SampleSet
is updated; otherwise, a new
+
inplace (bool, optional, default=True) – If True, the current SampleSet
is updated; otherwise, a new
SampleSet
is returned.
@@ -2036,7 +2043,7 @@ Functions
- Parameters
-n (int, optional, default=None) – Maximum number of samples to return in the view.
+n (int, optional, default=None) – Maximum number of samples to return in the view.
sorted_by (str/None, optional, default='energy') – Selects the record field used to sort the samples. If None,
samples are returned in record order.
@@ -2085,9 +2092,9 @@ Functions
- Parameters
-start (int, optional, default=None) – Start index for slice.
-stop (int) – Stop index for slice.
-step (int, optional, default=None) – Step value for slice.
+start (int, optional, default=None) – Start index for slice.
+stop (int) – Stop index for slice.
+step (int, optional, default=None) – Step value for slice.
sorted_by (str/None, optional, default='energy') – Selects the record field used to sort the samples before
slicing. Note that sorted_by determines the sample order in
the returned sample set.
@@ -2156,7 +2163,7 @@ Functions
- Parameters
-sample_column (bool, optional, default=False) – If True, samples are
+
sample_column (bool, optional, default=False) – If True, samples are
represented as a column of type dict.
- Returns
@@ -2191,12 +2198,12 @@ Functions
- Parameters
-use_bytes (bool, optional, default=False) – If True, a compact representation of the biases as bytes is used.
+use_bytes (bool, optional, default=False) – If True, a compact representation of the biases as bytes is used.
bytes_type (class, optional, default=bytes) – If use_bytes is True, this class is used to wrap the bytes
objects in the serialization. Useful for Python 2 using BSON
encoding, which does not accept the raw bytes type;
bson.Binary can be used instead.
-pack_samples (bool, optional, default=True) – Pack the samples using 1 bit per sample. Samples are never
+
pack_samples (bool, optional, default=True) – Pack the samples using 1 bit per sample. Samples are never
packed when SampleSet.vartype
is
~ExtendedVartype.DISCRETE.
@@ -2205,7 +2212,7 @@ FunctionsObject that can be serialized.
- Return type
-dict
+-
Examples
@@ -2229,7 +2236,7 @@ Functions
- Parameters
-n (int) – Maximum number of rows in the returned sample set. Does not return
+
n (int) – Maximum number of rows in the returned sample set. Does not return
any rows above this limit in the original sample set.
sorted_by (str/None, optional, default='energy') – Selects the record field used to sort the samples before
truncating. Note that this sort order is maintained in the
@@ -2282,7 +2289,7 @@
Functions
-
-class openjij.sampler.SASampler(beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None)[source]#
+class openjij.sampler.SASampler(beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None)[source]#
Bases: openjij.sampler.sampler.BaseSampler
@@ -2292,20 +2299,21 @@ Functions
- Parameters
-beta_min (float) – Minmum beta (inverse temperature).
+
beta_min (float) – Minmum beta (inverse temperature).
You can overwrite in methods .sample_*.
-beta_max (float) – Maximum beta (inverse temperature).
+
beta_max (float) – Maximum beta (inverse temperature).
You can overwrite in methods .sample_*.
-num_reads (int) – number of sampling (algorithm) runs. defaults None.
+
num_reads (int) – number of sampling (algorithm) runs. defaults None.
You can overwrite in methods .sample_*.
-num_sweeps (int) – number of MonteCarlo steps during SA. defaults None.
+
num_sweeps (int) – number of MonteCarlo steps during SA. defaults None.
You can overwrite in methods .sample_*.
-schedule_info (dict) – Information about an annealing schedule.
+schedule_info (dict) – Information about an annealing schedule.
+schedule (Optional[list]) –
- Raises
-ValueError – If schedules or variables violate as below.
+ValueError – If schedules or variables violate as below.
- not list or numpy.array. –
- not list of tuple (beta – float, step_length : int).
- beta is less than zero. –
@@ -2327,12 +2335,15 @@ Functions
-
-remove_unknown_kwargs(**kwargs) Dict[str, Any] #
+remove_unknown_kwargs(**kwargs) Dict[str, Any] #
Remove with warnings any keyword arguments not accepted by the sampler.
- Parameters
**kwargs – Keyword arguments to be validated.
+- Return type
+Dict[str, Any]
+
Returns: Updated kwargs dict.
Examples
@@ -2351,21 +2362,22 @@ Functions
-
-sample(bqm: Union[openj.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response [source]#
+sample(bqm: Union[openj.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response [source]#
sample Ising model.
- Parameters
bqm (openjij.model.model.BinaryQuadraticModel) –
-beta_min (float) – minimal value of inverse temperature
-beta_max (float) – maximum value of inverse temperature
-num_sweeps (int) – number of sweeps
-num_reads (int) – number of reads
-schedule (list) – list of inverse temperature
-initial_state (dict) – initial state
-updater (str) – updater algorithm
-reinitialize_state (bool) – if true reinitialize state for each run
-seed (int) – seed for Monte Carlo algorithm
+beta_min (float) – minimal value of inverse temperature
+beta_max (float) – maximum value of inverse temperature
+num_sweeps (int) – number of sweeps
+num_reads (int) – number of reads
+schedule (list) – list of inverse temperature
+initial_state (dict) – initial state
+updater (str) – updater algorithm
+reinitialize_state (bool) – if true reinitialize state for each run
+seed (int) – seed for Monte Carlo algorithm
+sparse (Optional[bool]) –
- Returns
@@ -2393,21 +2405,23 @@ Functions
-
-sample_hubo(J: Union[dict, openj.model.model.BinaryPolynomialModel, cimod.BinaryPolynomialModel], vartype: Optional[str] = None, beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response [source]#
+sample_hubo(J: Union[dict, openj.model.model.BinaryPolynomialModel, cimod.BinaryPolynomialModel], vartype: Optional[str] = None, beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response [source]#
sampling from higher order unconstrainted binary optimization.
- Parameters
-J (dict) – Interactions.
-vartype (str, openjij.VarType) – “SPIN” or “BINARY”.
-beta_min (float, optional) – Minimum beta (initial inverse temperature). Defaults to None.
-beta_max (float, optional) – Maximum beta (final inverse temperature). Defaults to None.
-schedule (list, optional) – schedule list. Defaults to None.
-num_sweeps (int, optional) – number of sweeps. Defaults to None.
-num_reads (int, optional) – number of reads. Defaults to 1.
-init_state (list, optional) – initial state. Defaults to None.
-reinitialize_state (bool) – if true reinitialize state for each run
-seed (int, optional) – seed for Monte Carlo algorithm. Defaults to None.
+J (dict) – Interactions.
+vartype (str, openjij.VarType) – “SPIN” or “BINARY”.
+beta_min (float, optional) – Minimum beta (initial inverse temperature). Defaults to None.
+beta_max (float, optional) – Maximum beta (final inverse temperature). Defaults to None.
+schedule (list, optional) – schedule list. Defaults to None.
+num_sweeps (int, optional) – number of sweeps. Defaults to None.
+num_reads (int, optional) – number of reads. Defaults to 1.
+init_state (list, optional) – initial state. Defaults to None.
+reinitialize_state (bool) – if true reinitialize state for each run
+seed (int, optional) – seed for Monte Carlo algorithm. Defaults to None.
+
+updater (Optional[str]) –
- Returns
@@ -2443,8 +2457,8 @@ Functions
- Parameters
-
- Returns
@@ -2462,7 +2476,7 @@ Functions
- Parameters
-Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
+Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
- Returns
results
@@ -2477,7 +2491,7 @@ Functions
-
-class openjij.sampler.SQASampler(beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None)[source]#
+class openjij.sampler.SQASampler(beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None)[source]#
Bases: openjij.sampler.sampler.BaseSampler
@@ -2491,18 +2505,18 @@ Functions
- Parameters
-beta (float) – Inverse temperature.
-gamma (float) – Amplitude of quantum fluctuation.
-trotter (int) – Trotter number.
-num_sweeps (int) – number of sweeps
-schedule (list) – schedule list
-num_reads (int) – Number of iterations.
-schedule_info (dict) – Information about a annealing schedule.
+beta (float) – Inverse temperature.
+gamma (float) – Amplitude of quantum fluctuation.
+trotter (int) – Trotter number.
+num_sweeps (int) – number of sweeps
+schedule (list) – schedule list
+num_reads (int) – Number of iterations.
+schedule_info (dict) – Information about a annealing schedule.
- Raises
-ValueError – If the schedule violates as below.
+ValueError – If the schedule violates as below.
- not list or numpy.array. –
- schedule range is '0 <= s <= 1'. –
@@ -2523,12 +2537,15 @@ Functions
-
-remove_unknown_kwargs(**kwargs) Dict[str, Any] #
+remove_unknown_kwargs(**kwargs) Dict[str, Any] #
Remove with warnings any keyword arguments not accepted by the sampler.
- Parameters
**kwargs – Keyword arguments to be validated.
+- Return type
+Dict[str, Any]
+
Returns: Updated kwargs dict.
Examples
@@ -2547,26 +2564,27 @@ Functions
-
-sample(bqm: Union[openjij.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None, num_reads: Optional[int] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response [source]#
+sample(bqm: Union[openjij.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None, num_reads: Optional[int] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response [source]#
Sampling from the Ising model
- Parameters
bqm (openjij.BinaryQuadraticModel) –
-beta (float, optional) – inverse tempareture.
-gamma (float, optional) – strangth of transverse field. Defaults to None.
-num_sweeps (int, optional) – number of sweeps. Defaults to None.
-schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
-trotter (int) – Trotter number.
-num_reads (int, optional) – number of sampling. Defaults to 1.
-initial_state (list[int], optional) – Initial state. Defaults to None.
-updater (str, optional) – update method. Defaults to ‘single spin flip’.
-reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
-seed (int, optional) – Sampling seed. Defaults to None.
+beta (float, optional) – inverse tempareture.
+gamma (float, optional) – strangth of transverse field. Defaults to None.
+num_sweeps (int, optional) – number of sweeps. Defaults to None.
+schedule (list[list[float, int]], optional) – List of annealing parameter. Defaults to None.
+trotter (int) – Trotter number.
+num_reads (int, optional) – number of sampling. Defaults to 1.
+initial_state (list[int], optional) – Initial state. Defaults to None.
+updater (str, optional) – update method. Defaults to ‘single spin flip’.
+reinitialize_state (bool, optional) – Re-initilization at each sampling. Defaults to True.
+seed (int, optional) – Sampling seed. Defaults to None.
+sparse (Optional[bool]) –
- Raises
-ValueError –
+-
- Returns
results
@@ -2598,8 +2616,8 @@ Functions
- Parameters
-
- Returns
@@ -2617,7 +2635,7 @@ Functions
- Parameters
-Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
+Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
- Returns
results
diff --git a/www/reference/openjij/sampler/response/index.html b/www/reference/openjij/sampler/response/index.html
index 35f06d3..b8cda2f 100644
--- a/www/reference/openjij/sampler/response/index.html
+++ b/www/reference/openjij/sampler/response/index.html
@@ -963,11 +963,11 @@ Classes
- Parameters
-record (numpy.recarray
) – A NumPy record array. Must have ‘sample’, ‘energy’ and ‘num_occurrences’ as fields.
+
record (numpy.recarray
) – A NumPy record array. Must have ‘sample’, ‘energy’ and ‘num_occurrences’ as fields.
The ‘sample’ field should be a 2D NumPy array where each row is a sample and each
column represents the value of a variable.
variables (iterable) – An iterable of variable labels, corresponding to columns in record.samples.
-info (dict) – Information about the SampleSet
as a whole, formatted as a dict.
+info (dict) – Information about the SampleSet
as a whole, formatted as a dict.
vartype (Vartype
/str/set) –
Variable type for the SampleSet
. Accepted input values:
Vartype.SPIN
, 'SPIN'
, {-1, 1}
@@ -1044,7 +1044,7 @@ ClassesSampleSet.record.
-inplace (bool, optional, default=True) – If True, the instantiated SampleSet
is updated; otherwise, a new
+
inplace (bool, optional, default=True) – If True, the instantiated SampleSet
is updated; otherwise, a new
SampleSet
is returned.
@@ -1083,16 +1083,16 @@ Classes
- Parameters
-fields (list, optional, default=None) – If specified, only these fields are included in the yielded tuples.
+
fields (list, optional, default=None) – If specified, only these fields are included in the yielded tuples.
The special field name ‘sample’ can be used to view the samples.
sorted_by (str/None, optional, default='energy') – Selects the record field used to sort the samples. If None, the samples are yielded
in record order.
name (str/None, optional, default='Sample') – Name of the yielded namedtuples or None to yield regular tuples.
-reverse (bool, optional, default=False) – If True, yield in reverse order.
-sample_dict_cast (bool, optional, default=True) – Samples are returned as dicts rather than
+
reverse (bool, optional, default=False) – If True, yield in reverse order.
+sample_dict_cast (bool, optional, default=True) – Samples are returned as dicts rather than
SampleView
, which requires heavy memory
usage. Set to False to reduce load on memory.
-index (bool, optional, default=False) – If True, datum.idx gives the corresponding index of the
+
index (bool, optional, default=False) – If True, datum.idx gives the corresponding index of the
SampleSet.record
.
@@ -1132,7 +1132,7 @@ ClassesReturn type
-dict
+-
Examples
@@ -1157,9 +1157,9 @@ ClassesSampleSet is constructed with SampleSet.from_future()
.
Examples
-This example uses a Future
object directly. Typically
-a Executor
sets the result of the future
-(see documentation for concurrent.futures
).
+This example uses a Future
object directly. Typically
+a Executor
sets the result of the future
+(see documentation for concurrent.futures
).
>>> from concurrent.futures import Future
...
>>> future = Future()
@@ -1182,17 +1182,20 @@ Classes
-
-filter(pred: Callable[[Any], bool]) SampleSet #
+filter(pred: Callable[[Any], bool]) SampleSet #
Return a new sampleset with rows filtered by the given predicate.
- Parameters
-pred – A function that accepts a named tuple as returned by
-data()
and returns a bool
.
+pred (Callable[[Any], bool]) – A function that accepts a named tuple as returned by
+data()
and returns a bool
.
- Returns
A new sample set with only the data rows for which pred
returns
True
.
+- Return type
+SampleSet
+
Examples
>>> sampleset = dimod.SampleSet.from_samples(
@@ -1216,7 +1219,7 @@ Classes
- Raises
-ValueError – If empty.
+ValueError – If empty.
Example
@@ -1234,8 +1237,8 @@ Classes
- Parameters
-future (object) – Object that contains or will contain the information needed to construct a
-SampleSet
. If future has a done()
method,
+
future (object) – Object that contains or will contain the information needed to construct a
+SampleSet
. If future has a done()
method,
this determines the value returned by SampleSet.done()
.
result_hook (callable, optional) –
A function that is called to resolve the future. Must accept the future and return
a SampleSet
. If not provided, set to
@@ -1282,12 +1285,12 @@ ClassesSampleSet as a whole formatted as a dict.
+info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
num_occurrences (array_like, optional) – Number of occurrences for each sample. If not provided, defaults to a vector of 1s.
-aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
+
aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
with num_occurrences accounting for any duplicate samples in
samples_like.
-sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
+
sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
(unsortable) types, the given order is maintained.
**vectors (array_like) – Other per-sample data.
@@ -1320,12 +1323,12 @@ Classesas_samples().
bqm (BinaryQuadraticModel
) – A binary quadratic model.
-info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
+info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
num_occurrences (array_like, optional) – Number of occurrences for each sample. If not provided, defaults to a vector of 1s.
-aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
+
aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
with num_occurrences accounting for any duplicate samples in
samples_like.
-sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
+
sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
(unsortable) types, the given order is maintained.
**vectors (array_like) – Other per-sample data.
@@ -1352,16 +1355,16 @@ Classesas_samples().
cqm (ConstrainedQuadraticModel
) – A constrained quadratic model.
-rtol (float, optional, default=1e-6) – Relative tolerance for constraint violation.
+
rtol (float, optional, default=1e-6) – Relative tolerance for constraint violation.
See ConstrainedQuadraticModel.check_feasible()
for more information.
-atol (float, optional, default=1e-8) – Absolute tolerance for constraint violations.
+
atol (float, optional, default=1e-8) – Absolute tolerance for constraint violations.
See ConstrainedQuadraticModel.check_feasible()
for more information.
-info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
+info (dict, optional) – Information about the SampleSet
as a whole formatted as a dict.
num_occurrences (array_like, optional) – Number of occurrences for each sample. If not provided, defaults to a vector of 1s.
-aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
+
aggregate_samples (bool, optional, default=False) – If True, all samples in returned SampleSet
are unique,
with num_occurrences accounting for any duplicate samples in
samples_like.
-sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
+
sort_labels (bool, optional, default=True) – Return SampleSet.variables
in sorted order. For mixed
(unsortable) types, the given order is maintained.
**vectors (array_like) – Other per-sample data.
@@ -1386,7 +1389,7 @@ ClassesSampleSet.
- Parameters
-obj (dict) – A SampleSet
serialized by to_serializable()
.
+obj (dict) – A SampleSet
serialized by to_serializable()
.
- Returns
SampleSet
@@ -1440,12 +1443,12 @@ Classesnumpy.isclose() for additional details and caveats.
+See numpy.isclose()
for additional details and caveats.
- Parameters
-rtol (float, optional, default=1.e-5) – The relative tolerance (see above).
-atol (float, optional, default=1.e-8) – The absolute tolerance (see above).
+rtol (float, optional, default=1.e-5) – The relative tolerance (see above).
+atol (float, optional, default=1.e-8) – The absolute tolerance (see above).
- Returns
@@ -1487,7 +1490,7 @@ Classes
-
property record#
-numpy.recarray
containing the samples, energies, number of occurences, and other sample data.
+numpy.recarray
containing the samples, energies, number of occurences, and other sample data.
Examples
>>> sampler = dimod.ExactSolver()
>>> sampleset = sampler.sample_ising({'a': -0.5, 'b': 1.0}, {('a', 'b'): -1.0})
@@ -1509,9 +1512,9 @@ Classes
- Parameters
-mapping (dict) – Mapping from current variable labels to new, as a dict. If incomplete mapping is
+
mapping (dict) – Mapping from current variable labels to new, as a dict. If incomplete mapping is
specified, unmapped variables keep their current labels.
-inplace (bool, optional, default=True) – If True, the current SampleSet
is updated; otherwise, a new
+
inplace (bool, optional, default=True) – If True, the current SampleSet
is updated; otherwise, a new
SampleSet
is returned.
@@ -1549,7 +1552,7 @@ Classes
- Parameters
-n (int, optional, default=None) – Maximum number of samples to return in the view.
+n (int, optional, default=None) – Maximum number of samples to return in the view.
sorted_by (str/None, optional, default='energy') – Selects the record field used to sort the samples. If None,
samples are returned in record order.
@@ -1598,9 +1601,9 @@ Classes
- Parameters
-start (int, optional, default=None) – Start index for slice.
-stop (int) – Stop index for slice.
-step (int, optional, default=None) – Step value for slice.
+start (int, optional, default=None) – Start index for slice.
+stop (int) – Stop index for slice.
+step (int, optional, default=None) – Step value for slice.
sorted_by (str/None, optional, default='energy') – Selects the record field used to sort the samples before
slicing. Note that sorted_by determines the sample order in
the returned sample set.
@@ -1669,7 +1672,7 @@ Classes
- Parameters
-sample_column (bool, optional, default=False) – If True, samples are
+
sample_column (bool, optional, default=False) – If True, samples are
represented as a column of type dict.
- Returns
@@ -1704,12 +1707,12 @@ Classes
- Parameters
-use_bytes (bool, optional, default=False) – If True, a compact representation of the biases as bytes is used.
+use_bytes (bool, optional, default=False) – If True, a compact representation of the biases as bytes is used.
bytes_type (class, optional, default=bytes) – If use_bytes is True, this class is used to wrap the bytes
objects in the serialization. Useful for Python 2 using BSON
encoding, which does not accept the raw bytes type;
bson.Binary can be used instead.
-pack_samples (bool, optional, default=True) – Pack the samples using 1 bit per sample. Samples are never
+
pack_samples (bool, optional, default=True) – Pack the samples using 1 bit per sample. Samples are never
packed when SampleSet.vartype
is
~ExtendedVartype.DISCRETE.
@@ -1718,7 +1721,7 @@ ClassesObject that can be serialized.
- Return type
-dict
+-
Examples
@@ -1742,7 +1745,7 @@ Classes
- Parameters
-n (int) – Maximum number of rows in the returned sample set. Does not return
+
n (int) – Maximum number of rows in the returned sample set. Does not return
any rows above this limit in the original sample set.
sorted_by (str/None, optional, default='energy') – Selects the record field used to sort the samples before
truncating. Note that this sort order is maintained in the
diff --git a/www/reference/openjij/sampler/sa_sampler/index.html b/www/reference/openjij/sampler/sa_sampler/index.html
index 4979d7a..d41ee66 100644
--- a/www/reference/openjij/sampler/sa_sampler/index.html
+++ b/www/reference/openjij/sampler/sa_sampler/index.html
@@ -767,7 +767,7 @@
Functions
-
-class openjij.sampler.sa_sampler.SASampler(beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None)[source]#
+class openjij.sampler.sa_sampler.SASampler(beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None)[source]#
Bases: openjij.sampler.sampler.BaseSampler
@@ -777,20 +777,21 @@ Functions
- Parameters
-beta_min (float) – Minmum beta (inverse temperature).
+
beta_min (float) – Minmum beta (inverse temperature).
You can overwrite in methods .sample_*.
-beta_max (float) – Maximum beta (inverse temperature).
+
beta_max (float) – Maximum beta (inverse temperature).
You can overwrite in methods .sample_*.
-num_reads (int) – number of sampling (algorithm) runs. defaults None.
+
num_reads (int) – number of sampling (algorithm) runs. defaults None.
You can overwrite in methods .sample_*.
-num_sweeps (int) – number of MonteCarlo steps during SA. defaults None.
+
num_sweeps (int) – number of MonteCarlo steps during SA. defaults None.
You can overwrite in methods .sample_*.
-schedule_info (dict) – Information about an annealing schedule.
+schedule_info (dict) – Information about an annealing schedule.
+schedule (Optional[list]) –
- Raises
-ValueError – If schedules or variables violate as below.
+ValueError – If schedules or variables violate as below.
- not list or numpy.array. –
- not list of tuple (beta – float, step_length : int).
- beta is less than zero. –
@@ -812,12 +813,15 @@ Functions
-
-remove_unknown_kwargs(**kwargs) Dict[str, Any] #
+remove_unknown_kwargs(**kwargs) Dict[str, Any] #
Remove with warnings any keyword arguments not accepted by the sampler.
- Parameters
**kwargs – Keyword arguments to be validated.
+- Return type
+Dict[str, Any]
+
Returns: Updated kwargs dict.
Examples
@@ -836,21 +840,22 @@ Functions
-
-sample(bqm: Union[openj.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response [source]#
+sample(bqm: Union[openj.model.model.BinaryQuadraticModel, dimod.BinaryQuadraticModel], beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, sparse: Optional[bool] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response [source]#
sample Ising model.
- Parameters
bqm (openjij.model.model.BinaryQuadraticModel) –
-beta_min (float) – minimal value of inverse temperature
-beta_max (float) – maximum value of inverse temperature
-num_sweeps (int) – number of sweeps
-num_reads (int) – number of reads
-schedule (list) – list of inverse temperature
-initial_state (dict) – initial state
-updater (str) – updater algorithm
-reinitialize_state (bool) – if true reinitialize state for each run
-seed (int) – seed for Monte Carlo algorithm
+beta_min (float) – minimal value of inverse temperature
+beta_max (float) – maximum value of inverse temperature
+num_sweeps (int) – number of sweeps
+num_reads (int) – number of reads
+schedule (list) – list of inverse temperature
+initial_state (dict) – initial state
+updater (str) – updater algorithm
+reinitialize_state (bool) – if true reinitialize state for each run
+seed (int) – seed for Monte Carlo algorithm
+sparse (Optional[bool]) –
- Returns
@@ -878,21 +883,23 @@ Functions
-
-sample_hubo(J: Union[dict, openj.model.model.BinaryPolynomialModel, cimod.BinaryPolynomialModel], vartype: Optional[str] = None, beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response [source]#
+sample_hubo(J: Union[dict, openj.model.model.BinaryPolynomialModel, cimod.BinaryPolynomialModel], vartype: Optional[str] = None, beta_min: Optional[float] = None, beta_max: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, initial_state: Optional[Union[list, dict]] = None, updater: Optional[str] = None, reinitialize_state: Optional[bool] = None, seed: Optional[int] = None) openjij.sampler.response.Response [source]#
sampling from higher order unconstrainted binary optimization.
- Parameters
-J (dict) – Interactions.
-vartype (str, openjij.VarType) – “SPIN” or “BINARY”.
-beta_min (float, optional) – Minimum beta (initial inverse temperature). Defaults to None.
-beta_max (float, optional) – Maximum beta (final inverse temperature). Defaults to None.
-schedule (list, optional) – schedule list. Defaults to None.
-num_sweeps (int, optional) – number of sweeps. Defaults to None.
-num_reads (int, optional) – number of reads. Defaults to 1.
-init_state (list, optional) – initial state. Defaults to None.
-reinitialize_state (bool) – if true reinitialize state for each run
-seed (int, optional) – seed for Monte Carlo algorithm. Defaults to None.
+J (dict) – Interactions.
+vartype (str, openjij.VarType) – “SPIN” or “BINARY”.
+beta_min (float, optional) – Minimum beta (initial inverse temperature). Defaults to None.
+beta_max (float, optional) – Maximum beta (final inverse temperature). Defaults to None.
+schedule (list, optional) – schedule list. Defaults to None.
+num_sweeps (int, optional) – number of sweeps. Defaults to None.
+num_reads (int, optional) – number of reads. Defaults to 1.
+init_state (list, optional) – initial state. Defaults to None.
+reinitialize_state (bool) – if true reinitialize state for each run
+seed (int, optional) – seed for Monte Carlo algorithm. Defaults to None.
+
+updater (Optional[str]) –
- Returns
@@ -928,8 +935,8 @@ Functions
- Parameters
-
- Returns
@@ -947,7 +954,7 @@ Functions
- Parameters
-Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
+Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
- Returns
results
@@ -973,9 +980,9 @@ FunctionsParameters
model (openjij.model.BinaryQuadraticModel) –
-beta_max (float, optional) – [description]. Defaults to None.
-beta_min (float, optional) – [description]. Defaults to None.
-num_sweeps (int, optional) – [description]. Defaults to 1000.
+beta_max (float, optional) – [description]. Defaults to None.
+beta_min (float, optional) – [description]. Defaults to None.
+num_sweeps (int, optional) – [description]. Defaults to 1000.
- Returns
diff --git a/www/reference/openjij/sampler/sampler/index.html b/www/reference/openjij/sampler/sampler/index.html
index 361a343..5b02d1e 100644
--- a/www/reference/openjij/sampler/sampler/index.html
+++ b/www/reference/openjij/sampler/sampler/index.html
@@ -763,12 +763,15 @@ Functions
-
-remove_unknown_kwargs(**kwargs) Dict[str, Any] #
+remove_unknown_kwargs(**kwargs) Dict[str, Any] #
Remove with warnings any keyword arguments not accepted by the sampler.
- Parameters
**kwargs – Keyword arguments to be validated.
+- Return type
+Dict[str, Any]
+
Returns: Updated kwargs dict.
Examples
@@ -809,8 +812,8 @@ Functions
- Parameters
-
- Returns
@@ -828,7 +831,7 @@ Functions
- Parameters
-Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
+Q (dict or numpy.ndarray) – Coefficients of a quadratic unconstrained binary optimization
- Returns
results
diff --git a/www/reference/openjij/sampler/sqa_sampler/index.html b/www/reference/openjij/sampler/sqa_sampler/index.html
index 1332e86..c98357b 100644
--- a/www/reference/openjij/sampler/sqa_sampler/index.html
+++ b/www/reference/openjij/sampler/sqa_sampler/index.html
@@ -757,7 +757,7 @@ Functions
-
-class openjij.sampler.sqa_sampler.SQASampler(beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None)[source]#
+class openjij.sampler.sqa_sampler.SQASampler(beta: Optional[float] = None, gamma: Optional[float] = None, num_sweeps: Optional[int] = None, num_reads: Optional[int] = None, schedule: Optional[list] = None, trotter: Optional[int] = None)[source]#
Bases: openjij.sampler.sampler.BaseSampler
@@ -771,18 +771,18 @@ Functions
- Parameters
-beta (float) – Inverse temperature.
-gamma (float) – Amplitude of quantum fluctuation.
-trotter (int) – Trotter number.
-num_sweeps (int) – number of sweeps
-schedule (list) – schedule list
-num_reads (int) – Number of iterations.
-schedule_info (dict) – Information about a annealing schedule.
+beta (float) – Inverse temperature.
+gamma (float) – Amplitude of quantum fluctuation.
+trotter (int) – Trotter number.
+num_sweeps (int) – number of sweeps
+schedule (list) – schedule list
+num_reads (int) – Number of iterations.
+schedule_info (dict) – Information about a annealing schedule.
- Raises
-ValueError – If the schedule violates as below.
+ValueError – If the schedule violates as below.
- not list or numpy.array. –
- schedule range is '0 <= s <= 1'. –
@@ -803,12 +803,15 @@ Functions
-
-remove_unknown_kwargs(**kwargs) Dict[str, Any] #
+remove_unknown_kwargs(**kwargs) Dict[str, Any] #
Remove with warnings any keyword arguments not accepted by the sampler.
- Parameters
**kwargs – Keyword arguments to be validated.
+- Return type
+Dict[str, Any]
+
Returns: Updated kwargs dict.
Examples
@@ -827,26 +830,27 @@ Functions
-
-sample(