Client

This section describes the Ising machine clients.

Client Class Overview

The client class provides an interface for getting and setting hardware parameters of each Ising machine, as well as for executing it. By giving the client class object as a driver to the solver class Solver, the client class is typically used as a solver for the logical model using the corresponding Ising machine. See Solver or execution example of each client for more details and examples.

Note

The client class can be also used as a solver for the physical model (see physical model solver for more information), it is recommended to use it through the solver class.

There are two types of parameters that can be set by the client class:

  • Settings of access information and execution of the Ising machines

    It sets the URL of the access point and API token. These are provided as the attributes of the client class. Some clients have settings related to compression of communicated data and construction methods of transmitted data.

  • Execution parameters of the Ising machines

    It sets the execution parameters that follow the API specifications of the machines. It is provided by the attribute of the client class parameters.

See also

See Client for more information on the client classes and their peripheral classes.

Fixstars

Please refer to Fixstars client reference for more information.

Amplify AE Client Class

Name

Fixstars Amplify Annealing Engine

Client class

FixstarsClient

Execution parameter class

FixstarsClientParameters

Execution result class

FixstarsClientResult

Execution time class

FixstarsClientResultTiming

Physical graph

Fully Connected coupling

Number of physical bits

65536~

Number of logical bits (Fully connected coupling)

65536~

API endpoint (default)

https://optigan.fixstars.com/

Attributes of Amplify AE Client Class

Example of Amplify AE Client

from amplify import BinarySymbolGenerator, Solver
from amplify.client import FixstarsClient

gen = BinarySymbolGenerator()
q = gen.array(3)
f = 2 * q[0] * q[1] - q[0] - q[2] + 1

client = FixstarsClient()
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client.parameters.timeout = 1000  # Timeout is 1 second

solver = Solver(client)
result = solver.solve(f)
>>> f
2 q_0 q_1 - q_0 - q_2 + 1
>>> [f"energy = {s.energy}, q = {q.decode(s.values)}" for s in result]
['energy = -1.0, q = [1. 0. 1.]']

D-Wave

Please refer to D-Wave client reference for more information.

D-Wave Client Classes

Note

To use D-Wave Sampler and Leap Hybrid Solver, dwave-system module needs to be installed. The dependent packages can be installed by installing Amplify SDK as follows:

$ pip install amplify[extra]

Name

D-Wave Sampler (Ocean SDK)

Client class

DWaveSamplerClient

Execution parameter class

DWaveSamplerClientQuantumSolverParametersOcean

Execution result class

DWaveSamplerClientResult

Execution time class

DWaveSamplerClientResultTiming

Physical graph

Pegasus graph (Advantage_system4.1, Advantage_system1.1)、Chimera graph (DW_2000Q_6, DW_2000Q_VFYC_6)

Number of physical bits

5627 (Advantage_system4.1), 5436 (Advantage_system1.1), 2041 (DW_2000Q_6), 2048 (DW_2000Q_VFYC_6)

Number of logical bits (Fully connected coupling)

177 (Advantage_system4.1), 123 (Advantage_system1.1), 64 (DW_2000Q_6, DW_2000Q_VFYC_6)

API endpoint (default)

https://cloud.dwavesys.com/sapi

Name

Leap Hybrid Solver (Ocean SDK)

Client class

LeapHybridSamplerClient

Execution parameter class

LeapHybridSamplerClientLeapHybridSolverParameters

Execution result class

LeapHybridSamplerClientResult

Execution time class

LeapHybridSamplerClientResultTiming

Physical graph

Fully Connected coupling

Number of physical bits

10000

Number of logical bits (Fully connected coupling)

10000

API endpoint (default)

https://cloud.dwavesys.com/sapi

Attributes of D-Wave Client

Name

Description

num_bits

Gets the maximum number of executable variables.

D-Wave Sampler

N/A

Leap Hybrid Solver

1000000

parameters

Gets the execution parameters.

D-Wave Sampler

DWaveSamplerClientQuantumSolverParametersOcean

Leap Hybrid Solver

LeapHybridSamplerClientLeapHybridSolverParameters

proxy

Gets or sets the proxy server address.

solver

Gets or sets the name of the solver to be executed.

D-Wave Sampler

"Advantage_system4.1", "Advantage_system1.1", "DW_2000Q_6", "DW_2000Q_VFYC_6"

Leap Hybrid Solver

"hybrid_binary_quadratic_model_version2"

solver_names

Gets the list of available solver names.

token

Gets or sets the API token.

url

Gets or sets the API URL.

version

Gets the version information of the client.

Examples of D-Wave Client

D-Wave Sampler Client

