app.processing ============== .. py:module:: app.processing .. autoapi-nested-parse:: Provides the core logic of the backend. Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/app/processing/frontend_graph/index /autoapi/app/processing/graph/index /autoapi/app/processing/merge/index /autoapi/app/processing/optimize/index /autoapi/app/processing/post/index /autoapi/app/processing/pre/index /autoapi/app/processing/utils/index Package Contents ---------------- .. py:class:: CommonProcessor(enricher: app.enricher.Enricher, frontend_graph: frontend_graph.FrontendGraph, optimize_settings: app.model.CompileRequest.OptimizeSettings) Process a :class:`~app.processing.frontend_graph.FrontendGraph`. :param enricher: The enricher to use to get node implementations :frontend_graph: The graph to process :optimize_settings: Specify how to optimize the result .. py:class:: MergingProcessor(enricher: app.enricher.Enricher, frontend_graph: frontend_graph.FrontendGraph, optimize_settings: app.model.CompileRequest.OptimizeSettings) Process request with the whole pipeline. .. py:method:: process_nodes() -> None :async: Process graph by enriching and preprocessing the nodes. .. py:method:: process() -> str :async: Process the :class:`~app.model.CompileRequest`. #. Enrich frontend nodes. #. :meth:`~app.processing.pre.preprocess` frontend nodes. #. Optionally :meth:`~app.processing.optimize.optimize` graph width. #. :meth:`~app.processing.merge.merge_nodes` and #. :meth:`~app.processing.post.postprocess` into final program. :return: The final QASM program as a string. .. py:class:: EnrichingProcessor(enricher: app.enricher.Enricher, frontend_graph: frontend_graph.FrontendGraph, optimize_settings: app.model.CompileRequest.OptimizeSettings) Return enrichment for all nodes. .. py:method:: enrich() -> collections.abc.AsyncIterator[app.model.CompileRequest.ImplementationNode] :async: Yield enrichment of nodes. .. py:method:: enrich_all() -> list[app.model.CompileRequest.ImplementationNode] :async: Get list of all enrichments. .. py:class:: EnrichmentInserter(inserts: list[app.model.CompileRequest.SingleInsert], enricher: app.enricher.Enricher, engine: sqlalchemy.ext.asyncio.AsyncEngine) Insert enrichment implementations for frontend-nodes into the Enricher. .. py:method:: insert_all() -> None :async: Insert all enrichments.