atomiq.components.lock¶
Classes¶
This is a very generic class to describe a laser lock. It is characterized by some means |
|
This is a very generic class to describe a laser lock where the lock offset can be |
|
This is a very generic class to describe a laser lock. It is characterized by some means |
|
Lock on a sideband modulated onto the laser |
|
Lock on an optical frequency comb |
|
Lock on a reference laser via beating signal |
Module Contents¶
- class atomiq.components.lock.Lock(reference_frequency, lock_offset=0.0, harmonic=1, *args, **kwargs)[source]¶
Bases:
atomiq.components.primitives.ComponentThis is a very generic class to describe a laser lock. It is characterized by some means of a reference frequency and an offset to that frequency at which the lock tries to stabilize.
Most likely you want to use a more specific class inherited from this one.
- Parameters:
reference_frequency (artiq.language.types.TFloat) -- The frequency in Hz that the lock references to
lock_offset (artiq.language.types.TFloat) -- The frequency offset in Hz at which the lock stabilizes
harmonic (artiq.language.types.TInt32) -- Use this option if the laser is frequency converted but locked to the fundamental. Use 1 for no conversion, 2 for SHG, 4 for FHG ,... (default 1)
- kernel_invariants¶
- _lock_offset = 0.0¶
- reference_frequency¶
- harmonic = 1¶
- experiment¶
- identifier¶
- debug_output = False¶
- core¶
- _kernel_invariants¶
- _prepare_done = False¶
- _build_done = False¶
- _hooks_done = []¶
- _recursive_prepare()¶
- _prepare()¶
Specify here what should be done for this component in the prepare phase
- _recursive_build()¶
- _build()¶
Specify here what should be done for this component in the build phase
- _do_prerun()¶
- required_components(ancestors=[])¶
- _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.
- children = []¶
- __in_build = True¶
- register_child(child)¶
- call_child_method(method, *args, **kwargs)¶
Calls the named method for each child, if it exists for that child, in the order of registration.
- Parameters:
method (str) -- Name of the method to call
args -- Tuple of positional arguments to pass to all children
kwargs -- Dict of keyword arguments to pass to all children
- build()¶
Should be implemented by the user to request arguments.
Other initialization steps such as requesting devices may also be performed here.
There are two situations where the requested devices are replaced by
DummyDevice()and arguments are set to their defaults (orNone) instead: when the repository is scanned to build the list of available experiments and when the dataset browserartiq_browseris used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments inbuild().Datasets are read-only in this method.
Leftover positional and keyword arguments from the constructor are forwarded to this method. This is intended for experiments that are only meant to be executed programmatically (not from the GUI).
- get_argument(key, processor, group=None, tooltip=None)¶
Retrieves and returns the value of an argument.
This function should only be called from
build.- Parameters:
key -- Name of the argument.
processor -- A description of how to process the argument, such as instances of
BooleanValueandNumberValue.group -- An optional string that defines what group the argument belongs to, for user interface purposes.
tooltip -- An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface.
- setattr_argument(key, processor=None, group=None, tooltip=None)¶
Sets an argument as attribute. The names of the argument and of the attribute are the same.
The key is added to the instance's kernel invariants.
- interactive(title='')¶
Request arguments from the user interactively.
This context manager returns a namespace object on which the method
setattr_argument()should be called, with the usual semantics.When the context manager terminates, the experiment is blocked and the user is presented with the requested argument widgets. After the user enters values, the experiment is resumed and the namespace contains the values of the arguments.
If the interactive arguments request is cancelled, raises
CancelledArgsError.
- get_device_db()¶
Returns the full contents of the device database.
- get_device(key)¶
Creates and returns a device driver.
- setattr_device(key)¶
Sets a device driver as attribute. The names of the device driver and of the attribute are the same.
The key is added to the instance's kernel invariants.
- set_dataset(key, value, *, unit=None, scale=None, precision=None, broadcast=False, persist=False, archive=True)¶
Sets the contents and handling modes of a dataset.
Datasets must be scalars (
bool,int,floator NumPy scalar) or NumPy arrays.- Parameters:
unit -- A string representing the unit of the value.
scale -- A numerical factor that is used to adjust the value of the dataset to match the scale or units of the experiment's reference frame when the value is displayed.
precision -- The maximum number of digits to print after the decimal point. Set
precision=Noneto print as many digits as necessary to uniquely specify the value. Uses IEEE unbiased rounding.broadcast -- the data is sent in real-time to the master, which dispatches it.
persist -- the master should store the data on-disk. Implies broadcast.
archive -- the data is saved into the local storage of the current run (archived as a HDF5 file).
- mutate_dataset(key, index, value)¶
Mutate an existing dataset at the given index (e.g. set a value at a given position in a NumPy array)
If the dataset was created in broadcast mode, the modification is immediately transmitted.
If the index is a tuple of integers, it is interpreted as
slice(*index). If the index is a tuple of tuples, each sub-tuple is interpreted asslice(*sub_tuple)(multi-dimensional slicing).
- append_to_dataset(key, value)¶
Append a value to a dataset.
The target dataset must be a list (i.e. support
append()), and must have previously been set from this experiment.The broadcast/persist/archive mode of the given key remains unchanged from when the dataset was last set. Appended values are transmitted efficiently as incremental modifications in broadcast mode.
- get_dataset(key, default=NoDefault, archive=True)¶
Returns the contents of a dataset.
The local storage is searched first, followed by the master storage (which contains the broadcasted datasets from all experiments) if the key was not found initially.
If the dataset does not exist, returns the default value. If no default is provided, raises
KeyError.By default, datasets obtained by this method are archived into the output HDF5 file of the experiment. If an archived dataset is requested more than one time or is modified, only the value at the time of the first call is archived. This may impact reproducibility of experiments.
- Parameters:
archive -- Set to
Falseto prevent archival together with the run's results. Default isTrue.
- get_dataset_metadata(key, default=NoDefault)¶
Returns the metadata of a dataset.
Returns dictionary with items describing the dataset, including the units, scale and precision.
This function is used to get additional information for displaying the dataset.
See
set_dataset()for documentation of metadata items.
- setattr_dataset(key, default=NoDefault, archive=True)¶
Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same.
- set_default_scheduling(priority=None, pipeline_name=None, flush=None)¶
Sets the default scheduling options.
This function should only be called from
build.
- class atomiq.components.lock.DetunableLock(settle_time=0, blind=False, *args, **kwargs)[source]¶
Bases:
Lock,atomiq.components.primitives.ParametrizableThis is a very generic class to describe a laser lock where the lock offset can be changed. It is characterized by some means of a reference frequency and a detunable offset to that frequency at which the lock tries to stabilize.
Most likely you want to use a more specific class inherited from this one.
- Parameters:
settle_time (artiq.language.types.TFloat) -- Time in s the lock needs to settle after a detuning of the lock point
blind (artiq.language.types.TBool) -- Whether the lock is set to its default values during each prerun phase. If True, the lock is unchanged in the prerun phase. Defaults to False.
- kernel_invariants¶
- settle_time = 0¶
- _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.
- abstractmethod _set_lock_frequency(detuning)[source]¶
- Parameters:
detuning (artiq.language.types.TFloat)
- abstractmethod _ramp_lock_frequency(duration, detuning_start=float('nan'), detuning_end=float('nan'))[source]¶
- Parameters:
duration (artiq.language.types.TFloat)
detuning_start (artiq.language.types.TFloat)
detuning_end (artiq.language.types.TFloat)
- set_frequency(frequency)[source]¶
Set the absolute frequency of the locked line
- Parameters:
frequency (artiq.language.types.TFloat) -- The absolute frequency at which the system should lock
- set_detuning(offset_frequency)[source]¶
Set the frequency relative to the reference frequency, i.e. set the lock offset.
- Parameters:
offset_frequency (artiq.language.types.TFloat) -- new lock offset in Hz
- ramp_detuning(duration, offset_frequency_start=float('nan'), offset_frequency_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)[source]¶
- Parameters:
duration (artiq.language.types.TFloat)
offset_frequency_start (artiq.language.types.TFloat)
offset_frequency_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
ramp_steps (artiq.language.types.TInt32)
- ramp_frequency(duration, frequency_start=float('nan'), frequency_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)[source]¶
- Parameters:
duration (artiq.language.types.TFloat)
frequency_start (artiq.language.types.TFloat)
frequency_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
ramp_steps (artiq.language.types.TInt32)
- _lock_offset = 0.0¶
- reference_frequency¶
- harmonic = 1¶
- get_frequency()¶
- Return type:
artiq.language.types.TFloat
- experiment¶
- identifier¶
- debug_output = False¶
- core¶
- _kernel_invariants¶
- _prepare_done = False¶
- _build_done = False¶
- _hooks_done = []¶
- _recursive_prepare()¶
- _prepare()¶
Specify here what should be done for this component in the prepare phase
- _recursive_build()¶
- _build()¶
Specify here what should be done for this component in the build phase
- _do_prerun()¶
- required_components(ancestors=[])¶
- children = []¶
- __in_build = True¶
- register_child(child)¶
- call_child_method(method, *args, **kwargs)¶
Calls the named method for each child, if it exists for that child, in the order of registration.
- Parameters:
method (str) -- Name of the method to call
args -- Tuple of positional arguments to pass to all children
kwargs -- Dict of keyword arguments to pass to all children
- build()¶
Should be implemented by the user to request arguments.
Other initialization steps such as requesting devices may also be performed here.
There are two situations where the requested devices are replaced by
DummyDevice()and arguments are set to their defaults (orNone) instead: when the repository is scanned to build the list of available experiments and when the dataset browserartiq_browseris used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments inbuild().Datasets are read-only in this method.
Leftover positional and keyword arguments from the constructor are forwarded to this method. This is intended for experiments that are only meant to be executed programmatically (not from the GUI).
- get_argument(key, processor, group=None, tooltip=None)¶
Retrieves and returns the value of an argument.
This function should only be called from
build.- Parameters:
key -- Name of the argument.
processor -- A description of how to process the argument, such as instances of
BooleanValueandNumberValue.group -- An optional string that defines what group the argument belongs to, for user interface purposes.
tooltip -- An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface.
- setattr_argument(key, processor=None, group=None, tooltip=None)¶
Sets an argument as attribute. The names of the argument and of the attribute are the same.
The key is added to the instance's kernel invariants.
- interactive(title='')¶
Request arguments from the user interactively.
This context manager returns a namespace object on which the method
setattr_argument()should be called, with the usual semantics.When the context manager terminates, the experiment is blocked and the user is presented with the requested argument widgets. After the user enters values, the experiment is resumed and the namespace contains the values of the arguments.
If the interactive arguments request is cancelled, raises
CancelledArgsError.
- get_device_db()¶
Returns the full contents of the device database.
- get_device(key)¶
Creates and returns a device driver.
- setattr_device(key)¶
Sets a device driver as attribute. The names of the device driver and of the attribute are the same.
The key is added to the instance's kernel invariants.
- set_dataset(key, value, *, unit=None, scale=None, precision=None, broadcast=False, persist=False, archive=True)¶
Sets the contents and handling modes of a dataset.
Datasets must be scalars (
bool,int,floator NumPy scalar) or NumPy arrays.- Parameters:
unit -- A string representing the unit of the value.
scale -- A numerical factor that is used to adjust the value of the dataset to match the scale or units of the experiment's reference frame when the value is displayed.
precision -- The maximum number of digits to print after the decimal point. Set
precision=Noneto print as many digits as necessary to uniquely specify the value. Uses IEEE unbiased rounding.broadcast -- the data is sent in real-time to the master, which dispatches it.
persist -- the master should store the data on-disk. Implies broadcast.
archive -- the data is saved into the local storage of the current run (archived as a HDF5 file).
- mutate_dataset(key, index, value)¶
Mutate an existing dataset at the given index (e.g. set a value at a given position in a NumPy array)
If the dataset was created in broadcast mode, the modification is immediately transmitted.
If the index is a tuple of integers, it is interpreted as
slice(*index). If the index is a tuple of tuples, each sub-tuple is interpreted asslice(*sub_tuple)(multi-dimensional slicing).
- append_to_dataset(key, value)¶
Append a value to a dataset.
The target dataset must be a list (i.e. support
append()), and must have previously been set from this experiment.The broadcast/persist/archive mode of the given key remains unchanged from when the dataset was last set. Appended values are transmitted efficiently as incremental modifications in broadcast mode.
- get_dataset(key, default=NoDefault, archive=True)¶
Returns the contents of a dataset.
The local storage is searched first, followed by the master storage (which contains the broadcasted datasets from all experiments) if the key was not found initially.
If the dataset does not exist, returns the default value. If no default is provided, raises
KeyError.By default, datasets obtained by this method are archived into the output HDF5 file of the experiment. If an archived dataset is requested more than one time or is modified, only the value at the time of the first call is archived. This may impact reproducibility of experiments.
- Parameters:
archive -- Set to
Falseto prevent archival together with the run's results. Default isTrue.
- get_dataset_metadata(key, default=NoDefault)¶
Returns the metadata of a dataset.
Returns dictionary with items describing the dataset, including the units, scale and precision.
This function is used to get additional information for displaying the dataset.
See
set_dataset()for documentation of metadata items.
- setattr_dataset(key, default=NoDefault, archive=True)¶
Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same.
- set_default_scheduling(priority=None, pipeline_name=None, flush=None)¶
Sets the default scheduling options.
This function should only be called from
build.
- set_parameter(value, channel=None)¶
- Parameters:
value (artiq.language.types.TFloat)
channel (artiq.language.types.TStr)
- class atomiq.components.lock.SpectroscopyLock(reference_frequency, lock_offset=0.0, harmonic=1, *args, **kwargs)[source]¶
Bases:
LockThis is a very generic class to describe a laser lock. It is characterized by some means of a reference frequency and an offset to that frequency at which the lock tries to stabilize.
Most likely you want to use a more specific class inherited from this one.
- Parameters:
reference_frequency (artiq.language.types.TFloat) -- The frequency in Hz that the lock references to
lock_offset (artiq.language.types.TFloat) -- The frequency offset in Hz at which the lock stabilizes
harmonic (artiq.language.types.TInt32) -- Use this option if the laser is frequency converted but locked to the fundamental. Use 1 for no conversion, 2 for SHG, 4 for FHG ,... (default 1)
- kernel_invariants¶
- _lock_offset = 0.0¶
- reference_frequency¶
- harmonic = 1¶
- get_frequency()¶
- Return type:
artiq.language.types.TFloat
- experiment¶
- identifier¶
- debug_output = False¶
- core¶
- _kernel_invariants¶
- _prepare_done = False¶
- _build_done = False¶
- _hooks_done = []¶
- _recursive_prepare()¶
- _prepare()¶
Specify here what should be done for this component in the prepare phase
- _recursive_build()¶
- _build()¶
Specify here what should be done for this component in the build phase
- _do_prerun()¶
- required_components(ancestors=[])¶
- _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.
- children = []¶
- __in_build = True¶
- register_child(child)¶
- call_child_method(method, *args, **kwargs)¶
Calls the named method for each child, if it exists for that child, in the order of registration.
- Parameters:
method (str) -- Name of the method to call
args -- Tuple of positional arguments to pass to all children
kwargs -- Dict of keyword arguments to pass to all children
- build()¶
Should be implemented by the user to request arguments.
Other initialization steps such as requesting devices may also be performed here.
There are two situations where the requested devices are replaced by
DummyDevice()and arguments are set to their defaults (orNone) instead: when the repository is scanned to build the list of available experiments and when the dataset browserartiq_browseris used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments inbuild().Datasets are read-only in this method.
Leftover positional and keyword arguments from the constructor are forwarded to this method. This is intended for experiments that are only meant to be executed programmatically (not from the GUI).
- get_argument(key, processor, group=None, tooltip=None)¶
Retrieves and returns the value of an argument.
This function should only be called from
build.- Parameters:
key -- Name of the argument.
processor -- A description of how to process the argument, such as instances of
BooleanValueandNumberValue.group -- An optional string that defines what group the argument belongs to, for user interface purposes.
tooltip -- An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface.
- setattr_argument(key, processor=None, group=None, tooltip=None)¶
Sets an argument as attribute. The names of the argument and of the attribute are the same.
The key is added to the instance's kernel invariants.
- interactive(title='')¶
Request arguments from the user interactively.
This context manager returns a namespace object on which the method
setattr_argument()should be called, with the usual semantics.When the context manager terminates, the experiment is blocked and the user is presented with the requested argument widgets. After the user enters values, the experiment is resumed and the namespace contains the values of the arguments.
If the interactive arguments request is cancelled, raises
CancelledArgsError.
- get_device_db()¶
Returns the full contents of the device database.
- get_device(key)¶
Creates and returns a device driver.
- setattr_device(key)¶
Sets a device driver as attribute. The names of the device driver and of the attribute are the same.
The key is added to the instance's kernel invariants.
- set_dataset(key, value, *, unit=None, scale=None, precision=None, broadcast=False, persist=False, archive=True)¶
Sets the contents and handling modes of a dataset.
Datasets must be scalars (
bool,int,floator NumPy scalar) or NumPy arrays.- Parameters:
unit -- A string representing the unit of the value.
scale -- A numerical factor that is used to adjust the value of the dataset to match the scale or units of the experiment's reference frame when the value is displayed.
precision -- The maximum number of digits to print after the decimal point. Set
precision=Noneto print as many digits as necessary to uniquely specify the value. Uses IEEE unbiased rounding.broadcast -- the data is sent in real-time to the master, which dispatches it.
persist -- the master should store the data on-disk. Implies broadcast.
archive -- the data is saved into the local storage of the current run (archived as a HDF5 file).
- mutate_dataset(key, index, value)¶
Mutate an existing dataset at the given index (e.g. set a value at a given position in a NumPy array)
If the dataset was created in broadcast mode, the modification is immediately transmitted.
If the index is a tuple of integers, it is interpreted as
slice(*index). If the index is a tuple of tuples, each sub-tuple is interpreted asslice(*sub_tuple)(multi-dimensional slicing).
- append_to_dataset(key, value)¶
Append a value to a dataset.
The target dataset must be a list (i.e. support
append()), and must have previously been set from this experiment.The broadcast/persist/archive mode of the given key remains unchanged from when the dataset was last set. Appended values are transmitted efficiently as incremental modifications in broadcast mode.
- get_dataset(key, default=NoDefault, archive=True)¶
Returns the contents of a dataset.
The local storage is searched first, followed by the master storage (which contains the broadcasted datasets from all experiments) if the key was not found initially.
If the dataset does not exist, returns the default value. If no default is provided, raises
KeyError.By default, datasets obtained by this method are archived into the output HDF5 file of the experiment. If an archived dataset is requested more than one time or is modified, only the value at the time of the first call is archived. This may impact reproducibility of experiments.
- Parameters:
archive -- Set to
Falseto prevent archival together with the run's results. Default isTrue.
- get_dataset_metadata(key, default=NoDefault)¶
Returns the metadata of a dataset.
Returns dictionary with items describing the dataset, including the units, scale and precision.
This function is used to get additional information for displaying the dataset.
See
set_dataset()for documentation of metadata items.
- setattr_dataset(key, default=NoDefault, archive=True)¶
Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same.
- set_default_scheduling(priority=None, pipeline_name=None, flush=None)¶
Sets the default scheduling options.
This function should only be called from
build.
- class atomiq.components.lock.SidebandLock(rf_source, sideband_order=1, *args, **kwargs)[source]¶
Bases:
DetunableLockLock on a sideband modulated onto the laser
This kind of lock is frequently used when locking on tunable sideband to the transmission signal of a stable cavity. The offset frequency for the sideband is generated by an RF source and can be changed at runtime. Thus the lock point can be detuned.
- Parameters:
rf_source (RFSource) -- RF source that determines the sideband frequency.
sideband_order (artiq.language.types.TInt32) -- Order of the sideband the laser is locked to [.., -2, -1, 1, 2, ...] (default 1)
- kernel_invariants¶
- rf_source¶
- sideband_order = 1¶
- _ramp_lock_frequency(duration, frequency_start=float('nan'), frequency_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)[source]¶
- Parameters:
duration (artiq.language.types.TFloat)
frequency_start (artiq.language.types.TFloat)
frequency_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
ramp_steps (artiq.language.types.TInt32)
- settle_time = 0¶
- _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.
- set_frequency(frequency)¶
Set the absolute frequency of the locked line
- Parameters:
frequency (artiq.language.types.TFloat) -- The absolute frequency at which the system should lock
- set_detuning(offset_frequency)¶
Set the frequency relative to the reference frequency, i.e. set the lock offset.
- Parameters:
offset_frequency (artiq.language.types.TFloat) -- new lock offset in Hz
- ramp_detuning(duration, offset_frequency_start=float('nan'), offset_frequency_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)¶
- Parameters:
duration (artiq.language.types.TFloat)
offset_frequency_start (artiq.language.types.TFloat)
offset_frequency_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
ramp_steps (artiq.language.types.TInt32)
- ramp_frequency(duration, frequency_start=float('nan'), frequency_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)¶
- Parameters:
duration (artiq.language.types.TFloat)
frequency_start (artiq.language.types.TFloat)
frequency_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
ramp_steps (artiq.language.types.TInt32)
- _lock_offset = 0.0¶
- reference_frequency¶
- harmonic = 1¶
- get_frequency()¶
- Return type:
artiq.language.types.TFloat
- experiment¶
- identifier¶
- debug_output = False¶
- core¶
- _kernel_invariants¶
- _prepare_done = False¶
- _build_done = False¶
- _hooks_done = []¶
- _recursive_prepare()¶
- _prepare()¶
Specify here what should be done for this component in the prepare phase
- _recursive_build()¶
- _build()¶
Specify here what should be done for this component in the build phase
- _do_prerun()¶
- required_components(ancestors=[])¶
- children = []¶
- __in_build = True¶
- register_child(child)¶
- call_child_method(method, *args, **kwargs)¶
Calls the named method for each child, if it exists for that child, in the order of registration.
- Parameters:
method (str) -- Name of the method to call
args -- Tuple of positional arguments to pass to all children
kwargs -- Dict of keyword arguments to pass to all children
- build()¶
Should be implemented by the user to request arguments.
Other initialization steps such as requesting devices may also be performed here.
There are two situations where the requested devices are replaced by
DummyDevice()and arguments are set to their defaults (orNone) instead: when the repository is scanned to build the list of available experiments and when the dataset browserartiq_browseris used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments inbuild().Datasets are read-only in this method.
Leftover positional and keyword arguments from the constructor are forwarded to this method. This is intended for experiments that are only meant to be executed programmatically (not from the GUI).
- get_argument(key, processor, group=None, tooltip=None)¶
Retrieves and returns the value of an argument.
This function should only be called from
build.- Parameters:
key -- Name of the argument.
processor -- A description of how to process the argument, such as instances of
BooleanValueandNumberValue.group -- An optional string that defines what group the argument belongs to, for user interface purposes.
tooltip -- An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface.
- setattr_argument(key, processor=None, group=None, tooltip=None)¶
Sets an argument as attribute. The names of the argument and of the attribute are the same.
The key is added to the instance's kernel invariants.
- interactive(title='')¶
Request arguments from the user interactively.
This context manager returns a namespace object on which the method
setattr_argument()should be called, with the usual semantics.When the context manager terminates, the experiment is blocked and the user is presented with the requested argument widgets. After the user enters values, the experiment is resumed and the namespace contains the values of the arguments.
If the interactive arguments request is cancelled, raises
CancelledArgsError.
- get_device_db()¶
Returns the full contents of the device database.
- get_device(key)¶
Creates and returns a device driver.
- setattr_device(key)¶
Sets a device driver as attribute. The names of the device driver and of the attribute are the same.
The key is added to the instance's kernel invariants.
- set_dataset(key, value, *, unit=None, scale=None, precision=None, broadcast=False, persist=False, archive=True)¶
Sets the contents and handling modes of a dataset.
Datasets must be scalars (
bool,int,floator NumPy scalar) or NumPy arrays.- Parameters:
unit -- A string representing the unit of the value.
scale -- A numerical factor that is used to adjust the value of the dataset to match the scale or units of the experiment's reference frame when the value is displayed.
precision -- The maximum number of digits to print after the decimal point. Set
precision=Noneto print as many digits as necessary to uniquely specify the value. Uses IEEE unbiased rounding.broadcast -- the data is sent in real-time to the master, which dispatches it.
persist -- the master should store the data on-disk. Implies broadcast.
archive -- the data is saved into the local storage of the current run (archived as a HDF5 file).
- mutate_dataset(key, index, value)¶
Mutate an existing dataset at the given index (e.g. set a value at a given position in a NumPy array)
If the dataset was created in broadcast mode, the modification is immediately transmitted.
If the index is a tuple of integers, it is interpreted as
slice(*index). If the index is a tuple of tuples, each sub-tuple is interpreted asslice(*sub_tuple)(multi-dimensional slicing).
- append_to_dataset(key, value)¶
Append a value to a dataset.
The target dataset must be a list (i.e. support
append()), and must have previously been set from this experiment.The broadcast/persist/archive mode of the given key remains unchanged from when the dataset was last set. Appended values are transmitted efficiently as incremental modifications in broadcast mode.
- get_dataset(key, default=NoDefault, archive=True)¶
Returns the contents of a dataset.
The local storage is searched first, followed by the master storage (which contains the broadcasted datasets from all experiments) if the key was not found initially.
If the dataset does not exist, returns the default value. If no default is provided, raises
KeyError.By default, datasets obtained by this method are archived into the output HDF5 file of the experiment. If an archived dataset is requested more than one time or is modified, only the value at the time of the first call is archived. This may impact reproducibility of experiments.
- Parameters:
archive -- Set to
Falseto prevent archival together with the run's results. Default isTrue.
- get_dataset_metadata(key, default=NoDefault)¶
Returns the metadata of a dataset.
Returns dictionary with items describing the dataset, including the units, scale and precision.
This function is used to get additional information for displaying the dataset.
See
set_dataset()for documentation of metadata items.
- setattr_dataset(key, default=NoDefault, archive=True)¶
Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same.
- set_default_scheduling(priority=None, pipeline_name=None, flush=None)¶
Sets the default scheduling options.
This function should only be called from
build.
- set_parameter(value, channel=None)¶
- Parameters:
value (artiq.language.types.TFloat)
channel (artiq.language.types.TStr)
- class atomiq.components.lock.OFCLock(rf_source, lock_direction=1, tooth_number=-1, rep_rate=float('nan'), ceo=float('nan'), *args, **kwargs)[source]¶
Bases:
DetunableLockLock on an optical frequency comb
This is used to lock the laser on a beat note with an optical frequency comb. It is characterized by the frequency of the closest comb tooth and the offset frequency. The offset frequency is generated by an RF source and can be changed at runtime. Thus the lock point can be detuned.
- Parameters:
rfsource -- RF source that generates the reference beat frequency (i.e. the offset frequency) to which the laser beat note is stabilized.
reference_frequency -- The frequency in Hz of the comb tooth. Instead
ceo,rep_rateandtooth_number) can be passed to automatically calculate the reference frequency.reference_frequencyis ignored in this case.lock_offset -- The default frequency offset to the comb tooth in Hz at which the lock stabilizes
settle_time -- Time in s the lock needs to settle after a detuning of the lock point
lock_direction (artiq.language.types.TInt32) -- Whether the laser is locked to the positive (+1) or negative (-1) beat note (default 1)
tooth_number (artiq.language.types.TInt32) -- Number of the comb tooth, the laser is beaten with (default -1)
rep_rate (artiq.language.types.TFloat) -- Repetition frequency of the comb in Hz (default
nan)ceo (artiq.language.types.TFloat) -- Ceo frequency of the comb in Hz (default
nan)rf_source (RFSource)
- kernel_invariants¶
- rf_source¶
- lock_direction = 1¶
- _ramp_lock_frequency(duration, frequency_start=float('nan'), frequency_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)[source]¶
- Parameters:
duration (artiq.language.types.TFloat)
frequency_start (artiq.language.types.TFloat)
frequency_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
ramp_steps (artiq.language.types.TInt32)
- settle_time = 0¶
- _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.
- set_frequency(frequency)¶
Set the absolute frequency of the locked line
- Parameters:
frequency (artiq.language.types.TFloat) -- The absolute frequency at which the system should lock
- set_detuning(offset_frequency)¶
Set the frequency relative to the reference frequency, i.e. set the lock offset.
- Parameters:
offset_frequency (artiq.language.types.TFloat) -- new lock offset in Hz
- ramp_detuning(duration, offset_frequency_start=float('nan'), offset_frequency_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)¶
- Parameters:
duration (artiq.language.types.TFloat)
offset_frequency_start (artiq.language.types.TFloat)
offset_frequency_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
ramp_steps (artiq.language.types.TInt32)
- ramp_frequency(duration, frequency_start=float('nan'), frequency_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)¶
- Parameters:
duration (artiq.language.types.TFloat)
frequency_start (artiq.language.types.TFloat)
frequency_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
ramp_steps (artiq.language.types.TInt32)
- _lock_offset = 0.0¶
- reference_frequency¶
- harmonic = 1¶
- experiment¶
- identifier¶
- debug_output = False¶
- core¶
- _kernel_invariants¶
- _prepare_done = False¶
- _build_done = False¶
- _hooks_done = []¶
- _recursive_prepare()¶
- _prepare()¶
Specify here what should be done for this component in the prepare phase
- _recursive_build()¶
- _build()¶
Specify here what should be done for this component in the build phase
- _do_prerun()¶
- required_components(ancestors=[])¶
- children = []¶
- __in_build = True¶
- register_child(child)¶
- call_child_method(method, *args, **kwargs)¶
Calls the named method for each child, if it exists for that child, in the order of registration.
- Parameters:
method (str) -- Name of the method to call
args -- Tuple of positional arguments to pass to all children
kwargs -- Dict of keyword arguments to pass to all children
- build()¶
Should be implemented by the user to request arguments.
Other initialization steps such as requesting devices may also be performed here.
There are two situations where the requested devices are replaced by
DummyDevice()and arguments are set to their defaults (orNone) instead: when the repository is scanned to build the list of available experiments and when the dataset browserartiq_browseris used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments inbuild().Datasets are read-only in this method.
Leftover positional and keyword arguments from the constructor are forwarded to this method. This is intended for experiments that are only meant to be executed programmatically (not from the GUI).
- get_argument(key, processor, group=None, tooltip=None)¶
Retrieves and returns the value of an argument.
This function should only be called from
build.- Parameters:
key -- Name of the argument.
processor -- A description of how to process the argument, such as instances of
BooleanValueandNumberValue.group -- An optional string that defines what group the argument belongs to, for user interface purposes.
tooltip -- An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface.
- setattr_argument(key, processor=None, group=None, tooltip=None)¶
Sets an argument as attribute. The names of the argument and of the attribute are the same.
The key is added to the instance's kernel invariants.
- interactive(title='')¶
Request arguments from the user interactively.
This context manager returns a namespace object on which the method
setattr_argument()should be called, with the usual semantics.When the context manager terminates, the experiment is blocked and the user is presented with the requested argument widgets. After the user enters values, the experiment is resumed and the namespace contains the values of the arguments.
If the interactive arguments request is cancelled, raises
CancelledArgsError.
- get_device_db()¶
Returns the full contents of the device database.
- get_device(key)¶
Creates and returns a device driver.
- setattr_device(key)¶
Sets a device driver as attribute. The names of the device driver and of the attribute are the same.
The key is added to the instance's kernel invariants.
- set_dataset(key, value, *, unit=None, scale=None, precision=None, broadcast=False, persist=False, archive=True)¶
Sets the contents and handling modes of a dataset.
Datasets must be scalars (
bool,int,floator NumPy scalar) or NumPy arrays.- Parameters:
unit -- A string representing the unit of the value.
scale -- A numerical factor that is used to adjust the value of the dataset to match the scale or units of the experiment's reference frame when the value is displayed.
precision -- The maximum number of digits to print after the decimal point. Set
precision=Noneto print as many digits as necessary to uniquely specify the value. Uses IEEE unbiased rounding.broadcast -- the data is sent in real-time to the master, which dispatches it.
persist -- the master should store the data on-disk. Implies broadcast.
archive -- the data is saved into the local storage of the current run (archived as a HDF5 file).
- mutate_dataset(key, index, value)¶
Mutate an existing dataset at the given index (e.g. set a value at a given position in a NumPy array)
If the dataset was created in broadcast mode, the modification is immediately transmitted.
If the index is a tuple of integers, it is interpreted as
slice(*index). If the index is a tuple of tuples, each sub-tuple is interpreted asslice(*sub_tuple)(multi-dimensional slicing).
- append_to_dataset(key, value)¶
Append a value to a dataset.
The target dataset must be a list (i.e. support
append()), and must have previously been set from this experiment.The broadcast/persist/archive mode of the given key remains unchanged from when the dataset was last set. Appended values are transmitted efficiently as incremental modifications in broadcast mode.
- get_dataset(key, default=NoDefault, archive=True)¶
Returns the contents of a dataset.
The local storage is searched first, followed by the master storage (which contains the broadcasted datasets from all experiments) if the key was not found initially.
If the dataset does not exist, returns the default value. If no default is provided, raises
KeyError.By default, datasets obtained by this method are archived into the output HDF5 file of the experiment. If an archived dataset is requested more than one time or is modified, only the value at the time of the first call is archived. This may impact reproducibility of experiments.
- Parameters:
archive -- Set to
Falseto prevent archival together with the run's results. Default isTrue.
- get_dataset_metadata(key, default=NoDefault)¶
Returns the metadata of a dataset.
Returns dictionary with items describing the dataset, including the units, scale and precision.
This function is used to get additional information for displaying the dataset.
See
set_dataset()for documentation of metadata items.
- setattr_dataset(key, default=NoDefault, archive=True)¶
Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same.
- set_default_scheduling(priority=None, pipeline_name=None, flush=None)¶
Sets the default scheduling options.
This function should only be called from
build.
- set_parameter(value, channel=None)¶
- Parameters:
value (artiq.language.types.TFloat)
channel (artiq.language.types.TStr)
- class atomiq.components.lock.OffsetLock(reference_laser, *args, **kwargs)[source]¶
Bases:
SidebandLockLock on a reference laser via beating signal
- Parameters:
reference_laser -- laser that is used to generate the beat note. It's frequency serves as the reference frequency for this lock
- kernel_invariants¶
- reference_laser¶
- set_frequency(frequency)[source]¶
Set the absolute frequency of the locked line
- Parameters:
frequency (artiq.language.types.TFloat) -- The absolute frequency at which the system should lock
- ramp_frequency(duration, frequency_start=float('nan'), frequency_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)[source]¶
- Parameters:
duration (artiq.language.types.TFloat)
frequency_start (artiq.language.types.TFloat)
frequency_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
ramp_steps (artiq.language.types.TInt32)
- rf_source¶
- sideband_order = 1¶
- _set_lock_frequency(frequency)¶
- Parameters:
frequency (artiq.language.types.TFloat)
- _ramp_lock_frequency(duration, frequency_start=float('nan'), frequency_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)¶
- Parameters:
duration (artiq.language.types.TFloat)
frequency_start (artiq.language.types.TFloat)
frequency_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
ramp_steps (artiq.language.types.TInt32)
- settle_time = 0¶
- _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.
- set_detuning(offset_frequency)¶
Set the frequency relative to the reference frequency, i.e. set the lock offset.
- Parameters:
offset_frequency (artiq.language.types.TFloat) -- new lock offset in Hz
- ramp_detuning(duration, offset_frequency_start=float('nan'), offset_frequency_end=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)¶
- Parameters:
duration (artiq.language.types.TFloat)
offset_frequency_start (artiq.language.types.TFloat)
offset_frequency_end (artiq.language.types.TFloat)
ramp_timestep (artiq.language.types.TFloat)
ramp_steps (artiq.language.types.TInt32)
- _lock_offset = 0.0¶
- reference_frequency¶
- harmonic = 1¶
- experiment¶
- identifier¶
- debug_output = False¶
- core¶
- _kernel_invariants¶
- _prepare_done = False¶
- _build_done = False¶
- _hooks_done = []¶
- _recursive_prepare()¶
- _prepare()¶
Specify here what should be done for this component in the prepare phase
- _recursive_build()¶
- _build()¶
Specify here what should be done for this component in the build phase
- _do_prerun()¶
- required_components(ancestors=[])¶
- children = []¶
- __in_build = True¶
- register_child(child)¶
- call_child_method(method, *args, **kwargs)¶
Calls the named method for each child, if it exists for that child, in the order of registration.
- Parameters:
method (str) -- Name of the method to call
args -- Tuple of positional arguments to pass to all children
kwargs -- Dict of keyword arguments to pass to all children
- build()¶
Should be implemented by the user to request arguments.
Other initialization steps such as requesting devices may also be performed here.
There are two situations where the requested devices are replaced by
DummyDevice()and arguments are set to their defaults (orNone) instead: when the repository is scanned to build the list of available experiments and when the dataset browserartiq_browseris used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments inbuild().Datasets are read-only in this method.
Leftover positional and keyword arguments from the constructor are forwarded to this method. This is intended for experiments that are only meant to be executed programmatically (not from the GUI).
- get_argument(key, processor, group=None, tooltip=None)¶
Retrieves and returns the value of an argument.
This function should only be called from
build.- Parameters:
key -- Name of the argument.
processor -- A description of how to process the argument, such as instances of
BooleanValueandNumberValue.group -- An optional string that defines what group the argument belongs to, for user interface purposes.
tooltip -- An optional string to describe the argument in more detail, applied as a tooltip to the argument name in the user interface.
- setattr_argument(key, processor=None, group=None, tooltip=None)¶
Sets an argument as attribute. The names of the argument and of the attribute are the same.
The key is added to the instance's kernel invariants.
- interactive(title='')¶
Request arguments from the user interactively.
This context manager returns a namespace object on which the method
setattr_argument()should be called, with the usual semantics.When the context manager terminates, the experiment is blocked and the user is presented with the requested argument widgets. After the user enters values, the experiment is resumed and the namespace contains the values of the arguments.
If the interactive arguments request is cancelled, raises
CancelledArgsError.
- get_device_db()¶
Returns the full contents of the device database.
- get_device(key)¶
Creates and returns a device driver.
- setattr_device(key)¶
Sets a device driver as attribute. The names of the device driver and of the attribute are the same.
The key is added to the instance's kernel invariants.
- set_dataset(key, value, *, unit=None, scale=None, precision=None, broadcast=False, persist=False, archive=True)¶
Sets the contents and handling modes of a dataset.
Datasets must be scalars (
bool,int,floator NumPy scalar) or NumPy arrays.- Parameters:
unit -- A string representing the unit of the value.
scale -- A numerical factor that is used to adjust the value of the dataset to match the scale or units of the experiment's reference frame when the value is displayed.
precision -- The maximum number of digits to print after the decimal point. Set
precision=Noneto print as many digits as necessary to uniquely specify the value. Uses IEEE unbiased rounding.broadcast -- the data is sent in real-time to the master, which dispatches it.
persist -- the master should store the data on-disk. Implies broadcast.
archive -- the data is saved into the local storage of the current run (archived as a HDF5 file).
- mutate_dataset(key, index, value)¶
Mutate an existing dataset at the given index (e.g. set a value at a given position in a NumPy array)
If the dataset was created in broadcast mode, the modification is immediately transmitted.
If the index is a tuple of integers, it is interpreted as
slice(*index). If the index is a tuple of tuples, each sub-tuple is interpreted asslice(*sub_tuple)(multi-dimensional slicing).
- append_to_dataset(key, value)¶
Append a value to a dataset.
The target dataset must be a list (i.e. support
append()), and must have previously been set from this experiment.The broadcast/persist/archive mode of the given key remains unchanged from when the dataset was last set. Appended values are transmitted efficiently as incremental modifications in broadcast mode.
- get_dataset(key, default=NoDefault, archive=True)¶
Returns the contents of a dataset.
The local storage is searched first, followed by the master storage (which contains the broadcasted datasets from all experiments) if the key was not found initially.
If the dataset does not exist, returns the default value. If no default is provided, raises
KeyError.By default, datasets obtained by this method are archived into the output HDF5 file of the experiment. If an archived dataset is requested more than one time or is modified, only the value at the time of the first call is archived. This may impact reproducibility of experiments.
- Parameters:
archive -- Set to
Falseto prevent archival together with the run's results. Default isTrue.
- get_dataset_metadata(key, default=NoDefault)¶
Returns the metadata of a dataset.
Returns dictionary with items describing the dataset, including the units, scale and precision.
This function is used to get additional information for displaying the dataset.
See
set_dataset()for documentation of metadata items.
- setattr_dataset(key, default=NoDefault, archive=True)¶
Sets the contents of a dataset as attribute. The names of the dataset and of the attribute are the same.
- set_default_scheduling(priority=None, pipeline_name=None, flush=None)¶
Sets the default scheduling options.
This function should only be called from
build.
- set_parameter(value, channel=None)¶
- Parameters:
value (artiq.language.types.TFloat)
channel (artiq.language.types.TStr)