openjij
Framework for the Ising model and QUBO.
Loading...
Searching...
No Matches
openjij.model.chimera_model Namespace Reference

Functions

 make_ChimeraModel (linear, quadratic)
 make_ChimeraModel_from_JSON (obj)
 ChimeraModel (dict linear={}, dict quadratic={}, float offset=0.0, vartype=SPIN, int unit_num_L=2, model=None)

Variables

 from_qubo
 Q
 offset
 from_ising
 linear
 quadratic
 from_serializable
 unit_num_L = unit_num_L
str coordinate = self._validate_indices(self.indices)
 _chimera_index = lambda i, L: self.chimera_coordinate(i, L)
 _to_index = lambda x, y, z, L: self.to_index(x, y, z, L)

Function Documentation

◆ ChimeraModel()

openjij.model.chimera_model.ChimeraModel ( dict linear = {},
dict quadratic = {},
float offset = 0.0,
vartype = SPIN,
int unit_num_L = 2,
model = None )
Generate ChimeraModel object

This model deal with chimera graph.
ChimeraModel provide methods to verify whether a given interaction graph
matches a Chimera graph and to convert it to cxxjij.graph.Chimera.

Args:
    linear (dict): linear biases
    quadratic (dict): quadratic biases
    offset (float): offset
    vartype: vartype ('SPIN' or 'BINARY')
    unit_num_L (int): unit_num_L
    model (BinaryQuadraticModel): if model is not None, the object is initialized by model.
Returns:
    generated ChimeraModel

Examples:
    Example shows how to initialize ChimeraModel.::

        # This interactions satisfy chimera topology.
        >>> Q={(0, 4): -1, (4, 12): -1}
        >>> chimera_model = ChimeraModel(Q, unit_num_L=2)  # make
        >>> chimera_self.validate_chimera()

References make_ChimeraModel().

Here is the call graph for this function:

◆ make_ChimeraModel()

openjij.model.chimera_model.make_ChimeraModel ( linear,
quadratic )
ChimeraModel factory.

Returns:
    generated ChimeraModel class

References linear, and quadratic.

Referenced by ChimeraModel(), and make_ChimeraModel_from_JSON().

Here is the caller graph for this function:

◆ make_ChimeraModel_from_JSON()

openjij.model.chimera_model.make_ChimeraModel_from_JSON ( obj)
Make ChimeraModel from JSON.

Returns:
    corresponding ChimeraModel type

References make_ChimeraModel().

Here is the call graph for this function:

Variable Documentation

◆ _chimera_index

openjij.model.chimera_model._chimera_index = lambda i, L: self.chimera_coordinate(i, L)
protected

◆ _to_index

openjij.model.chimera_model._to_index = lambda x, y, z, L: self.to_index(x, y, z, L)
protected

◆ coordinate

str openjij.model.chimera_model.coordinate = self._validate_indices(self.indices)

◆ from_ising

openjij.model.chimera_model.from_ising

◆ from_qubo

openjij.model.chimera_model.from_qubo

◆ from_serializable

openjij.model.chimera_model.from_serializable

◆ linear

openjij.model.chimera_model.linear

Referenced by make_ChimeraModel().

◆ offset

openjij.model.chimera_model.offset

◆ Q

openjij.model.chimera_model.Q

◆ quadratic

openjij.model.chimera_model.quadratic

Referenced by make_ChimeraModel().

◆ unit_num_L

openjij.model.chimera_model.unit_num_L = unit_num_L