atomiq

Submodules

Attributes

Classes

AtomiqBlock

Base class for top-level experiments that use the

AtomiqExperiment

Base class for top-level experiments that use the

SharedDDS

DDS configuration device for SU-Servo.

Functions

is_experiment(o)

Checks if a Python object is a top-level experiment class.

Package Contents

atomiq.__version__ = '2026.5.6'
class atomiq.AtomiqBlock(*args, **kwargs)[source]

Bases: AtomiqExperiment

Base class for top-level experiments that use the HasEnvironment environment manager.

Most experiments should derive from this class.

experiment
_getmro()[source]
CHUNKSIZE = 10
TAGS = []
components = ['log']
heros_realm = 'heros'
log
arg_provider
max_step_counter: int
scan_argument_order: list[str]
_components = []
_blocks = []
name
component_map = None
scannable_arguments
non_scannable_arguments
clock_at_start
identifier
step_counter = 0
run_id = 0
__terminate_asap__ = False
_sequence_error = False
_create_atomiq_hero()
_import_from_block(blkdata)

This uses monkey patching of the class to make members available to the current experiment

Parameters:

blkdata (dict) -- Block data with the keys "class", "map", "alias"

_add_to_hook_handler(obj_list)

Add the hooks the objects in obj_list to the experiment hooks such that they are called when processing the hooks. Only if the child object posses a method with the according name of the hook, it will be called.

Parameters:

obj_list -- list of child objects relative to self (e.g. 'modulator.rfsource.switch') for which the hook should be called

_build_blocks()
_build_components()
setattr_argument(key, processor=None, group=None, tooltip=None)

Set an argument as an attribute.

This extends the ARTIQ setattr_argument function by checking if there are incompatible collisions between arguments of different blocks and the experiment.

_build_arguments()
get_multiscanmanager()

Get the MultiScanManager of all arguments.

Return type:

tuple[list[str], MultiScanManager]

prepare()

Prepares components and structure. Called by ARTIQ in the prepare phase, see ARTIQ documentation for more information on experiment phases.

Note

If you overwrite this method in your experiment, make sure to call super().prepare().

_build_core()
_build()
build()

Initializes arguments. Called by ARTIQ in the build phase, see ARTIQ documentation for more information on experiment phases.

Note

If you overwrite this method in your experiment, make sure to call super().build()

_prerun_core(reset=False)
_set_identifiers_in_master(identifier, run_id, step_counter)

makes an rpc call to set the identifier in the master

chunker(mult_scan, size=100)

Generator to call a kernel with chunks of scan points.

Parameters:

size (numpy.int32)

_loop_chunks(chunk_list)

Loop over a list of chunks in the host, i.e. iterate over starting kernels holding CHUNKSIZE experiments

Parameters:
  • chunks -- (list) list of chunks. Each entry is again an iterable with CHUNKSIZE Scanpoint objects inside

  • chunk_list (list)

_run_init()
run()

Run entry point for ARTIQ, see ARTIQ documentation for more information on experiment phases.

Warning

Do not implement this entry point in your experiment. Use the provided sub-phases (prerun, step, etc.) More information can be found in the Phases and Chunking documentation.

_runchunk(points)
terminate()

Terminate the running experiment as soon as possible. Normally this means after the current chunk.

prerun()

Kernel entry point, run once at the beginning of the run phase of an experiment. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

prerun_host()

Host entry point, run once at the beginning of the run phase of an experiment. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

postfail()
postfail_host()
postrun()

Kernel entry point, run once at the end of the run phase of an experiment. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

postrun_host()

Host entry point, run once at the end of the run phase of an experiment. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

prestep(point)

Kernel entry point, run before every step. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

poststep(point)

Kernel entry point, run after every step. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

prechunk(points)

Kernel entry point, run once at the beginning of a chunk. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

postchunk(points)

Kernel entry point, run once at the end of a chunk. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

prechunk_host(points)

Host entry point, run once at the beginning of a chunk. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

postchunk_host(points)

Host entry point, run once at the end of a chunk. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

abstractmethod step(point)

Kernel entry point, for the main experiment sequence code. This method must be overloaded by the user. Details can be found in the Phases and Chunking documentation.

analyze()

Entry point for analyzing the results of the experiment.

