app.enricher.utils

Utils for generating implementations for a Node in an EnricherStrategy.

Module Contents

app.enricher.utils.implementation(node: app.model.CompileRequest.Node, statements: list[openqasm3.ast.Statement | openqasm3.ast.Pragma]) app.enricher.ParsedImplementationNode

Creates an ImplementationNode from partial syntax tree.

Parameters:
Return type:

app.enricher.ParsedImplementationNode

app.enricher.utils.leqo_input(name: str, index: int, size: int | None) openqasm3.ast.QubitDeclaration

Creates a qubit input declaration.

Parameters:
  • name (str) – Identifier of the input declaration

  • index (int) – Index of the input

  • size (int | None) – Size of the input (in qubits)

Return type:

openqasm3.ast.QubitDeclaration

app.enricher.utils.leqo_output(name: str, index: int, value: openqasm3.ast.Concatenation | openqasm3.ast.Identifier) openqasm3.ast.AliasStatement

Creates an output declaration.

Parameters:
Return type:

openqasm3.ast.AliasStatement