pygsti.tools.edesigntools.calculate_edesign_estimated_runtime

pygsti.tools.edesigntools.calculate_edesign_estimated_runtime#

calculate_edesign_estimated_runtime(edesign, gate_time_dict=None, gate_time_1Q=None, gate_time_2Q=None, measure_reset_time=0.0, interbatch_latency=0.0, total_shots_per_circuit=1000, shots_per_circuit_per_batch=None, circuits_per_batch=None)#

Estimate the runtime for an ExperimentDesign from gate times and batch sizes.

The rough model is that the required circuit shots are split into batches, where each batch runs a subset of the circuits for some fraction of the needed shots. One round consists of running all batches once, i.e. collecting some shots for all circuits, and rounds are repeated until the required number of shots is met for all circuits.

In addition to gate times, the user can also provide the time at the end of each circuit for measurement and/or reset, as well as the latency between batches for classical upload/ communication of the next set of circuits. Since times are user-provided, this function makes no assumption on the units of time, only that a consistent unit is used for all times.

Parameters:
  • edesign (ExperimentDesign) – An experiment design containing all required circuits.

  • gate_time_dict (dict) – Dictionary with keys as either gate names or gate labels (for qubit-specific overrides) and values as gate time in user-specified units. All operations in the circuits of edesign must be specified. Either gate_time_dict or both gate_time_1Q and gate_time_2Q must be specified.

  • gate_time_1Q (float) – Gate time in user-specified units for all operations acting on one qubit. Either gate_time_dict or both gate_time_1Q and gate_time_2Q must be specified.

  • gate_time_2Q (float) – Gate time in user-specified units for all operations acting on more than one qubit. Either gate_time_dict or both gate_time_1Q and gate_time_2Q must be specified.

  • measure_reset_time (float) – Measurement and/or reset time in user-specified units. This is applied once for every circuit.

  • interbatch_latency (float) – Time between batches in user-specified units.

  • total_shots_per_circuit (int) – Total number of shots per circuit. Together with shots_per_circuit_per_batch, this will determine the total number of rounds needed.

  • shots_per_circuit_per_batch (int) – Number of shots to do for each circuit within a batch. Together with total_shots_per_circuit, this will determine the total number of rounds needed. If None, this is set to the total shots, meaning that only one round is done.

  • circuits_per_batch (int) – Number of circuits to include in each batch. Together with the number of circuits in edesign, this will determine the number of batches in each round. If None, this is set to the total number of circuits such that only one batch is done.

Returns:

The estimated time to run the experiment design.

Return type:

float