NEC

NEC Vector Annealing (VA) Service 2.0

NEC provides the QUBO solver, which runs on the vector supercomputer SX-Aurora TSUBASA.

The Amplify SDK provides NECVA2Client which calls the NEC Vector Annealing Service 2.0 API with automatically detected and configured request parameters.

Solver specification:

1: Corresponding to API reference “3-3-2 solve_params”
2: Corresponding to API reference “3-4. Response”
3: No need for additional installation

Binary variable

Ising variable

Integer variable

Real variable

Objective function

2nd

-

-

-

Equality constraint

*

-

-

-

Inequality constraint

*

-

-

-

*: Several 1st and 2nd order constraints described later are supported.

Client class:

In addition to the common interface of the client class, it has the following attributes.

Attribute

Data type

Details

set_fixed

bool

If set as True, fixed constraints are detected from the model’s constraints as many as possible and are passed to the fixed parameter which is a flip option. (Default: True)

set_onehot

bool

If set as True, onehot constraints are detected from the model’s constraints as many as possible and are passed to the onehot parameter which is a flip option. (Default: True)

set_andzero

bool

If set as True, andzero constraints are detected from the model’s constraints as many as possible and are passed to the andzero parameter which is a flip option. (Default: True)

set_orone

bool

If set as True, orone constraints are detected from the model’s constraints as many as possible and are passed to the orone parameter which is a flip option. (Default: True)

set_supplement

bool

If set as True, supplement constraints are detected from the model’s constraints as many as possible and are passed to the supplement parameter which is a flip option. (Default: True)

set_maxone

bool

If set as True, maxone constraints are detected from the model’s constraints as many as possible and are passed to the maxone parameter which is a flip option. (Default: True)

set_minmaxone

bool

If set as True, minmaxone constraints are detected from the model’s constraints as many as possible and are passed to the minmaxone parameter which is a flip option. (Default: True)

Note

Regardless of whether the flip option is enabled, penalty functions of constraints are added to the objective function as needed.

Execution time:

The NEC VA Service 2.0 returns the execution time for each sampling of VA but does not return the total processing time taken to find the solution. Therefore, in addition to the sampling time, the NECVA2Client independently measures and returns the response time of the solve_qubo API of the SAC Service Client and the execution time of the the VA (which is also included in the response time). These timing attributes are stored in the ~amplify.NECVA2Client.Result.timing attribute of the result class.

Attribute

Details

amplify.NECVA2Client.Result.Result.time

VA sampling time for each read.

amplify.NECVA2Client.Result.Timing.solve_qubo_time

Execution time of the solve_qubo Python API

amplify.NECVA2Client.Result.Timing.execution_time

Execution time of the VA (including network overhead and queue time)

Configuration example:
from amplify import NECVA2Client

client = NECVA2Client()

# Set API token
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Run in speed mode
client.parameters.vector_mode = "speed"
Execution example:
from amplify import VariableGenerator, Model, solve

# Define decision variables and the objective function
g = VariableGenerator()
q = g.array("Binary", 2)
f = q[0] * q[1] + q[0] - q[1] + 1

# Create a model
model = Model(f)

# Run the solver
result = solve(model, client)

# Print API execution time
print(result.execution_time)

Obtain the solver version:

>>> client.version
'2.0.2'