app.transformation_manager.graph

Basic program graph used withing the app.transformation_manager.

Module Contents

class app.transformation_manager.graph.ProgramNode(name: str, label: str | None = None, is_ancilla_node: bool = False, id: uuid.UUID | None = None)

Represents a node in a visual model of an openqasm3 program.

Parameters:
  • name (str) – The id given from the front-end.

  • id (uuid.UUID | None) – Unique ID of this node, used in the renaming.

  • label (str | None) – (Optional) Label given from the front-end.

  • is_ancilla_node (bool) – This node is ancilla node in the model.

class app.transformation_manager.graph.IOConnection

Map output-reg from source to target input-reg with specified size.

class app.transformation_manager.graph.AncillaConnection

Map output qubits from source to target input qubits.

The qubits are identified via the id specified in IOInfo.

class app.transformation_manager.graph.ProgramGraph

Internal representation of the program graph.

class app.transformation_manager.graph.QubitInfo

Store QubitIDs of declarations and the various ancilla types.

Parameters:
  • declaration_to_ids – Maps declared names to corresponding qubits ids.

  • clean_ids – List of required reusable/fresh/uncomputed qubit ids.

  • dirty_ids – List of required (possible) dirty qubits.

  • reusable_ids – List of returned reusable qubits.

  • uncomputable_ids – List of qubits that are reusable after uncompute.

  • entangled_ids – List of qubits that are always returned dirty.

class app.transformation_manager.graph.ClassicalIOInstance

Single input/output from a snippet of type classical.

Parameters:
  • name – Name of the annotated variable.

  • type – Type of the annotated variable.

class app.transformation_manager.graph.QubitIOInstance

Single input/output from a snippet of type qubits.

Parameters:
  • name – Name of the annotated variable.

  • ids – List of annotated qubit ids.

class app.transformation_manager.graph.IOInfo

Input/output info for a single snippet.

Parameters:
  • inputs – Maps input-index to (Qubit/Classical)IOInstance.

  • outputs – Maps output-index to (Qubit/Classical)IOInstance.

class app.transformation_manager.graph.ProcessedProgramNode

Store a qasm snippet as string and AST.

Parameters:
  • raw – The corresponding ProgramNode.

  • implementation – The implementation as AST. Might be modified during processing.

  • io – Input/output information required for connections.

  • qubit – Qubit information required for optimization.