Ejemplo n.º 1
0
    def get_readout_pulse(self, pulse_len=None):
        if pulse_len is None:
            pulse_len = self.readout_info.pulse_len

        if not hasattr(self.readout_info, 'flux_chan'):
            return sequencer.Combined([
                pulselib.Constant(pulse_len, 1, chan=self.readout_info.readout_chan),
                pulselib.Constant(pulse_len, 1, chan=self.readout_info.acq_chan),
            ])
        else:
            flux_pulse = lambda duration, flux_level: pulselib.Constant(duration,
                                    flux_level, chan=self.readout_info.flux_chan)
            s = sequencer.Sequence()
            s.append(flux_pulse(self.readout_info.pre_flux_len,
                                self.readout_info.ro_flux_amp))
            s.append(sequencer.Combined([
                        pulselib.Constant(self.readout_info.pulse_len, 1,
                                 chan=self.readout_info.readout_chan),
                        pulselib.Constant(self.readout_info.pulse_len, 1,
                                 chan=self.readout_info.acq_chan),
                        flux_pulse(self.readout_info.pulse_len,
                                   self.readout_info.ro_flux_amp)
                    ]))
            s.append(flux_pulse(self.readout_info.post_flux_len,
                                self.readout_info.ro_flux_amp))
            #This is required so that after one expt and before the next trigger
            #we chill at zero flux.
            s.append(flux_pulse(2000,0)) # this is extended to
            return s
Ejemplo n.º 2
0
    def load_test_waveform(self):

        self.awg.delete_all_waveforms()
        self.awg.get_id() #Sometimes AWGs are slow.  If it responds it's ready.

        length = abs(int(1e9/self.if_freq *100))
        qubit_info = mclient.get_qubit_info(self.qubit_info.get_name())

        s = sequencer.Sequence()
        s.append(sequencer.Combined([
                            sequencer.Constant(length, 0.25, chan=qubit_info.sideband_channels[0]),
                            sequencer.Constant(length, 0.25, chan=qubit_info.sideband_channels[1])]))

        s = sequencer.Sequencer(s)

        s.add_ssb(qubit_info.ssb)
        seqs = s.render()
        self.seqs = seqs

        l = awgloader.AWGLoader(bulkload=config.awg_bulkload)
        base = 1
        for i in range(1, 5):
            awg = instruments['AWG%d'%i]
            if awg:
                chanmap = {1:base, 2:base+1, 3:base+2, 4:base+3}
                logging.info('Adding AWG%d, channel map: %s', i, chanmap)
                l.add_awg(awg, chanmap)
                base += 4
        l.load(seqs)
        l.run()
Ejemplo n.º 3
0
def LongMeasurementPulse(pulselen=None,
                         rolen=None,
                         reflen=None,
                         ro_delay=0,
                         pulse_pump=False,
                         **kwargs):
    sequencer.Pulse.RANGE_ACTION = sequencer.IGNORE
    label = kwargs.pop('label', None)
    if pulselen is None:
        pulselen = ro_ins.get_pulse_len()
    if rolen is None:
        rolen = ro_ins.get_acq_len()
    if reflen is None:
        reflen = ro_ins.get_ref_len()

    ro = sequencer.Constant(reflen, 3, chan='master', **kwargs)
    kwargs.pop('master_integrate', None)  # Remove integrate from kwargs
    if reflen != rolen:
        ro = sequencer.Sequence([
            ro,
            sequencer.Constant(rolen - reflen, 2, chan='master', **kwargs)
        ])

    if pulse_pump:
        cb = sequencer.Sequence([
            sequencer.Constant(800, 1, chan='m1'),
            sequencer.Combined([
                sequencer.Constant(pulselen, 2, chan='m0'),
                sequencer.Constant(rolen, 1, chan='m1'),
                ro,
            ],
                               align=sequencer.ALIGN_LEFT)
        ],
                                label=label)
    else:
        cb = sequencer.Combined([
            sequencer.Constant(pulselen, 2, chan='m0'),
            ro,
        ],
                                label=label,
                                align=sequencer.ALIGN_LEFT)

    if ro_delay == 0:
        return cb
    else:
        return sequencer.Sequence([sequencer.Delay(ro_delay), cb])
