UrukulChannel

Class Arguments

Argument

Type

Default Value

urukul

Urukul

device

TStr

ttl

None

default_attenuation

19.0

profile_arb

TInt32

0

use_drg

TBool

True

auto_sync_drg

TInt32

0

read_delay

TInt64

8000

write_delay

TInt64

8000

calc_delay_modifier

TInt64

7

default_frequency

TFloat

100000000.0

default_amplitude

TFloat

0.0

default_phase

TFloat

0.0

freq_limit

tuple

(0.0, inf)

amp_limit

tuple

(0.0, 1.0)

blind

TBool

False

default_ramp_steps

TInt32

30

Bold arguments are mandatory. For more documentation on the listed arguments refer to the class definition below. If parameters appear in this list but not in the class definition below, please recursively check the linked base classes for the definition of the parameter.

Inheritance Diagram

Inheritance diagram of atomiq.components.sinara.urukul.UrukulChannel

Example Component Dictionary

   {
    "urukul_example": {
        "classname": "atomiq.components.sinara.urukul.UrukulChannel",
        "arguments": {
            "urukul": "<mandatory parameter (Urukul)>",
            "device": "<mandatory parameter (TStr)>",
            "ttl": null,
            "default_attenuation": 19.0,
            "profile_arb": 0,
            "use_drg": true,
            "auto_sync_drg": 0,
            "read_delay": 8000,
            "write_delay": 8000,
            "calc_delay_modifier": 7,
            "default_frequency": 100000000.0,
            "default_amplitude": 0.0,
            "default_phase": 0.0,
            "freq_limit": [
                0.0,
                1e999
            ],
            "amp_limit": [
                0.0,
                1.0
            ],
            "blind": false,
            "default_ramp_steps": 30
        }
    }
}

Class Description

class atomiq.components.sinara.urukul.UrukulChannel(urukul, device, ttl=None, default_attenuation=19.0, profile_arb=0, use_drg=True, auto_sync_drg=0, read_delay=np.int64(8000), write_delay=np.int64(8000), calc_delay_modifier=np.int64(7), *args, **kwargs)[source]

Bases: RFSource, Switchable

Single DDS Channel of a Sinara Urukul

Parameters:
  • urukul (Urukul) -- The Urukul component this channel belongs to

  • device (TStr) -- The ARTIQ device from the device_db representing the Urukul channel, e.g. @urukul0_ch0

  • ttl -- The ARTIQ device from the device_db representing the Urukul fast RF switch, e.g. @ttl_urukul0_sw0

  • default_attenuation -- Default attenuation to set for the channel on startup. (default -19dBm)

  • profile_arb (TInt32) -- Profile on the DDS to use for arbitrary function generation. (default 0)

  • use_drg (TBool) -- Use the DRG for amplitude or frequency ramps (recommended). (default True)

  • auto_sync_drg (TInt32) -- Defined if the drg is synced to either frequency (1) or amplitude (2) in the prepare phase. Default is not synced (0). Syncing is recommended in combination with blind if continuous operation is required.

  • read_delay (TInt64) -- Delay necessary for read operations of 64bit in mu. This is hardware specific and can be obtained from calibrate_read_write_delays().The default value is conservative but fine for most uses. If you need to for example run drg ramps in quick succession you should adjust this.

  • write_delay (TInt64) -- Delay necessary for write operations of 64bit in mu. See read_delay for more info.

  • calc_delay_modifier (TInt64) -- Multiplier for delays inserted into function code to accommodate for CPU calculation time and avoid underflow. If necessary you can try to reduce the conservative default value. Specifically for Kasli SoC, the necessary multiplier is smaller.

Tip

The ramp() method can be used in combination with the blind component argument. This allows for generating continous, jump-free ramps between experiments. This makes it possible to use the dds output to generate a lock signal for a laser cavity lock.

Attention

