Source code for bragi_quantum.experiments.nodes.qubit_control.motzoi_parameter.parameters

# ══════════════════════════════════════════════════════════════════════════
#     ___   ___ ___   _      _   ___
#    / _ \ / __|_  ) | |    /_\ | _ )
#   | (_) | (__ / /  | |__ / _ \| _ \
#    \__\_\\___/___| |____/_/ \_\___/
#
#   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:
#
#   Matteo Robbiati, robbiati@chalmers.se
#   Axel Andersson, axean@chalmers.se
#   Michele Faucci Giannelli, faucci@chalmers.se
# ══════════════════════════════════════════════════════════════════════════


from typing import Literal, override

from pydantic import Field

from bragi_quantum.experiments.abstract.parameter_fields import acquisition_field
from bragi_quantum.experiments.abstract.parameters import (
    BaseParameters,
    BaseQoi,
)


[docs] class MotzoiParameters(BaseParameters): """Parameters for Motzoi (DRAG beta) calibration. The transition field selects which DRAG coefficient is calibrated: ``transition="01"`` corrects ``rxy.beta``, ``transition="12"`` ``r12.ef_beta``. """ transition: Literal["01", "12"] = acquisition_field(default="01", variant=True) # Motzoi (DRAG beta) sweep — data acquisition min_motzoi: float = acquisition_field( default=-2e-9, description="Minimum motzoi value." ) max_motzoi: float = acquisition_field( default=2e-9, description="Maximum motzoi value." ) motzoi_bins: int = acquisition_field( default=51, description="Number of motzoi steps." ) # Acquisition repetitions: int = acquisition_field( default=1024, description="Number of repetitions (averages) per point." )
[docs] class MotzoiBaseQOI(BaseQoi): """Base Quantities of Interest for Motzoi.""" motzoi: float = Field(default=0.0) motzoi_error: float = Field(default=0.0)
[docs] class Motzoi01QOI(MotzoiBaseQOI): """Quantities of Interest for Motzoi (0->1 transition)."""
[docs] @override def to_dict(self) -> dict[str, float]: return {"rxy.beta": self.motzoi}
[docs] def to_redis_dict(self) -> dict[str, dict[str, float]]: return {"rxy:beta": {"value": self.motzoi, "error": self.motzoi_error}}
[docs] class Motzoi12QOI(MotzoiBaseQOI): """Quantities of Interest for Motzoi (1->2 transition)."""
[docs] @override def to_dict(self) -> dict[str, float]: return {"r12.ef_beta": self.motzoi}
[docs] def to_redis_dict(self) -> dict[str, dict[str, float]]: return {"r12:ef_beta": {"value": self.motzoi, "error": self.motzoi_error}}