helpers#

Helpers for Zurich Instruments.

Module Contents#

Functions#

get_value(→ numpy.ndarray)

Gets the value of a ZI node.

set_value(→ None)

Sets the value of a ZI node.

set_values(→ None)

Sets the value of a ZI node.

set_vector(→ None)

Sets the vector value of a ZI node.

set_awg_value(→ None)

Sets the value of a AWG module node.

set_and_compile_awg_seqc(instrument, awg_index, node, ...)

Uploads and compiles the AWG sequencer program.

set_wave_vector(→ None)

Sets the command table wave vector for an awg of an instrument.

set_commandtable_data(→ None)

Sets the commandtable JSON for an AWG.

get_directory(→ pathlib.Path)

Returns the LabOne directory of an AWG.

get_src_directory(→ pathlib.Path)

Returns the source directory of an AWG.

get_waves_directory(→ pathlib.Path)

Returns the waves directory of an AWG.

write_seqc_file(→ pathlib.Path)

Writes the contents of to the source directory

get_waveform_table(→ Dict[int, int])

Returns a dictionary that contains the locations of

get_readout_channel_bitmask(→ str)

Returns a bitmask to enable readout channels.

get_sampling_rates(→ Dict[int, int])

Returns the allowed sampling rate values.

Attributes#

logger[source]#
get_value(instrument: zhinst.qcodes.base.ZIBaseInstrument, node: str) numpy.ndarray[source]#

Gets the value of a ZI node.

Parameters:
  • instrument

  • node

Returns:

The node value.

set_value(instrument: zhinst.qcodes.base.ZIBaseInstrument, node: str, value) None[source]#

Sets the value of a ZI node.

Parameters:
  • instrument – The instrument.

  • path – The node path.

  • value – The new node value.

set_values(instrument: zhinst.qcodes.base.ZIBaseInstrument, value: List[Tuple[str, Any]]) None[source]#

Sets the value of a ZI node.

Parameters:
  • instrument – The instrument.

  • value – The dictionary with nodes and values.

set_vector(instrument: zhinst.qcodes.base.ZIBaseInstrument, node: str, value: List | str) None[source]#

Sets the vector value of a ZI node.

Parameters:
  • instrument – The instrument.

  • awg_index – The awg to configure.

  • node – The node path.

  • value – The new node vector value.

set_awg_value(instrument: zhinst.qcodes.base.ZIBaseInstrument, awg_index: int, node: str, value: int | str) None[source]#

Sets the value of a AWG module node.

Parameters:
  • instrument – The instrument.

  • awg_index – The awg to configure.

  • node – The node path.

  • value – The new node value.

set_and_compile_awg_seqc(instrument: zhinst.qcodes.base.ZIBaseInstrument, awg_index: int, node: str, value: str)[source]#

Uploads and compiles the AWG sequencer program.

Parameters:
  • instrument – The ZI instrument object.

  • awg_index – The awg to configure.

  • node – The node path.

  • value – The seqc program.

  • waveforms_dict – The new waveforms for comparison.

set_wave_vector(instrument: zhinst.qcodes.base.ZIBaseInstrument, awg_index: int, wave_index: int, vector: List | str) None[source]#

Sets the command table wave vector for an awg of an instrument.

Parameters:
  • instrument – The instrument.

  • awg_index – The index of an AWG

  • wave_index – The wave index.

  • vector – The vector value.

set_commandtable_data(instrument: zhinst.qcodes.base.ZIBaseInstrument, awg_index: int, json_data: Dict[str, Any] | str) None[source]#

Sets the commandtable JSON for an AWG.

Parameters:
  • instrument – The instrument

  • awg_index – The awg index.

  • json_data – The json data.

get_directory(awg: zhinst.qcodes.hdawg.AWG) pathlib.Path[source]#

Returns the LabOne directory of an AWG.

Parameters:

awg – The HDAWG AWG object.

Returns:

The path of this directory.

get_src_directory(awg: zhinst.qcodes.hdawg.AWG) pathlib.Path[source]#

Returns the source directory of an AWG.

Parameters:

awg – The HDAWG AWG object.

Returns:

The path to the source directory.

get_waves_directory(awg: zhinst.qcodes.hdawg.AWG) pathlib.Path[source]#

Returns the waves directory of an AWG.

Parameters:

awg – The HDAWG AWG object.

Returns:

The path to the waves directory.

write_seqc_file(awg: zhinst.qcodes.hdawg.AWG, contents: str, filename: str) pathlib.Path[source]#

Writes the contents of to the source directory of LabOne.

Parameters:
  • awg – The HDAWG AWG instance.

  • contents – The content to write.

  • filename – The name of the file.

Returns:

Returns the path which was written.

get_waveform_table(pulse_ids: List[int], pulseid_pulseinfo_dict: Dict[int, Dict[str, Any]]) Dict[int, int][source]#

Returns a dictionary that contains the locations of pulses in the AWG waveform table.

Parameters:
  • pulse_ids – The list of pulse ids.

  • pulseid_pulseinfo_dict – The info lookup dictionary.

Returns:

The waveform table dictionary.

get_readout_channel_bitmask(readout_channels_count: int) str[source]#

Returns a bitmask to enable readout channels. The bitmask can be used to turn on QA for induvidual channels in startQAResult.

Parameters:

readout_channels_count – The amount of readout channels to enable. Maximum readout channels for UHFQA is 10.

Returns:

The channel bitmask.

get_sampling_rates(base_sampling_rate: float) Dict[int, int][source]#

Returns the allowed sampling rate values. See zhinst User manuals, section /DEV…./AWGS/n/TIME.

Parameters:

base_sampling_rate – The Instruments base sampling rate.

Returns:

The node value and corresponding sampling rate. e.g. {0: 2400000, 1:1200000, …} for the HDAWG.

Return type:

Dict[int, int]