app.processing.pre.io_parser ============================ .. py:module:: app.processing.pre.io_parser .. autoapi-nested-parse:: Parse input/output info for single code snippet over leqo-annotations. Module Contents --------------- .. py:class:: ParseAnnotationsVisitor(io: app.processing.graph.IOInfo, qubit: app.processing.graph.QubitInfo) Non-modifying visitor to parse leqo annotations. :param io: The :class:`~app.processing.graph.IOInfo` to be modified in-place. :param qubit: The :class:`~app.processing.graph.QubitInfo` to be modified in-place. .. py:method:: 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. .. py:method:: 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. .. py:method:: get_branching_annotation_info(annotations: list[openqasm3.ast.Annotation]) -> bool Extract annotation info for branching statement, throw error on bad usage. .. py:method:: visit_QubitDeclaration(node: openqasm3.ast.QubitDeclaration) -> openqasm3.ast.QASMNode Parse qubit-declarations and their corresponding input/dirty annotations. .. py:method:: visit_ClassicalDeclaration(node: openqasm3.ast.ClassicalDeclaration) -> openqasm3.ast.QASMNode Parse classical-declarations and their corresponding input annotations. .. py:method:: visit_AliasStatement(node: openqasm3.ast.AliasStatement) -> openqasm3.ast.QASMNode Parse alias and their corresponding output/reusalbe annotations. .. py:method:: visit_BranchingStatement(node: openqasm3.ast.BranchingStatement) -> openqasm3.ast.QASMNode Parse if-then-else-block and their corresponding uncompute annotations. .. py:method:: raise_on_non_contiguous_range(numbers: set[int], name_of_check: str) -> None :staticmethod: Check if int-set is contiguous and starting from 0. .. py:method:: visit_Program(node: openqasm3.ast.Program) -> openqasm3.ast.QASMNode Ensure contiguous input/output indexes and compute returned-dirty qubits.