Parameter¶
- class lightworks.Parameter(value: T, bounds: list[Number] | None = None, label: str | None = None)¶
Enables the definition a modifiable parameter that can be used as part of a Circuit. It allows for the parameter to be modified after utilisation in a Circuit for the adjustment of the functionality with having to redefine the entire object. Once created the value of the parameter should be modified with the get and set functions.
- Parameters:
value (Any) – The value to be assigned to the parameter.
bounds (list | None, optional) – If specified this allows for restrictions to be implemented on the value of each parameter. In optimisations this can also used to set parameter bounds if the optimisation allows. Bounds should be given as a list in the format [min_bound, max_bound]. Note bounds are only supported in the case of Numeric values.
label (str | None, optional) – Used to set an optional label which is then shown when using the display circuit method, instead of the parameter value.
- get() T ¶
Returns the current value of the parameter.
- has_bounds() bool ¶
Checks if the parameter has at least one bound given.
- property max_bound: Number | None¶
The upper bound of the parameter value.
- property min_bound: Number | None¶
The lower bound of the parameter value.
- set(value: Any) None ¶
Update the current value of the parameter.