app.processing
Provides the core logic of the backend.
Submodules
Package Contents
- class app.processing.CommonProcessor(enricher: app.enricher.Enricher, frontend_graph: frontend_graph.FrontendGraph, optimize_settings: app.model.CompileRequest.OptimizeSettings)
Process a
FrontendGraph
.- Parameters:
enricher (app.enricher.Enricher) – The enricher to use to get node implementations
frontend_graph (frontend_graph.FrontendGraph)
optimize_settings (app.model.CompileRequest.OptimizeSettings)
- Frontend_graph:
The graph to process
- Optimize_settings:
Specify how to optimize the result
- class app.processing.MergingProcessor(enricher: app.enricher.Enricher, frontend_graph: frontend_graph.FrontendGraph, optimize_settings: app.model.CompileRequest.OptimizeSettings)
Process request with the whole pipeline.
- Parameters:
enricher (app.enricher.Enricher)
frontend_graph (frontend_graph.FrontendGraph)
optimize_settings (app.model.CompileRequest.OptimizeSettings)
- async process_nodes() None
Process graph by enriching and preprocessing the nodes.
- Return type:
None
- async process() str
Process the
CompileRequest
.Enrich frontend nodes.
preprocess()
frontend nodes.Optionally
optimize()
graph width.merge_nodes()
andpostprocess()
into final program.
- Returns:
The final QASM program as a string.
- Return type:
- class app.processing.EnrichingProcessor(enricher: app.enricher.Enricher, frontend_graph: frontend_graph.FrontendGraph, optimize_settings: app.model.CompileRequest.OptimizeSettings)
Return enrichment for all nodes.
- Parameters:
enricher (app.enricher.Enricher)
frontend_graph (frontend_graph.FrontendGraph)
optimize_settings (app.model.CompileRequest.OptimizeSettings)
- async enrich() collections.abc.AsyncIterator[app.model.CompileRequest.ImplementationNode]
Yield enrichment of nodes.
- async enrich_all() list[app.model.CompileRequest.ImplementationNode]
Get list of all enrichments.
- Return type:
- class app.processing.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.
- Parameters:
inserts (list[app.model.CompileRequest.SingleInsert])
enricher (app.enricher.Enricher)
engine (sqlalchemy.ext.asyncio.AsyncEngine)