Ejemplo n.º 4
0
def MeasurementPulse(pulselen=200, delay=0, ro_delay=0, **kwargs):
    label = kwargs.pop('label', None)
    cb = sequencer.Combined([
        sequencer.Constant(pulselen, 2, chan='m0'),
        sequencer.Sequence([
            sequencer.Delay(delay),
            sequencer.Constant(40, 1, chan='master', **kwargs),
            sequencer.Constant(220, 2, chan='master', **kwargs)
        ]),
    ],
                            label=label,
                            align=sequencer.ALIGN_LEFT)
    if ro_delay == 0:
        return cb
    else:
        return sequencer.Sequence([sequencer.Delay(ro_delay), cb])
Ejemplo n.º 5
0
    def __call__(self, alpha, amp=None, plot=False, **kwargs):
        '''
        Generate a rotation pulse of angle <alpha> around axis <phase>.
        If <amp> is specified that amplitude is used and <alpha> is ignored.
        '''

        self.determine_correction()

        sequencer.Pulse.RANGE_ACTION = sequencer.IGNORE
        data = self.get_pulse_data()
        name = self.get_pulse_name()
        Ipulse = sequencer.Pulse('%s_I' % name,
                                 np.real(data),
                                 chan=self.chans[0]).rendered()
        Qpulse = sequencer.Pulse('%s_Q' % name,
                                 np.imag(data),
                                 chan=self.chans[1]).rendered()
        if plot:
            plt.figure()
            plt.plot(self.pulse.data)
            plt.plot(np.real(data))
            plt.plot(np.imag(data))
            plt.plot(2 * np.arange(len(data) / 2), np.real(data[::2]), 'ks')
            plt.plot(2 * np.arange(len(data) / 2), np.imag(data[::2]), 'ro')

        pulses = []
        Ipulse.set_params(mixer_amplitudes=(0xffff, 0), **kwargs)
        pulses.append(Ipulse)
        Qpulse.set_params(mixer_amplitudes=(0, 0xffff), **kwargs)
        pulses.append(Qpulse)

        if self.marker_chan is not None:
            mpulse = sequencer.Constant(pulses[0].get_length(),
                                        self.marker_val,
                                        chan=self.marker_chan,
                                        **kwargs)
            pulses.append(mpulse)

        if len(pulses) == 1:
            return sequencer.Sequence(pulses, **kwargs)
        else:
            return sequencer.Combined(pulses, **kwargs)
Ejemplo n.º 6
0
    def __call__(self, alpha, phase, amp=None, **kwargs):
        '''
        Generate a rotation pulse of angle <alpha> around axis <phase>.
        If <amp> is specified that amplitude is used and <alpha> is ignored.
        '''
        if amp is None:
            amp = self.ampgen(alpha)
        amp *= 65535.0
        pulses = []

        kwargs['chan%d_mixer_amplitudes' %
               self.chans[0]] = (np.cos(phase) * amp, np.sin(phase) * amp)
        kwargs['chan%d_mixer_amplitudes' %
               self.chans[1]] = (-np.sin(phase) * amp, np.cos(phase) * amp)
        if 'detune_period' in kwargs and kwargs['detune_period'] != 0:
            period = kwargs.pop('detune_period')
            ts = np.arange(len(self.Ipulse.data))
            data = self.Ipulse.data * np.exp(2j * np.pi * ts / period)
            if 0:
                import matplotlib.pyplot as plt
                plt.figure()
                plt.plot(ts, np.real(data))
                plt.plot(ts, np.imag(data))
                plt.suptitle('period=%s' % period)
            Ipulse = sequencer.Pulse('%s_re%s' % (self.Ipulse.name, period),
                                     np.real(data),
                                     chan=self.chans[0]).rendered()
            Qpulse = sequencer.Pulse('%s_im%s' % (self.Ipulse.name, period),
                                     np.imag(data),
                                     chan=self.chans[1]).rendered()
            Ipulse.set_params(**kwargs)
            pulses.append(Ipulse)
            Qpulse.set_params(**kwargs)
            pulses.append(Qpulse)

        else:
            if self.Ipulse:
                p = copy.deepcopy(self.Ipulse)
                pulses.append(p)
                pulses[-1].chan = self.chans[0]
                pulses[-1].set_params(**kwargs)
                if not self.Qpulse:
                    pulses.append(
                        sequencer.Constant(self.Ipulse.get_length(),
                                           1e-6,
                                           chan=self.chans[1]))
                    pulses[-1].set_params(
                        mixer_amplitudes=(-amp * np.sin(phase),
                                          amp * np.cos(phase)),
                        **kwargs)
            if self.Qpulse:
                p = copy.deepcopy(self.Qpulse)
                pulses.append(p)
                pulses[-1].chan = self.chans[1]
                pulses[-1].set_params(**kwargs)

        sequencer.Pulse.RANGE_ACTION = sequencer.IGNORE
        if self.marker_chan is not None:
            mpulse = sequencer.Constant(pulses[0].get_length(),
                                        self.marker_val,
                                        chan=self.marker_chan,
                                        **kwargs)
            pulses.append(mpulse)

        if len(pulses) == 1:
            return sequencer.Sequence(pulses)
        else:
            return sequencer.Combined(pulses, **kwargs)
