# ══════════════════════════════════════════════════════════════════════════
# ___ ___ ___ _ _ ___
# / _ \ / __|_ ) | | /_\ | _ )
# | (_) | (__ / / | |__ / _ \| _ \
# \__\_\\___/___| |____/_/ \_\___/
#
# QC2 @ CHALMERS CALIBRATION TOOLKIT
# (c) 2026 Chalmers University of Technology and Project Contributors
# ──────────────────────────────────────────────────────────────────────────
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ──────────────────────────────────────────────────────────────────────────
# CONTRIBUTORS list:
#
# Axel Andersson, axean@chalmers.se
# Matteo Robbiati, robbiati@chalmers.se
# ══════════════════════════════════════════════════════════════════════════
"""
Module containing classes that fit and plot data from a T1 experiment.
"""
from typing import override
from bragi_quantum.experiments.nodes.characterization.coherence_analysis import (
ExponentialDecayAnalysis,
)
from bragi_quantum.experiments.nodes.characterization.t1.parameters import (
T1QOI,
T1Parameters,
)
[docs]
class T1Analysis(ExponentialDecayAnalysis):
"""
Analysis that fits T1 decay of a single qubit, repeated independently
``t1_repetitions`` times.
Every delay point is a single hardware-averaged value (``repetitions``
hardware-averaged shots collapse into it — that averaging is not a
coordinate this analysis has access to). Each of the ``t1_repetitions``
independent sweeps is projected onto the |0>-|1> calibration axis using
*its own* calibration points (``project`` broadcasts per
slice of the outer ``t1_repetitions`` dimension, never averaging
calibration points across repeats) and fitted separately to an
exponential decay. The reported T1 is the mean of the per-repeat fits and
its error is the plain standard deviation across those repeats.
"""
label = "T1"
repetitions_key = "t1_repetitions"
parameters: T1Parameters
@override
def _build_qoi(self) -> T1QOI:
return self.qoi_cls(
is_successful=True,
t1=self.time,
t1_error=self.time_error,
offset=self.offset,
offset_error=self.offset_error,
amplitude=self.amplitude,
amplitude_error=self.amplitude_error,
)