atomiq¶
Submodules¶
Attributes¶
Classes¶
Base class for top-level experiments that use the |
|
Base class for top-level experiments that use the |
|
DDS configuration device for SU-Servo. |
Functions¶
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:
AtomiqExperimentBase class for top-level experiments that use the
HasEnvironmentenvironment manager.Most experiments should derive from this class.
- experiment¶
- 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.EnvExperimentBase class for top-level experiments that use the
HasEnvironmentenvironment 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¶
- _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
- 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.
- 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()[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()
- _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()[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.
- 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.
- 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¶
Bases:
artiq.coredevice.suservo.SharedDDSDDS 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_INdelays tuning starting value. To stabilize theSYNC_INdelays tuning, runtune_sync_delays()once and set this to the delay tap number returned (default: [-1, -1, -1, -1] to signal no synchronization and no tuning duringinit()). Can be a string of the formeeprom_device:byte_offsetto read the value from a I2C EEPROM, in which caseio_update_delaymust be set to the same string value.io_update_delay --
IO_UPDATEpulse alignment delay. To alignIO_UPDATEtoSYNC_CLK, runtune_io_update_group_delay()and set this to the delay tap number returned. Can be a string of the formeeprom_device:byte_offsetto read the value from a I2C EEPROM, in which casesync_delay_seedsmust be set to the same string value.core_device -- Core device name
Select a specific DDS channel to accept I/O update
Initialize and configure the SU-Servo as a whole.
See the
init()method ofAD9910for AD9910 initialization.- Parameters:
blind -- Do not read back DDS identity and do not wait for lock. See
init().
Find a set of stable
SYNC_INdelays.This method first locates a set of
SYNC_INdelays viatune_sync_delay()ofAD9910.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])
Find a stable
IO_UPDATEdelay alignment suitable for all DDS channels.Scan through increasing
IO_UPDATEdelays until a delay is found that letsIO_UPDATEbe registered in the nextSYNC_CLKcycle. Return anIO_UPDATEdelay that does not coincide with anySYNC_CLKedges.This method assumes that the
IO_UPDATETTLOut device has one machine unit resolution (SERDES).This method and
tune_sync_delays()can be run in any order.- Returns:
IO_UPDATEdelay to be passed to the constructorCPLDvia the device database.- Return type:
artiq.language.types.TInt32
Return the 32-bit frequency tuning word corresponding to the given frequency.
- Parameters:
frequency (artiq.language.types.TFloat)
- Return type:
artiq.language.types.TInt32
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