diff --git a/qualang_tools/wirer/README.md b/qualang_tools/wirer/README.md index 6859d7e5..9dac0ee9 100644 --- a/qualang_tools/wirer/README.md +++ b/qualang_tools/wirer/README.md @@ -113,6 +113,18 @@ instruments.add_octave(indices=1) instruments.add_lf_fem(controller=1, slots=[1]) instruments.add_mw_fem(controller=1, slots=[2]) ``` +#### Setups with External Mixers +Note: An **external mixer** is defined as abstractly as a combined, IQ-upconverter and IQ-downconverter instrument. +```python +# Single LF-FEM and 2x External Mixers +instruments.add_lf_fem(controller=1, slots=[1]) +instruments.add_external_mixer(indices=[1, 2]) +``` +```python +# Single OPX+ and 2x External Mixers +instruments.add_opx_plus(controllers=[1, 2]) +instruments.add_external_mixer(indices=[1, 2]) +```
Image Empty OPX1000 diff --git a/qualang_tools/wirer/instruments/instruments.py b/qualang_tools/wirer/instruments/instruments.py index 1689b1fb..0fd2e991 100644 --- a/qualang_tools/wirer/instruments/instruments.py +++ b/qualang_tools/wirer/instruments/instruments.py @@ -25,6 +25,9 @@ def __init__(self): def add_external_mixer(self, indices: Union[List[int], int]): """ + Add an external mixer, which is defined abstractly as a combined, IQ-upconverter and + IQ-downconverter. + `indices` (List[int] | int): Can be one or more indices for one or more external mixers. """ if isinstance(indices, int): diff --git a/qualang_tools/wirer/wirer/channel_specs.py b/qualang_tools/wirer/wirer/channel_specs.py index f759ee15..1259bf91 100644 --- a/qualang_tools/wirer/wirer/channel_specs.py +++ b/qualang_tools/wirer/wirer/channel_specs.py @@ -15,7 +15,7 @@ InstrumentChannelMwFemDigitalOutput, InstrumentChannelLfFemDigitalOutput, InstrumentChannelOctaveDigitalInput, - InstrumentChannelExternalMixerDigitalInput, + InstrumentChannelExternalMixerDigitalInput ) # A channel template is a partially filled InstrumentChannel object @@ -112,6 +112,29 @@ 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, + ): + super().__init__() + self.channel_templates = [ + InstrumentChannelLfFemInput(con=con, slot=slot, port=in_port_i), + InstrumentChannelLfFemInput(con=con, slot=slot, port=in_port_q), + InstrumentChannelLfFemOutput(con=con, slot=slot, port=out_port_i), + InstrumentChannelLfFemOutput(con=con, slot=slot, port=out_port_q), + InstrumentChannelOctaveInput(con=octave_index, port=rf_in), + InstrumentChannelOctaveOutput(con=octave_index, port=rf_out), + ] + +class ChannelSpecLfFemBasebandAndExternalMixer(ChannelSpec): def __init__( self, con: int = None, @@ -120,9 +143,7 @@ def __init__( 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, + mixer_index: int = None, ): super().__init__() self.channel_templates = [ @@ -130,12 +151,34 @@ def __init__( InstrumentChannelLfFemInput(con=con, slot=slot, port=in_port_q), InstrumentChannelLfFemOutput(con=con, slot=slot, port=out_port_i), InstrumentChannelLfFemOutput(con=con, slot=slot, port=out_port_q), - InstrumentChannelOctaveInput(con=octave_index, port=rf_in), - InstrumentChannelOctaveOutput(con=octave_index, port=rf_out), + InstrumentChannelExternalMixerInput(con=mixer_index, port=1), + InstrumentChannelExternalMixerOutput(con=mixer_index, port=1), ] 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, + ): + super().__init__() + self.channel_templates = [ + InstrumentChannelOpxPlusInput(con=con, port=in_port_i), + InstrumentChannelOpxPlusInput(con=con, port=in_port_q), + InstrumentChannelOpxPlusOutput(con=con, port=out_port_i), + InstrumentChannelOpxPlusOutput(con=con, port=out_port_q), + InstrumentChannelOctaveInput(con=octave_index, port=rf_in), + InstrumentChannelOctaveOutput(con=octave_index, port=rf_out), + ] + +class ChannelSpecOpxPlusBasebandAndExternalMixer(ChannelSpec): def __init__( self, con: int = None, @@ -143,9 +186,7 @@ def __init__( 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, + mixer_index: int = None, ): super().__init__() self.channel_templates = [ @@ -153,8 +194,8 @@ def __init__( InstrumentChannelOpxPlusInput(con=con, port=in_port_q), InstrumentChannelOpxPlusOutput(con=con, port=out_port_i), InstrumentChannelOpxPlusOutput(con=con, port=out_port_q), - InstrumentChannelOctaveInput(con=octave_index, port=rf_in), - InstrumentChannelOctaveOutput(con=octave_index, port=rf_out), + InstrumentChannelExternalMixerInput(con=mixer_index, port=1), + InstrumentChannelExternalMixerOutput(con=mixer_index, port=1), ] @@ -192,8 +233,11 @@ def __init__(self, con: int = None, in_port: int = None): lf_fem_spec = ChannelSpecLfFemSingle lf_fem_iq_spec = ChannelSpecLfFemBaseband lf_fem_iq_octave_spec = ChannelSpecLfFemBasebandAndOctave +lf_fem_iq_ext_mixer_spec = ChannelSpecLfFemBasebandAndExternalMixer opx_spec = ChannelSpecOpxPlusSingle opx_iq_spec = ChannelSpecOpxPlusBaseband opx_iq_octave_spec = ChannelSpecOpxPlusBasebandAndOctave +opx_iq_ext_mixer_spec = ChannelSpecOpxPlusBasebandAndExternalMixer octave_spec = ChannelSpecOctave +ext_mixer_spec = ChannelSpecExternalMixer opx_dig_spec = ChannelSpecOpxPlusDigital