Solver#

A solver is a resource for solving problems.

Solvers are responsible for:

  • Encoding submitted problems

  • Checking submitted parameters

  • Decoding answers

  • Adding problems to a client’s submission queue

You can list all solvers available to a Client with its get_solvers() method and select and return one with its get_solver() method.

Class#

Solver[source]#

alias of StructuredSolver

class BaseSolver(client: dwave.cloud.Client | None, data: dict | SolverConfiguration)[source]#

Base class for a general D-Wave solver.

This class provides Ising, QUBO and BQM sampling methods and encapsulates the solver description returned from the D-Wave cloud API.

Parameters:
  • client (Client) – Client that manages access to this solver.

  • data (dict) – Data from the server describing this solver.

Examples

This example creates a client using the local system’s default D-Wave Cloud Client configuration file and checks the identity of its default solver.

>>> from dwave.cloud import Client
>>> with Client.from_config() as client:
...     solver = client.get_solver()
...     solver.name     
'Advantage_system4'
class StructuredSolver(*args, **kwargs)[source]#

Class for D-Wave structured solvers.

This class provides Ising, QUBO and BQM sampling methods and encapsulates the solver description returned from the D-Wave cloud API.

Parameters:
  • client (Client) – Client that manages access to this solver.

  • data (dict) – Data from the server describing this solver.

UnstructuredSolver[source]#

alias of BQMSolver

Methods#

StructuredSolver.check_problem(linear, quadratic)

Test if an Ising model matches the graph provided by the solver.

StructuredSolver.estimate_qpu_access_time(...)

Estimates QPU access time for a submission to the selected solver.

StructuredSolver.max_num_reads(**params)

Returns the maximum number of reads for the given solver parameters.

StructuredSolver.reformat_parameters(...[, ...])

Reformat some solver parameters for SAPI.

StructuredSolver.sample_bqm(bqm[, label])

Sample from the specified BQM.

StructuredSolver.sample_ising(linear, quadratic)

Sample from the specified Ising model.

StructuredSolver.sample_qubo(qubo[, offset, ...])

Sample from the specified QUBO.

UnstructuredSolver.sample_ising(linear, ...)

Sample from the specified Ising model.

UnstructuredSolver.sample_qubo(qubo[, ...])

Sample from the specified QUBO.

UnstructuredSolver.sample_bqm(bqm[, label])

Sample from the specified BQM.

UnstructuredSolver.upload_bqm(bqm)

Upload the specified BQM to SAPI, returning a Problem ID that can be used to submit the BQM to this solver (i.e. call the sample_bqm() method).

BQMSolver.sample_ising(linear, quadratic[, ...])

Sample from the specified Ising model.

BQMSolver.sample_qubo(qubo[, offset, label])

Sample from the specified QUBO.

BQMSolver.sample_bqm(bqm[, label])

Sample from the specified BQM.

BQMSolver.upload_bqm(bqm)

Upload the specified BQM to SAPI, returning a Problem ID that can be used to submit the BQM to this solver (i.e. call the sample_bqm() method).

CQMSolver.sample_cqm(cqm[, label])

Sample from the specified CQM.

CQMSolver.upload_cqm(cqm)

Upload the specified CQM to SAPI, returning a Problem ID that can be used to submit the CQM to this solver (i.e. call the .sample_cqm method).

DQMSolver.sample_dqm(dqm[, label])

Sample from the specified DQM.

DQMSolver.upload_dqm(dqm)

Upload the specified DQM to SAPI, returning a Problem ID that can be used to submit the DQM to this solver (i.e. call the .sample_dqm method).

NLSolver.sample_nlm(model[, label, ...])

Sample from the specified NL model.

NLSolver.upload_nlm(model, **upload_params)

Upload the specified NL model to SAPI, returning a Problem ID that can be used to submit the NL model to this solver (i.e. call the sample_nlm() method).

Properties#

BaseSolver.identity

Solver identity/specification (name, version, etc)

BaseSolver.name

Solver name.

BaseSolver.avg_load

Solver's average load, at the time of description fetch.

BaseSolver.online

Is this solver online (or offline)?

BaseSolver.qpu

Is this a QPU-based solver?

BaseSolver.hybrid

Is this a hybrid quantum-classical solver?

BaseSolver.software

Is this a software-based solver?

StructuredSolver.nodes

The nodes in this solver's graph.

StructuredSolver.variables

Alias for nodes.

StructuredSolver.edges

(a,b) and (b,a).

StructuredSolver.couplers

Alias for edges.

StructuredSolver.undirected_edges

The edges in this solver's graph, with each edge represented only once.

StructuredSolver.graph_id

QPU solver working graph id.

StructuredSolver.version

QPU solver version dict (contains at least graph_id).

StructuredSolver.num_active_qubits

The number of active (encoding) qubits.

StructuredSolver.num_qubits

Nominal number of qubits on chip (includes active AND inactive).

StructuredSolver.is_vfyc

Is this a virtual full-yield chip?

StructuredSolver.has_flux_biases

Solver supports/accepts flux_biases.

StructuredSolver.has_anneal_schedule

Solver supports/accepts anneal_schedule.

StructuredSolver.lower_noise