Skip to content

Tips & Tricks

How to adjust the number of log messages

LabOne Q provides various log levels: DEBUG, INFO (default), WARNING, ERROR.

As an example, to create and connect to a session and set the log level to DEBUG, use

import logging
session = Session(device_setup=my_setup, log_level=logging.DEBUG)

Be aware that DEBUG logging creates a large amount of output.

It is also possible to change the log level of an already open session at any point using e.g.

import logging
laboneq_logging.set_level(logging.DEBUG)

or even use your own python logger to collect LabOne Q log messages

## create and connect to the session, without any laboneq logging
session = Session(device_setup=device_setup, configure_logging=False)

## configure your own logging.getLogger() here

What to do when my (randomized benchmarking) experiment exceeds the waveform or instruction limit of my instruments?

You can try to find an optimum trade-off between number of sequencer instructions and consumed waveform memory for your experiment. The paragraph below explains how this is done.

Setting the Compiler’s Minimal Waveform and Zero Lengths

The compiler of LabOne Q is able to merge short pulses into longer waveforms. Longer waveforms tend to require more of the instruments' waveform memory, but their execution needs fewer (play) instructions. In contrast, short waveforms require less of the instruments' waveform memory, but their execution needs more (play) instructions.

Depending on your specific experiment and the instruments used, setting the minimal waveform length and the minimal length of zeros can help you to find a sweet spot for your experiment-setup combination.

As for the command table, you can enforce these settings by specifying the compiler settings as a dictionary of the form

compiler_settings = {"SHFSG_MIN_PLAYWAVE_HINT": 1024, "SHFSG_MIN_PLAYZERO_HINT": 512}

with the following settings available (the default values are specified in qccs/compiler/compiler_settings.py):

Setting Default value
HDAWG_MIN_PLAYWAVE_HINT 128
HDAWG_MIN_PLAYZERO_HINT 128
UHFQA_MIN_PLAYWAVE_HINT 64
UHFQA_MIN_PLAYZERO_HINT 64
SHFQA_MIN_PLAYWAVE_HINT 64
SHFQA_MIN_PLAYZERO_HINT 64
SHFSG_MIN_PLAYWAVE_HINT 64
SHFSG_MIN_PLAYZERO_HINT 64

Note

Setting the minimal waveform and zero lengths to very small numbers, gapless playback might not be guaranteed anymore, because the sequencer does not find the time to process all instructions until the next waveform should be played, or because the waveform cannot be fetched from the memory fast enough. In this case, an exception will be generated.

With the Randomized Benchmarking example notebook, the following results are found with a gate length of 64 ns corresponding to 128 samples.

SHFSG_MIN_PLAYWAVE_HINT # SeqC lines # generated samples
1024 338 108352
512 458 85824
256 427 28992
128 477 9792

How to debug an experiment

In case your experiment does not run properly, does not compile, or does not yield the expected result, have a look in the execution log and look for the WARNING or ERROR flag. If this is not present, it may be useful to switch to a lower log level and check for any peculiarities.

It can be useful to compare the log with a known good experiment, what are the differences?