qtt.instrument_drivers.virtualAwg package

Subpackages

Submodules

qtt.instrument_drivers.virtualAwg.sequencer module

class qtt.instrument_drivers.virtualAwg.sequencer.Sequencer[source]

Bases: object

Conversion factor from seconds to nano-seconds.

static deserialize(json_string)[source]

Convert a JSON string into a sequencer object.

Parameters:

json_string – The JSON data containing the sequencer object.

Returns:

NAME, TYPE, WAVE keys containing values; sequence name,

sequence data type and the actual qupulse sequencePT respectively.

Return type:

Dict

static get_data(sequence, sampling_rate)[source]
This function returns the raw array data given a sequence.

A sequence can hold different types of data dependend on the used pulse library. Currently only raw array data and qupulse can be used.

Parameters:
  • sequence (dict) – a waveform is a dictionary with “type” value

  • contain (given the used pulse library. The "wave" value should) –

  • wave-object. (the actual) –

  • sampling_rate (float) – a sample rate of the awg in samples per sec.

Returns:

A numpy.ndarray with the corresponding sampled voltages.

static make_marker(period, uptime=0.2, offset=0.0, repetitions=1, name='marker')[source]

Creates a marker block waveforms of the type qupulse template.

Parameters:
  • period (float) – The period of the waveform in seconds.

  • uptime (float) – The marker up period in seconds.

  • offset (float) – The marker delay in seconds.

  • repetitions (int) – The number of oscillations in the sequence.

  • name (str) – The name of the returned sequence.

Returns:

NAME, TYPE, WAVE keys containing values; sequence name,

sequence data type and the actual qupulse sequencePT respectively.

Return type:

Dict

static make_pulse_table(amplitudes, waiting_times, repetitions=1, name='pulse_table')[source]

Creates a sequence of pulses from a list of amplitudes and waiting times.

Note that the initial voltage level will be given by the last element in amplitudes.

Parameters:
  • amplitudes (list of floats) – List with voltage amplitudes of the pulses.

  • waiting_times (list of float) – List with durations containing the waiting time of each pulse.

  • repetitions (int) – The number of oscillations in the sequence.

  • name (str) – The name of the returned sequence.

Returns:

NAME, TYPE, WAVE keys containing values; sequence name,

sequence data type and the actual qupulse sequencePT respectively.

Return type:

Dict

static make_sawtooth_wave(amplitude, period, width=0.95, repetitions=1, name='sawtooth', zero_padding=0)[source]

Creates a sawtooth waveform of the type qupulse template.

Parameters:
  • amplitude (float) – The peak-to-peak voltage of the waveform.

  • width (float) – The width of the rising ramp as a proportion of the total cycle.

  • period (float) – The period of the waveform in seconds.

  • repetitions (int) – The number of oscillations in the sequence.

  • name (str) – The name of the returned sequence.

  • zero_padding (float) – Amount in seconds of zero padding to add

Returns:

NAME, TYPE, WAVE keys containing values; sequence name,

sequence data type and the actual qupulse sequencePT respectively.

Return type:

Dict

static make_square_wave(amplitude, period, repetitions=1, name='pulse')[source]

Creates a block waveforms of the type qupulse template.

Parameters:
  • amplitude (float) – The peak-to-peak voltage of the waveform.

  • period (float) – The period of the waveform in seconds.

  • repetitions (int) – The number of oscillations in the sequence.

  • name (str) – The name of the returned sequence.

Returns:

NAME, TYPE, WAVE keys containing values; sequence name,

sequence data type and the actual qupulse sequencePT respectively.

Return type:

Dict

static make_wave_from_array(qupulse_template, name='pulse')[source]

Creates a waveform from a numpy array.

Parameters:
  • array (np.ndarray) – Array with data

  • name (str) – The name of the returned sequence.

Returns:

NAME, TYPE, WAVE keys containing values; sequence name,

sequence data type and the actual qupulse sequencePT respectively.

Return type:

Dict

static make_wave_from_template(qupulse_template, name='pulse')[source]

Creates a waveform from a qupulse template.

Parameters:
  • qupulse_template (obj) – Qupulse template

  • name (str) – The name of the returned sequence.

Returns:

NAME, TYPE, WAVE keys containing values; sequence name,

sequence data type and the actual qupulse sequencePT respectively.

Return type:

Dict

static plot(sequence, sampling_rate, axes=None)[source]

Creates a plot for viewing the sequence.

Parameters:
  • sequence (dict) – a waveform dictionary with “type” value

  • contain (given by the used pulse library. The "wave" value should) –

  • wave-object. (the actual) –

  • sampling_rate (float) – a sample rate of the awg in samples per sec.

  • axes – matplotlib Axes object the pulse will be drawn into if provided.

