Skip to content

Commit abf3a59

Browse files
committed
in qblox: mixer_corr_gain and moxer_corr_phase per sequencer instead of per port
1 parent c99eb51 commit abf3a59

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

src/qibolab/_core/instruments/qblox/config/module.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66

77
from qibolab._core.components import Channel, OscillatorConfig
88
from qibolab._core.components.channels import AcquisitionChannel
9-
from qibolab._core.components.configs import Configs, DcConfig, IqMixerConfig
9+
from qibolab._core.components.configs import Configs, DcConfig
1010
from qibolab._core.components.filters import (
1111
ExponentialFilter,
1212
FiniteImpulseResponseFilter,
1313
)
1414
from qibolab._core.identifier import ChannelId
15+
from qibolab._core.instruments.qblox.config.sequencer import QbloxIqMixerConfig
1516
from qibolab._core.serialize import Model
1617

1718
from .port import PortAddress
@@ -68,10 +69,10 @@ def mixers(
6869
all: dict[ChannelId, str],
6970
configs: Configs,
7071
module_channels: set[ChannelId],
71-
) -> dict[ChannelId, IqMixerConfig]:
72+
) -> dict[ChannelId, QbloxIqMixerConfig]:
7273
# TODO: identical to the `.los()` function, deduplicate it please...
7374
return {
74-
id_: cast(IqMixerConfig, configs[mixer])
75+
id_: cast(QbloxIqMixerConfig, configs[mixer])
7576
for id_, mixer in all.items()
7677
if id_ in module_channels
7778
}
@@ -121,7 +122,7 @@ def build(
121122
channels: dict[ChannelId, Channel],
122123
configs: Configs,
123124
los: dict[ChannelId, OscillatorConfig],
124-
mixers: dict[ChannelId, IqMixerConfig],
125+
mixers: dict[ChannelId, QbloxIqMixerConfig],
125126
qrm: bool,
126127
) -> "ModuleConfig":
127128
ports = {}

src/qibolab/_core/instruments/qblox/config/sequencer.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import json
2-
from typing import Optional, cast
2+
from typing import Literal, Optional, cast
33

44
import numpy as np
55
from pydantic import ConfigDict
@@ -24,6 +24,24 @@
2424
__all__ = []
2525

2626

27+
class QbloxIqMixerConfig(IqMixerConfig):
28+
kind: Literal["qblox-iq-mixer"] = "qblox-iq-mixer"
29+
30+
"""qblox has 6 sequencers per module."""
31+
scale_q_sequencer0: float = 1.0
32+
phase_q_sequencer0: float = 0.0
33+
scale_q_sequencer1: float = 1.0
34+
phase_q_sequencer1: float = 0.0
35+
scale_q_sequencer2: float = 1.0
36+
phase_q_sequencer2: float = 0.0
37+
scale_q_sequencer3: float = 1.0
38+
phase_q_sequencer3: float = 0.0
39+
scale_q_sequencer4: float = 1.0
40+
phase_q_sequencer4: float = 0.0
41+
scale_q_sequencer5: float = 1.0
42+
phase_q_sequencer5: float = 0.0
43+
44+
2745
def _integration_length(sequence: Q1Sequence) -> Optional[int]:
2846
"""Find integration length based on sequence waveform lengths."""
2947
lengths = {
@@ -129,9 +147,11 @@ def build(
129147
lo_freq = cast(OscillatorConfig, configs[probe_.lo]).frequency
130148
cfg.nco_freq = int(freq - lo_freq)
131149
assert probe_.mixer is not None
132-
mixer = cast(IqMixerConfig, configs[probe_.mixer])
133-
cfg.mixer_corr_gain_ratio = mixer.scale_q
134-
cfg.mixer_corr_phase_offset_degree = mixer.phase_q
150+
mixer = cast(QbloxIqMixerConfig, configs[probe_.mixer])
151+
cfg.mixer_corr_gain_ratio = getattr(mixer, f"scale_q_sequencer{index}")
152+
cfg.mixer_corr_phase_offset_degree = getattr(
153+
mixer, f"phase_q_sequencer{index}"
154+
)
135155

136156
return cfg
137157

0 commit comments

Comments
 (0)