Commit 5d8bd2fa authored by Wiggert Vermeer's avatar Wiggert Vermeer Committed by Robert Sokolewicz
Browse files

Propogate fixes in qbs !219 to quantify scheduler qblox backend

parent 86c48f2b
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ dependencies = [
  "pydantic>2.0",
  "qblox-instruments>=0.17.0,<2", # Prevent upgrade upon minor release while allowing for installing patch releases
  "quantify-core>=0.8.3", # ThresholdedAcquisition bug fix
  "qcodes>=0.32.0", # 0.32.0: introduces InstrumentModule
  "qcodes>=0.32.0, <0.53.0", # 0.32.0: introduces InstrumentModule
  "scipy",
  "xxhash",
  "ruamel.yaml>=0.18.0",
+7 −4
Original line number Diff line number Diff line
@@ -57,8 +57,9 @@ Only applies to square pulses.
"""
PULSE_STITCHING_DURATION_RAMP = 2000e-9
"""Duration of the individual pulses when RampPulse is concerted to long_ramp_pulse."""
DEFAULT_MIXER_PHASE_ERROR_DEG = 0.0
"""Default phase shift in the instruments for mixer corrections.
DEFAULT_MIXER_PHASE_ERROR_DEG = None
"""Default phase shift in the instruments for mixer corrections. None is equivalent to "do not set
this on the instrument".
"""
MIN_MIXER_PHASE_ERROR_DEG = -45
"""Lowest phase shift that can be configured in the instruments for mixer corrections.
@@ -66,9 +67,11 @@ MIN_MIXER_PHASE_ERROR_DEG = -45
MAX_MIXER_PHASE_ERROR_DEG = 45
"""Highest phase shift that can be configured in the instruments for mixer corrections.
"""
DEFAULT_MIXER_AMP_RATIO = 1.0
DEFAULT_MIXER_AMP_RATIO = None
"""Default value of the amplitude correction. N.B. This correction is defined
as Q/I."""
as Q/I. None is equivalent to "do not set this on the instrument".
"""

MIN_MIXER_AMP_RATIO = 0.5
"""Lowest value the amplitude correction can be set to. N.B. This correction is defined
as Q/I."""
+14 −0
Original line number Diff line number Diff line
@@ -1212,6 +1212,13 @@ def _generate_new_style_hardware_compilation_config( # noqa: PLR0915
                        new_style_config["hardware_options"]["mixer_corrections"][port_clock][
                            "amp_ratio"
                        ] = portclock_cfg.pop("mixer_amp_ratio")
                    else:
                        # Preserve legacy defaults only when mixer settings are in use.
                        mixer_corrections = new_style_config["hardware_options"][
                            "mixer_corrections"
                        ].get(port_clock)
                        if mixer_corrections is not None:
                            mixer_corrections["amp_ratio"] = 1.0
                    if "auto_sideband_cal" in portclock_cfg:
                        # Set auto_sideband_cal from portclock config:
                        new_style_config["hardware_options"]["mixer_corrections"][port_clock][
@@ -1222,6 +1229,13 @@ def _generate_new_style_hardware_compilation_config( # noqa: PLR0915
                        new_style_config["hardware_options"]["mixer_corrections"][port_clock][
                            "phase_error"
                        ] = portclock_cfg.pop("mixer_phase_error_deg")
                    else:
                        # Preserve legacy defaults only when mixer settings are in use.
                        mixer_corrections = new_style_config["hardware_options"][
                            "mixer_corrections"
                        ].get(port_clock)
                        if mixer_corrections is not None:
                            mixer_corrections["phase_error"] = 0.0
                    if portclock_cfg != {}:
                        # Set remaining portclock config parameters to sequencer options:
                        new_style_config["hardware_options"]["sequencer_options"][port_clock] = (
+2 −2
Original line number Diff line number Diff line
@@ -233,9 +233,9 @@ class MixerCorrections(DataStructure):
    """The DC offset on the I channel used for this port-clock combination."""
    dc_offset_q: float = 0.0
    """The DC offset on the Q channel used for this port-clock combination."""
    amp_ratio: float = 1.0
    amp_ratio: float | None = 1.0
    """The mixer gain ratio used for this port-clock combination."""
    phase_error: float = 0.0
    phase_error: float | None = 0.0
    """The mixer phase error used for this port-clock combination."""


+2 −2
Original line number Diff line number Diff line
@@ -1448,11 +1448,11 @@ class QbloxMixerCorrections(MixerCorrections):
    """The DC offset on the I channel used for this port-clock combination."""
    dc_offset_q: Optional[float] = None  # type: ignore  # (optional due to AMC)
    """The DC offset on the Q channel used for this port-clock combination."""
    amp_ratio: float = Field(
    amp_ratio: Optional[float] = Field(
        default=DEFAULT_MIXER_AMP_RATIO, ge=MIN_MIXER_AMP_RATIO, le=MAX_MIXER_AMP_RATIO
    )
    """The mixer gain ratio used for this port-clock combination."""
    phase_error: float = Field(
    phase_error: Optional[float] = Field(
        default=DEFAULT_MIXER_PHASE_ERROR_DEG,
        ge=MIN_MIXER_PHASE_ERROR_DEG,
        le=MAX_MIXER_PHASE_ERROR_DEG,
Loading