|
openjij
Framework for the Ising model and QUBO.
|
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 |
| 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().

| 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().

| 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().

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