static serialize(sequence)[source]

Converts a sequence into a JSON string.

Parameters:

sequence (dict) – A sequence created using the sequencer.

Returns:

A JSON string with the sequence data.

Return type:

Str

qtt.instrument_drivers.virtualAwg.serializer module

class qtt.instrument_drivers.virtualAwg.serializer.StringBackend[source]

Bases: StorageBackend

exists(identifier)[source]

Checks if data is stored for the given identifier.

Parameters:

identifier (str) – The identifier for which presence of data shall be checked.

Returns:

True, if stored data is associated with the given identifier.

get(identifier)[source]

Retrieves the data string with the given identifier.

Parameters:

identifier (str) – The identifier of the data to be retrieved.

Returns:

A serialized string of the data associated with the given identifier, if present.

Raises:

KeyError if no data is associated with the given identifier.

put(identifier, data, overwrite=False)[source]

Stores the data string identified by identifier.

Parameters:
  • identifier (str) – A unique identifier/name for the data to be stored.

  • data (str) – A serialized string of data to be stored.

  • overwrite (bool) – Set to True, if already existing data shall be overwritten. (default: False)

Raises:

FileExistsError if overwrite is False and there already exists data which – is associated with the given identifier.

qtt.instrument_drivers.virtualAwg.settings module

class qtt.instrument_drivers.virtualAwg.settings.SettingsInstrument(*args: Any, **kwargs: Any)[source]

Bases: Instrument

Instrument that holds settings for the Virtual AWG

ask_raw(cmd: str) str[source]

Low level method to write to the hardware and return a response.

Subclasses that define a new hardware communication should override this method. Subclasses that transform cmd should instead override ask.

Parameters:

cmd – The string to send to the instrument.

property awg_gates
property awg_map
property awg_markers
create_map()[source]

Adds default parameters based on known gates and markers

write_raw(cmd: str) None[source]

Low level method to write a command string to the hardware.

Subclasses that define a new hardware communication should override this method. Subclasses that transform cmd should instead override write.

Parameters:

cmd – The string to send to the instrument.

qtt.instrument_drivers.virtualAwg.templates module

class qtt.instrument_drivers.virtualAwg.templates.DataTypes[source]

Bases: object

The possible data types for the pulse creation.

QU_PULSE = 'qupulse'
RAW_DATA = 'rawdata'
class qtt.instrument_drivers.virtualAwg.templates.Templates[source]

Bases: object

static chirp(name)[source]

Creates a chirp signal

Parameters:

name (str) – The user defined name of the pulse template.

Returns:

The pulse template with the chirp signal.

Parameters of the pulse template are the duration (in the same unit as time), omega_0 (in Hz), delta_omega (in Hz), amplitude and phase. Time is in ns.

Return type:

FunctionPT

static hold(name)[source]

Creates a DC offset qupulse template for sequencing.

Parameters:

name (str) – The user defined name of the sequence.

Returns:

The sequence with the wait pulse.

Return type:

TablePT

static marker(name)[source]

Creates a TTL pulse qupulse template for sequencing.

Parameters:

name (str) – The user defined name of the sequence.

Returns:

The sequence with the wait pulse.

Return type:

TablePT

static pulse_table(name, entries)[source]
static rollover_marker(name)[source]

Creates a TTL pulse qupulse template for sequencing that rolls over to the subsequent period.

——— ———-

<———period————> <—–offset—–> <——–> uptime <———>

Parameters:

name (str) – The user defined name of the sequence.

Returns:

The sequence with the marker pulse and rollover part of the pulse.

Return type:

TablePT

static sawtooth(name, padding=0)[source]

Creates a sawtooth qupulse template for sequencing.

Parameters:
  • name (str) – The user defined name of the sequence.

  • padding (float) – Padding to add at the end of the sawtooth

Returns:

The sequence with the sawtooth wave.

Return type:

TablePT

static skewed_sawtooth(name)[source]

Creates a skewed sawtooth qupulse template for sequencing. This pulse is symmetric, has total integral zero and right at period/2 it has amplitude 0 and a sharp corner.

A visual representation of the waveform is:

A / /

/ /

0 / / /

/ /

-A
/ /

T/6

<->

T/3

<——>

T/2

<———>

T

<——————–>

T is period and A is the amplitude. Negative amplitude will produce an inverted pulse.

Parameters:

name (str) – The user defined name of the sequence.

Returns:

The sequence with the skewed sawtooth wave.

