# ══════════════════════════════════════════════════════════════════════════
# ___ ___ ___ _ _ ___
# / _ \ / __|_ ) | | /_\ | _ )
# | (_) | (__ / / | |__ / _ \| _ \
# \__\_\\___/___| |____/_/ \_\___/
#
# 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
# Michele Faucci Giannelli, faucci@chalmers.se
# Matteo Robbiati, robbiati@chalmers.se
# ══════════════════════════════════════════════════════════════════════════
"""
Node implementation for deriving CZ working-point currents from spectroscopies.
Ported from tergite-autocalibration (CZCurrentsFromSpectroscopiesNode).
"""
from typing import override
from bragi_quantum.experiments.abstract.node import CouplerNode
from bragi_quantum.experiments.nodes.coupler.cz_currents_from_spectroscopies.analysis import (
CZCurrentsFromSpectroscopiesAnalysis,
)
from bragi_quantum.experiments.nodes.coupler.cz_currents_from_spectroscopies.parameters import (
CZCurrentsFromSpectroscopiesParameters,
CZCurrentsFromSpectroscopiesQOI,
)
[docs]
class CZCurrentsFromSpectroscopies(CouplerNode):
"""
Analysis-only node evaluating the candidate currents at which the coupler
can be operated to perform a CZ gate.
No measurement is performed: the analysis fits the tunable-coupler
frequency model to the qubit and resonator crossing currents stored in
Redis by qubit_spectroscopy_vs_current and resonator_spectroscopy_vs_current
(combined with the qubits' clock frequencies from the session device), and
solves the fit for the CZ avoided-crossing currents.
"""
# Analysis-only node: there is no measurement to build or execute; the
# inherited measure_node returns an empty dataset.
measurement_cls = None
analysis_cls = CZCurrentsFromSpectroscopiesAnalysis
parameters: CZCurrentsFromSpectroscopiesParameters
def __init__(
self,
parameters: CZCurrentsFromSpectroscopiesParameters,
qoi_cls: type[
CZCurrentsFromSpectroscopiesQOI
] = CZCurrentsFromSpectroscopiesQOI,
):
super().__init__(
parameters=parameters,
qoi_cls=qoi_cls,
)
@override
def _build_measurement(self):
return None