3.4.1. qupulse.hardware.awgs

qupulse.hardware.awgs.base

This module defines the common interface for arbitrary waveform generators.

qupulse.hardware.awgs.tektronix

qupulse.hardware.awgs.zihdawg

class qupulse.hardware.awgs.TektronixAWG(device, synchronize, identifier='Tektronix', logger=None, default_program_repetition_mode='once', idle_waveform_length=250)[source]

Bases: qupulse.hardware.awgs.base.AWG

Driver for Tektronix AWG object (5000/7000 series).

Special characteristics:
  • Changing the run mode to ‘running’ takes a lot of time (depending on the sequence)

  • To keep the “arm” time low each program is uploaded to the sequence table! This reduces the number of programs drastically but allows very fast switching with arm IF the awg runs.

  • Arm starts the awg if it does not run. The first call to arm after uploading new programs is therefore slow. This guarantees that subsequent calls to arm and run_current_program are always fast.

  • Uploading while the awg runs is VERY slow. The private properties _allow_upload_while_running and _auto_stop_on_upload control the behaviour in this case (stopping the awg or raising an exception). These properties are currently not a stable interface to that functionality hence the privateness.

This driver implements an interface for changing the program repetition mode consisting of:
  • the property default_program_repetition_mode

  • set_program_repetition_mode(program_name, mode)

  • get_program_repetition_mode(program_name)

Synchronization: The driver relies on the fact that internal variables correspond to the device state: _sequence_entries and _waveforms We do not aim to detect user manipulation but want to make sure invalidate the internal state on upload errors. To do this the attribute _synchronized is set to False. Methods that rely on the synchronization state to correctly modify the awg check that attribute.

All private functions assume that the error queue is empty when called.

TODO: Move logger and repetition mode functionality to AWG interface

Parameters
  • device (TekAwg) – Instance of the underlying driver from tek_awg package

  • synchronize (str) – Either ‘read’ or ‘clear’.

  • identifier – Some identifier

  • logger – Logging will happen here (defaults to ‘qupulse.tektronix’ otherwise)

  • default_program_repetition_mode – ‘once’ or ‘infinite’

  • idle_waveform_length – length of the idle_waveform in samples

__init__(device, synchronize, identifier='Tektronix', logger=None, default_program_repetition_mode='once', idle_waveform_length=250)[source]
Parameters
  • device (TekAwg) – Instance of the underlying driver from tek_awg package

  • synchronize (str) – Either ‘read’ or ‘clear’.

  • identifier – Some identifier

  • logger – Logging will happen here (defaults to ‘qupulse.tektronix’ otherwise)

  • default_program_repetition_mode – ‘once’ or ‘infinite’

  • idle_waveform_length – length of the idle_waveform in samples

arm(name)[source]

Arming starts the awg

property armed_program: Optional[str]
Return type

Optional[str]

assert_synchronized()[source]
cleanup()[source]

Delete all waveforms not used anymore and rewrite sequence entries if they are fragmented

clear()[source]

Clear all waveforms, the sequence table and program registry and initialize the idle program.

property default_program_repetition_mode: str

repetition mode for newly uploaded programs. Valid values are ‘once’ and ‘infinite’. You can use set_program_repetition_mode to change the repetition mode of an existing program

Return type

str

property device: tek_awg.TekAwg
Return type

TekAwg

get_program_information()[source]
Return type

Dict[str, dict]

get_program_repetition_mode(program_name)[source]

This function uses cached data and does not talk to the awg

Return type

str

static idle_pulse_name(idle_length)[source]
Return type

str

initialize_idle_program()[source]

Make sure we can arm the idle program which plays the idle waveform(default 0V) on all channels.

make_idle_waveform(length)[source]
Return type

Waveform

property num_channels: int

Implements num_channels.

Return type

int

property num_markers: int

Implements num_markers.

Return type

int

property programs: Set[str]

Implements programs.

Return type

Set[str]

read_waveforms()[source]

Read all waveform data from the device (including binary data).

remove(name)[source]

Implements remove().

run_current_program(channel_states=None)[source]

Runs the currentlz armed program

Parameters

channel_states (Optional[Tuple[bool, bool, bool, bool]]) – If given the channel states are set to these values

Returns:

property sample_rate: float

Implements sample_rate.

Return type

float

set_program_repetition_mode(program_name, mode)[source]
set_volatile_parameters(program_name, parameters)[source]

Implements set_volatile_parameters().

synchronize()[source]

Read waveforms from device and re-upload all programs

property synchronized: bool
Return type

bool

upload(*args, **kwargs)[source]

Implements upload().

warn_if_errors_are_present()[source]

Emit a warning with present errors.

qupulse.hardware.awgs.install_requirements(vendor)[source]