qat.runtime.simple module

class SimpleRuntime(engine, results_pipeline=None, connection_mode=<ConnectionMode.DEFAULT: 3>, aggregator=None)

Bases: BaseRuntime

The entry point to the execution interface. Programs generated from the backend are wrapped in a :class:Executable object which further specifies high level metadata about acquisition restrictions such as the expected shape of any loop nest, the post-processing, and results formatting. The runtime provides the following services.

  • Execution batching: Some programs require memory specifications beyond that of the control hardware. It important to slice and batch-execute large programs. Equally important is necessity to aggregate results from different batches.

  • Postprocessing: Performs any required post-processing steps that haven’t been carried out real-time on the FPGA.

  • Error mitigation: Adjusts results based on error mitigation strategies.

These services are specified as a pipline of passes, see results_pipeline module.

Parameters:
  • engine (NativeEngine) – The execution engine for a target machine.

  • results_pipeline (Optional[PassManager]) – Optionally provided a pipeline for results processing. If not provided, a default pipeline is provided.

  • connection_mode (ConnectionMode) – Specifies how the connection is maintained.

execute(executable, res_mgr=None, met_mgr=None, **kwargs)

Fully execute a package against the hardware with batching of shots and results post-processing.

Parameters:
  • executable (Executable) – The executable program.

  • res_mgr (Optional[ResultManager]) – Optionally provide a results manager to save pass information.

  • met_mgr (Optional[MetricsManager]) – Optionally provide a metric manager to save pass information.

Returns:

Execution results.