atomiq.components.electronics.currentsource

Classes

CurrentSource

Current Source

HBridgedCurrentSource

Combination of an H-bridge and a current source

TTLHardwareLogicHBridgedCurrentSource

H-bridged current source with control logic implemented in hardware

TTLSoftwareLogicHBridgedCurrentSource

H-bridged current source with control logic implemented in software

RPCCurrentSource

A current source controlled via RPC calls

RPCCurrentSourceChannel

One channel of a multi-channel currentsource controlled via RPC

VoltageControlledCurrentSource

A current source controlled by an analog voltage

Module Contents

class atomiq.components.electronics.currentsource.CurrentSource(min_current=float('-inf'), max_current=float('inf'), default_ramp_steps=30, *args, **kwargs)[source]

Bases: atomiq.components.primitives.Component, atomiq.components.primitives.Parametrizable

Current Source

This abstract class represents any device that can output a defined, controllable current.

Parameters:
  • min_current (artiq.language.types.TFloat) -- The minimum current the device can output [A]

  • max_current (artiq.language.types.TFloat) -- The maximum current the device can output [A]

  • default_ramp_steps (artiq.language.types.TInt32) -- The default number of steps that this device should use if the current is ramped. This value is only used if no ramp_steps are given in the ramp_current() method.

kernel_invariants
current
min_current
max_current
default_ramp_steps = 30
set_current(current)[source]

Set the current delivered by the current source

Parameters:

current (artiq.language.types.TFloat) -- Current in A

abstractmethod _set_current(current)[source]
Parameters:

current (artiq.language.types.TFloat)

_ramp_current(duration, current_start, current_end, ramp_timestep=0.0002)[source]

This method implements a stupid ramp on an abstract level. This will most likely work but be slow. If your hardware has native support for ramping, please override this function when you inherit from currentSource

Parameters:
  • duration (artiq.language.types.TFloat)

  • current_start (artiq.language.types.TFloat)

  • current_end (artiq.language.types.TFloat)

  • ramp_timestep (artiq.language.types.TFloat)

ramp_current(duration, current_end, current_start=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)[source]

Ramp current over a given duration.

This method advances the timeline by duration

