D-Wave Systems

D-Wave Sampler

D-Wave Systems offers a quantum annealing machine (quantum processing unit; QPU) that allows you to input QUBO or a combinatorial optimization problem expressed as a quadratic polynomial in Ising variables.

Tip

You can register as a Fixstars Amplify user to get a free trial API token for D-Wave Systems, or get an API token with your D-Wave Systems account.

Solver specification:

Client class

amplify.DWaveSamplerClient

Execution parameters

amplify.DWaveClientParameters

Execution results

dimod.sampleset.SampleSet

Execution time

dimod.sampleset.SampleSet.info["timing"]["qpu_access_time"]

API method

REST API (SAPI)

Execution parameter reference

📖 Parameters Reference

Binary variable

Ising variable

Integer variable

real variable

Objective function

2nd*

2nd*

-

-

Equality constraint

-

-

-

-

Inequality constraint

-

-

-

-

*: Problems involving both binary and Ising variables at the same time are not handled.

Client class:

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

Attribute

Data type

Details

solver

str

Get and set the name of the D-Wave Sampler to use

solver_names

list[str]

Get a list of D-Wave Sampler names that can be specified with the set token.

properties

dict

Get the solver properties to use (returns the same as dwave.system.samplers.DWaveSampler.properties)

Configuration example:
from amplify import DWaveSamplerClient

client = DWaveSamplerClient()

# Set API token
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Specify the solver to use
# (Specify one of the client.solver_names)
client.solver = "Advantage_system4.1"

# Set the number of runs to 1000
client.parameters.num_reads = 1000

See also

For the attribute you can set in amplify.DWaveSamplerClient.parameters, refer to 📖 Parameters Reference.

You can also get them from properties (the output will vary depending on the solver) as follows.

>>> client.properties["parameters"]
{'anneal_offsets': 'Anneal offsets for each working qubit, formatted as a list, with NaN specified for unused qubits.',
 'anneal_schedule': "Annealing schedule formatted as a piecewise linear list of floating-point pairs of 't' and 's'.",
 'annealing_time': 'Quantum annealing duration, in microseconds, as a positive floating point number.',
 ...}
Execution example:
from amplify import Model, VariableGenerator, solve

# Create 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)

Obtain the solver to use (if not specified, it will be determined automatically):

>>> client.solver
'Advantage_system4.1'

Obtain the list of solvers currently available:

>>> client.solver_names
['Advantage_system6.4', 'Advantage2_prototype2.5', 'Advantage_system4.1']

Obtain detailed execution time:

>>> result.client_result.info
{'timing': {'qpu_sampling_time': 66040.0,
  'qpu_anneal_time_per_sample': 20.0,
  'qpu_readout_time_per_sample': 25.46,
  'qpu_access_time': 81799.16,
  'qpu_access_overhead_time': 621.84,
  'qpu_programming_time': 15759.16,
  'qpu_delay_time_per_sample': 20.58,
  'total_post_processing_time': 1.0,
  'post_processing_overhead_time': 1.0},
 'problem_id': '14eaa606-9eed-4c72-83f1-d563bb0e1956'}

Leap’s Hybrid BQM Sampler

This is a hybrid solver from D-Wave Systems that works with quantum annealing machines (QPUs) and classical algorithms, allowing input of combinatorial optimization problems expressed as QUBOs or quadratic polynomials in Ising variables, and supporting input of larger problems than D-Wave Sampler.

Tip

You can register as a Fixstars Amplify user to get a free trial API token for D-Wave Systems, or get an API token with your D-Wave Systems account.

Solver specification:

Client class

amplify.LeapHybridSamplerClient

Execution parameters

amplify.DWaveClientParameters

Execution result

dimod.sampleset.SampleSet

Execution time

dimod.sampleset.SampleSet.info["run_time"]

API method

REST API (SAPI)

Execution parameter reference

📖 Parameters Reference

Binary variable

Ising variable

Integer variable

Real variable

Objective function

2nd

2nd

-

-

Equality constraint

-

-

-

-

Inequality constraint

-

-

-

-

Client class:

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

Attribute

Data type

Details

solver

str

Get and set the name of Leap’s Hybrid BQM Sampler.

solver_names

