app.processing.pre

Each single qasm snippet attached to a node will first pass through the preprocessing pipeline.

This happens without the global graph view. The steps are:

  • parse implementation if it is a string

  • convert to OpenQASM 3 if in OpenQASM 2

  • rename the identifiers by prefixing with node id

  • inline constants

  • parse annotation info

  • upcast inputs if they are too small for the required spec

Submodules

Package Contents

app.processing.pre.preprocess(node: app.processing.graph.ProgramNode, implementation: str | openqasm3.ast.Program, requested_inputs: dict[int, app.model.data_types.LeqoSupportedType] | None = None) app.processing.graph.ProcessedProgramNode

Run an openqasm3 snippet through the preprocessing pipeline.

Parameters:
Returns:

The preprocessed program.

Return type:

app.processing.graph.ProcessedProgramNode