This method may be overloaded by the user to implement the analysis phase of the experiment, for example fitting curves.

Splitting this phase from run() enables tweaking the analysis algorithm on pre-existing data, and CPU-bound analyses to be run overlapped with the next experiment in a pipelined manner.

This method must not interact with the hardware.

children = []
__in_build = True
class atomiq.AtomiqExperiment(managers_or_parent, name=None, arg_provider=None, component_map=None, *args, **kwargs)[source]

Bases: artiq.language.environment.EnvExperiment

Base class for top-level experiments that use the HasEnvironment environment manager.

Most experiments should derive from this class.

CHUNKSIZE = 10
TAGS = []
components = ['log']
heros_realm = 'heros'
log
arg_provider
max_step_counter: int
scan_argument_order: list[str]
_components = []
_blocks = []
name
component_map = None
scannable_arguments
non_scannable_arguments
clock_at_start
identifier
step_counter = 0
run_id = 0
__terminate_asap__ = False
_sequence_error = False
_create_atomiq_hero()[source]
_getmro()[source]
_import_from_block(blkdata)[source]

This uses monkey patching of the class to make members available to the current experiment

Parameters:

blkdata (dict) -- Block data with the keys "class", "map", "alias"

_add_to_hook_handler(obj_list)[source]

Add the hooks the objects in obj_list to the experiment hooks such that they are called when processing the hooks. Only if the child object posses a method with the according name of the hook, it will be called.

Parameters:

obj_list -- list of child objects relative to self (e.g. 'modulator.rfsource.switch') for which the hook should be called

_build_blocks()[source]
_build_components()[source]
setattr_argument(key, processor=None, group=None, tooltip=None)[source]

Set an argument as an attribute.

This extends the ARTIQ setattr_argument function by checking if there are incompatible collisions between arguments of different blocks and the experiment.

_build_arguments()[source]
get_multiscanmanager()[source]

Get the MultiScanManager of all arguments.

Return type:

tuple[list[str], MultiScanManager]

prepare()[source]

Prepares components and structure. Called by ARTIQ in the prepare phase, see ARTIQ documentation for more information on experiment phases.

Note

If you overwrite this method in your experiment, make sure to call super().prepare().

_build_core()[source]
_build()[source]
build()[source]

Initializes arguments. Called by ARTIQ in the build phase, see ARTIQ documentation for more information on experiment phases.

Note

If you overwrite this method in your experiment, make sure to call super().build()

_prerun_core(reset=False)[source]
_set_identifiers_in_master(identifier, run_id, step_counter)[source]

makes an rpc call to set the identifier in the master

chunker(mult_scan, size=100)[source]

Generator to call a kernel with chunks of scan points.

Parameters:

size (numpy.int32)

_loop_chunks(chunk_list)[source]

Loop over a list of chunks in the host, i.e. iterate over starting kernels holding CHUNKSIZE experiments

Parameters:
  • chunks -- (list) list of chunks. Each entry is again an iterable with CHUNKSIZE Scanpoint objects inside

  • chunk_list (list)

_run_init()[source]
run()[source]

Run entry point for ARTIQ, see ARTIQ documentation for more information on experiment phases.

Warning

Do not implement this entry point in your experiment. Use the provided sub-phases (prerun, step, etc.) More information can be found in the Phases and Chunking documentation.

_runchunk(points)[source]
terminate()[source]

Terminate the running experiment as soon as possible. Normally this means after the current chunk.

prerun()[source]

Kernel entry point, run once at the beginning of the run phase of an experiment. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

prerun_host()[source]

Host entry point, run once at the beginning of the run phase of an experiment. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

postfail()[source]
postfail_host()[source]
postrun()[source]

Kernel entry point, run once at the end of the run phase of an experiment. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

postrun_host()[source]

Host entry point, run once at the end of the run phase of an experiment. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

prestep(point)[source]

Kernel entry point, run before every step. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

poststep(point)[source]

Kernel entry point, run after every step. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

prechunk(points)[source]

Kernel entry point, run once at the beginning of a chunk. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

postchunk(points)[source]

Kernel entry point, run once at the end of a chunk. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

prechunk_host(points)[source]

Host entry point, run once at the beginning of a chunk. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

postchunk_host(points)[source]