Setting parameters before the DRG is synced with the python object would break the continuity. Run sync_drg() before setting amplitude, frequency or phase parameters or use auto_sync_drg.

A Parametrizable is an entity that can be controlled by one or more continuous parameter(s)

kernel_invariants = {'auto_sync_drg', 'device', 'profile_arb', 'profile_default', 'read_delay', 'ttl', 'urukul', 'use_drg', 'write_delay'}
init()[source]

Initialize the urukul channel. Necessary only once after power on.

Warning

This function is not called automatically as it is slow and resets the device leading to a frequency/amplitude jump.

set(frequency=nan, amplitude=nan, phase=0.0, profile=-1)[source]

Set the frequency and amplitude. Frequency/amplitude are set to the last known value if float("nan") is passed (default).

Parameters:
  • frequency (artiq.compiler.types.TMono('float', OrderedDict())) -- Frequency in Hz (float("nan") to use previous value)

  • amplitude (artiq.compiler.types.TMono('float', OrderedDict())) -- Amplitude in units of full scale (float("nan") to use previous value)

  • phase (artiq.compiler.types.TMono('float', OrderedDict())) -- Phase tuning word in turns

  • profile (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))) -- DDS Profile (-1 to keep current profile)

set_att(attenuation)[source]

Set the hardware attenuation for this urukul channel via CPLD.

Parameters:

attenuation (artiq.compiler.types.TMono('float', OrderedDict())) -- channel attenuation (0. to 31.0 in 0.5 increments) [dB]

on()[source]

Turn on via ttl.

:return

off()[source]

Turn off via ttl.

:return

calibrate_read_write_delays(security_factor=1.4)[source]

Helper function to calibrate the delays necessary in high level functions when writing and reading registers from the DDS to avoid underflows.

The default values for the component arguments read_delay and write_delay are conservative and should generally work. If you need fast successive drg ramps you can obtain your hardware specific values with this method and try to lower the delays in your components db.

Parameters:

security_factor (artiq.compiler.types.TMono('float', OrderedDict())) -- Factor with which the returned delay values are multiplied. Since the CPU is non-deterministic the real calculation time can vary, which is compensated by the security factor.

Returns:

The read (0) and write (1) delays in machine units.

Return type:

tuple[TInt64, TInt64]

Attention

This method turns off the urukul output writes into the drg registers and therefore brings the drg out of sync. It is generally not meant to run within a real experiment but for one-time callibration.

amplitude_to_drg_step(val)[source]
Parameters:

val (artiq.compiler.types.TMono('float', OrderedDict()))

Return type:

artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))

read64_32(addr)[source]

Read two 32-bit values from 64-bit register. Advances time cursor by 8640ns and removes all slack

Parameters:

addr (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))) -- Register address

Returns:

Tuple of two 32-bit integer register values

Return type:

tuple[artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))])), artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))]

sync_drg(target)[source]

Synchronises the python object with the current register values of the DRG. Advances time cursor by 25us.

Parameters:

target (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))) -- Target to synchronise to. 1 for frequency, 2 for amplitude.

Return type:

None

ramp(duration, frequency_start=nan, frequency_end=nan, amplitude_start=nan, amplitude_end=nan, ramp_timestep=nan, ramp_steps=-1)[source]

Ramp frequency and amplitude over a given duration. Parameters default to -1 or nan to indicate no change. If the start frequency/amplitude is set to nan, the ramp starts from the last frequency/amplitude which was set. This method advances the timeline by ´duration´

Tip

This method can be used in combination with the blind component argument. This allows for generating continuous, jump-free ramps between experiments. This makes it possible to use the dds output to generate a lock signal for a laser cavity lock. Note that in this mode using amplitude and frequency ramps leads to undefined behavior when switching between them. As the DRG can only address either amplitude or frequency, parallel ramps of both parameters are ramped in a simple step by step way. Usage of the DRG can be avoided by setting the component attribute use_drg to False.

Attention

