Experiment queue

The task queue table panel: maintains priority ordering, status tracking and lifecycle management (pause/terminate/sleep/delete) of experiment tasks.

Overview

ExperimentQ (quatm/GUI/experiment/experiment_queue.py) is the “experiment queue” panel of the experiment browser (Browser) main window: a task table driven by the queue table model ScheduleModel (module quatm/GUI/widgets/models.py). Task dictionaries are stored with the task number as primary key; each task is one record containing everything needed to run it, and the table sorts by priority priority (lower value first) and then by task number.

Task status

The experiment manager (ExperimentManager) and the panel jointly maintain the status of each task:

StatusMeaning
QueuedEnqueued and waiting for execution
WaitingA due time has been set; not executed until that time is reached
SleepingAsleep; the manager ignores it for the moment (click again to wake it)
RunningA single run is in progress
ScanningA sequence/scan is in progress
PausedPaused; can be resumed
Terminating / Termination PendingGraceful termination in progress (lets the current run finish)
DoneExecution completed
FailedExecution failed

Operations and shortcuts

  • Button bar (created by create_buttons): icon buttons for pause/resume, terminate selected tasks, terminate all, and so on.
  • Context menu and single-key shortcuts (init_table_actions): e edits parameters, v opens a read-only preview, and delete, sleep/wake and pause are also available.
  • Deleting a running task: automatically becomes a graceful termination (delete_clicked).
  • Terminate (terminate_clicked / terminate_all): stops gracefully, letting the run currently in progress finish before ending.

Main methods

MethodFunction
submit(taskDict)The only entry point into the queue (runs on the GUI thread): assigns task numbers centrally; the looper (Looper) also reaches it through the submitItem signal
pause()Pauses/resumes the experiment currently running
set_sleeping()Marks the selected tasks as sleeping or wakes them
delete_item(k) / delete_clicked()Deletes by task number, or deletes the selected rows (a running task is terminated gracefully)
terminate_clicked() / terminate_all()Gracefully terminates the selected tasks / all tasks
update_item(k, v)Updates a model entry by task number and resets its lock
open_editor() / open_viewer()Edits / previews the parameters of the selected task read-only (shortcuts e / v)

Data model

# task dictionary structure (key = task number)
expDict = {
    1: {
        "expName": "Rabi scan",
        "filepath": "experiments/ion/rabi.py",
        "status": "Queued",
        "priority": 1,
        "args": {},
        "due": "",
    },
}

Sorting rule: priority (lower value first) → task number (first in, first out).

Relation to the looper

Task items of the looper (Looper) are also enqueued through ExperimentQ.submit(), so the desktop interface and loop scheduling share the same “central task-number assignment” entry channel.