autoqasm.converters.arithmetic module

Converters for aritmetic operator nodes

class autoqasm.converters.arithmetic.ArithmeticTransformer(ctx)[source]

Bases: Base

Transformer for arithmetic nodes.

Initialize the transformer.

Subclasses should call this.

Parameters:

ctx – A Context object.

visit_BinOp(node: stmt) stmt[source]

Transforms a BinOp node. Args :

node(ast.stmt) : AST node to transform

Returns :

ast.stmt : Transformed node

autoqasm.converters.arithmetic.transform(node: stmt, ctx: ControlStatusCtx) stmt[source]

Transform arithmetic nodes. :param node: AST node to transform :type node: ast.stmt :param ctx: Transformer context. :type ctx: ag_ctx.ControlStatusCtx

Returns :

ast.stmt : Transformed node.