Drivers

Arbitrary waveform generator driver

class
silospin.drivers.zi_hdawg_driver.HdawgDriver(dev_id, server_host='localhost', server_port=8004, api_level=6, interface='1GbE', rf_cores=[1, 2, 3], plunger_channels={'p12': 7, 'p21': 8})

Driver class for Zurich HDAWG (Zurich arbitrary waveform generator) instrument. Configured for 4 AWG cores.

Attributes
  • _awgs (dict) Dictionary for 4 AWG cores. Keys correspond to each AWG ("awg1"..."awg4"), values are Zurich AWG core objects.
  • _channel_mapping (dict) Channel mapping for AWG. Takes in RF core and DC channel groupings, returns mapping from AWG core indices to gate indices and channels.
  • _command_tables (dict) Dictionary of command tables uploaded to each AWG core, pulled dicectly from the instrument.
  • _connection_settings ('dict') Dictionary of connection settings. Keys/values: "hdawg_id" (str), "server_host" (str), "server_port" (int), "api_level" (int), "interface" (str), "connection_status" (bool).
  • _daq (zhinst.core.ziDAQServer) Instance of Zurich driver DAQ module.
  • _hdawg (zhinst.toolkit.driver.devices.hdawg.HDAWG) Instance of Zurich HDAWG driver.
  • _oscillator_freq (dict) Dictionary of 16 HDAWG oscillator frequencies. Keys: "osc1"..."osc16" (str). Values: corresponding oscillator frequencies in Hz (float).
  • _run_status (dict) Dictionary of run status for each core ("awg1"..."awg4"), True if running and False if not.
  • _sequences (dict) Dictionary of sequencer code uploaded to each AWG core (keys correspond to each core "awg1"..."awg4").
  • _session (zhinst.toolkit.session.Session) Instance of Zurich session for established connection.
  • _sines (dict) Dictionary of 8 HDAWG sine generator properties. Outer keys correspond to the sine wave ("sine1"..."sine8"), with dictionary values as separate dictionaries. Inner dictionary for each sine generator describes propertie of sine generator. Keys/Values: "osc" (int) [oscillator index from 0-15], "phaseshift" (float) [phase shift for oscillator in degrees], "harmonic" (int) [harmonic of sine wave], "amp1" (float) [amplitude on output 1], "amp2" (float) [amplitude on output 2].
Methods
  • assign_osc(sin_num, osc_num) (None.) Assigns an oscillator index (osc_num from 1-16) to a sine generator (sin_num from 1-8).
  • compile_core(awg_num) (None.) Compiles specified core awg_num.
  • compile_run_core(awg_num) (None.) Compiles and runs specified core, awg_num.
  • get_all_awg_parameters() (all_awg_parameters : 'dict') No input parameters. Returns dictionary current state of the instrument.
  • get_awg(awg_num) (awg_core : 'zhinst.toolkit.driver.nodes.awg.AWG') Gets AWG core object for awg core awg_num (ranges from 1-4).
  • get_connection_settings(param) (connection_setting : 'str' or 'int' or 'bool'.) Returns connections setting corresponding to param of the instrument. Parameters include: "hdawg_id" , "server_host" , "server_port" , "api_level" , "interface" , "connection_status".
  • get_modulation_mode(sin_num) (modulation_mode : 'int') Gets modulation mode for sine generator sin_num ranges from 1-8).
  • get_osc_freq(osc_num) (osc_freq : 'float') Returns frequency of oscillator osc_num in Hz. osc_num ranges from 1-16.
  • get_out_amp(sin_num, wave_num) (amp : 'float') Gets output amplitude (in volts) for wave output wave_num (ranges from 1-2) of sine generator sin_num (ranges from 1-8).
  • get_phase(sin_num) (phaseshift : 'float') Gets the phase (in degrees) for sine generator sin_num (from 1-8).
  • get_sequence(awg_idx) (sequence : 'str') Gets the code on the sequencer for a given AWG core index, awg_idx ranging from 0-3.
  • get_sine(sin_num) (sine : 'dict') Returns a dictionary representing the state of sine generator sin_num (ranges from 1-8).
  • get_updated_run_status(awg_num) (run_status : 'bool') Gets the run status for specified AWG core.
  • set_command_table(ct, awg_idx) (None.) Uploads command table ct (in specified format) to AWG core, awg_idx (ranges from 0-3).
  • set_modulation_mode(sin_num, mode) (None) Sets modulation mode for sine generator sin_num ranges from 1-8).
  • set_osc_freq(osc_num, freq) (None.) Sets oscillator frequency freq in Hz for oscillator osc_num (from 1-16).
  • set_out_amp(sin_num, wave_num, amp) (None.) Sets output amplitude (in volts) for wave output wave_num (ranges from 1-2) of sine generator sin_num (ranges from 1-8).
  • set_phase(sin_num, phase) (None.) Sets oscillator phase (in degrees) for sine generator sin_num (from 1-8).
  • set_sine(sin_num, osc_num, phase, harmonic, amp1, amp2) (None) Returns a dictionary representing the state of sine generator sin_num (ranges from 1-8).
  • stop_core(awg_num) (None.) Stops specified core.
