Experiment queue
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:
| Status | Meaning |
|---|---|
Queued | Enqueued and waiting for execution |
Waiting | A due time has been set; not executed until that time is reached |
Sleeping | Asleep; the manager ignores it for the moment (click again to wake it) |
Running | A single run is in progress |
Scanning | A sequence/scan is in progress |
Paused | Paused; can be resumed |
Terminating / Termination Pending | Graceful termination in progress (lets the current run finish) |
Done | Execution completed |
Failed | Execution 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):eedits parameters,vopens 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
| Method | Function |
|---|---|
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.