Computation manages the interactions between your code and a solver, which manages interactions between the remote resource and your submitted problems.

Your solver instantiates a Future object for its calls, via D-Wave Sampler API (SAPI) servers, to the remote resource.

You can interact through the Future object with pending (running) or completed computation—sampling on a QPU or software solver—executed remotely, monitoring problem status, waiting for and retrieving results, cancelling enqueued jobs, etc.

Some Future methods are blocking.


class Future(solver, id_, return_matrix=False)[source]

Class for interacting with jobs submitted to SAPI.

Solver uses Future to construct objects for pending SAPI calls that can wait for requests to complete and parse returned messages.

Objects are blocked for the duration of any data accessed on the remote resource.


Future objects are not intended to be directly created. Problem submittal is initiated by one of the solvers in solver module and executed by one of the clients.

  • solver (Solver) – Solver responsible for this Future object.
  • id (str, optional, default=None) – Identification for a query submitted by a solver to SAPI. May be None following submission until an identification number is set.
  • return_matrix (bool, optional, default=False) – Return values for this Future object are NumPy matrices.


This example creates a solver using the local system’s default D-Wave Cloud Client configuration file, submits a simple QUBO problem to a remote D-Wave resource for 100 samples, and checks a couple of times whether the sampling is completed.

>>> from import Client
>>> client = Client.from_config()       # doctest: +SKIP
>>> solver = client.get_solver()        # doctest: +SKIP
>>> u, v = next(iter(solver.edges))     # doctest: +SKIP
>>> Q = {(u, u): -1, (u, v): 0, (v, u): 2, (v, v): -1}   # doctest: +SKIP
>>> computation = solver.sample_qubo(Q, num_reads=100)   # doctest: +SKIP
>>> computation.done()  # doctest: +SKIP
>>>   # doctest: +SKIP
>>> computation.done()   # doctest: +SKIP
>>> client.close()       # doctest: +SKIP


Future.result() Results for a submitted job.
Future.error Deprecated in favor of exception().
Future.as_completed(fs[, timeout]) Yield Futures objects as they complete.
Future.wait([timeout]) Wait for the solver to receive a response for a submitted problem.
Future.wait_id([timeout]) Blocking id getter.
Future.wait_sampleset() Blocking sampleset getter.
Future.wait_multiple(futures[, min_done, …]) Wait for multiple Future objects to complete.
Future.done() Check whether the solver received a response for a submitted problem.
Future.cancel() Try to cancel the problem corresponding to this result.


Future.samples State buffer for the submitted job.
Future.variables List of active variables in response/answer.
Future.energies Energy buffer for the submitted job.
Future.num_occurrences Number of sample occurrences buffer for the submitted job.
Future.occurrences Deprecated in favor of Future.num_occurrences property.
Future.sampleset Return SampleSet representation of the results. The id the server will use to identify this problem, None until the id is actually known
Future.problem_type Submitted problem type for this computation, as returned by the solver API.
Future.timing Timing information about a solver operation.