Parameters of the pulse template are the amplitude and period.

Return type:

TablePT

static square(name)[source]

Creates a block wave qupulse template for sequencing.

Parameters:

name (str) – The user defined name of the sequence.

Returns:

The template with the square wave.

Return type:

TablePT

qtt.instrument_drivers.virtualAwg.virtual_awg module

class qtt.instrument_drivers.virtualAwg.virtual_awg.VirtualAwg(*args: Any, **kwargs: Any)[source]

Bases: Instrument

The virtual AWG is an abstraction layer to produce pulse driven state manipulation of physical qubits.

The class aims for hardware independent control, where only common arbitrary waveform generator (AWG) functionality is used. A translation between the AWG channels and the connected quantum gates provide the user control of the AWG’s in terms of gate names and waveform sequences only. The virtual AWG is used for fast change of the DC landscape by changing the voltage levels of the gates. No microwave control is involved, meaning not related to the spin degrees of freedom of the qubits.

enable_debug

If Tre that store intermediate results in debugging variables

Type:

bool

add_instruments(instruments: List[Instrument])[source]

Adds a list of instruments and updates its hardware parameters.

Parameters:

instruments – The list of instruments to add

are_awg_gates(gate_names)[source]

Checks whether the given quantum chip gates are connected to an AWG channel.

Parameters:

gate_names (str or list) – the name(s) of the gates which needs to be checked.

Returns:

True if the gate or all gates are connected, else False.

property awgs: List[AwgCommon]

The device’s awgs.

disable_outputs(gate_names=None)[source]
Sets the given gates output to disabled. The gate map translates the given gate

names to the correct AWG and channels. The digitizer and awg marker channels are automatically disabled if the channels are provided by the setttings awg_map. A start command is required to enable the outputs.

Parameters:

gate_names (list or None) –

enable_outputs(gate_names)[source]
Sets the given gates output to enabled. The gate map translates the given gate

names to the correct AWG and channels. The digitizer and awg marker channels are automatically enabled if the channels are provided by the setttings awg_map. A start command is required to enable the outputs.

Arguments;

gate_names (list[str]): The names of the gates which needs to be enabled.

property instruments: List[Instrument]

The device’s instruments.

make_markers(period, repetitions=1)[source]
Constructs the markers for triggering the digitizer readout and the slave AWG

start sequence. The sequence length equals the period x repetitions.

Parameters:
  • period (float) – The period of the markers in seconds.

  • repetitions (int) – The number of markers in the sequence.

pulse_gates(gate_voltages, waiting_times, repetitions=1, do_upload=True)[source]
Supplies custom sequences to the gates. The supplied list of voltage setpoints with

waiting times are converted into sequences for each gate and upload to the AWG.

Parameters:
  • gate_voltages (dict) – Each gate name key contains a an array with millivolt setpoint level to be converted into a sequence.

  • waiting_times (list[float]) – The duration in seconds of each pulse in the sequence.

  • repetitions (int) – The number of times to repeat the sequence.

  • do_upload (bool, Optional) – Does not upload the waves to the AWG’s when set to False.

Returns:

A dictionary with the properties of the pulse waves; the original pulse sequence, the sweep ranges and the marker properties and period of the pulse waves.

Example

>> gates_voltages = {‘P4’: [50, 0, -50], ‘P7’: [-25, 0, 25]} >> waiting_times = [1e-4, 1e-4, 1e-4] >> pulse_data = virtual_awg.pulse_gates(gate_voltages, waiting_times)

pulse_gates_2d(gates, sweep_ranges, period, resolution, do_upload=True)[source]

Supplies square signals to a linear combination of gates, which effectively does a 2D scan.

Parameters:
  • gates (list[dict]) – A list containing two dictionaries with both the the gate name keys and relative amplitude values.

  • sweep_ranges (list) – A list two overall amplitude of the square signal in millivolt in the x- and y-direction.

  • period (float) – The period of the square signals in seconds.

  • resolution (list) – Two integer values with the number of square signal (pixels) in the x- and y-direction.

  • do_upload (bool, Optional) – Does not upload the waves to the AWG’s when set to False.

Returns:

A dictionary with the properties of the square signals; the original square sequence, the sweep ranges, the marker properties and period of the square signals.

Example

>> sec_period = 1e-6 >> resolution = [10, 10] >> mV_sweep_ranges = [100, 100] >> gates = [{‘P4’: 1}, {‘P7’: 0.1}] >> sweep_data = virtual_awg.pulse_gates_2d(gates, mV_sweep_ranges, period, resolution)

reset()[source]

Resets all AWG’s to its initialization state.

