qblox_scheduler.operations.statements#

Assignment statement operation.

Classes#

Assign

Assign a value to a variable.

Module Contents#

class Assign(variable: qblox_scheduler.operations.variables.Variable, value: qblox_scheduler.operations.variables.Variable | qblox_scheduler.operations.expressions.Expression | int | float)[source]#

Bases: qblox_scheduler.operations.operation.Operation

Assign a value to a variable.

The assigned value is evaluated and stored in the target variable. For a plain variable or literal this is a direct copy; for a more complex expression it is broken down into a short sequence of arithmetic operations.

Parameters:

Examples

from qblox_scheduler.operations.expressions import DType
from qblox_scheduler.operations.statements import Assign

offset = sched.declare(DType.AMPLITUDE)
sched.add(Assign(offset, 0.0))           # literal
sched.add(Assign(offset, start))          # variable copy
sched.add(Assign(offset, offset + step))  # arithmetic expression
property variable: qblox_scheduler.operations.variables.Variable[source]#

Target variable.

property value: qblox_scheduler.operations.variables.Variable | qblox_scheduler.operations.expressions.Expression | int | float[source]#

Value to assign.