list[str]

Get a list of Leap’s Hybrid BQM sampler names that can be specified with the set token.

properties

dict

Get the properties of the solver to use (returns the same result as dwave.system.samplers.LeapHybridSampler.properties)

Configuration example:
from amplify import LeapHybridSamplerClient

client = LeapHybridSamplerClient()

# Set API token
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Get the solver to use
# (if not specified, it will be determined automatically)
# print(client.solver)

# Get a list of available solvers
# print(client.solver_names)

# Specify which solver ro use
# (Specify one of the names in client.solver_names)
client.solver = "hybrid_binary_quadratic_model_version2"

# Set the execution time limit to 5 seconds
client.parameters.time_limit = 5

See also

Dor attributes you can set in amplify.LeapHybridSamplerClient.parameters, refer to 📖 Parameters Reference.

You can also get them from properties as follows (the output will vary depending on the solver)

>>> client.properties["parameters"]
{'time_limit': 'Maximum requested runtime in seconds.'}
Execution example:
from amplify import Model, VariableGenerator, solve

# Create 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)

Obtain the solver to use (if not specified, it will be determined automatically):

>>> client.solver
'hybrid_binary_quadratic_model_version2'

Obtain the list of currently available solvers::

>>> client.solver_names
['hybrid_binary_quadratic_model_version2']

Obtain detailed execution time:

>>> result.client_result.info
{'qpu_access_time': 47632,
 'charge_time': 2989001,
 'run_time': 2989001,
 'problem_id': '745910bb-2e3b-4f3e-90fc-eb5734c637f3'}

Leap’s Hybrid CQM Sampler

This is a hybrid solver from D-Wave Systems that uses quantum annealing machines (QPUs) and classical algorithms to solve combinatorial optimization problems with QUBO or Ising, integer or real variable objective functions, and one or more constraints.

Tip

You can register as a Fixstars Amplify user to get a free trial API token for D-Wave Systems, or get an API token with your D-Wave Systems account.

Solver specification:

Client class

amplify.LeapHybridCQMSamplerClient

Execution parameters

amplify.DWaveClientParameters

Execution result

dimod.sampleset.SampleSet

Execution time

dimod.sampleset.SampleSet.info["run_time"]

API method

REST API (SAPI)

Execution parameter reference

📖 Parameters Reference

Binary variable

Ising variable

Integer variable

Real variable

Objective function

2nd

2nd

2nd

1st

Equality constraint

2nd

2nd

2nd

1st

Inequality constraint

2nd

2nd

2nd

1st

Client class:

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

Attribute

Data type

Details

solver

str

Get and set the name of Leap’s Hybrid BQM Sampler.

solver_names

list[str]

Get the list of Leap’s Hybrid BQM Sampler names you can use with the set token.

properties

dict

Get the properties of the solver to use (returns the same result as dwave.system.samplers.LeapHybridCQMSampler.properties)

Configuration example:
from amplify import LeapHybridCQMSamplerClient

client = LeapHybridCQMSamplerClient()

# Set an API token
client.token = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

# Specify the solver to use
# (Specify a name from client.solver_names)
client.solver = "hybrid_constrained_quadratic_model_version1p"

# Set an execution time limit to 3 seconds
client.parameters.time_limit = 3

See also

For attributes you can set in amplify.LeapHybridCQMSamplerClient.parameters, refer to 📖 Parameters Reference.

You can also get them from properties as follows (the output will vary depending on the solver)

>>> client.properties["parameters"]
{'time_limit': 'Maximum requested runtime in seconds.'}
Execution example:
from amplify import Model, VariableGenerator, solve

# Create 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)

Obtain the solver (if not specified it will be automatically set):

>>> client.solver
'hybrid_constrained_quadratic_model_version1p'

Obtain the list of the solvers currently available:

>>> client.solver_names
['hybrid_constrained_quadratic_model_version1p']

Obtain the solver version:

>>> client.version
'1.12'

Obtain detailed execution time:

>>> result.client_result.info
{'constraint_labels': [],
 'qpu_access_time': 15846,
 'charge_time': 4305380,
 'run_time': 4305380,
 'problem_id': '47db4ee7-2e60-4c99-99ae-b596914d4907'}