# # Copyright 2024 Keysight Technologies Inc. # # This file generates the asset "channel_mapper.qcs". Run `python channel_mapper.py` # to generate the asset. # import keysight.qcs as qcs awgs = qcs.Channels(range(4), "xy_channels") readout_awgs = qcs.Channels(range(4), "readout_channels") dig = qcs.Channels(range(1), "acquire_channels") # define the address of physical channels awg_1x4x4 = qcs.Address(1, 4, 4) dig_1x3x4 = qcs.Address(1, 3, 4) dc_1x2x4 = qcs.Address(1, 2, 4) # initialize a mapper and specify the mapping mapper = qcs.ChannelMapper() mapper.add_channel_mapping(awgs, [awg_1x4x4] * 4, qcs.InstrumentEnum.M5300AWG) mapper.add_channel_mapping(readout_awgs, [awg_1x4x4] * 4, qcs.InstrumentEnum.M5300AWG) mapper.add_channel_mapping(dig, dig_1x3x4, qcs.InstrumentEnum.M5200Digitizer) # specify the downconverter for the digitizer at `dig_1x3x4` mapper.add_downconverters(dig_1x3x4, dc_1x2x4) mapper.set_delays(dig_1x3x4, 160e-9) # set the LO frequency of the AWG and downconverter channels to be the same value by # passing in a range of possible RF frequencies mapper.constrain_lo_frequencies([awg_1x4x4, dc_1x2x4], 5.5e9, 6.4e9) qcs.save(mapper, "channel_mapper.qcs") # Channel mapper for FOX, examples in Application section awgs = qcs.Channels(range(4), "xy_channels", absolute_phase=True) readout_awgs = qcs.Channels(range(4), "readout_channels", absolute_phase=True) dig = qcs.Channels(range(1), "acquire_channels") # define the address of physical channels awg_addr = (1, 8, 4) dig_addr = (2, 6, 4) dnc_addr = (2, 5, 4) # initialize a mapper and specify the mapping mapper = qcs.ChannelMapper() mapper.add_channel_mapping(awgs, [awg_addr] * 4, qcs.InstrumentEnum.M5300AWG) mapper.add_channel_mapping(readout_awgs, [awg_addr] * 4, qcs.InstrumentEnum.M5300AWG) mapper.add_channel_mapping(dig, dig_addr, qcs.InstrumentEnum.M5200Digitizer) # specify the downconverter for the digitizer at `dig_2x6x4` mapper.add_downconverters(dig_addr, dnc_addr) mapper.set_delays(dig_addr, 16e-9) # set the LO frequency of the AWG and downconverter channels to be the same value by # passing in a range of possible RF frequencies mapper.set_lo_frequencies([awg_addr, dnc_addr], 5.5e9) qcs.save(mapper, "mapper.qcs") # Channel mapper for program files with data, KIT, sweep examples awgs = qcs.Channels(range(2), "readoutawg") digs = qcs.Channels(range(2), "readoutreceiver") mapper = qcs.ChannelMapper() # physical channel addresses # you can pass an Address object, or simply a tuple containing (chassis, slot, channel) awg_addresses = [qcs.Address(chassis=1, slot=1, channel=1), (1, 1, 2)] dig_addresses = [(1, 2, 1), (1, 2, 2)] dnc_addresses = [(1, 3, 1), (1, 3, 2)] # define the mapping between virtual and physical channels mapper.add_channel_mapping(awgs, awg_addresses, qcs.InstrumentEnum.M5300AWG) mapper.add_channel_mapping(digs, dig_addresses, qcs.InstrumentEnum.M5200Digitizer) # specify the downconverter connection mapper.add_downconverters(dig_addresses, dnc_addresses) # Specify a local oscillator frequency of 4 GHz for the AWG and the downconverter mapper.set_lo_frequencies(awg_addresses + dnc_addresses, 4e9) qcs.save(mapper, "channel_map.qcs")