Parameters:
  • duration (artiq.language.types.TFloat) -- ramp duration [s]

  • current_end (artiq.language.types.TFloat) -- end current [A]

  • current_start (artiq.language.types.TFloat) -- initial current [A]. If not given, the ramp starts from the current operating current.

  • ramp_timestep (artiq.language.types.TFloat)

  • ramp_steps (artiq.language.types.TInt32)

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 (or None) instead: when the repository is scanned to build the list of available experiments and when the dataset browser artiq_browser is used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments in build().

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 BooleanValue and NumberValue.

  • 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, float or 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=None to 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 as slice(*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 False to prevent archival together with the run's results. Default is True.

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.electronics.currentsource.HBridgedCurrentSource(current_source, *args, **kwargs)[source]

Bases: CurrentSource, atomiq.components.primitives.Switchable

Combination of an H-bridge and a current source

Combining an H-bridge with a unipolar current source allows to create a bipolar current source. This class bundles these two comoponents an exposes them as a bipolar current source.

Parameters:

current_source (CurrentSource) -- The current source connected to the H-bridge

class HBridgeState[source]

Bases: enum.IntEnum

Enum where members are also (and must be) ints

FORWARD = (1,)
OFF = (0,)
REVERSE = -1
kernel_invariants
current_source
state
last_state
hbridge_off()[source]
hbridge_reverse()[source]
hbridge_forward()[source]
hbridge_toggle()[source]
abstractmethod _hbridge_off()[source]
abstractmethod _hbridge_forward()[source]
abstractmethod _hbridge_reverse()[source]
_set_current(current)[source]
Parameters:

current (artiq.language.types.TFloat)

_ramp_current(duration, current_start, current_end, ramp_timestep)[source]

This method implements a stupid ramp on an abstract level. This will most likely work but be slow. If your hardware has native support for ramping, please override this function when you inherit from currentSource

Parameters:
  • duration (artiq.language.types.TFloat)

  • current_start (artiq.language.types.TFloat)

  • current_end (artiq.language.types.TFloat)

  • ramp_timestep (artiq.language.types.TFloat)

off()[source]
on()[source]
current
min_current
max_current
default_ramp_steps = 30
set_current(current)

Set the current delivered by the current source

Parameters:

current (artiq.language.types.TFloat) -- Current in A

ramp_current(duration, current_end, current_start=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)

Ramp current over a given duration.

This method advances the timeline by duration

Parameters:
  • duration (artiq.language.types.TFloat) -- ramp duration [s]

  • current_end (artiq.language.types.TFloat) -- end current [A]

  • current_start (artiq.language.types.TFloat) -- initial current [A]. If not given, the ramp starts from the current operating current.

  • ramp_timestep (artiq.language.types.TFloat)

  • ramp_steps (artiq.language.types.TInt32)

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 (or None) instead: when the repository is scanned to build the list of available experiments and when the dataset browser artiq_browser is used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments in build().

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 BooleanValue and NumberValue.

  • 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, float or 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=None to 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 as slice(*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 False to prevent archival together with the run's results. Default is True.

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)

abstractmethod is_on(channel=None)
Parameters:

channel (artiq.language.types.TStr)

toggle(channel=None)
Parameters:

channel (artiq.language.types.TStr)

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

  • channel (artiq.language.types.TStr)

class atomiq.components.electronics.currentsource.TTLHardwareLogicHBridgedCurrentSource(switch_direction, switch_on, invert_direction=False, *args, **kwargs)[source]

Bases: HBridgedCurrentSource

H-bridged current source with control logic implemented in hardware

Some external hardware (logic gates) take care to set all MOSFETs of the H-bridge based on the desired direction as indicated by switch_direction. Via switch_on the entire bridge can be enabled and disabled.

switch_on

switch_direction

current flow

off

on

off

off

off

off

on

on

forward

on

off

reverse

Parameters:
  • switch_on (Switchable) -- When ON, H-bridge is with forward or reverse; when OFF, load is disconnected from the PSU

  • switch_direction (Switchable) -- select forward or reverse direction of current flow

  • invert_direction (artiq.language.types.TBool) -- flip forward/reverse

kernel_invariants
switch_direction
switch_on
invert_direction = False
_hbridge_off()[source]
_hbridge_forward()[source]
_hbridge_reverse()[source]
class HBridgeState

Bases: enum.IntEnum

Enum where members are also (and must be) ints

FORWARD = (1,)
OFF = (0,)
REVERSE = -1
current_source
state
last_state
hbridge_off()
hbridge_reverse()
hbridge_forward()
hbridge_toggle()
_set_current(current)
Parameters:

current (artiq.language.types.TFloat)

_ramp_current(duration, current_start, current_end, ramp_timestep)

This method implements a stupid ramp on an abstract level. This will most likely work but be slow. If your hardware has native support for ramping, please override this function when you inherit from currentSource

Parameters:
  • duration (artiq.language.types.TFloat)

  • current_start (artiq.language.types.TFloat)

  • current_end (artiq.language.types.TFloat)

  • ramp_timestep (artiq.language.types.TFloat)

off()
on()
current
min_current
max_current
default_ramp_steps = 30
set_current(current)

Set the current delivered by the current source

Parameters:

current (artiq.language.types.TFloat) -- Current in A

ramp_current(duration, current_end, current_start=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)

Ramp current over a given duration.

This method advances the timeline by duration

Parameters:
  • duration (artiq.language.types.TFloat) -- ramp duration [s]

  • current_end (artiq.language.types.TFloat) -- end current [A]

  • current_start (artiq.language.types.TFloat) -- initial current [A]. If not given, the ramp starts from the current operating current.

  • ramp_timestep (artiq.language.types.TFloat)

  • ramp_steps (artiq.language.types.TInt32)

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 (or None) instead: when the repository is scanned to build the list of available experiments and when the dataset browser artiq_browser is used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments in build().

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 BooleanValue and NumberValue.

  • 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, float or 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=None to 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 as slice(*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 False to prevent archival together with the run's results. Default is True.

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)

abstractmethod is_on(channel=None)
Parameters:

channel (artiq.language.types.TStr)

toggle(channel=None)
Parameters:

channel (artiq.language.types.TStr)

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

  • channel (artiq.language.types.TStr)

class atomiq.components.electronics.currentsource.TTLSoftwareLogicHBridgedCurrentSource(switch_forward, switch_reverse, *args, **kwargs)[source]

Bases: HBridgedCurrentSource

H-bridged current source with control logic implemented in software

Each pair of MOSFETs is directly controlled by one switch. So when both TTLs are off, the bridge is off, but also when both are on the PSU is shorted.

switch_forward

switch_reverse

current flow

off

off

off

off

on

reverse

on

off

forward

on

on

INVALID

Parameters:
  • switch_forward (Switchable) -- TTL to enable forward pair of MOSFETs

  • switch_reverse (Switchable) -- TTL to enable reverse pair of MOSFETs

kernel_invariants
switch_forward
switch_reverse
_hbridge_off()[source]
_hbridge_forward()[source]
_hbridge_reverse()[source]
class HBridgeState

Bases: enum.IntEnum

Enum where members are also (and must be) ints

FORWARD = (1,)
OFF = (0,)
REVERSE = -1
current_source
state
last_state
hbridge_off()
hbridge_reverse()
hbridge_forward()
hbridge_toggle()
_set_current(current)
Parameters:

current (artiq.language.types.TFloat)

_ramp_current(duration, current_start, current_end, ramp_timestep)

This method implements a stupid ramp on an abstract level. This will most likely work but be slow. If your hardware has native support for ramping, please override this function when you inherit from currentSource

Parameters:
  • duration (artiq.language.types.TFloat)

  • current_start (artiq.language.types.TFloat)

  • current_end (artiq.language.types.TFloat)

  • ramp_timestep (artiq.language.types.TFloat)

off()
on()
current
min_current
max_current
default_ramp_steps = 30
set_current(current)

Set the current delivered by the current source

Parameters:

current (artiq.language.types.TFloat) -- Current in A

ramp_current(duration, current_end, current_start=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)

Ramp current over a given duration.

This method advances the timeline by duration

Parameters:
  • duration (artiq.language.types.TFloat) -- ramp duration [s]

  • current_end (artiq.language.types.TFloat) -- end current [A]

  • current_start (artiq.language.types.TFloat) -- initial current [A]. If not given, the ramp starts from the current operating current.

  • ramp_timestep (artiq.language.types.TFloat)

  • ramp_steps (artiq.language.types.TInt32)

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 (or None) instead: when the repository is scanned to build the list of available experiments and when the dataset browser artiq_browser is used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments in build().

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 BooleanValue and NumberValue.

  • 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, float or 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=None to 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 as slice(*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 False to prevent archival together with the run's results. Default is True.

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)

abstractmethod is_on(channel=None)
Parameters:

channel (artiq.language.types.TStr)

toggle(channel=None)
Parameters:

channel (artiq.language.types.TStr)

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

  • channel (artiq.language.types.TStr)

class atomiq.components.electronics.currentsource.RPCCurrentSource(rpc_currentsource, *args, **kwargs)[source]

Bases: CurrentSource

A current source controlled via RPC calls

Parameters:

rpc_currentsource (Component) -- The ARTIQ rpc object representing the current source. This object needs to provide a function named set_current(current_in_A) to set the current.

kernel_invariants
currentsource
_set_current(current)[source]
Parameters:

current (artiq.language.types.TFloat)

current
min_current
max_current
default_ramp_steps = 30
set_current(current)

Set the current delivered by the current source

Parameters:

current (artiq.language.types.TFloat) -- Current in A

_ramp_current(duration, current_start, current_end, ramp_timestep=0.0002)

This method implements a stupid ramp on an abstract level. This will most likely work but be slow. If your hardware has native support for ramping, please override this function when you inherit from currentSource

Parameters:
  • duration (artiq.language.types.TFloat)

  • current_start (artiq.language.types.TFloat)

  • current_end (artiq.language.types.TFloat)

  • ramp_timestep (artiq.language.types.TFloat)

ramp_current(duration, current_end, current_start=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)

Ramp current over a given duration.

This method advances the timeline by duration

Parameters:
  • duration (artiq.language.types.TFloat) -- ramp duration [s]

  • current_end (artiq.language.types.TFloat) -- end current [A]

  • current_start (artiq.language.types.TFloat) -- initial current [A]. If not given, the ramp starts from the current operating current.

  • ramp_timestep (artiq.language.types.TFloat)

  • ramp_steps (artiq.language.types.TInt32)

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 (or None) instead: when the repository is scanned to build the list of available experiments and when the dataset browser artiq_browser is used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments in build().

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 BooleanValue and NumberValue.

  • 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, float or 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=None to 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 as slice(*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 False to prevent archival together with the run's results. Default is True.

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.electronics.currentsource.RPCCurrentSourceChannel(rpc_currentsource, channel, *args, **kwargs)[source]

Bases: CurrentSource

One channel of a multi-channel currentsource controlled via RPC

Parameters:
  • rpc_currentsource (Component) -- The ARTIQ rpc object representing the multi channel current source. This object needs to provide a function named set_current(current_in_A, channel) to set the current.

  • channel (artiq.language.types.TInt32) -- channel of the multi-channel current source to operate on

kernel_invariants
currentsource
channel
_set_current(current)[source]
Parameters:

current (artiq.language.types.TFloat)

current
min_current
max_current
default_ramp_steps = 30
set_current(current)

Set the current delivered by the current source

Parameters:

current (artiq.language.types.TFloat) -- Current in A

_ramp_current(duration, current_start, current_end, ramp_timestep=0.0002)

This method implements a stupid ramp on an abstract level. This will most likely work but be slow. If your hardware has native support for ramping, please override this function when you inherit from currentSource

Parameters:
  • duration (artiq.language.types.TFloat)

  • current_start (artiq.language.types.TFloat)

  • current_end (artiq.language.types.TFloat)

  • ramp_timestep (artiq.language.types.TFloat)

ramp_current(duration, current_end, current_start=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)

Ramp current over a given duration.

This method advances the timeline by duration

Parameters:
  • duration (artiq.language.types.TFloat) -- ramp duration [s]

  • current_end (artiq.language.types.TFloat) -- end current [A]

  • current_start (artiq.language.types.TFloat) -- initial current [A]. If not given, the ramp starts from the current operating current.

  • ramp_timestep (artiq.language.types.TFloat)

  • ramp_steps (artiq.language.types.TInt32)

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 (or None) instead: when the repository is scanned to build the list of available experiments and when the dataset browser artiq_browser is used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments in build().

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 BooleanValue and NumberValue.

  • 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, float or 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=None to 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 as slice(*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 False to prevent archival together with the run's results. Default is True.

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.electronics.currentsource.VoltageControlledCurrentSource(voltage_source, calibration, *args, **kwargs)[source]

Bases: CurrentSource

A current source controlled by an analog voltage

A typical usecase for this class are voltage-controlled power supplies that drive the current through a coil.

Parameters:
  • voltage_source (VoltageSource) -- Voltage source that controls the current source

  • calibration (Calibration) -- Calibration U = f(I) to give the control voltage U for a desired current I

kernel_invariants
voltage_source
calibration
_set_current(current)[source]
Parameters:

current (artiq.language.types.TFloat)

_ramp_current(duration, current_start, current_end, ramp_timestep)[source]

This method implements a stupid ramp on an abstract level. This will most likely work but be slow. If your hardware has native support for ramping, please override this function when you inherit from currentSource

Parameters:
  • duration (artiq.language.types.TFloat)

  • current_start (artiq.language.types.TFloat)

  • current_end (artiq.language.types.TFloat)

  • ramp_timestep (artiq.language.types.TFloat)

current
min_current
max_current
default_ramp_steps = 30
set_current(current)

Set the current delivered by the current source

Parameters:

current (artiq.language.types.TFloat) -- Current in A

ramp_current(duration, current_end, current_start=float('nan'), ramp_timestep=float('nan'), ramp_steps=-1)

Ramp current over a given duration.

This method advances the timeline by duration

Parameters:
  • duration (artiq.language.types.TFloat) -- ramp duration [s]

  • current_end (artiq.language.types.TFloat) -- end current [A]

  • current_start (artiq.language.types.TFloat) -- initial current [A]. If not given, the ramp starts from the current operating current.

  • ramp_timestep (artiq.language.types.TFloat)

  • ramp_steps (artiq.language.types.TInt32)

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 (or None) instead: when the repository is scanned to build the list of available experiments and when the dataset browser artiq_browser is used to open or run the analysis stage of an experiment. Do not rely on being able to operate on devices or arguments in build().

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 BooleanValue and NumberValue.

  • 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, float or 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=None to 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 as slice(*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 False to prevent archival together with the run's results. Default is True.

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)