Commit 9754eb05 authored by Victor Gervilla Palomar's avatar Victor Gervilla Palomar Committed by Edgar Reehuis
Browse files

Remove pulsar rf code: rewrite pulsar rf fixtures to use clusters and remove support code (SE-71)

parent 94d7075a
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -8,9 +8,10 @@

- Compilation - Add a `scheduling_strategy` parameter to `QuantumDevice` and `DeviceCompilationConfig` classes to enable new strategies for calculating absolute timing in `compilation.determine_absolute_timing`  (!736)
- Security - Add `check=True` flag to all subprocess calls (see also Ruff rule PLW1510). (!767)
- Gettable - Add `ScheduleGettable.initialize_and_get_with_report` that saves information from an experiment in a report zipfile for diagnostics. 
  - For Qblox instruments, this includes hardware logs, retrieved via `InstrumentCoordinator.retrieve_hardware_logs` from `qblox-instruments.ConfigurationManager`. (!672)
- Gettable - Add `ScheduleGettable.initialize_and_get_with_report` that saves information from an experiment in a report zipfile for diagnostics. (!672)
  - For Qblox instruments, this includes hardware logs, retrieved via `InstrumentCoordinator.retrieve_hardware_logs` from `qblox-instruments.ConfigurationManager`.
- Qblox backend - Make QASM fields aligning optional, disable by default (!741)
- Qblox backend - Remove code referencing RF pulsars (these devices do not exist) (!748).
- Documentation - Color change for code block emphasized lines (!741)
- Infrastructure - Improve speed of `make_hash` (affecting `Schedule.add`) and some compilation steps (!770)
- Infrastructure - Use new qcodes syntax for adding parameters. (!758)
+12 −4
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ from quantify_scheduler.backends.types.qblox import (
    BasebandModuleSettings,
    BaseModuleSettings,
    OpInfo,
    PulsarRFSettings,
    PulsarSettings,
    RFModuleSettings,
    SequencerSettings,
@@ -1867,14 +1866,23 @@ class QbloxRFModule(QbloxBaseModule):

    @property
    def settings_type(self) -> type:
        """The settings type used by RF-type devices"""
        return PulsarRFSettings if self.is_pulsar else RFModuleSettings
        """The settings type used by RF modules"""
        if self.is_pulsar:
            raise RuntimeError(
                "Cannot return RFModule settings, RF pulsar components do not exist."
            )
        return RFModuleSettings

    def assign_frequencies(self, sequencer: Sequencer):
        """
        Determines LO/IF frequencies and assigns them for RF modules.
        """
        compiler_container = self.parent if self.is_pulsar else self.parent.parent
        if self.is_pulsar:
            raise RuntimeError(
                "Cannot determine LO/IF frequencies, RF pulsar components do not exist."
            )

        compiler_container = self.parent.parent
        if (
            sequencer.connected_outputs is None
            or sequencer.clock not in compiler_container.resources
+1 −3
Original line number Diff line number Diff line
@@ -3,8 +3,8 @@
"""Compiler classes for Qblox backend."""
from __future__ import annotations

from typing import Any, Dict, Optional, Tuple
from collections import abc
from typing import Any, Dict, Optional, Tuple

from quantify_scheduler.backends.qblox import compiler_abc, compiler_container
from quantify_scheduler.backends.qblox.constants import (
@@ -359,8 +359,6 @@ class Cluster(compiler_abc.ControlDeviceCompiler):
COMPILER_MAPPING: Dict[str, type] = {
    "Pulsar_QCM": QcmModule,
    "Pulsar_QRM": QrmModule,
    "Pulsar_QCM_RF": QcmRfModule,
    "Pulsar_QRM_RF": QrmRfModule,
    "Cluster": Cluster,
    "LocalOscillator": LocalOscillator,
}
+0 −33
Original line number Diff line number Diff line
@@ -316,39 +316,6 @@ class RFModuleSettings(BaseModuleSettings):
        return cls(**combined_settings)


@dataclass
class PulsarRFSettings(RFModuleSettings, PulsarSettings):
    """
    Settings specific for a Pulsar RF. Effectively, combines the Pulsar specific
    settings with the RF specific settings.
    """

    @classmethod
    def extract_settings_from_mapping(
        cls, mapping: Dict[str, Any], **kwargs: Optional[dict]
    ) -> PulsarRFSettings:
        """
        Factory method that takes all the settings defined in the mapping and generates
        a :class:`~.PulsarRFSettings` object from it.

        Parameters
        ----------
        mapping
            The mapping dict to extract the settings from
        **kwargs
            Additional keyword arguments passed to the constructor. Can be used to
            override parts of the mapping dict.
        """
        rf_settings = RFModuleSettings.extract_settings_from_mapping(mapping)
        pulsar_settings = PulsarSettings.extract_settings_from_mapping(mapping)
        combined_settings = {
            **rf_settings.to_dict(),
            **pulsar_settings.to_dict(),
            **kwargs,
        }
        return cls(**combined_settings)


@dataclass
class SequencerSettings(DataClassJsonMixin):
    # pylint: disable=too-many-instance-attributes
+0 −57
Original line number Diff line number Diff line
@@ -340,63 +340,6 @@ def hardware_cfg_pulsar():
    }


@pytest.fixture
def hardware_cfg_pulsar_rf():
    yield {
        "backend": "quantify_scheduler.backends.qblox_backend.hardware_compile",
        "qcm_rf0": {
            "instrument_type": "Pulsar_QCM_RF",
            "ref": "internal",
            "complex_output_0": {
                "dc_mixer_offset_I": -0.045,
                "dc_mixer_offset_Q": -0.035,
                "portclock_configs": [
                    {
                        "mixer_amp_ratio": 0.9996,
                        "mixer_phase_error_deg": -3.9,
                        "port": "q2:mw",
                        "clock": "q2.01",
                        "interm_freq": 50e6,
                    }
                ],
            },
            "complex_output_1": {
                "lo_freq": 5e9,
                "portclock_configs": [
                    {"port": "q3:mw", "clock": "q3.01", "interm_freq": None}
                ],
            },
        },
        "qrm_rf0": {
            "instrument_type": "Pulsar_QRM_RF",
            "ref": "external",
            "complex_output_0": {
                "lo_freq": 7.2e9,
                "dc_mixer_offset_I": -0.046,
                "dc_mixer_offset_Q": -0.036,
                "portclock_configs": [
                    {
                        "mixer_amp_ratio": 0.9999,
                        "mixer_phase_error_deg": -3.8,
                        "port": "q2:res",
                        "clock": "q2.ro",
                        "interm_freq": None,
                    }
                ],
            },
        },
        "qrm_rf1": {
            "instrument_type": "Pulsar_QRM_RF",
            "ref": "external",
            "complex_output_0": {
                "portclock_configs": [
                    {"port": "q3:res", "clock": "q3.ro", "interm_freq": 100e6}
                ]
            },
        },
    }


@pytest.fixture
def hardware_cfg_pulsar_qcm(add_lo1):
    yield {
Loading