method
get_all_awg_parameters()

No input parameters. Returns dictionary current state of the instrument.

Parameters dictionaries are described below:

  • "connection", dictionary of connection settings

  • "oscillators", dictionary of oscillator frequencies

  • "sines", dictionary of sine generator parameters

  • "command_tables", dictionary of uploaded command tables

  • "sequences", dictionary of uploaded sequencer code

  • "run_status", dictionary of run statuses for each core

  • "channel_map", channel mapping dictonary

method
get_connection_settings(param)

Returns connections setting corresponding to param of the instrument. Parameters include: "hdawg_id" , "server_host" , "server_port" , "api_level" , "interface" , "connection_status".

Returns (connection_setting : 'str' or 'int' or 'bool'.)

Specified connection setting for the HDAWG.

method
get_osc_freq(osc_num)

Returns frequency of oscillator osc_num in Hz. osc_num ranges from 1-16.

Keep the following oscillator grouping per AWG core in mind: -osc 1-4, AWG 1 -osc 5-9, AWG 2 -osc 10-13, AWG 3 -osc 14-16, AWG 4

Returns (osc_freq : 'float')

Oscillator frequency in Hz.

method
set_osc_freq(osc_num, freq)

Sets oscillator frequency freq in Hz for oscillator osc_num (from 1-16).

method
get_phase(sin_num)

Gets the phase (in degrees) for sine generator sin_num (from 1-8).

Returns (phaseshift : 'float')

Phase shift for sine generator in degrees.

method
set_phase(sin_num, phase)

Sets oscillator phase (in degrees) for sine generator sin_num (from 1-8).

method
get_modulation_mode(sin_num)

Gets modulation mode for sine generator sin_num ranges from 1-8).

Note that modulation mode follows the convention:

  • 0, Modulation Off: AWG Output goes directly to Signal Output.

  • 1, Sine 11: AWG Outputs 0 and 1 are both multiplied with Sine Generator signal 0.

  • 2, Sine 22: AWG Outputs 0 and 1 are both multiplied with Sine Generator signal 1.

  • 3, Sine 12: AWG Outputs 0 and 1 are multiplied with Sine Generator signal 0 and 1.

  • 4, Sine 21: AWG Outputs 0 and 1 are multiplied with Sine Generator signal 1 and 0.

  • 5, Advanced: Output modulates corresponding sines from modulation carriers.

  • 6, Mixer Calibration: The AWG outputs are multiplied with the sum or difference of Sine Generators multiplied by gains specified. The resulting output signal is AWG1(Sine1Gain1 - Sine2Gain2) + AWG2(Sine1Gain2 + Sine2Gain1).

