Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
>>> print(response)
number of state: 10, minimun energy: -4.0, spin_type: ising
info:
averaged_spins: [[2, 0, 1.0], [0, 1, -1.0], [0, 0, 1.0], [1, 0, 1.0]]
averaged_energy: -4.0
execution_time: 58769171
job_id: XXXXXXXXXXXXXXXXX
"""
var_type = 'SPIN'
if king_graph is not None:
_king_graph = KingGraph(machine_type=self.machine_type, king_graph=king_graph, var_type=var_type)
return self._sampling(_king_graph, var_type=var_type, token=self.token)
elif (h is not None) and (J is not None):
_king_graph = KingGraph(machine_type=self.machine_type, h=h, J=J, var_type=var_type)
return self._sampling(_king_graph, var_type=var_type, token=self.token)
else:
raise ValueError('intput "h and J" or king_graph model')
>>> import openjij as oj
>>> sampler = oj.CMOSAnnealer(token="YOUR_TOKEN", iteration=10)
>>> response = sampler.sample_qubo({(0, 0): 1, (0, 1): -1, (1, 2): -1, (0, 80): 3})
>>> print(response)
number of state: 10, minimun energy: -4.0, spin_type: binary
info:
averaged_spins: [[2, 0, 1.0], [0, 1, -1.0], [0, 0, 1.0], [1, 0, 1.0]]
averaged_energy: -4.0
execution_time: 58769171
job_id: XXXXXXXXXXXXXXXXX
"""
var_type = 'BINARY'
if king_graph is not None:
_king_graph = KingGraph(machine_type=self.machine_type, king_graph=king_graph, var_type=var_type)
return self._sampling(_king_graph, var_type=var_type, token=self.token)
elif Q is not None:
_king_graph = KingGraph(machine_type=self.machine_type, Q=Q, var_type=var_type)
return self._sampling(_king_graph, var_type=var_type, token=self.token)
else:
raise ValueError('intput Q or king_graph model')
>>> import openjij as oj
>>> sampler = oj.CMOSAnnealer(token="YOUR_TOKEN", iteration=10)
>>> response = sampler.sample_ising({0: 1}, {(0, 1): -1, (1, 2): -1, (0, 80): 3})
>>> print(response)
number of state: 10, minimun energy: -4.0, spin_type: ising
info:
averaged_spins: [[2, 0, 1.0], [0, 1, -1.0], [0, 0, 1.0], [1, 0, 1.0]]
averaged_energy: -4.0
execution_time: 58769171
job_id: XXXXXXXXXXXXXXXXX
"""
var_type = 'SPIN'
if king_graph is not None:
_king_graph = KingGraph(machine_type=self.machine_type, king_graph=king_graph, var_type=var_type)
return self._sampling(_king_graph, var_type=var_type, token=self.token)
elif (h is not None) and (J is not None):
_king_graph = KingGraph(machine_type=self.machine_type, h=h, J=J, var_type=var_type)
return self._sampling(_king_graph, var_type=var_type, token=self.token)
else:
raise ValueError('intput "h and J" or king_graph model')
>>> print(response)
number of state: 10, minimun energy: -4.0, spin_type: binary
info:
averaged_spins: [[2, 0, 1.0], [0, 1, -1.0], [0, 0, 1.0], [1, 0, 1.0]]
averaged_energy: -4.0
execution_time: 58769171
job_id: XXXXXXXXXXXXXXXXX
"""
var_type = 'BINARY'
if king_graph is not None:
_king_graph = KingGraph(machine_type=self.machine_type, king_graph=king_graph, var_type=var_type)
return self._sampling(_king_graph, var_type=var_type, token=self.token)
elif Q is not None:
_king_graph = KingGraph(machine_type=self.machine_type, Q=Q, var_type=var_type)
return self._sampling(_king_graph, var_type=var_type, token=self.token)
else:
raise ValueError('intput Q or king_graph model')