atomiq.components.optimizers ============================ .. py:module:: atomiq.components.optimizers Classes ------- .. autoapisummary:: atomiq.components.optimizers.Optimizer atomiq.components.optimizers.BoundOptimizer atomiq.components.optimizers.BisectionOptimizer Module Contents --------------- .. py:class:: Optimizer(actor_component, actor_name, monitor_component, monitor_name, *args, **kwargs) Bases: :py:obj:`atomiq.components.primitives.Component` An atomiq Component Every component in atomiq inherits from this class. It provides basic functionality for automatic and recursive building and initialization of components (prepare, build, prerun). It also takes care for joining kernel invariants along the inheritance tree. .. Note:: The arguments `parent` and `identifier` are automatically passed to the component object by the atomiq object builder. :param parent: The parent context of the component. Usually this is the experiment that uses the component :param identifier: A unique name to identify the component. :param debug_output: Set whether the component should show debug output. Using this switch rather than the debug kernel logger can allow the compiler to not include the debug commands in the kernel code if the output is not needed. .. py:attribute:: kernel_invariants .. py:attribute:: actor .. py:attribute:: monitor .. py:attribute:: actor_name .. py:method:: optimize() :abstractmethod: .. py:class:: BoundOptimizer(actor_min, actor_max, *args, **kwargs) Bases: :py:obj:`Optimizer` An Optimizer with restrictions on the values of the actor. :param actor_min: The minumum value the actor is allowed to take during optimization :param actor_max: The maxiumum value the actor is allowed to take during optimization .. py:attribute:: kernel_invariants .. py:attribute:: actor_min .. py:attribute:: actor_max .. py:class:: BisectionOptimizer(timestep=325 * us, epsilon=0.01, max_steps=20, switch_actor = False, *args, **kwargs) Bases: :py:obj:`BoundOptimizer` An optimizer that uses bisection to achieve the optimization target on the monitor :param timestep: The time the individual steps in the algorithm take :param epsilon: Acceptable relative difference from the target value (default 0.01, i.e. 1% of the target value) :param switch_actor: If True, the actor (needs to be Switchable) is switched on before the measurement of the monitor and switched off after (default False) .. py:attribute:: kernel_invariants .. py:attribute:: timestep .. py:attribute:: epsilon :value: 0.01 .. py:attribute:: max_steps :value: 20 .. py:attribute:: switch_actor :value: False .. py:method:: _actor_on() .. py:method:: _actor_off() .. py:method:: optimize(target)