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 |
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"
so = StrangeworksOptimizer(
model=model,
solver=solver,
options=options)
sw_job = so.run()
print(f"Job slug: {sw_job.slug}")
print(f"Job status: {so.status(sw_job.slug)}")
results = so.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"
so = StrangeworksOptimizer(
model=model,
solver=solver,
options=options)
sw_job = so.run()
print(f"Job slug: {sw_job.slug}")
print(f"Job status: {so.status(sw_job.slug)}")
results = so.results(sw_job.slug)
NECParameterModel
You can set the parameters for the NEC backend using the NECParameterModel
class. The (optional) parameters are:
Name | Type | Description | Default | Values (Range) |
---|---|---|---|---|
offset | float | Adjustment applied to normalize weights in the QUBO formulation. | 0.0 | [-inf, inf] |
num_reads | int | Number of annealing sweeps to perform, determining solution attempts. | 1 | [1, 20] |
num_results | int | Specifies the number of top solutions to retrieve from the annealing process. | 1 | [1, num_reads] |
timeout | int | Time limit in seconds for the job execution, impacting the duration of VA. | 1800 | [1, 7200] |
num_sweeps | int | Number of sweeps to perform per annealing. | 500 | [1, 100000] |
beta_range | List[float, float, int] | VA beta value range in the format [start, end, steps]. | [10.0, 100.0, 200] | start: [1.1754945E-38, 3.402823E+38], end: [1.1754945E-38, 3.402823E+38], steps: [1, 100000] |
dense | bool | VA matrix mode. None: automatic selection, True: dense matrix mode, False: operates in sparse matrix mode. | None | [None, True, False] |
vector_mode | str | Mode during VA annealing. Single speed/accuracy. | speed | [speed, accuracy] |
Ve_num | int | Number of Vector Engines (VEs) engaged in the annealing process. | 1 | [1, max VE available] |
onehot | int | Parameter for enforcing a one-hot encoding constraint during annealing. | 0 | [0, 1] |
fixed | int | Applies a fixed value constraint to specified variables during annealing. | 0 | [0, 1] |
andzero | int | Ensures specified variable combinations result in zero in the solution. | 0 | [0, 1] |
orone | int | Ensures at least one variable in a specified set equals one in the solution. | 0 | [0, 1] |
supplement | int | Additional constraints parameter to aid in exploring the solution space. | 0 | [0, 1] |
maxone | int | Limits the maximum number of ones that can appear in a solution subset. | 0 | [0, inf] |
minmaxone | int | Sets a minimum limit on the maximum number of ones allowed in any solution subset. | 0 | [0, inf] |
init_spin | int | Initial setting of spins, defining the starting state for the annealing process. | 0 | [-1, 1] |
spin_list | List[int] | List of initial spin values used to define constraints or initial conditions. | None | Specific to setup |