When using the DRG, this method always advances the timeline by at least 10us, even if the ramp is shorter. Reading and writing of DDS registers is scheduled in the past, this means no drg changes should be made in the ~100us (dependent on read_delay and write_delay) before this function is called.

Parameters:
  • duration (artiq.compiler.types.TMono('float', OrderedDict())) -- ramp duration [s]

  • frequency_start (artiq.compiler.types.TMono('float', OrderedDict())) -- initial frequency [Hz]

  • frequency_end (artiq.compiler.types.TMono('float', OrderedDict())) -- end frequency [Hz]

  • amplitude_start (artiq.compiler.types.TMono('float', OrderedDict())) -- initial amplitude [0..1]

  • amplitude_end (artiq.compiler.types.TMono('float', OrderedDict())) -- end amplitude [0..1]

  • ramp_timesteps -- time between steps in the ramp [s]

  • ramp_steps (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))) -- number of steps the whole ramp should have. This takes precedence over ramp_timesteps

  • ramp_timestep (artiq.compiler.types.TMono('float', OrderedDict()))

arb(duration, samples_amp=[], samples_freq=[], samples_phase=[], repetitions=1, prepare_only=False, run_prepared=False, transform_amp=<function identity_float>, transform_freq=<function identity_float>, transform_phase=<function identity_float>)

Play Arbitrary Samples from a List

This method allows to set the output amplitude, frequency an phase according to the values specified in respective lists. The whole sequence is played in the specified duration. The pattern store in the sample list can also be repeated.

We supports a scheme to prepare the arb function before it is actually used. If that is needed, run this function with prepapre_only = True when the arb should be prepared and with run_only = True when the prepared arb should be played. In both calls the other parameters have to be passed.

Parameters:
  • samples_amp (artiq.compiler.types.TMono('list', OrderedDict([('elt', artiq.compiler.types.TMono('float', OrderedDict()))]))) -- List of amplitude samples. If this list is empty (default), the amplitude is not modified.

  • samples_freq (artiq.compiler.types.TMono('list', OrderedDict([('elt', artiq.compiler.types.TMono('float', OrderedDict()))]))) -- List of frequency samples. If this list is empty (default), the frequency is not modified.

  • samples_phase (artiq.compiler.types.TMono('list', OrderedDict([('elt', artiq.compiler.types.TMono('float', OrderedDict()))]))) -- List of phase samples. If this list is empty (default), the phase is not modified.

  • duration (artiq.compiler.types.TMono('float', OrderedDict())) -- The time in which the whole sequence of samples should be played back [s].

  • repetitions (artiq.compiler.types.TMono('int', OrderedDict([('width', artiq.compiler.types.TValue(32))]))) -- Number of times the sequence of all samples should be played. (default 1)

  • prepare_only (artiq.compiler.types.TMono('bool', OrderedDict()))

  • run_prepared (artiq.compiler.types.TMono('bool', OrderedDict()))

get_amplitude()
Return type:

artiq.compiler.types.TMono('float', OrderedDict())

get_frequency()
Return type:

artiq.compiler.types.TMono('float', OrderedDict())

get_phase()
Return type:

artiq.compiler.types.TMono('float', OrderedDict())

is_on(channel=None)
Parameters:

channel (artiq.compiler.types.TMono('str', OrderedDict()))

pulse(pulsetime, channel='')
Parameters:
  • pulsetime (artiq.compiler.types.TMono('float', OrderedDict()))

  • channel (artiq.compiler.types.TMono('str', OrderedDict()))

set_amplitude(amplitude)
set_frequency(frequency)
set_parameter(value, channel=None)
Parameters:
  • value (artiq.compiler.types.TMono('float', OrderedDict()))

  • channel (artiq.compiler.types.TMono('str', OrderedDict()))

set_phase(phase)
toggle(channel=None)
Parameters:

channel (artiq.compiler.types.TMono('str', OrderedDict()))