app.processing.pre.io_parser
Parse input/output info for single code snippet over leqo-annotations.
Module Contents
- class app.processing.pre.io_parser.ParseAnnotationsVisitor(io: app.processing.graph.IOInfo, qubit: app.processing.graph.QubitInfo)
Non-modifying visitor to parse leqo annotations.
- Parameters:
io (app.processing.graph.IOInfo) – The
IOInfo
to be modified in-place.qubit (app.processing.graph.QubitInfo) – The
QubitInfo
to be modified in-place.
- get_declaration_annotation_info(name: str, annotations: list[openqasm3.ast.Annotation]) tuple[int | None, bool]
Extract annotation info for declaration, throw error on bad usage.
- get_alias_annotation_info(name: str, annotations: list[openqasm3.ast.Annotation]) tuple[int | None, bool]
Extract annotation info for alias, throw error on bad usage.
- get_branching_annotation_info(annotations: list[openqasm3.ast.Annotation]) bool
Extract annotation info for branching statement, throw error on bad usage.
- Parameters:
annotations (list[openqasm3.ast.Annotation])
- Return type:
- visit_QubitDeclaration(node: openqasm3.ast.QubitDeclaration) openqasm3.ast.QASMNode
Parse qubit-declarations and their corresponding input/dirty annotations.
- Parameters:
- Return type:
- visit_ClassicalDeclaration(node: openqasm3.ast.ClassicalDeclaration) openqasm3.ast.QASMNode
Parse classical-declarations and their corresponding input annotations.
- Parameters:
- Return type:
- visit_AliasStatement(node: openqasm3.ast.AliasStatement) openqasm3.ast.QASMNode
Parse alias and their corresponding output/reusalbe annotations.
- Parameters:
node (openqasm3.ast.AliasStatement)
- Return type:
- visit_BranchingStatement(node: openqasm3.ast.BranchingStatement) openqasm3.ast.QASMNode
Parse if-then-else-block and their corresponding uncompute annotations.
- Parameters:
- Return type:
- static raise_on_non_contiguous_range(numbers: set[int], name_of_check: str) None
Check if int-set is contiguous and starting from 0.
- visit_Program(node: openqasm3.ast.Program) openqasm3.ast.QASMNode
Ensure contiguous input/output indexes and compute returned-dirty qubits.
- Parameters:
node (openqasm3.ast.Program)
- Return type: