app.processing.pre.renaming
Transformer to rename identifiers in a qasm program to globally unique names.
Module Contents
- class app.processing.pre.renaming.RenameRegisterTransformer
Renames all declarations inside a qasm program to prevent collisions when merging.
- new_identifier(old_identifier: openqasm3.ast.Identifier, context: uuid.UUID) openqasm3.ast.Identifier
Generates a new identifier that will be globally unique even after merging multiple programs. Adds the old identifier to the list of renames.
- Parameters:
old_identifier (openqasm3.ast.Identifier) – The old identifier to be renamed.
context (uuid.UUID) – The context of the current program.
- Returns:
A new globally unique identifier.
- Return type:
- visit_Identifier(node: openqasm3.ast.Identifier, _context: uuid.UUID) openqasm3.ast.Identifier
Renames identifiers using the old declaration names.
- Parameters:
node (openqasm3.ast.Identifier) – Identifier to rename
_context (uuid.UUID)
- Returns:
Modified identifier
- Return type: