|
openjij
Framework for the Ising model and QUBO.
|
Variables | |
| from_numpy_matrix | |
| from_qubo | |
| from_ising | |
| from_serializable | |
| from_hising | |
| from_hubo | |
| str | model_type = "openjij.BinaryQuadraticModel" |
| This module defines the BinaryQuadraticModel with the Hamiltonian,
.. math::
H = \\sum_{i\\neq j} J_{ij}\\sigma_i \\sigma_j + \\sum_{i} h_{i}\\sigma_i,
| in an Ising form and
.. math::
H = \\sum_{ij} Q_{ij}x_i x_j + \\sum_{i} H_{i}x_i,
| in a QUBO form.
| The methods and usage are basically the same as `dimod <https://github.com/dwavesystems/dimod>`_.
|
protected |
References _to_cxxcimod(), and make_BinaryPolynomialModel().
Referenced by BinaryPolynomialModel().


|
protected |
References _to_cxxcimod(), and make_BinaryPolynomialModel().
Referenced by BinaryPolynomialModel().


|
protected |
References from_hising, and make_BinaryPolynomialModel().
Referenced by make_BinaryPolynomialModel_from_hising().


|
protected |
References from_hising, and make_BinaryPolynomialModel().
Referenced by make_BinaryPolynomialModel_from_hising().


|
protected |
References from_hubo, and make_BinaryPolynomialModel().
Referenced by make_BinaryPolynomialModel_from_hubo().


|
protected |
References from_hubo, and make_BinaryPolynomialModel().
Referenced by make_BinaryPolynomialModel_from_hubo().


|
protected |
References from_serializable, and make_BinaryPolynomialModel_from_JSON().
Referenced by _BinaryPolynomialModel_from_dict(), _BinaryPolynomialModel_from_list(), and BinaryPolynomialModel().


| openjij.model.model.BinaryPolynomialModel | ( | * | args, |
| ** | kwargs ) |
References _BinaryPolynomialModel_from_dict(), _BinaryPolynomialModel_from_list(), and _to_cxxcimod().

| openjij.model.model.BinaryQuadraticModel | ( | linear, | |
| quadratic, | |||
| * | args, | ||
| ** | kwargs ) |
Generate BinaryQuadraticModel object.
Attributes:
vartype (dimod.Vartype): variable type SPIN or BINARY
linear (dict): represents linear term
quadratic (dict): represents quadratic term
offset (float): represents constant energy term when convert to SPIN from BINARY
num_variables (int): represents number of variables in the model
variables (list): represents variables of the binary quadratic model
Args:
linear (dict): linear biases
quadratic (dict): quadratic biases
offset (float): offset
vartype (openjij.variable_type.Vartype): vartype ('SPIN' or 'BINARY')
kwargs:
Returns:
generated BinaryQuadraticModel
Examples:
BinaryQuadraticModel can be initialized by specifing h and J::
>>> h = {0: 1, 1: -2}
>>> J = {(0, 1): -1, (1, 2): -3, (2, 3): 0.5}
>>> bqm = oj.BinaryQuadraticModel(self.h, self.J)
You can also use strings and tuples of integers (up to 4 elements) as indices::
>>> h = {'a': 1, 'b': -2}
>>> J = {('a', 'b'): -1, ('b', 'c'): -3, ('c', 'd'): 0.5}
>>> bqm = oj.BinaryQuadraticModel(self.h, self.J)
References make_BinaryQuadraticModel().

| openjij.model.model.bqm_from_ising | ( | linear, | |
| quadratic, | |||
| offset = 0.0, | |||
| ** | kwargs ) |
| openjij.model.model.bqm_from_numpy_matrix | ( | mat, | |
| list | variables = None, | ||
| offset = 0.0, | |||
| vartype = "BINARY", | |||
| ** | kwargs ) |
References from_numpy_matrix, and make_BinaryQuadraticModel().

| openjij.model.model.bqm_from_qubo | ( | Q, | |
| offset = 0.0, | |||
| ** | kwargs ) |
| openjij.model.model.make_BinaryPolynomialModel | ( | polynomial, | |
| index_type = None, | |||
| tuple_size = 0 ) |
Referenced by _BinaryPolynomialModel_from_dict(), _BinaryPolynomialModel_from_list(), _make_BinaryPolynomialModel_from_hising_from_dict(), _make_BinaryPolynomialModel_from_hising_from_list(), _make_BinaryPolynomialModel_from_hubo_from_dict(), _make_BinaryPolynomialModel_from_hubo_from_list(), and make_BinaryPolynomialModel_from_JSON().

| openjij.model.model.make_BinaryPolynomialModel_from_hising | ( | * | args, |
| ** | kwargs ) |
References _make_BinaryPolynomialModel_from_hising_from_dict(), and _make_BinaryPolynomialModel_from_hising_from_list().

| openjij.model.model.make_BinaryPolynomialModel_from_hubo | ( | * | args, |
| ** | kwargs ) |
References _make_BinaryPolynomialModel_from_hubo_from_dict(), and _make_BinaryPolynomialModel_from_hubo_from_list().

| openjij.model.model.make_BinaryPolynomialModel_from_JSON | ( | obj | ) |
References make_BinaryPolynomialModel().
Referenced by _to_cxxcimod().


| openjij.model.model.make_BinaryQuadraticModel | ( | dict | linear, |
| dict | quadratic, | ||
| sparse ) |
BinaryQuadraticModel factory.
Returns:
generated BinaryQuadraticModel class
Referenced by BinaryQuadraticModel(), bqm_from_ising(), bqm_from_numpy_matrix(), bqm_from_qubo(), and make_BinaryQuadraticModel_from_JSON().

| openjij.model.model.make_BinaryQuadraticModel_from_JSON | ( | dict | obj | ) |
Make BinaryQuadraticModel from JSON.
Returns:
corresponding BinaryQuadraticModel type
References make_BinaryQuadraticModel().

| openjij.model.model.from_hising |
| openjij.model.model.from_hubo |
| openjij.model.model.from_ising |
Referenced by bqm_from_ising().
| openjij.model.model.from_numpy_matrix |
Referenced by bqm_from_numpy_matrix().
| openjij.model.model.from_qubo |
Referenced by bqm_from_qubo().
| openjij.model.model.from_serializable |
Referenced by _to_cxxcimod().
| str openjij.model.model.model_type = "openjij.BinaryQuadraticModel" |