Ejemplo n.º 1
0
    def test_mod_square_VSM(self):
        waveform = wf.mod_square_VSM(1,
                                     0,
                                     20e-9,
                                     f_modulation=0,
                                     sampling_rate=1e9)

        np.testing.assert_almost_equal(waveform[0], np.ones(20))
        np.testing.assert_almost_equal(waveform[1], np.zeros(20))
        np.testing.assert_almost_equal(waveform[2], np.zeros(20))
        np.testing.assert_almost_equal(waveform[3], np.zeros(20))

        waveform = wf.mod_square_VSM(1,
                                     1,
                                     20e-9,
                                     f_modulation=0,
                                     sampling_rate=1e9)

        np.testing.assert_almost_equal(waveform[0], np.ones(20))
        np.testing.assert_almost_equal(waveform[1], np.zeros(20))
        np.testing.assert_almost_equal(waveform[2], np.ones(20))
        np.testing.assert_almost_equal(waveform[3], np.zeros(20))

        waveform = wf.mod_square_VSM(0,
                                     1,
                                     20e-9,
                                     f_modulation=0,
                                     sampling_rate=1e9)
        np.testing.assert_almost_equal(waveform[0], np.zeros(20))
        np.testing.assert_almost_equal(waveform[1], np.zeros(20))
        np.testing.assert_almost_equal(waveform[2], np.ones(20))
        np.testing.assert_almost_equal(waveform[3], np.zeros(20))
Ejemplo n.º 2
0
    def generate_standard_waveforms(self):
        wave_dict = super(AWG8_MW_LutMan, self).generate_standard_waveforms()
        wave_dict['square'] = wf.mod_square_VSM(
            amp_G=self.sq_G_amp(),
            amp_D=self.sq_D_amp(),
            length=self.mw_gauss_width() * 4,  # to ensure same duration as mw
            f_modulation=self.mw_modulation(),
            sampling_rate=self.sampling_rate())

        if self.mixer_apply_predistortion_matrix():
            self._wave_dict = self.apply_mixer_predistortion_corrections(
                self._wave_dict)
        return self._wave_dict
Ejemplo n.º 3
0
    def generate_standard_waveforms(
            self, apply_predistortion_matrix: bool=True):
        self._wave_dict = OrderedDict()

        if self.cfg_sideband_mode() == 'static':
            f_modulation = self.mw_modulation()
        else:
            f_modulation = 0

        # lutmap is expected to obey lutmap mw schema
        for idx, waveform in self.LutMap().items():
            if waveform['type'] == 'ge':
                amp = theta_to_amp(theta=waveform['theta'],
                                   amp180=self.mw_amp180())
                self._wave_dict[idx] = self.wf_func(
                    amp=amp,
                    phase=waveform['phi'],
                    sigma_length=self.mw_gauss_width(),
                    f_modulation=f_modulation,
                    sampling_rate=self.sampling_rate(),
                    motzoi=self.mw_motzoi())
            elif waveform['type'] == 'ef':
                amp = theta_to_amp(theta=waveform['theta'],
                                   amp180=self.mw_ef_amp180())
                self._wave_dict[idx] = self.wf_func(
                    amp=amp,
                    phase=waveform['phi'],
                    sigma_length=self.mw_gauss_width(),
                    f_modulation=self.mw_ef_modulation(),
                    sampling_rate=self.sampling_rate(),
                    motzoi=0)
            elif waveform['type'] == 'raw-drag':
                self._wave_dict[idx] = self.wf_func(
                    **waveform["drag_pars"])

            elif waveform['type'] == 'spec':
                self._wave_dict[idx] = self.spec_func(
                    amp=self.spec_amp(),
                    length=self.spec_length(),
                    sampling_rate=self.sampling_rate(),
                    delay=0,
                    phase=0)

            elif waveform['type'] == 'square':
                # Using a slightly different construction as above
                # as the call signatures of these functions is different.
                # Apperently the VSM LutMan has both parameters, so make sure
                # we detect on the one only available in the VSM. Otherwise, we
                # won't get the needed four waveforms.
                if 'sq_G_amp' in self.parameters:
                    self._wave_dict[idx] = wf.mod_square_VSM(
                        amp_G=self.sq_G_amp(), amp_D=self.sq_D_amp(),
                        length=self.mw_gauss_width()*4,
                        f_modulation=self.mw_modulation(),
                        sampling_rate=self.sampling_rate())
                elif 'sq_amp' in self.parameters:
                    self._wave_dict[idx] = wf.mod_square(
                        amp=self.sq_amp(), length=self.mw_gauss_width()*4,
                        f_modulation=self.mw_modulation(),  phase=0,
                        motzoi=0, sampling_rate=self.sampling_rate())
                else:
                    raise KeyError('Expected parameter "sq_amp" to exist')
            else:
                raise ValueError

        # Add predistortions + test
        if (self.mixer_apply_predistortion_matrix()
                and apply_predistortion_matrix):
            self._wave_dict = self.apply_mixer_predistortion_corrections(
                self._wave_dict)
        return self._wave_dict