Ejemplo n.º 7
0
                               seq=seq,
                               delay=5,
                               bgcor=False,
                               extra_info=[
                                   Qswitch_info1A,
                                   Qswitch_info1B,
                               ])
    Qfun.measure()

if 0:  # ge entangled cat
    from scripts.single_cavity import Qfunction
    from scripts.single_cavity import WignerbyParity
    prepareAB = sequencer.Join([
        sequencer.Trigger(250),
        gepi2,
        sequencer.Combined([cA(2.0, 0), cB(1.65, 0)]),
    ])
    disentangle = sequencer.Join([
        sequencer.Combined([cA(2.00, pi * 0.33),
                            cB(1.65, -pi * 0.175)]),
        geqs(np.pi, 0),
        sequencer.Combined([cA(-1.73, pi * 0.17),
                            cB(-1.65, -pi * 0.02)]),
    ])
    #    seq = sequencer.Join([prepareAB, sequencer.Delay(950), disentangle, cB(1.65, -pi*0.02)])
    #    Qfun = Qfunction.QFunction(qubit_info, cavity_info1A, amax=2.5, N=15, amaxx=None, Nx=None, amaxy=None, Ny=None,
    #                 seq=seq, delay=5, saveas=None, bgcor=True, singleshotbin=True, extra_info=[cavity_info1B])
    #    Qfun.measure()
    #
    #    seq = sequencer.Join([prepareAB, sequencer.Delay(950), disentangle, cB(-1.65, -pi*0.02)])
    #    Qfun = Qfunction.QFunction(qubit_info, cavity_info1A, amax=2.5, N=15, amaxx=None, Nx=None, amaxy=None, Ny=None,
Ejemplo n.º 8
0
                                            cavity_info1B, [0.01],
                                            np.linspace(
                                                cav_freq - 0.5e6,
                                                cav_freq + 0.5e6, 61),
                                            Qswitchseq=None)
    cspec.measure()
    bla

if 1:  # pump tone spectroscopy
    from scripts.single_cavity import cavspectroscopy
    cav_freq = 7782.70e6
    seq = sequencer.Join([
        sequencer.Delay(10000),
        sequencer.Combined([
            Qswitch_info1A.rotate(np.pi, 0),  # 250us square pulse pump
            Qswitch_info1B.rotate(np.pi, 0),
            sequencer.Repeat(sequencer.Constant(1000, 0.0001, chan=5),
                             250),  # Qubit/Readout master switch
        ]),
        sequencer.Delay(20000)
    ])
    cspec = cavspectroscopy.CavSpectroscopy(
        mclient.instruments['brick4'],
        qubit_info,
        cavity_info1B, [1.2],
        np.linspace(cav_freq - 0.5e6, cav_freq + 0.5e6, 61),
        Qswitchseq=seq,
        extra_info=[Qswitch_info1A, Qswitch_info1B])
    cspec.measure()
    bla

if 0:  #Find qubit ef