atomica.optimization.Adjustable

class atomica.optimization.Adjustable(name, limit_type='abs', lower_bound=- inf, upper_bound=inf, initial_value=None)[source]

Bases: object

Class to store single optimizable parameter

An Adjustable represents a single entry in the ASD matrix. An Adjustment uses one or more Adjustables to make changes to the program instructions.

Parameters
  • name – The name of the adjustable

  • limit_type – If bounds are provided, are they relative or absolute ('abs' or 'rel')

  • lower_bound – Optionally specify minimum value

  • upper_bound – Optionally specify maximum value

  • initial_value – Optionally specify initial value. Most commonly, the initial value would be set by the Adjustment containing the Adjustable

Methods

get_hard_bounds

Return hard bounds for the adjustable

get_hard_bounds(x0=None)[source]

Return hard bounds for the adjustable

The hard bounds could be relative or absolute. If they are relative, then they are treated as being relative to the initial value for this adjustable. This is because not all adjustables can be directly drawn from the program instructions (e.g. parametric overwrites) in which case it would not be possible to extract initial values from the instructions alone. For consistency, all adjustables behave the same way with constraints relative to their initialization.

Parameters

x0 (Optional[float]) – The reference value for relative constraints - only required if the limit type is not absolute

Return type

tuple

Returns

A tuple with (min,max) limits