NEC
NEC is developing quantum annealers using superconducting parametron qubits with a greater number of all-to-all connected qubits.
Solver
Models | Backend |
---|---|
BinaryQuadraticModel, QuboDict | nec.vector_annealer |
NECParameterModel
Parameters: You can set the parameters for the NEC backend using the
NECParameterModel
class. The (optional) parameters are:
offset
(float): The offset for the normalized weight information stored in the qubo.num_reads
(int): The number of VA annealing sweeps.num_results
(int): The number of VA annealing results.timeout
(int): The job execution timeout.Ve_num
(int): The number of VEs used in VA annealing.onehot
(int): VA onehot constraint parameter.fixed
(int): VA fixed constraint parameter.andzero
(int): VA andzero constraint parameter.orone
(int): VA orone constraint parameter.supplement
(int): VA supplement constraint parameter.maxone
(int): VA maxone constraint parameter.minmaxone
(int): VA minmaxone constraint parameter.init_spin
(int): VA initial spin parameter.spin_list
(List[int]): VA spin list parameter.
QUBO Dictionary
The native NEC QUBO Dictionary is a representation of a Quadratic Unconstrained Binary Optimization (QUBO) problem. In the QUBO Dictionary, each key-value pair represents a term in the QUBO problem. The keys are tuples that represent the variables involved in the term, and the values represent the coefficients of those terms.
For example, a QUBO Dictionary may look like this:
QuboDict({("x1", "x1"): 1.0, ("x1", "x2"): -2.0})
In this case, the QUBO problem has two variables, x1
and x2
. The first term (x1, x1)
has a coefficient of 1.0
, and the second term (x1, x2)
has a coefficient of -2.0
.
import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.parameter_models import NECParameterModel
from strangeworks_optimization_models.problem_models import QuboDict
sw.authenticate('your-api-key')
model = QuboDict({("x1", "x1"): 1.0, ("x1", "x2"): -2.0})
options = NECParameterModel(offset=0, num_reads=2, num_results=2, timeout=100)
solver = "nec.vector_annealer"
optimizer = StrangeworksOptimizer(model=model, solver=solver, options=options)
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)
Binary Quadratic Model
import strangeworks as sw
from strangeworks_optimization import StrangeworksOptimizer
from strangeworks_optimization_models.parameter_models import NECParameterModel
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}
model = BinaryQuadraticModel(linear, quadratic, "BINARY")
options = NECParameterModel(offset=0, num_reads=2, num_results=2, timeout=100)
solver = "nec.vector_annealer"
optimizer = StrangeworksOptimizer(model=model, solver=solver, options=options)
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)