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:
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, **kwargs)

Compiles an input QatInput down to QatIR with the custom pipeline and emits it.

Parameters:
  • src (Union[str, bytes, InstructionBuilder]) – The high-level input.

  • res_mgr (Optional[ResultManager]) – Collection of analysis results with caching and aggregation capabilities, defaults to None.

  • 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.