atomiq.components.primitives

All components in atomiq derive from the 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 Measurable. If on the other hand, it can be switched, it will inherit from Switchable.

Attributes

Classes

Functions

add_or_append(obj, member, value)

Module Contents

atomiq.components.primitives.logger
atomiq.components.primitives.add_or_append(obj, member, value)[source]
class atomiq.components.primitives.Component(parent, identifier, debug_output=False, *args, **kwargs)[source]

Bases: 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.

Parameters:
  • parent -- The parent context of the component. Usually this is the experiment that uses the component

  • identifier (artiq.language.types.TStr) -- A unique name to identify the component.

  • debug_output (artiq.language.types.TBool) -- 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.

kernel_invariants
experiment
identifier
debug_output = False
core
_kernel_invariants
_prepare_done = False
_build_done = False
_hooks_done = []
_recursive_prepare()[source]
_prepare()[source]

Specify here what should be done for this component in the prepare phase

_recursive_build()[source]
_build()[source]

Specify here what should be done for this component in the build phase

_do_prerun()[source]
required_components(ancestors=[])[source]
_prerun()[source]

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.

class atomiq.components.primitives.Measurable(channels)[source]
Parameters:

channels (TList(TStr))

kernel_invariants
abstractmethod measure(channel='')[source]
Parameters:

channel (artiq.language.types.TStr)

Return type:

artiq.language.types.TFloat

measurement_channels()[source]
class atomiq.components.primitives.Triggerable(channels)[source]
Parameters:

channels (TList(TStr))

kernel_invariants
abstractmethod fire(channel='')[source]
Parameters:

channel (artiq.language.types.TStr)

class atomiq.components.primitives.Switchable(channels)[source]
Parameters:

channels (TList(TStr))

kernel_invariants
abstractmethod on(channel=None)[source]
Parameters:

channel (artiq.language.types.TStr)

abstractmethod off(channel=None)[source]
Parameters:

channel (artiq.language.types.TStr)

abstractmethod is_on(channel=None)[source]
Parameters:

channel (artiq.language.types.TStr)

toggle(channel=None)[source]
Parameters:

channel (artiq.language.types.TStr)

pulse(pulsetime, channel='')[source]
Parameters:
  • pulsetime (artiq.language.types.TFloat)

  • channel (artiq.language.types.TStr)

class atomiq.components.primitives.Parametrizable(channels)[source]
Parameters:

channels (TList(TStr))

kernel_invariants
set_parameter(value, channel=None)[source]
Parameters:
  • value (artiq.language.types.TFloat)

  • channel (artiq.language.types.TStr)

class atomiq.components.primitives.Remote(remote_reference, sync=False)[source]
Parameters:
  • remote_reference (str)

  • sync (bool)

remote_reference
sync = False