qat.frontend.custom module
- class CustomFrontend(model, pipeline=None)
Bases:
BaseFrontend
Frontend that uses a custom pipeline to compile the input to an IR. While it is not equipped with a specific parser, it allows the user to specify custom compilation requirements via a pipeline.
- Parameters:
model¶ (
None
|QuantumHardwareModel
|PhysicalHardwareModel
) – The hardware model that holds calibrated information on the qubits on the QPU, defaults to None.pipeline¶ (
Optional
[PassManager
]) – The custom pipeline, defaults to None.
- check_and_return_source(src)
Custom frontends are too flexible to have any type checking, so just return the source file.
- emit(src, res_mgr=None, met_mgr=None, compiler_config=None)
Compiles an input
QatInput
down toQatIR
with the custom pipeline and emits it. :type _sphinx_paramlinks_qat.frontend.custom.CustomFrontend.emit.src:Union
[str
,bytes
,InstructionBuilder
] :param _sphinx_paramlinks_qat.frontend.custom.CustomFrontend.emit.src: The high-level input. :type _sphinx_paramlinks_qat.frontend.custom.CustomFrontend.emit.res_mgr:Optional
[ResultManager
] :param _sphinx_paramlinks_qat.frontend.custom.CustomFrontend.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.
- Returns:
An intermediate representation as an
InstructionBuilder
which holds a list of instructions to be executed on the QPU.