dwave.cloud.solver.StructuredSolver.estimate_qpu_access_time

StructuredSolver.estimate_qpu_access_time(num_qubits: int, num_reads: int = 1, annealing_time: Optional[float] = None, anneal_schedule: Optional[List[Tuple[float, float]]] = None, initial_state: Optional[List[Tuple[float, float]]] = None, reverse_anneal: bool = False, reinitialize_state: bool = False, programming_thermalization: Optional[float] = None, readout_thermalization: Optional[float] = None, reduce_intersample_correlation: bool = False, **kwargs) float[source]

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

Estimates a problem’s quantum processing unit (QPU) access time from the parameter values you specify, timing data provided in the problem_timing_data solver property, and the number of qubits used to embed the problem on the selected QPU, as described in the system documentation.

Requires that you provide the number of qubits to be used for your problem submission. Embedding is typically heuristic and the number of required qubits can vary between executions.

Parameters
  • num_qubits – Number of qubits required to represent your binary quadratic model on the selected solver.

  • num_reads – Number of reads. Provide this value if you explictly set num_reads in your submission.

  • annealing_time – Annealing duration. Provide this value of if you set annealing_time in your submission.

  • anneal_schedule – Anneal schedule. Provide the anneal_schedule if you set it in your submission.

  • initial_state – Initial state. Provide the initial_state if your submission uses reverse annealing.

  • reinitialize_state – Set to True if your submission sets reinitialize_state.

  • programming_thermalization – programming thermalization time. Provide this value if you explictly set a value for programming_thermalization in your submission.

  • readout_thermalization – Set to True if your submission sets readout_thermalization.

  • reduce_intersample_correlation – Set to True if your submission sets reduce_intersample_correlation.

Returns

Estimated QPU access time, in microseconds.

Raises
  • KeyError – If a solver property, or a field in the problem_timing_data solver property, required by the timing model is missing for the selected solver.

  • ValueError – If conflicting parameters are set or the selected solver uses an unsupported timing model.

Examples

This example estimates the QPU access time for a ferromagnetic problem using all the selected QPU’s qubits before deciding whether to submit the problem.

>>> from dimod import BinaryQuadraticModel
>>> from dwave.cloud import Client
>>> reads = 100
>>> max_time = 100000
>>> with Client.from_config() as client:
...    solver = client.get_solver(qpu=True)
...    bqm = BinaryQuadraticModel({}, {edge: -1 for edge in solver.edges}, "BINARY")
...    num_qubits = len(solver.nodes)
...    estimated_runtime = solver.estimate_qpu_access_time(num_qubits, num_reads=reads) 
...    print("Estimate of {:.0f}us on {}".format(estimated_runtime, solver.name)) 
...    if estimated_runtime < max_time:
...       computation = solver.sample_bqm(bqm, num_reads=reads)
Estimate of 42657us on Advantage_system4.1
>>> print("QPU access time: {:.0f}us".format(computation.timing["qpu_access_time"]))  
QPU access time: 42640us