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:
Returns:

A new globally unique identifier.

Return type:

openqasm3.ast.Identifier

visit_Identifier(node: openqasm3.ast.Identifier, _context: uuid.UUID) openqasm3.ast.Identifier

Renames identifiers using the old declaration names.

Parameters:
Returns:

Modified identifier

Return type:

openqasm3.ast.Identifier