from amplify import BinarySymbolGenerator, Solver
from amplify.client.ocean import DWaveSamplerClient

client = DWaveSamplerClient()
client.token = "XXXX-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client.solver = "Advantage_system4.1"
client.parameters.num_reads = 100  # Number of executions

gen = BinarySymbolGenerator()
q = gen.array(3)
f = 2 * q[0] * q[1] - q[0] - q[2] + 1

solver = Solver(client)

result = solver.solve(f)
>>> f
2 q_0 q_1 - q_0 - q_2 + 1
>>> [f"energy = {s.energy}, q = {q.decode(s.values)}" for s in result]
['energy = -1.0, q = [1. 0. 1.]']

By setting token, the list of available solver names related to the token as follows:

>>> client.solver_names
['DW_2000Q_6', 'DW_2000Q_VFYC_6', 'Advantage_system4.1', 'Advantage_system1.1']

D-Wave Leap Hybrid Solver Client

from amplify import BinarySymbolGenerator, Solver
from amplify.client.ocean import LeapHybridSamplerClient

client = LeapHybridSamplerClient()
client.token = "XXXX-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client.solver = "hybrid_binary_quadratic_model_version2"
client.parameters.time_limit = 3  # Time limit is 3 seconds

gen = BinarySymbolGenerator()
q = gen.array(3)
f = 2 * q[0] * q[1] - q[0] - q[2] + 1

solver = Solver(client)

result = solver.solve(f)
>>> f
2 q_0 q_1 - q_0 - q_2 + 1
>>> [f"energy = {s.energy}, q = {q.decode(s.values)}" for s in result]
['energy = -1.0, q = [1. 0. 1.]']

Similar to DwaveSamplerClient, the available solver names can be obtained as follows:

>>> client.solver_names
['hybrid_binary_quadratic_model_version2']

Fujitsu

Please refer to Fujitsu client reference for more information.

Fujitsu Client Classes

Name

FujitsuDASolver

Client class

FujitsuDASolverClient

Execution parameter class

FujitsuDASolverClientParameters

Execution result class

FujitsuDASolverClientResult

Execution time class

FujitsuDASolverClientResultTiming

Physical graph

Fully Connected coupling

Number of physical bits

1024

Number of logical bits (Fully connected coupling)

1024

API endpoint (default)

https://api.aispf.global.fujitsu.com/da/

Name

FujitsuDASolver (Expert Mode)

Client class

FujitsuDASolverExpertClient

Execution parameter class

FujitsuDASolverExpertClientParameters

Execution result class

FujitsuDASolverExpertClientResult

Execution time class

FujitsuDASolverExpertClientResultTiming

Physical graph

Fully Connected coupling

Number of physical bits

1024

Number of logical bits (Fully connected coupling)

1024

API endpoint (default)

https://api.aispf.global.fujitsu.com/da/

Name

FujitsuDAPTSolver

Client class

FujitsuDAPTSolverClient

Execution parameter class

FujitsuDAPTSolverClientParameters

Execution result class

FujitsuDAPTSolverClientResult

Execution time class

FujitsuDAPTSolverClientResultTiming

Physical graph

Fully Connected coupling

Number of physical bits

1024

Number of logical bits (Fully connected coupling)

1024

API endpoint (default)

https://api.aispf.global.fujitsu.com/da/

Name

FujitsuDAMixedModeSolver

Client class

FujitsuDAMixedModeSolverClient

Execution parameter class

FujitsuDAMixedModeSolverClientParameters

Execution result class

FujitsuDAMixedModeSolverClientResult

Execution time class

FujitsuDAMixedModeSolverClientResultTiming

Physical graph

Fully Connected coupling

Number of physical bits

1024

Number of logical bits (Fully connected coupling)

1024

API endpoint (default)

https://api.aispf.global.fujitsu.com/da/

Name

FujitsuDA2Solver

Client class

FujitsuDA2SolverClient

Execution parameter class

FujitsuDA2SolverClientParameters

Execution result class

FujitsuDA2SolverClientResult

Execution time class

FujitsuDA2SolverClientResultTiming

Physical graph

Fully Connected coupling

Number of physical bits

8192

Number of logical bits (Fully connected coupling)

8192

API endpoint (default)

https://api.aispf.global.fujitsu.com/da/

Name

FujitsuDA2Solver (Expert Mode)

Client class

FujitsuDA2SolverExpertClient

Execution parameter class

FujitsuDA2SolverExpertClientParameters

Execution result class

FujitsuDA2SolverExpertClientResult

Execution time class

FujitsuDA2SolverExpertClientResultTiming

Physical graph

Fully Connected coupling

Number of physical bits

8192

Number of logical bits (Fully connected coupling)

8192

API endpoint (default)

https://api.aispf.global.fujitsu.com/da/

Name

FujitsuDA2PTSolver

Client class

FujitsuDA2PTSolverClient

Execution parameter class

FujitsuDA2PTSolverClientParameters

Execution result class

FujitsuDA2PTSolverClientResult

Execution time class

FujitsuDA2PTSolverClientResultTiming

Physical graph

Fully Connected coupling

Number of physical bits

8192

Number of logical bits (Fully connected coupling)

8192

API endpoint (default)

https://api.aispf.global.fujitsu.com/da/

Name

FujitsuDA2MixedModeSolver

Client class

FujitsuDA2MixedModeSolverClient

Execution parameter class

FujitsuDA2MixedModeSolverClientParameters

Execution result class

FujitsuDA2MixedModeSolverClientResult

Execution time class

FujitsuDA2MixedModeSolverClientResultTiming

Physical graph

Fully Connected coupling

Number of physical bits

8192

Number of logical bits (Fully connected coupling)

8192

API endpoint (default)

https://api.aispf.global.fujitsu.com/da/

Name

FujitsuDA3SolverClient

Client class

FujitsuDA3SolverClient

Execution parameter class

FujitsuDA3SolverClientParameters

Execution result class

FujitsuDA3SolverClientResult

Execution time class

FujitsuDA3SolverClientResultTiming

Physical graph

Fully Connected coupling

Number of physical bits

100000

Number of logical bits (Fully connected coupling)

100000

API endpoint (default)

https://api.aispf.global.fujitsu.com/da/

Attributes of Fujitsu Client

Name

Description

num_bits

Gets the maximum number of executable variables.

parameters

Gets the execution parameters.

FujitsuDASolver

FujitsuDASolverClientParameters

FujitsuDASolver (Expert Mode)

FujitsuDASolverExpertClientParameters

FujitsuDAPTSolver

FujitsuDAPTSolverClientParameters

FujitsuDAMixedModeSolver

FujitsuDAMixedModeSolverClientParameters

FujitsuDA2Solver

FujitsuDA2SolverClientParameters

FujitsuDA2Solver (Expert Mode)

FujitsuDA2SolverExpertClientParameters

FujitsuDA2PTSolver

FujitsuDA2PTSolverClientParameters

FujitsuDA2MixedModeSolver

FujitsuDA2MixedModeSolverClientParameters

FujitsuDA3Solver

FujitsuDA3SolverClientParameters

proxy

Gets or sets the proxy server address.

token

Gets or sets the API token.

url

Gets or sets the API URL.

version

Gets the version information of the client.

set_penalty_binary_polynomial

Specifies whether to use penalty quadratic polynomial for FujitsuDA3SolverClient. Defaults to False.

FujitsuDA2PTSolverClient

from amplify import BinarySymbolGenerator, Solver
from amplify.client import FujitsuDA2PTSolverClient

gen = BinarySymbolGenerator()
q = gen.array(3)
f = 2 * q[0] * q[1] - q[0] - q[2] + 1

client = FujitsuDA2PTSolverClient()
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client.parameters.number_iterations = 1000

solver = Solver(client)

result = solver.solve(f)
>>> f
2 q_0 q_1 - q_0 - q_2 + 1
>>> [f"energy = {s.energy}, q = {q.decode(s.values)}" for s in result]
['energy = -1.0, q = [1. 0. 1.]']

Note

See the corresponding parts of the Schemes of Digital Annealer API reference (QUBO API V2) for details on the parameters of FujitsuDA and FujitsuDA2 clients.

FujitsuDA3SolverClient

from amplify import BinarySymbolGenerator, Solver
from amplify.client import FujitsuDA3SolverClient

gen = BinarySymbolGenerator()
q = gen.array(3)
f = 2 * q[0] * q[1] - q[0] - q[2] + 1

client = FujitsuDA3SolverClient()
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client.parameters.time_limit_sec = 1  # Time limit is 1 second

solver = Solver(client)

result = solver.solve(f)
>>> f
2 q_0 q_1 - q_0 - q_2 + 1
>>> [f"energy = {s.energy}, q = {q.decode(s.values)}" for s in result]
['energy = -1.0, q = [1. 0. 1.]',
 'energy = 0.0, q = [1. 0. 0.]',
 'energy = 0.0, q = [0. 1. 1.]',
 'energy = 1.0, q = [0. 0. 0.]']

Note

See FujitsuDA3Solver Schemas of Digital Annealer API reference (QUBO API V3) for details of FujitsuDA3SolverClient parameters.

Toshiba

