Example #1
0
def qubit_cool(m, NCONVINCE=4, label='qcool', tgtlabel=None):
    '''
    Qubit cooling sequence: measure |g> <NCONVINCE> times in a row.
    If <tgtlabel> is None, a function return will be generated at the end,
    otherwise the sequence jumps to <tgtlabel> on completion.
    Uses counter0
    '''
    if tgtlabel:
        retlabel = tgtlabel
    else:
        retlabel = label + '_ret'
    s = sequencer.Sequence()
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.NOP(), master_integrate=m.integrate_nolog, master_counter0=NCONVINCE, label=label))
    s.append(fpgapulses.LongMeasurementPulse(label=label+'_meas'))
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.NOP(), length=220, master_internal_function=ye.FPGASignals.s0, jump=(label+'_decc0', 'next')))
    # We measured |e>, reset counter and jump back to measure
    s.append(m.qubit.rotate(np.pi,0,jump=label+'_meas',master_counter0=NCONVINCE))
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.NOP(), master_counter0=-1, master_internal_function=ye.FPGASignals.c0, jump=(retlabel, label+'_meas'), label=label+'_decc0'))
    if tgtlabel is None:
        s.append(fpgapulses.RegOp(ye.RegisterInstruction., NCONVINCE=4NOP(), callreturn=True, label=retlabel))
    return s
Example #2
0
if 0:
    s.append(sequencer.Delay(240, label='start'))
    for period in periods:
        if CAVPULSE:
    #        s.append(sequencer.Constant(500, 1, chan='m0'))
            s.append(m.cavity.displace(DISP))
        s.append(m.qubit.rotate(np.pi, 0, detune_period=period))
        s.append(fpgapulses.LongMeasurementPulse())
        s.append(sequencer.Delay(REPRATE_DELAY))
    s.append(sequencer.Delay(240, jump='start'))

# New style, in logic a13 and up
else:
    F0 = 50000 - round(dfs[0]/1000)     # F0 in kHz
    DF = round(-(dfs[1]-dfs[0])/1000)   # DF in hHz
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.MOVI(12, F0), master_counter0=N, label='reset'))
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.MOVI(0, F0)))
    s.append(sequencer.Delay(1000, label='start', **m.qubit.load_ssb_kwargs))
    if CAVPULSE:
        s.append(m.cavity.displace(DISP))
    s.append(m.qubit.rotate(np.pi, 0))
    s.append(fpgapulses.LongMeasurementPulse())
    s.append(sequencer.Delay(REPRATE_DELAY))
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.ADDI(0, DF), length=100))
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.ADDI(12, DF), length=100, master_counter0=-1, master_internal_function=ye.FPGASignals.c0, jump=('reset', 'start')))

m.set_seq(s, len(dfs))
#m.generate(plot=True)
m.start_exp()
m.plot_se()
plt.xlabel('Detuning [MHz]')
Example #3
0
N = 61  # Number of elements in sequence
DT = 2500
delays = np.arange(N) * DT
REPRATE_DELAY = 500000  # Delay to get a reasonable repetition rate
m = fpgameasurement.FPGAMeasurement('T1',
                                    xs=delays / 1000.,
                                    fit_func='exp_decay',
                                    rrec=False)

s = sequencer.Sequence()

# FPGA style, using R13 as dynamic instruction length
if 1:
    s.append(
        fpgapulses.RegOp(ye.RegisterInstruction.MOVI(13, 0),
                         master_counter0=N,
                         label='reset'))
    s.append(m.qubit.rotate(np.pi, 0, label='start'))
    s.append(sequencer.Delay(100, inslength=('R13', 10)))  # Length = R13 + 10
    #    s.append(sequencer.Constant(512, 1, value=1, chan='m0'))    # For debugging purposes
    s.append(fpgapulses.LongMeasurementPulse(label='measure'))
    s.append(
        fpgapulses.RegOp(ye.RegisterInstruction.ADDI(13, DT / 4),
                         master_counter0=-1,
                         master_internal_function=ye.FPGASignals.c0))
    s.append(sequencer.Delay(REPRATE_DELAY, jump=('reset', 'start')))

# Old-school
else:
    #    m.qubit.rotate = fpgapulses.FPGAMarkerLenRotation(72, 'm0', 1)
    s.append(sequencer.Delay(256, label='start'))
Example #4
0
wigodds = fpgapulses.FPGADetunedSum(m.qubit.rotate.Ipulse,
                                    periods=qubit_periods[1::2],
                                    amps=qubit_amps[1::2])

REPRATE_DELAY = 1000000  # Delay to get a reasonable repetition rate

s = sequencer.Sequence()

I0 = DMAX * m.cavity.rotate.pi_amp * 65535
Q0 = I0
DI = round(2.0 * I0 / (NI - 1))
DQ = round(2.0 * Q0 / (NQ - 1))

s.append(sequencer.Constant(512, 1, value=1, chan='m0'))

s.append(fpgapulses.RegOp(RegisterInstruction.MOVI(0, +I0), label='Ireset'))
s.append(fpgapulses.RegOp(RegisterInstruction.MOVI(3, +I0), fpga_counter0=NI))
s.append(fpgapulses.RegOp(RegisterInstruction.MOVI(2, +Q0), label='Qreset'))
s.append(fpgapulses.RegOp(RegisterInstruction.MOVI(1, -Q0), fpga_counter1=NQ))

