app.enricher.gates

Provides enricher strategy for gate nodes

Module Contents

app.enricher.gates.enrich_gate(node: app.model.CompileRequest.Node, constraints: app.enricher.Constraints | None, gate_name: str, input_count: int, *arguments: openqasm3.ast.Expression) app.enricher.EnrichmentResult

Generate implementation for gate nodes.

Parameters:
  • node (app.model.CompileRequest.Node) – Node that defined the gate. (Used as context for errors etc.)

  • constraints (app.enricher.Constraints | None) – Constraints that should be applied.

  • gate_name (str) – Name of the gate to generate.

  • input_count (int) – Count of expected inputs.

  • arguments (openqasm3.ast.Expression) – Optional arguments passed to the gate.

Returns:

Final enrichment result.

Return type:

app.enricher.EnrichmentResult

class app.enricher.gates.GateEnricherStrategy

Enricher strategy capable of enriching gate nodes.