Host entry point, run once at the end of a chunk. This method can be overloaded by the user. Details can be found in the Phases and Chunking documentation.

abstractmethod step(point)[source]

Kernel entry point, for the main experiment sequence code. This method must be overloaded by the user. Details can be found in the Phases and Chunking documentation.

analyze()

Entry point for analyzing the results of the experiment.

This method may be overloaded by the user to implement the analysis phase of the experiment, for example fitting curves.

Splitting this phase from run() enables tweaking the analysis algorithm on pre-existing data, and CPU-bound analyses to be run overlapped with the next experiment in a pipelined manner.

This method must not interact with the hardware.

children = []
__in_build = True
atomiq.is_experiment(o)

Checks if a Python object is a top-level experiment class. Monkey patch of the artiq_master function 'artiq.language.environment.is_experiment()' to include Atomiq experiments and blocks in the ignore list

atomiq.old_globals
class atomiq.SharedDDS(dmgr, cpld_device, pll_cp=7, pll_vco=5, sync_delay_seeds=[-1, -1, -1, -1], io_update_delay=0, pll_en=1, core_device='core')[source]

Bases: artiq.coredevice.suservo.SharedDDS

DDS configuration device for SU-Servo.

Shared DDS device controls all 4 DDSes on the same Urukul device. Control of the 4 channels is multiplexed by selecting the corresponding MASK_NU bit prior to SPI transaction. IO_UPDATE is transferred by temporarily disabling the corresponding MASK_NU bit.

Parameters:
  • cpld_device -- Name of the Urukul CPLD this device is on.

  • pll_en -- PLL enable bit, set to 0 to bypass PLL (default: 1). Note that when bypassing the PLL the red front panel LED may remain on.

  • pll_cp -- DDS PLL charge pump setting.

  • pll_vco -- DDS PLL VCO range selection.

  • sync_delay_seeds -- SYNC_IN delays tuning starting value. To stabilize the SYNC_IN delays tuning, run tune_sync_delays() once and set this to the delay tap number returned (default: [-1, -1, -1, -1] to signal no synchronization and no tuning during init()). Can be a string of the form eeprom_device:byte_offset to read the value from a I2C EEPROM, in which case io_update_delay must be set to the same string value.

  • io_update_delay -- IO_UPDATE pulse alignment delay. To align IO_UPDATE to SYNC_CLK, run tune_io_update_group_delay() and set this to the delay tap number returned. Can be a string of the form eeprom_device:byte_offset to read the value from a I2C EEPROM, in which case sync_delay_seeds must be set to the same string value.

  • core_device -- Core device name

_inner_dds
core
cpld
selected_ch = 0
update_dds_sel(channel)[source]

Select a specific DDS channel to accept I/O update

init(blind=False)[source]

Initialize and configure the SU-Servo as a whole.

See the init() method of AD9910 for AD9910 initialization.

Parameters:

blind -- Do not read back DDS identity and do not wait for lock. See init().

tune_sync_delays()[source]

Find a set of stable SYNC_IN delays.

This method first locates a set of SYNC_IN delays via tune_sync_delay() of AD9910.

This method and tune_io_update_group_delay() can be run in any order.

Returns:

Tuple of optimal delays.

Return type:

TTuple([TInt32, TInt32, TInt32, TInt32])

tune_io_update_group_delay()[source]

Find a stable IO_UPDATE delay alignment suitable for all DDS channels.

Scan through increasing IO_UPDATE delays until a delay is found that lets IO_UPDATE be registered in the next SYNC_CLK cycle. Return an IO_UPDATE delay that does not coincide with any SYNC_CLK edges.

This method assumes that the IO_UPDATE TTLOut device has one machine unit resolution (SERDES).

This method and tune_sync_delays() can be run in any order.

Returns:

IO_UPDATE delay to be passed to the constructor CPLD via the device database.

Return type:

artiq.language.types.TInt32

frequency_to_ftw(frequency)[source]

Return the 32-bit frequency tuning word corresponding to the given frequency.

Parameters:

frequency (artiq.language.types.TFloat)

Return type:

artiq.language.types.TInt32

turns_to_pow(turns)[source]

Return the 16-bit phase offset word corresponding to the given phase in turns.

Parameters:

turns (artiq.language.types.TFloat)

Return type:

artiq.language.types.TInt32