dwave.cloud.computation.Future.done

Future.done()[source]

Check whether the solver received a response for a submitted problem.

Non-blocking call that checks whether the solver has received a response from the remote resource.

Returns:True if solver received a response.
Return type:Boolean

Examples

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 sampling is completed.

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