openjij.model.chimera_model#

Functions#

ChimeraModel([linear, quadratic, offset, vartype, ...])

Generate ChimeraModel object

make_ChimeraModel(linear, quadratic)

ChimeraModel factory.

make_ChimeraModel_from_JSON(obj)

Make ChimeraModel from JSON.

Module Contents#

openjij.model.chimera_model.ChimeraModel(linear: dict = {}, quadratic: dict = {}, offset: float = 0.0, vartype=SPIN, unit_num_L: int = 2, model=None)[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 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()
openjij.model.chimera_model.make_ChimeraModel(linear, quadratic)[source]#

ChimeraModel factory.

Returns:

generated ChimeraModel class

openjij.model.chimera_model.make_ChimeraModel_from_JSON(obj)[source]#

Make ChimeraModel from JSON.

Returns:

corresponding ChimeraModel type