openjij.model.chimera_model
#
Module Contents#
Functions#
|
Generate ChimeraModel object |
|
ChimeraModel factory. |
Make ChimeraModel from JSON. |
- openjij.model.chimera_model.ChimeraModel(linear: dict = None, quadratic: dict = None, offset: float = 0.0, vartype=SPIN, unit_num_L: int = None, model=None, gpu: bool = False)[source]#
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.
- Parameters:
linear (
dict
) – linear biasesquadratic (
dict
) – quadratic biasesoffset (
float
) – offsetvartype – vartype (‘SPIN’ or ‘BINARY’)
unit_num_L (
int
) – unit_num_Lmodel (
BinaryQuadraticModel
) – if model is not None, the object is initialized by model.gpu (
bool
) – if true, this can be used for gpu samplers.
- 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()