Skip to content

Q0 Measurement

applications/q0/ measures the intrinsic quality factor (Q0) of individual SRF cavities. Q0 quantifies how efficiently a cavity stores RF energy — higher Q0 means less cryogenic heat load for the same accelerating gradient.

Measurement principle

Q0 is extracted by comparing RF power dissipation against a known thermal baseline:

  1. Calibration phase — with RF off, step heaters inside the cryomodule through a series of power levels (e.g., 1 W, 2 W, 3 W). Record the rate of change of liquid helium (LL) level at each heat load. Fit a linear relationship: ΔLL/Δt per watt.
  2. RF measurement phase — turn on cavity RF at a target amplitude. The measured ΔLL/Δt minus the thermal background (from calibration) gives the RF-induced heat load, and from that Q0 is computed:
Q0 = ω₀ × U / P_dissipated
   = (amplitude² × R/Q) / P_dissipated

where R/Q is 1012 Ω (normal cavities) or 750 Ω (harmonic linearizers).

Main classes

Q0Cryomodule (q0_cryomodule.py)

Extends Cryomodule. Manages: - Loading and saving calibration JSON files (path: {database_dir}/q0/{cm_name}_calibration.json) - JT valve reference position and heater setpoint state - Coordinating multi-cavity RF runs

Q0Cavity (q0_cavity.py)

Extends Cavity with: - r_over_q: geometry constant (1012 or 750 depending on HL/normal) - ready_for_q0: flag indicating cavity can participate in RF measurement

Calibration (calibration.py)

Holds one or more HeaterRun objects, each representing a single heat-load step. After all heater runs complete, linear regression on (heat_load, ΔLL/Δt) pairs produces the calibration slope used to subtract background in the RF measurement.

Q0Measurement (rf_measurement.py)

Records one RF measurement run: which cavities participated, their amplitudes, and the measured ΔLL/Δt. Computes Q0 using the calibration slope.

Workflow

Q0GUI
├── Select cryomodule + cavities
├── Calibration tab
│   ├── [Load existing calibration from JSON] or
│   └── [Run new calibration]
│       └── CalibrationWorker (QThread)
│           → Heater sweeps at 1W, 2W, 3W steps
│           → Each step: hold heater, record LL over time window
│           → Save to JSON
└── RF Measurement tab
    ├── [Load existing RF run] or
    └── [Run new measurement]
        └── Q0Worker (QThread)
            → Set cavity amplitudes
            → Record LL over time window
            → Compute Q0 using calibration slope
            → Display results + pyqtgraph plots

Both the calibration and RF measurement run in background Worker threads. The GUI remains responsive during the multi-minute data collection windows.

Packaged calibration data

The package ships example calibration data under applications/q0/calibrations/ and example measurement data under applications/q0/data/. These are accessed via importlib.resources and are included in the built wheel (listed in pyproject.toml package-data). They serve as test fixtures and demonstration data.

Entry point

sc-q0