qtt.instrument_drivers.virtualAwg package¶
Subpackages¶
Submodules¶
qtt.instrument_drivers.virtualAwg.sequencer module¶
-
class
qtt.instrument_drivers.virtualAwg.sequencer.Sequencer[source]¶ Bases:
objectConversion 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
- 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
- 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
- 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')[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.
- 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
- 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
qtt.instrument_drivers.virtualAwg.serializer module¶
-
class
qtt.instrument_drivers.virtualAwg.serializer.StringBackend[source]¶ Bases:
qupulse.serialization.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. –
-
qtt.instrument_drivers.virtualAwg.settings module¶
-
class
qtt.instrument_drivers.virtualAwg.settings.SettingsInstrument(name, **kwargs)[source]¶ Bases:
qcodes.instrument.base.InstrumentInstrument 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
cmdshould instead overrideask.- Parameters
cmd – The string to send to the instrument.
-
property
awg_gates¶
-
property
awg_map¶
-
property
awg_markers¶
-
qtt.instrument_drivers.virtualAwg.templates module¶
-
class
qtt.instrument_drivers.virtualAwg.templates.DataTypes[source]¶ Bases:
objectThe 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
rollover_marker(name)[source]¶ Creates a TTL pulse qupulse template for sequencing that rolls over to the subsequent period.
- 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)[source]¶ Creates a sawtooth qupulse template for sequencing.
- Parameters
name (str) – The user defined name of the sequence.
- 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
qtt.instrument_drivers.virtualAwg.virtual_awg module¶
-
class
qtt.instrument_drivers.virtualAwg.virtual_awg.VirtualAwg(awgs=None, settings=None, name='virtual_awg', logger=<module 'logging' from '/home/docs/.pyenv/versions/3.8.6/lib/python3.8/logging/__init__.py'>, **kwargs)[source]¶ Bases:
qcodes.instrument.base.InstrumentThe 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.
-
add_instruments(instruments: List[qcodes.instrument.base.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.
-
property
awgs¶ 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.
-
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¶ 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.
-
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)
-
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
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¶ The device’s settings.
-
sweep_gates(gates, sweep_range, period, width=0.9375, do_upload=True)[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.
- 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.
-
update_setting(awg_number, setting, value)[source]¶ - Updates a setting of the underlying AWG. The default settings are set
during constructing of the AWG.
-