How to run coherence measurements with Boulder Opal
Measure T1 energy relaxation, T2 Ramsey dephasing, and T2 echo coherence times on a single transmon
The T1, T2, and T2Echo experiments measure the three standard single-qubit coherence times on an individual transmon. T1 measures energy relaxation from the excited state, T2 measures total dephasing from a Ramsey sequence, and T2 echo measures the dephasing rate that remains after a refocusing π pulse suppresses low-frequency noise.
Running these experiments requires a device that has already been calibrated through TransmonDiscovery so that qubit frequencies and drive amplitudes are populated. If you do not have one, complete the get started tutorial first.
1. Set the device context
Create a client and select the target device. All experiments run against the currently active device.
await client.set_current_device("<your-device-name>")2. Collect all coherence data with a routine
The most direct way to obtain coherence data for a given qubit is the Transmon Coherence routine. It runs the T1, T2, and T2 echo experiments in sequence with input parameters pre-populated from the current device state, and saves the resulting coherence times to the virtual device. Use the per-experiment workflow in steps 3 to 5 instead if you want full control over delay grids, shot counts, oscillation counts, or other experiment options.
from boulderopalscaleup.routines import TransmonCoherence
target_transmon = "q0"
tc_routine = TransmonCoherence(transmon=[target_transmon])
tc_result = await client.run_routine(tc_routine)3. Measure T1 relaxation time
T1 is the energy relaxation time of the excited state. The experiment prepares $\lvert 1 \rangle$, waits for a variable delay, measures the survival probability, and fits an exponential decay to return T1 in nanoseconds. Pass the target transmon ID and a list of delays to sweep. LogspaceIterable distributes the delay points logarithmically, which is useful when T1 is not yet known to a narrow range.
from boulderopalscaleup.common import LogspaceIterable
from boulderopalscaleup.experiments import T1
t1_experiment = T1(
transmon=target_transmon,
delays_ns=LogspaceIterable(start=2, stop=5.3, count=51),
shot_count=500,
)
t1_job_id = await client.run_experiment(t1_experiment)4. Measure T2 dephasing time (Ramsey)
T2 measures total dephasing with a Ramsey sequence: two $\pi/2$ pulses separated by a variable free-evolution delay. The oscillation_count sets the target number of Ramsey fringes across the delay range, which fixes an artificial detuning large enough to keep the fringes resolved by the sampled delay grid and the fit well conditioned.
from boulderopalscaleup.experiments import T2
t2_experiment = T2(
transmon=target_transmon,
delays_ns=list(range(0, 50_001, 1000)),
oscillation_count=10,
shot_count=500,
)
t2_job_id = await client.run_experiment(t2_experiment)5. Measure T2 echo coherence time
T2Echo inserts a refocusing $\pi$ pulse halfway between the two Ramsey $\pi/2$ pulses. The $\pi$ pulse reverses the sign of phase accumulated from noise that is quasi-static over the echo delay, so slow frequency fluctuations cancel and the measured decay reflects only the faster noise components. The echo time is typically longer than the bare T2 and is a better measure of the intrinsic dephasing rate.
from boulderopalscaleup.experiments import T2Echo
t2_echo_experiment = T2Echo(
transmon=target_transmon,
delays_ns=list(range(0, 100_001, 2000)),
oscillation_count=10,
shot_count=500,
)
t2_echo_job_id = await client.run_experiment(t2_echo_experiment)6. Compare results across qubits
The device data sheet collects the latest calibrated parameters for every qubit on the active device. After running the TransmonCoherence routine, or the per-qubit experiments above on multiple qubits, the sheet contains T1 and T2 values that you can compare across the device.
await client.display_device_data_sheet()Next steps
- Run
TransmonCoherenceto automate coherence measurements across all qubits in a single routine call: see the Experiments and routines reference. - Use
OneQubitRBto characterize average gate error rates: see the user guide for your backend (OPX+ or Qblox).
