Hitachi
Hitachi has developed the CMOS annealing machine, a non-Neumann architecture computer utilizing the structure of SRAM, a storage device, to perform optimization processing with the Ising model.
Solvers
Models | Backend |
---|---|
BinaryQuadraticModel, HitachiModelList | hitachi.cmos_annealer |
HitachiParameterModel
Parameters:
solver_type
: An integer value representing the type of solver.num_executions
: An integer value representing the number of executions. It defaults to 1 if not specified.temperature_num_steps
: An integer value representing the number of steps in the temperature. It defaults to 10 if not specified.temperature_step_length
: An integer value representing the length of each step in the temperature. It defaults to 100 if not specified.temperature_initial
: A float value representing the initial temperature. It defaults to 10.0 if not specified.temperature_target
: A float value representing the target temperature. It defaults to 0.01 if not specified.energies
: A boolean value indicating whether to include energies in the output. It defaults to True if not specified.spins
: A boolean value indicating whether to include spins in the output. It defaults to True if not specified.execution_time
: A boolean value indicating whether to include execution time in the output. It defaults to True if not specified.num_outputs
: An integer value representing the number of outputs. It defaults to 0 if not specified.averaged_spins
: A boolean value indicating whether to include averaged spins in the output. It defaults to False if not specified.averaged_energy
: A boolean value indicating whether to include averaged energy in the output. It defaults to False if not specified.
Binary Quadratic Model
import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.parameter_models import HitachiParameterModel
from dimod import BinaryQuadraticModel
sw.authenticate('your-api-key')
linear = {1: -2, 2: -2, 3: -3, 4: -3, 5: -2}
quadratic = {(1, 2): 2, (1, 3): 2, (2, 4): 2, (3, 4): 2, (3, 5): 2, (4, 5): 2}
# linear = {"1": -2, "2": -2, "3": -3, "4": -3, "5": -2}
# quadratic = {("1", "2"): 2, ("1", "3"): 2, ("2", "4"): 2, ("3", "4"): 2, ("3", "5"): 2, ("4", "5"): 2}
model = BinaryQuadraticModel(linear, quadratic, "BINARY")
options = HitachiParameterModel(solver_type=5)
solver = 'hitachi.cmos_annealer'
optimizer = StrangeworksOptimizer(
model=model,
options=options,
solver=solver
)
sw_job = optimizer.run()
print(f"Job slug: {sw_job.slug}")
print(f"Job status: {optimizer.status(sw_job.slug)}")
results = optimizer.results(sw_job.slug)
print(results.solution)
For more information about the Hitachi solver, see the Hitachi Annealing Cloud API Reference.
Ising Model
The model parameter is an array of integer values [x0, y0, x1, y1, p]
with 5 elements representing the vertices or interactions of the Ising model. The order in which they are specified does not affect the calculation results.
x
and y
represent the coordinates (x-axis
, y-axis
) on the Ising model, respectively, and p
represents the coefficient.
Set the Ising model in the form x0 == x1, y0 == y1
to represent the vertex = first order term (magnetic field), and set x0, y0
and x1, y1
to be adjacent to each other to represent the interaction of two vertices.
Adjacent means up-down, left-right, and diagonal. An error occurs if the coordinate specification of two non-adjacent vertices is included.
import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.problem_models import HitachiModelList
from strangeworks_optimization_models.parameter_models import HitachiParameterModel
sw.authenticate('your-api-key')
model = HitachiModelList(
[
[0, 0, 0, 1, 117],
[0, 0, 1, 0, 104],
[0, 0, 1, 1, 65],
[0, 1, 1, 0, 72],
[0, 1, 1, 1, 45],
[1, 0, 1, 1, 40],
]
)
options = HitachiParameterModel(solver_type=5)
solver = 'hitachi.cmos_annealer'
optimizer = StrangeworksOptimizer(
model=model,
options=options,
solver=solver
)
sw_job = optimizer.run()
print(f"Job slug: {sw_job.slug}")
print(f"Job status: {optimizer.status(sw_job.slug)}")
results = optimizer.results(sw_job.slug)
print(results.solution)