qat.purr.compiler.runtime module
- class CalibrationWithArgs(calibration, args=None)
Bases:
QuantumExecutableBlock
Wrapper for a calibration and argument combination.
- run(runtime)
- class NewQuantumRuntime(execution_engine, metrics=None)
Bases:
QuantumRuntime
,InvokerMixin
Uses the new pass infrastructure.
Notice how polymorphic calls to XEngine.optimize() and XEngine.validate() are avoided. Instead, we have a flat structure of passes. This allows developers to focus on efficiently implementing a pass and easily test, demonstrate, and register passes without worrying too much about where it fits into the global compilation workflow.
The NewQuantumRuntime deliberately recognises the builder as the only acceptable form of input “IR” and refuses to take in a bare list of instructions. This reduces the constant confusion of “builder” vs “instructions”.
The NewQuantumRuntime is also deliberately stripped out of any handling of compilation metrics. In fact, ideas similar to the new pass infrastructure can be applied to compilation metrics, that’s why we’re excluding them during this iteration partly because other pieces need to come together and partly because the current iteration needs to be kept light-weight and technically tractable.
- build_pass_pipeline(*args, **kwargs)
- class QuantumExecutableBlock
Bases:
object
Generic executable block that can be run on a quantum runtime.
- run(runtime)
- class QuantumRuntime(execution_engine, metrics=None)
Bases:
MetricsMixin
- execute(instructions, results_format=None, repeats=None, error_mitigation=None)
Executes these instructions against the current engine and returns the results.
- property model
- run_calibration(calibrations)
Make ‘calibration’ distinct from ‘quantum executable’ for usabilities sake.
- run_quantum_executable(executables)
- class RemoteCalibration
Bases:
object
Base class for any remote calibration executions. These are far more complicated blocks than purely a string of instructions and include nested executions and rely on classic Python code.
- arguments_type()
Returns the type of this calibrations arguments.
- Return type:
type
- run(model, runtime, args)
- execute_instructions(hardware, instructions, config=None, executable_blocks=None, repeats=None, metrics=None, *args, **kwargs)
- get_builder(model)
- Return type:
- get_model(hardware)
- get_runtime(hardware)