Skip to main content

NEC

NEC is developing quantum annealers using superconducting parametron qubits with a greater number of all-to-all connected qubits.

Solver

ModelsBackend
BinaryQuadraticModel, QuboDictnec.vector_annealer

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)

NECParameterModel

You can set the parameters for the NEC backend using the NECParameterModel class. The (optional) parameters are:

NameTypeDescriptionDefaultValues (Range)
offsetfloatAdjustment applied to normalize weights in the QUBO formulation.0.0[-inf, inf]
num_readsintNumber of annealing sweeps to perform, determining solution attempts.1[1, 20]
num_resultsintSpecifies the number of top solutions to retrieve from the annealing process.1[1, num_reads]
timeoutintTime limit in milliseconds for the job execution, impacting the duration of VA.1000[1, inf]
Ve_numintNumber of Vector Engines (VEs) engaged in the annealing process.1[1, max VE available]
onehotintParameter for enforcing a one-hot encoding constraint during annealing.0[0, 1]
fixedintApplies a fixed value constraint to specified variables during annealing.0[0, 1]
andzerointEnsures specified variable combinations result in zero in the solution.0[0, 1]
oroneintEnsures at least one variable in a specified set equals one in the solution.0[0, 1]
supplementintAdditional constraints parameter to aid in exploring the solution space.0[0, 1]
maxoneintLimits the maximum number of ones that can appear in a solution subset.0[0, inf]
minmaxoneintSets a minimum limit on the maximum number of ones allowed in any solution subset.0[0, inf]
init_spinintInitial setting of spins, defining the starting state for the annealing process.0[-1, 1]
spin_listList[int]List of initial spin values used to define constraints or initial conditions.NoneSpecific to setup