qblox_scheduler.operations.statements#
Assignment statement operation.
Classes#
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.OperationAssign 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:
variable (Variable) – Target variable to receive the value. Must have been declared with
declare().value (Variable or Expression or int or float) – Value to assign. May be another
Variable, an arithmeticExpressionbuilt from variables/literals, or a plainint/floatliteral.
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.