Returns (modulation_mode : 'int')

Modulation mode of sine generator ranges from 0-6.

method
set_modulation_mode(sin_num, mode)

Sets modulation mode for sine generator sin_num ranges from 1-8).

Note that modulation mode follows the convention:

  • 0, Modulation Off: AWG Output goes directly to Signal Output.

  • 1, Sine 11: AWG Outputs 0 and 1 are both multiplied with Sine Generator signal 0.

  • 2, Sine 22: AWG Outputs 0 and 1 are both multiplied with Sine Generator signal 1.

  • 3, Sine 12: AWG Outputs 0 and 1 are multiplied with Sine Generator signal 0 and 1.

  • 4, Sine 21: AWG Outputs 0 and 1 are multiplied with Sine Generator signal 1 and 0.

  • 5, Advanced: Output modulates corresponding sines from modulation carriers.

  • 6, Mixer Calibration: The AWG outputs are multiplied with the sum or difference of Sine Generators multiplied by gains specified. The resulting output signal is AWG1x(Sine1xGain1 - Sine2*Gain2) + AWG2x(Sine1xGain2 + Sine2xGain1).

method
get_sine(sin_num)

Returns a dictionary representing the state of sine generator sin_num (ranges from 1-8).

The dictionary comprises the parameters listed below:

  • 'osc', oscillator index (int)

  • 'phaseshift', phase offset (degrees) for current sine generator (float)

  • 'harmonic', harmonic of the oscillator's output (int)

  • 'amp1', amplitude (volts) of sine output 1 (float)

  • 'amp2', amplitude (volts) of sine output 2 (float)

Returns (sine : 'dict')

Dictionary representing the sine generator's current state.

method
assign_osc(sin_num, osc_num)

Assigns an oscillator index (osc_num from 1-16) to a sine generator (sin_num from 1-8).

method
set_sine(sin_num, osc_num, phase=0.0, harmonic=1, amp1=1.0, amp2=1.0)

Returns a dictionary representing the state of sine generator sin_num (ranges from 1-8).

The dictionary comprises the parameters listed below:

  • 'osc', oscillator index (int)

  • 'phaseshift', phase offset (degrees) for current sine generator (float)

  • 'harmonic', harmonic of the oscillator's output (int)

  • 'amp1', amplitude (volts) of sine output 1 (float)

  • 'amp2', amplitude (volts) of sine output 2 (float)

method
get_awg(awg_num)

Gets AWG core object for awg core awg_num (ranges from 1-4).

Returns (awg_core : 'zhinst.toolkit.driver.nodes.awg.AWG')

Zurich AWG core object.

method
get_out_amp(sin_num, wave_num)

Gets output amplitude (in volts) for wave output wave_num (ranges from 1-2) of sine generator sin_num (ranges from 1-8).

Returns (amp : 'float')

Amplitude in volts of specified channel output.

method
set_out_amp(sin_num, wave_num, amp)

Sets output amplitude (in volts) for wave output wave_num (ranges from 1-2) of sine generator sin_num (ranges from 1-8).

method
get_sequence(awg_idx)

Gets the code on the sequencer for a given AWG core index, awg_idx ranging from 0-3.

Returns (sequence : 'str')

Sequencer code for specified AWG core.

method
get_updated_run_status(awg_num)

Gets the run status for specified AWG core.

Returns (run_status : 'bool')

True if currently running, False if not running.

method
compile_core(awg_num)

Compiles specified core awg_num.

method
compile_run_core(awg_num)

Compiles and runs specified core, awg_num.

method
stop_core(awg_num)

Stops specified core.

method
set_command_table(ct, awg_idx)

Uploads command table ct (in specified format) to AWG core, awg_idx (ranges from 0-3).

Lock-in amplifier driver

mkapi

Digital-to-analog convertor driver

mkapi

Trigger box driver

mkapi

Microwave-source driver

mkapi