s.append(sequencer.Constant(256, 1, chan=0, label='displace'))
s.append(stateprep)
s.append(m.cavity.displace(1.0, fpga_mixer_mask=(True, True)))
s.append(wigodds(np.pi, 0))
s.append(fpgapulses.LongMeasurementPulse(label='measure'))
s.append(sequencer.Delay(REPRATE_DELAY))
if BG:
    s.append(stateprep)
    s.append(m.cavity.displace(1.0, fpga_mixer_mask=(True, True)))
    s.append(wigevens(np.pi, 0))
    s.append(fpgapulses.LongMeasurementPulse(label='measure'))
Example #5
0
import numpy as np
from pulseseq import sequencer, pulselib
import sys
import time
import fpgapulses
import fpgameasurement
import fpga_sequences
from YngwieEncoding import *

REPRATE_DELAY = 50000  # Delay to get a reasonable repetition rate

m = fpgameasurement.FPGAMeasurement('cool', rrec=False)

s = sequencer.Sequence()

s.append(sequencer.Constant(512, 1, value=1, chan='m0'))
s.append(fpga_sequences.qubit_cool(m, label='qcool', tgtlabel='measure'))
s.append(
    fpgapulses.RegOp(RegisterInstruction.NOP(),
                     master_integrate=m.integrate_log,
                     label='measure'))
s.append(fpgapulses.LongMeasurementPulse())
s.append(sequencer.Delay(REPRATE_DELAY, jump='qcool'))

m.set_seq(s, 10)
#m.generate(plot=True)
m.start_exp()
m.plot_histogram()
Example #6
0
def cavity_cool(m, NCONVINCE=4, label='qccool', tgtlabel=None):
    '''
    Qubit/cavity |gg> cooling sequence.
    If <tgtlabel> is None, a function return will be generated at the end,
    otherwise the sequence jumps to <tgtlabel> on completion.
    Uses registers R1, R2 and counter0
    '''

    if tgtlabel:
        retlabel = tgtlabel
    else:
        retlabel = label + '_ret'

    s = sequencer.Sequence()

    s.append(sequencer.Delay(1000, label=label, master_integrate=m.integrate_nolog, master_counter0=NCONVINCE))
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.NOP(), label='_'))

    # First measurement, store result in R1, 0 = |g>, 1 = |e>
    s.append(fpgapulses.LongMeasurementPulse())
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.NOP(), length=220, master_internal_function=ye.FPGASignals.s0, jump=(label+'_setR1_0', label+'_setR1_1')))
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.MOVI(1, 0), label=label+'_setR1_0', jump=label+'_M2'))
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.MOVI(1, 1), label=label+'_setR1_1'))

    # Second measurement, store result in R2, 0 = |g>, 1 = |e>
    s.append(m.qubit.rotate_selective(np.pi,0,label=label+'_M2'))
    s.append(fpgapulses.LongMeasurementPulse())
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.NOP(), length=220, master_internal_function=ye.FPGASignals.s0, jump=(label+'_setR2_0', label+'_setR2_1')))
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.MOVI(2, 0), label=label+'_setR2_0', jump=label+'_decide'))
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.MOVI(2, 1), label=label+'_setR2_1'))

    # Compare R1 and R2
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.CMP(1, 2), master_internal_function=ye.FPGASignals.r0, label=label+'_decide', jump=(label+'_same', label+'_diff')))
    # If the same: reset counter, move last outcome to R1 and re-measure
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.MOV(1, 2), master_counter0=NCONVINCE, jump=label+'_M2', label=label+'_same'))

    # If different: decrease counter, move last outcome to R1 and goto remeasure if counter not zero
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.MOV(1, 2), master_counter0=-1, master_internal_function=ye.FPGASignals.c0, jump=('next', label+'_M2'), label=label+'_diff'))

    # We're almost good, make sure we are actually in |g>, if so jump to start
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.CMPI(1, 0), master_internal_function=ye.FPGASignals.r0, jump=(retlabel, 'next')))
#    s.append(fpgapulses.RegOp(ye.RegisterInstruction.CMPI(1, 0), master_internal_function=ye.FPGASignals.r0, jump=(label+'_qcool', 'next')))
    # Otherwise, set counter to 1 and remeasure
    s.append(fpgapulses.RegOp(ye.RegisterInstruction.NOP(), master_counter0=1, jump=label+'_M2'))
    if tgtlabel is None:
        s.append(fpgapulses.RegOp(ye.RegisterInstruction.NOP(), callreturn=True, label=retlabel))
    return s
Example #7
0
if 0:
    s.append(sequencer.Delay(256, label='start'))
    m.qubit.rotate.set_pi_amp(1)
    for amp in amps:
        for j in range(PULSE_REP):
            s.append(m.qubit.rotate(np.pi * amp, 0))
        s.append(fpgapulses.LongMeasurementPulse())
        s.append(sequencer.Delay(REPRATE_DELAY))
    s.append(sequencer.Delay(256, jump='start'))

# FPGA style
else:
    DA = round((MAXAMP / (N - 1)) * 65535)
    s.append(
        fpgapulses.RegOp(RegisterInstruction.MOVI(0, 0),
                         master_counter0=N,
                         label='reset'))
    s.append(fpgapulses.RegOp(RegisterInstruction.MOVI(1, 0)))
    s.append(fpgapulses.RegOp(RegisterInstruction.MOVI(2, 0)))
    s.append(fpgapulses.RegOp(RegisterInstruction.MOVI(3, 0)))

    s.append(fpgapulses.RegOp(RegisterInstruction.NOP(), label='start'))
    if COOL:
        s.append(
            fpgapulses.RegOp(RegisterInstruction.NOP(),
                             master_integrate=m.integrate_nolog,
                             label='cool'))
        s.append(fpgapulses.LongMeasurementPulse())
        s.append(
            fpgapulses.RegOp(RegisterInstruction.NOP(),
                             length=220,