Please refer to Toshiba client reference for more information.

Toshiba Client Class

Name

Toshiba SBM

Client class

ToshibaClient

Execution parameter class

ToshibaClientParameters

Execution result class

ToshibaClientResult

Execution time class

ToshibaClientResultTiming

Physical graph

Fully Connected coupling

Number of physical bits

10000

Number of logical bits (Fully connected coupling)

10000

API endpoint (default)

N/A

Attributes of Toshiba Client

Name

Description

num_bits

Gets the maximum number of executable variables.

parameters

Gets the execution parameters ToshibaClientParameters.

proxy

Gets or sets the proxy server address.

token

Gets or sets the API token.

url

Gets or sets the API URL.

version

Gets the version information of the client.

Example of Toshiba Client

ToshibaClient

from amplify import BinarySymbolGenerator, Solver
from amplify.client import ToshibaClient

gen = BinarySymbolGenerator()
q = gen.array(3)
f = 2 * q[0] * q[1] - q[0] - q[2] + 1

client = ToshibaClient()
client.url = "http://xxx.xxx.xxx.xxx:xxxx/"
client.parameters.timeout = 1  # Timeout is 1 second

solver = Solver(client)
result = solver.solve(f)
>>> f
2 q_0 q_1 - q_0 - q_2 + 1
>>> [f"energy = {s.energy}, q = {q.decode(s.values)}" for s in result]
['energy = -1.0, q = [1. 0. 1.]']

Note

See Simulated Bifurcation Machine (SBM) User Manual for details of Toshiba SBM.

Hitachi

Please refer to Hitachi client reference for more information.

Hitachi Client Class

Name

Hitachi CMOS annealing machine (type 4: GPU)

Client class

HitachiClient

Execution parameter class

HitachiClientParameters

Execution result class

HitachiClientResult

Execution time class

HitachiClientResultTiming

Physical graph

King Graph

Number of physical bits

262144 (512x512)

Number of logical bits (Fully connected coupling)

512

API endpoint (default)

https://annealing−cloud.com/api/v2/

Attributes of Hitachi Client

Name

Description

num_bits

Gets the maximum number of executable variables.

parameters

Gets the execution parameters HitachiClientParameters.

proxy

Gets or sets the proxy server address.

token

Gets or sets the API token.

url

Gets or sets the API URL.

version

Gets the version information of the client.

Example of Hitachi Client

HitachiClient

from amplify import BinaryPoly, gen_symbols, Solver
from amplify.client import HitachiClient

gen = BinarySymbolGenerator()
q = gen.array(3)
f = 2 * q[0] * q[1] - q[0] - q[2] + 1

client = HitachiClient()
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
client.parameters.temperature_num_steps = 10
client.parameters.temperature_step_length = 100
client.parameters.temperature_initial = 100.0
client.parameters.temperature_target = 0.02

solver = Solver(client)

result = solver.solve(f)
>>> f
2 q_0 q_1 - q_0 - q_2 + 1
>>> [f"energy = {s.energy}, q = {q.decode(s.values)}" for s in result]
['energy = -1.0, q = [1. 0. 1.]']

Note

See API reference V2 for details of Hitachi CMOS annealing machine.

Physical Model Solver

It is recommended use a client class as the driver of the solver class for typical usage, but the client class can also be used as a solver for the physical model.

Note

This function is intended for direct operation of each machine or for debugging purposes.

All clients have solve() method. The followings are possible inputs. For matrix object input, the second argument corresponds to the constant term.

Possible input polynomials must be quadratic, and variable indices and interactions must match the specifications of each machine. The model needs to be a physical model, and the interactions between variables need to be consistent with the graph based on the hardware specifications. Depending on the graph, there may be restrictions on the interactions between variables.

Note

See D-Wave System Documentation D-Wave machine’s QPU topology.

Note

Although Hitachi CMOS annealing machine is specified by two-dimensional indices, Amplify SDK uses one-dimensional indices. Regarding to the coordinates of the King’s graph \(x\), \(y\), note that one-dimensional variable index \(i = L x + y\) is given. Here, \(L = 512\) represents the length of one side of the King’s graph.

solve() method returns ClientResult class object, which is specific to the client in use.

ClientResult class has the following common attributes. optional is provided only for some clients.

  • annealing_time_ms : Gets the (typical) execution time in milliseconds.

  • execution_parameters (optional) : Gets the execution parameters.

  • timing : Gets the execution time object.

  • solutions : Gets the list of the execution results. Each element has the following attributes:

    • energy : Gets the energy value (evaluated value of physical model).

    • values : Gets the list of the values of physical variables.

    • frequency : Gets the number of identical solutions.