qat.middleend.base module
- class BaseMiddleend(model)
Bases:
ABCBase class for a middle end that takes an intermediate representation (IR)
QatIRand alters it based on optimisation and/or validation passes.- Parameters:
model¶ (
None|QuantumHardwareModel) – The hardware model that holds calibrated information on the qubits on the QPU.
- abstract emit(ir, res_mgr=None, met_mgr=None, compiler_config=None, **kwargs)
Converts an IR
QatIRto an optimised IR. :type _sphinx_paramlinks_qat.middleend.base.BaseMiddleend.emit.ir: :param _sphinx_paramlinks_qat.middleend.base.BaseMiddleend.emit.ir: The intermediate representation. :type _sphinx_paramlinks_qat.middleend.base.BaseMiddleend.emit.res_mgr:Optional[ResultManager] :param _sphinx_paramlinks_qat.middleend.base.BaseMiddleend.emit.res_mgr: Collection of analysis results with caching and aggregationcapabilities, defaults to None.
- Parameters:
met_mgr¶ (
Optional[MetricsManager]) – Stores useful intermediary metrics that are generated during compilation, defaults to None.compiler_config¶ (
Optional[CompilerConfig]) – Compiler settings, defaults to None.
- class CustomMiddleend(model, pipeline=None)
Bases:
BaseMiddleendMiddle end that uses a custom pipeline to convert the IR to an (optimised) IR.
- Parameters:
model¶ (
None|QuantumHardwareModel) – The hardware model that holds calibrated information on the qubits on the QPU.
- emit(ir, res_mgr=None, met_mgr=None, compiler_config=None, **kwargs)
Converts an IR
QatIRto an optimised IR with a custom pipeline. :type _sphinx_paramlinks_qat.middleend.base.CustomMiddleend.emit.ir: :param _sphinx_paramlinks_qat.middleend.base.CustomMiddleend.emit.ir: The intermediate representation. :type _sphinx_paramlinks_qat.middleend.base.CustomMiddleend.emit.res_mgr:Optional[ResultManager] :param _sphinx_paramlinks_qat.middleend.base.CustomMiddleend.emit.res_mgr: Collection of analysis results with caching and aggregationcapabilities, defaults to None.
- Parameters:
met_mgr¶ (
Optional[MetricsManager]) – Stores useful intermediary metrics that are generated during compilation, defaults to None.compiler_config¶ (
Optional[CompilerConfig]) – Compiler settings, defaults to None.