How to use the openjij.ChimeraModel.from_qubo function in openjij

To help you get started, we’ve selected a few openjij examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpenJij / OpenJij / tests / test_model.py View on Github external
def test_ising_dict(self):
        Q = {(0, 4): -1.0, (6, 2): -3.0}
        bqm = oj.ChimeraModel.from_qubo(Q=Q, unit_num_L=3)
github OpenJij / OpenJij / tests / test_model.py View on Github external
def test_get_chimera_graph(self):
        c_model = oj.ChimeraModel.from_qubo(
            Q={(0, 4): -1, (1, 1): -1, (1, 5): 1}, unit_num_L=2)
        chimera = c_model.get_chimera_graph()
        self.assertIsInstance(chimera, cj.graph.Chimera)

        c_model = oj.ChimeraModel.from_qubo(
            Q={((0, 0, 1), (0, 0, 4)): -1, ((0, 0, 4), (0, 0, 2)): -1},
            unit_num_L=2)
        chimera = c_model.get_chimera_graph()
        self.assertIsInstance(chimera, cj.graph.Chimera)
github OpenJij / OpenJij / tests / test_model.py View on Github external
def test_get_chimera_graph(self):
        c_model = oj.ChimeraModel.from_qubo(
            Q={(0, 4): -1, (1, 1): -1, (1, 5): 1}, unit_num_L=2)
        chimera = c_model.get_chimera_graph()
        self.assertIsInstance(chimera, cj.graph.Chimera)

        c_model = oj.ChimeraModel.from_qubo(
            Q={((0, 0, 1), (0, 0, 4)): -1, ((0, 0, 4), (0, 0, 2)): -1},
            unit_num_L=2)
        chimera = c_model.get_chimera_graph()
        self.assertIsInstance(chimera, cj.graph.Chimera)