# ══════════════════════════════════════════════════════════════════════════
# ___ ___ ___ _ _ ___
# / _ \ / __|_ ) | | /_\ | _ )
# | (_) | (__ / / | |__ / _ \| _ \
# \__\_\\___/___| |____/_/ \_\___/
#
# 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
# Yanchen Lin, linya@chalmers.se
# Matteo Robbiati, robbiati@chalmers.se
# Michele Faucci Giannelli, faucci@chalmers.se
# ══════════════════════════════════════════════════════════════════════════
"""
Node implementation for T2* (Ramsey) coherence-time characterization.
"""
import numpy as np
from bragi_quantum.experiments.nodes.characterization.t2.analysis import T2Analysis
from bragi_quantum.experiments.nodes.characterization.t2.measurement import (
T2Measurement,
)
from bragi_quantum.experiments.nodes.characterization.t2.parameters import (
T2QOI,
T2Parameters,
)
from bragi_quantum.experiments.nodes.external_parameter_node import (
ExternalParameterFixedScheduleQubitNode,
)
[docs]
class T2(ExternalParameterFixedScheduleQubitNode):
"""
Execution node for T2* (Ramsey) coherence-time characterization.
Each qubit's two pi/2 pulses are separated by a swept idle time, with a
shared ``artificial_detuning_Hz`` applied via a clock-phase shift to
produce a Ramsey fringe; ``T2Analysis`` fits the resulting decaying
oscillation to extract T2*.
"""
parameters: T2Parameters
measurement_cls = T2Measurement
analysis_cls = T2Analysis
append_calibration_points = True
def __init__(
self,
parameters: T2Parameters,
qoi_cls: type[T2QOI] = T2QOI,
):
"""
Initializes the T2 node.
Args:
parameters: Validated experimental parameters.
qoi_cls: The QOI class used to store results.
"""
super().__init__(
parameters=parameters,
qoi_cls=qoi_cls,
)
self.schedule_keywords = {
"artificial_detuning_Hz": self.parameters.artificial_detuning_Hz,
"repetitions": self.parameters.repetitions,
"transition": self.parameters.transition,
}
self.schedule_samplespace = {
"delays": {
qubit: np.array(self.parameters.delays) for qubit in self.all_qubits
}
}
self.external_samplespace = {
"t2_repetitions": {
qubit: range(self.parameters.t2_repetitions)
for qubit in self.all_qubits
}
}