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

Functions

 make_KingGraph (linear=None, quadratic=None, king_graph=None)
 make_KingGraph_from_JSON (obj)
 KingGraph (linear=None, quadratic=None, offset=0.0, king_graph=None, vartype=SPIN, machine_type="")

Variables

 from_qubo
 Q
 offset
 from_ising
 linear
 quadratic
 from_serializable
str machine_type = machine_type
list xrange = [0, 351 + 1]
list yrange = [0, 175 + 1]
list prange = [-3, 3]
list _ising_king_graph = king_graph

Function Documentation

◆ KingGraph()

openjij.model.king_graph.KingGraph ( linear = None,
quadratic = None,
offset = 0.0,
king_graph = None,
vartype = SPIN,
machine_type = "" )
Generate KingGraph model.

Args:
    linear (dict): linear biases
    quadratic (dict): quadratic biases
    offset (float): offset
    king_graph: represents ising or QUBO interaction.
        Each spins are decided by 2-d corrdinate x, y.

        * Quadratic term: [x1, y1, x2, y2, value]
        * Linear term:    [x1, y1, x1, y1, value]
    vartype: 'SPIN' or 'BINARY'
    machine_type (str): choose 'ASIC' or 'FPGA'
Returns:
    generated KingGraphModel
Examples:
    The following code shows intialization of KingGraph::

        >>> h = {}
        >>> J = {(0, 1): -1.0, (1, 2): -3.0}
        >>> king_graph = oj.KingGraph(machine_type="ASIC", linear=h, quadratic=J)

    You can initialize it from `king_interaction`::

        >>> king_interaction = [[0, 0, 1, 0, -1.0], [1, 0, 2, 0, -3.0]]
        >>> king_graph = oj.KingGraph(machine_type="ASIC", king_graph=king_interaction)

References make_KingGraph().

Here is the call graph for this function:

◆ make_KingGraph()

openjij.model.king_graph.make_KingGraph ( linear = None,
quadratic = None,
king_graph = None )
KingGraph factory

Returns:
    generated KingGraph class

Referenced by KingGraph(), and make_KingGraph_from_JSON().

Here is the caller graph for this function:

◆ make_KingGraph_from_JSON()

openjij.model.king_graph.make_KingGraph_from_JSON ( obj)
KingGraph factory for JSON

Args:
    obj (dict): JSON object
Returns:
    generated KingGraph class

References make_KingGraph().

Here is the call graph for this function:

Variable Documentation

◆ _ising_king_graph

list openjij.model.king_graph._ising_king_graph = king_graph
protected

◆ from_ising

openjij.model.king_graph.from_ising

◆ from_qubo

openjij.model.king_graph.from_qubo

◆ from_serializable

openjij.model.king_graph.from_serializable

◆ linear

openjij.model.king_graph.linear

◆ machine_type

str openjij.model.king_graph.machine_type = machine_type

◆ offset

openjij.model.king_graph.offset

◆ prange

list openjij.model.king_graph.prange = [-3, 3]

◆ Q

openjij.model.king_graph.Q

◆ quadratic

openjij.model.king_graph.quadratic

◆ xrange

list openjij.model.king_graph.xrange = [0, 351 + 1]

◆ yrange

list openjij.model.king_graph.yrange = [0, 175 + 1]