run()[source]

Enables the main output of the AWG’s.

sequence_gates(sequences, do_upload=True)[source]
The base function for uploading sequences to the AWG’s. The sequences must be

constructed using the qtt.instrument_drivers.virtualAwg.sequencer.Sequencer class.

Parameters:
  • sequences (dict) – A dictionary with names as keys and sequences as values.

  • do_upload (bool, Optional) – Does not upload the waves to the AWG’s when set to False.

Example

>> from qtt.instrument_drivers.virtualAwg.sequencer import Sequencer. >> amplitude = 1.5 >> period_in_seconds = 1e-6 >> sawtooth_signal = Sequencer.make_sawtooth_wave(amplitude, period_in_seconds) >> virtual_awg.sequence_gates(sawtooth_signal)

property settings: SettingsInstrument

The device’s settings.

stop()[source]

Disables the main output of the AWG’s.

sweep_gates(gates, sweep_range, period, width=0.9375, do_upload=True, zero_padding=0)[source]
Supplies a sawtooth wave to the given gates and returns the settings required

for processing and constructing the readout times for the digitizer.

Parameters:
  • gates (dict) – Contains the gate name keys with relative amplitude values.

  • sweep_range (float) – The peak-to-peak amplitude of the sawtooth waves in millivolt.

  • period (float) – The period of the pulse waves in seconds.

  • width (float) – Width of the rising sawtooth ramp as a proportion of the total cycle. Needs a value between 0 and 1. The value 1 producing a rising ramp, while 0 produces a falling ramp.

  • do_upload (bool, Optional) – Does not upload the waves to the AWG’s when set to False.

  • zero_padding (float) – Amount of zero padding to add (in seconds)

Returns:

A dictionary with the properties of the pulse waves; the original sawtooth sequence, the sweep ranges and the marker properties and period of the sawtooth waves.

Example

>> sec_period = 1e-6 >> mV_sweep_range = 100 >> gates = {‘P4’: 1, ‘P7’: 0.1} >> sweep_data = virtual_awg.sweep_gates(gates, 100, 1e-3)

sweep_gates_2d(gates, sweep_ranges, period, resolution, width=0.9375, do_upload=True)[source]

Supplies sawtooth signals to a linear combination of gates, which effectively does a 2D scan.

Parameters:
  • gates (list[dict]) – A list containing two dictionaries with both the the gate name keys and relative amplitude values.

  • sweep_ranges (list) – A list two overall amplitude of the sawtooth waves in millivolt in the x- and y-direction.

  • period (float) – The total period of the sawtooth signals in seconds.

  • resolution (list) – Two integer values with the number of sawtooth signal (pixels) in the x- and y-direction.

  • width (float) – Width of the rising sawtooth ramp as a proportion of the total cycle. Needs a value between 0 and 1. The value 1 producing a rising ramp, while 0 produces a falling ramp.

  • do_upload (bool, Optional) – Does not upload the waves to the AWG’s when set to False.

Returns:

A dictionary with the properties of the sawtooth signals; the original sawtooth sequence, the sweep ranges, the marker properties and period of the sawtooth signals.

Example

>> sec_period = 1e-6 >> resolution = [10, 10] >> mV_sweep_ranges = [100, 100] >> gates = [{‘P4’: 1}, {‘P7’: 0.1}] >> sweep_data = virtual_awg.sweep_gates_2d(gates, mV_sweep_ranges, period, resolution)

update_digitizer_marker_settings(uptime, delay)[source]
Updates the marker settings of the AWG to trigger the digitizer. Note that the

uptime and delay time in seconds must not be bigger then the period of the uploaded waveform.

Parameters:
  • uptime (float) – The marker up period in seconds.

  • delay (float) – The marker delay in seconds.

update_setting(awg_number, setting, value)[source]
Updates a setting of the underlying AWG. The default settings are set

during constructing of the AWG.

Parameters:
  • awg_number (int) – The AWG number for the settings that will be changed.

  • setting (str) – The name of the setting e.g. ‘amplitude’.

  • value (float, int or string) – The value of the setting e.g. 2.0 V.

update_slave_awg_marker_settings(uptime, delay)[source]
Updates the marker settings of the AWG to trigger the other AWG’s. Note that the

uptime and delay time in seconds must not be bigger then the period of the uploaded waveform.

Parameters:
  • uptime (float) – The marker up period in seconds.

  • delay (float) – The marker delay in seconds.

exception qtt.instrument_drivers.virtualAwg.virtual_awg.VirtualAwgError[source]

Bases: Exception

Exception for a specific error related to the virtual AWG.