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¶
-
dwave.cloud.solver.Solver¶ alias of
dwave.cloud.solver.StructuredSolver
-
class
dwave.cloud.solver.BaseSolver(client, data)¶ 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.id # doctest: +SKIP 'EXAMPLE_2000Q_SYSTEM'
- client (
-
class
dwave.cloud.solver.StructuredSolver(*args, **kwargs)¶ 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.
- client (
-
class
dwave.cloud.solver.UnstructuredSolver(client, data)¶ Class for D-Wave unstructured 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.
- client (
Methods¶
StructuredSolver.check_problem(linear, quadratic) |
Test if an Ising model matches the graph provided by the solver. |
StructuredSolver.sample_ising(linear, …) |
Sample from the specified Ising model. |
StructuredSolver.sample_qubo(qubo, **params) |
Sample from the specified QUBO. |
StructuredSolver.max_num_reads(**params) |
Returns the maximum number of reads for the given solver parameters. |
UnstructuredSolver.sample_ising(linear, …) |
Sample from the specified BQM. |
UnstructuredSolver.sample_qubo(qubo, **params) |
Sample from the specified QUBO. |
UnstructuredSolver.sample_bqm(bqm, **params) |
Sample from the specified BQM. |
Properties¶
BaseSolver.name |
|
BaseSolver.online |
Is this solver online (or offline)? |
BaseSolver.avg_load |
Solver’s average load, at the time of description fetch. |
BaseSolver.qpu |
Is this a QPU-based solver? |
BaseSolver.software |
Is this a software-based solver? |
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 |