Skip to content

Python Toolkit API QHub & PQSC

zhinst.toolkit.driver.devices.quantum_system_hub.QuantumSystemHub(serial, device_type, session)

Bases: BaseInstrument

Base driver for the Zurich Instruments PQSC and QHub.

This class should not be instantiated directly, but instead through PQSC or QHub

arm_and_run(*, repetitions=None, holdoff=None)

Arm the PQSC/QHub and start sending out triggers.

Simply combines the methods arm and run. A synchronization is performed between the device and the data server after arming and running the PQSC/QHub.

Parameters:

Name Type Description Default
repetitions Optional[int]

If specified, the number of triggers sent over ZSync ports will be set (default: None).

None
holdoff Optional[float]

If specified, the time between repeated triggers sent over ZSync ports will be set. It has a minimum value and a granularity of 100 ns (default: None).

None

check_ref_clock(*, timeout=30.0, sleep_time=1.0)

Check if reference clock is locked successfully.

Parameters:

Name Type Description Default
timeout float

Maximum time in seconds the program waits (default: 30.0).

30.0
sleep_time float

Time in seconds to wait between requesting the reference clock status (default: 1)

1.0

Raises:

Type Description
TimeoutError

If the process of locking to the reference clock exceeds the specified timeout.

check_zsync_connection(inputs, *, timeout=10.0, sleep_time=0.1)

Check if a ZSync connection is established.

Checks the current status of the instrument connected to the given ports. If a instrument(s) is given instead of a port number, first finds the correct port number(s).

Parameters:

Name Type Description Default
inputs Union[list[int], int, list[BaseInstrument], BaseInstrument]

The port numbers to check the ZSync connection for. It can either be a single port number given as integer, a list of several port numbers an instrument or a list of instruments.

required
timeout float

Maximum time in seconds the program waits (default: 10.0).

10.0
sleep_time float

Time in seconds to wait between requesting the reference clock status (default: 0.1)

0.1

Raises:

Type Description
TimeoutError

If the process of establishing a ZSync connection on one of the specified ports exceeds the specified timeout.

find_zsync_worker_port(device, timeout=10.0, sleep_time=0.1)

Find the ID of the PQSC/QHub ZSync port connected to a given device.

The function checks until the given timeout for the specified device to show up in the connection list.

Parameters:

Name Type Description Default
device BaseInstrument

device for which the connected ZSync port shall be found.

required
timeout float

Maximum time in seconds the program waits (default: 10.0).

10.0
sleep_time float

Time in seconds to wait between requesting the port serials list (default: 0.1)

0.1

Returns:

Type Description
int

Index of the searched PQSC/QHub ZSync port.

Raises:

Type Description
ToolkitError

If the given device doesn't appear to be connected to the PQSC/QHub via ZSync.

run(*, deep=True)

Start sending out triggers.

This method activates the trigger generation to trigger all connected instruments over ZSync ports.

Parameters:

Name Type Description Default
deep bool

A flag that specifies if a synchronization should be performed between the device and the data server after enabling the PQSC/QHub (default: True).

True

stop(*, deep=True)

Stop the trigger generation.

Parameters:

Name Type Description Default
deep bool

A flag that specifies if a synchronization should be performed between the device and the data server after disabling the PQSC/QHub (default: True).

True

wait_done(*, timeout=10.0, sleep_time=0.005)

Wait until trigger generation and feedback processing is done.

Parameters:

Name Type Description Default
timeout float

The maximum waiting time in seconds for the PQSC/QHub (default: 10.0).

10.0
sleep_time float

Time in seconds to wait between requesting PQSC/QHub state

0.005

Raises:

Type Description
TimeoutError

If the PQSC/QHub is not done sending out all triggers and processing feedback before the timeout.

zhinst.toolkit.driver.devices.qhub.QHub(serial, device_type, session)

Bases: QuantumSystemHub

High-level driver for the Zurich Instruments QHub.

arm(*, deep=True, repetitions=None, holdoff=None)

Prepare QHub for triggering the instruments.

This method configures the execution engine of QHub. Optionally, the number of triggers and hold-off time can be set when specified as keyword arguments. If they are not specified, they are not changed.

Note that the QHub is disabled at the end of the hold-off time after sending out the last trigger.

Parameters:

Name Type Description Default
deep

A flag that specifies if a synchronization should be performed between the device and the data server after stopping QHub (default: True).

True
repetitions Optional[int]

If specified, the number of triggers sent over ZSync ports will be set (default: None).

None
holdoff Optional[float]

If specified, the time between repeated triggers sent over ZSync ports will be set. It has a minimum value and a granularity of 100 ns (default: None).

None

zhinst.toolkit.driver.devices.pqsc.PQSC(serial, device_type, session)

Bases: QuantumSystemHub

High-level driver for the Zurich Instruments PQSC.

arm(*, deep=True, repetitions=None, holdoff=None)

Prepare PQSC for triggering the instruments.

This method configures the execution engine of the PQSC and clears the register bank. Optionally, the number of triggers and hold-off time can be set when specified as keyword arguments. If they are not specified, they are not changed.

Note that the PQSC is disabled at the end of the hold-off time after sending out the last trigger. Therefore, the hold-off time should be long enough such that the PQSC is still enabled when the feedback arrives. Otherwise, the feedback cannot be processed.

Parameters:

Name Type Description Default
deep

A flag that specifies if a synchronization should be performed between the device and the data server after stopping the PQSC and clearing the register bank (default: True).

True
repetitions Optional[int]

If specified, the number of triggers sent over ZSync ports will be set (default: None).

None
holdoff Optional[float]

If specified, the time between repeated triggers sent over ZSync ports will be set. It has a minimum value and a granularity of 100 ns (default: None).

None