atomiq.components.primitives ============================ .. py:module:: atomiq.components.primitives .. autoapi-nested-parse:: All components in atomiq derive from the :class:`Component` class. In addition they can inherit from one or more primitive classes, depending on the properties of the respective component. If, for example, the component represents a device that can measure something, it will inherit from :class:`Measurable`. If on the other hand, it can be switched, it will inherit from :class:`Switchable`. Attributes ---------- .. autoapisummary:: atomiq.components.primitives.logger Classes ------- .. autoapisummary:: atomiq.components.primitives.Component atomiq.components.primitives.Measurable atomiq.components.primitives.Triggerable atomiq.components.primitives.Switchable atomiq.components.primitives.Parametrizable atomiq.components.primitives.Remote Functions --------- .. autoapisummary:: atomiq.components.primitives.add_or_append Module Contents --------------- .. py:data:: logger .. py:function:: add_or_append(obj, member, value) .. py:class:: Component(parent, identifier, debug_output = False, *args, **kwargs) Bases: :py:obj:`artiq.language.environment.HasEnvironment` 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:: experiment .. py:attribute:: identifier .. py:attribute:: debug_output :value: False .. py:attribute:: core .. py:attribute:: _kernel_invariants .. py:attribute:: _prepare_done :value: False .. py:attribute:: _build_done :value: False .. py:attribute:: _hooks_done :value: [] .. py:method:: _recursive_prepare() .. py:method:: _prepare() Specify here what should be done for this component in the prepare phase .. py:method:: _recursive_build() .. py:method:: _build() Specify here what should be done for this component in the build phase .. py:method:: _do_prerun() .. py:method:: required_components(ancestors=[]) .. py:method:: _prerun() Specify here what should be done for this component before the run starts. In contrast to the _build() method, the _prerun() routine is executed on the core device before the actual experiment starts. .. py:class:: Measurable(channels) .. py:attribute:: kernel_invariants .. py:method:: measure(channel = '') :abstractmethod: .. py:method:: measurement_channels() .. py:class:: Triggerable(channels) .. py:attribute:: kernel_invariants .. py:method:: fire(channel = '') :abstractmethod: .. py:class:: Switchable(channels) .. py:attribute:: kernel_invariants .. py:method:: on(channel = None) :abstractmethod: .. py:method:: off(channel = None) :abstractmethod: .. py:method:: is_on(channel = None) :abstractmethod: .. py:method:: toggle(channel = None) .. py:method:: pulse(pulsetime, channel = '') .. py:class:: Parametrizable(channels) .. py:attribute:: kernel_invariants .. py:method:: set_parameter(value, channel = None) .. py:class:: Remote(remote_reference, sync = False) .. py:attribute:: remote_reference .. py:attribute:: sync :value: False