Skip to content

Commit

Permalink
Apply black formatting.]
Browse files Browse the repository at this point in the history
  • Loading branch information
deanpoulos committed Dec 19, 2024
1 parent b59152d commit 18a4a34
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 27 deletions.
3 changes: 2 additions & 1 deletion qualang_tools/wirer/instruments/instrument_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class InstrumentChannelAnalog:


InstrumentIdType = Literal["lf-fem", "mw-fem", "opx+", "octave", "external-mixer"]


@dataclass(eq=False)
class InstrumentChannelLfFem:
instrument_id: InstrumentIdType = "lf-fem"
Expand Down Expand Up @@ -142,7 +144,6 @@ class InstrumentChannelExternalMixerOutput(
pass



@dataclass(eq=False)
class InstrumentChannelOctaveInput(
InstrumentChannelAnalog, InstrumentChannelOctave, InstrumentChannelInput, InstrumentChannel
Expand Down
1 change: 0 additions & 1 deletion qualang_tools/wirer/instruments/instruments.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def add_external_mixer(self, indices: Union[List[int], int]):
channel = InstrumentChannelExternalMixerDigitalInput(con=index, port=1)
self.available_channels.add(channel)


def add_octave(self, indices: Union[List[int], int]):
if isinstance(indices, int):
indices = [indices]
Expand Down
2 changes: 1 addition & 1 deletion qualang_tools/wirer/visualizer/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"mw-fem": "OPX1000",
"opx+": "OPX+",
"octave": "Octave",
"external-mixer": "Mixers"
"external-mixer": "Mixers",
}

# Define the chassis dimensions
Expand Down
2 changes: 1 addition & 1 deletion qualang_tools/wirer/visualizer/port_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def draw(self, ax: Axes):
fontsize=8,
fontweight="bold",
color=outline_colour,
)
)
bbox = None
else:
raise NotImplementedError(f"No port-annotation drawing for {self.instrument_id}")
Expand Down
42 changes: 22 additions & 20 deletions qualang_tools/wirer/wirer/channel_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
InstrumentChannelMwFemDigitalOutput,
InstrumentChannelLfFemDigitalOutput,
InstrumentChannelOctaveDigitalInput,
InstrumentChannelExternalMixerDigitalInput
InstrumentChannelExternalMixerDigitalInput,
)

# A channel template is a partially filled InstrumentChannel object
Expand Down Expand Up @@ -113,16 +113,16 @@ def __init__(self, index: int = None, rf_in: int = None, rf_out: int = None):

class ChannelSpecLfFemBasebandAndOctave(ChannelSpec):
def __init__(
self,
con: int = None,
slot: int = None,
in_port_i: int = None,
in_port_q: int = None,
out_port_i: int = None,
out_port_q: int = None,
octave_index: int = None,
rf_in: int = None,
rf_out: int = None,
self,
con: int = None,
slot: int = None,
in_port_i: int = None,
in_port_q: int = None,
out_port_i: int = None,
out_port_q: int = None,
octave_index: int = None,
rf_in: int = None,
rf_out: int = None,
):
super().__init__()
self.channel_templates = [
Expand All @@ -134,6 +134,7 @@ def __init__(
InstrumentChannelOctaveOutput(con=octave_index, port=rf_out),
]


class ChannelSpecLfFemBasebandAndExternalMixer(ChannelSpec):
def __init__(
self,
Expand All @@ -158,15 +159,15 @@ def __init__(

class ChannelSpecOpxPlusBasebandAndOctave(ChannelSpec):
def __init__(
self,
con: int = None,
in_port_i: int = None,
in_port_q: int = None,
out_port_i: int = None,
out_port_q: int = None,
octave_index: int = None,
rf_in: int = None,
rf_out: int = None,
self,
con: int = None,
in_port_i: int = None,
in_port_q: int = None,
out_port_i: int = None,
out_port_q: int = None,
octave_index: int = None,
rf_in: int = None,
rf_out: int = None,
):
super().__init__()
self.channel_templates = [
Expand All @@ -178,6 +179,7 @@ def __init__(
InstrumentChannelOctaveOutput(con=octave_index, port=rf_out),
]


class ChannelSpecOpxPlusBasebandAndExternalMixer(ChannelSpec):
def __init__(
self,
Expand Down
12 changes: 9 additions & 3 deletions qualang_tools/wirer/wirer/wirer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
ChannelSpecLfFemDigital,
ChannelSpecOctaveDigital,
ChannelSpecOpxPlusDigital,
ChannelSpecExternalMixerDigital
ChannelSpecExternalMixerDigital,
)
from .wirer_assign_channels_to_spec import assign_channels_to_spec
from .wirer_exceptions import ConstraintsTooStrictException, NotEnoughChannelsException
Expand Down Expand Up @@ -105,11 +105,17 @@ def allocate_rf_channels(spec: WiringSpec, instruments: Instruments):
# LF-FEM I/Q output with Octave for upconversion
ChannelSpecLfFemBaseband() & ChannelSpecLfFemDigital() & ChannelSpecOctave() & ChannelSpecOctaveDigital(),
# LF-FEM I/Q output with External Mixer for upconversion
ChannelSpecLfFemBaseband() & ChannelSpecLfFemDigital() & ChannelSpecExternalMixer() & ChannelSpecExternalMixerDigital(),
ChannelSpecLfFemBaseband()
& ChannelSpecLfFemDigital()
& ChannelSpecExternalMixer()
& ChannelSpecExternalMixerDigital(),
# OPX+ I/Q output with Octave for upconversion
ChannelSpecOpxPlusBaseband() & ChannelSpecOpxPlusDigital() & ChannelSpecOctave() & ChannelSpecOctaveDigital(),
# OPX+ I/Q output with External Mixer for upconversion
ChannelSpecOpxPlusBaseband() & ChannelSpecOpxPlusDigital() & ChannelSpecExternalMixer() & ChannelSpecExternalMixerDigital(),
ChannelSpecOpxPlusBaseband()
& ChannelSpecOpxPlusDigital()
& ChannelSpecExternalMixer()
& ChannelSpecExternalMixerDigital(),
]

allocate_channels(spec, rf_specs, instruments, same_con=True, same_slot=True)
Expand Down

0 comments on commit 18a4a34

Please sign in to comment.