Example #1
0
def generate_sequence(do_program=True):

    # FIXME in principle we only want to create that once, at startup
    try:
        del qt.pulsar
    except:
        pass
    qt.pulsar = pulsar.Pulsar()
    qt.pulsar.AWG_sequence_cfg = {
        'SAMPLING_RATE': 1e9,
        'CLOCK_SOURCE': 1,  # Internal | External
        'REFERENCE_SOURCE': 2,  # Internal | External
        'EXTERNAL_REFERENCE_TYPE': 1,  # Fixed | Variable
        'REFERENCE_CLOCK_FREQUENCY_SELECTION': 1,  #10 MHz | 20 MHz | 100 MHz
        'TRIGGER_SOURCE': 1,  # External | Internal
        'TRIGGER_INPUT_IMPEDANCE': 1,  # 50 ohm | 1 kohm
        'TRIGGER_INPUT_SLOPE': 1,  # Positive | Negative
        'TRIGGER_INPUT_POLARITY': 1,  # Positive | Negative
        'TRIGGER_INPUT_THRESHOLD': 1.4,  # V
        'EVENT_INPUT_IMPEDANCE': 2,  # 50 ohm | 1 kohm
        'EVENT_INPUT_POLARITY': 1,  # Positive | Negative
        'EVENT_INPUT_THRESHOLD': 1.4,  #V
        'JUMP_TIMING': 1,  # Sync | Async
        'RUN_MODE': 4,  # Continuous | Triggered | Gated | Sequence
        'RUN_STATE': 0,  # On | Off
    }

    qt.pulsar.define_channel(id='ch2',
                             name='gate',
                             type='analog',
                             high=4.0,
                             low=0,
                             offset=0.,
                             delay=0.,
                             active=True)
    qt.pulsar.define_channel(id='ch2_marker1',
                             name='clock',
                             type='marker',
                             high=1.0,
                             low=0,
                             offset=0.,
                             delay=0.,
                             active=True)

    pulse_length = 2e-9

    gate = pulse.SquarePulse(channel='gate')
    clock_up = pulse.SquarePulse(channel='clock',
                                 amplitude=4.0,
                                 lenght=pulse_length)
    clock_down = pulse.SquarePulse(channel='clock',
                                   amplitude=0,
                                   lenght=pulse_length)

    elt1 = element.Element('trigger', pulsar=qt.pulsar)
    elt1.append(pulse.cp(clock_down, amplitude=0, length=5e-9))

    for i in arange(500):
        elt1.append(pulse.cp(clock_up, amplitude=4.0, length=pulse_length))
        elt1.append(pulse.cp(clock_down, amplitude=0, length=pulse_length))
    elt1.append(pulse.cp(clock_down, amplitude=0, length=1000e-9))
    elt1.add(pulse.cp(gate, amplitude=4.0, length=200 * pulse_length))
    for i in arange(2):
        elt1.append(pulse.cp(clock_up, amplitude=4.0, length=pulse_length))
        elt1.append(pulse.cp(clock_down, amplitude=0, length=pulse_length))
    #pprint.pprint (elt1.pulses)
    seq = pulsar.Sequence('FPGA_test')
    seq.append(name='trigger',
               wfname=elt1.name,
               trigger_wait=False,
               repetitions=100)
    #pprint.pprint (seq.elements)

    qt.pulsar.upload(elt1)
    qt.pulsar.program_sequence(seq)
Example #2
0
import qt

from measurement.lib.pulsar import pulsar
reload(pulsar)

pulsar.Pulsar.AWG = qt.instruments['AWG']

# FIXME in principle we only want to create that once, at startup
try:
    del qt.pulsar
except:
    pass
qt.pulsar = pulsar.Pulsar()

### channels
# RF
#RF channel is needed for the AOM for the short pulses
#qt.pulsar.define_channel(id='ch1', name='RF', type='analog', high=1.5,
#    low=-1.5, offset=0., delay=165e-9, active=True)

# MW
# On scope we find that MW_1 (and MW2) arrive 108 ns after the trigger, if we set the time between MW's and (begin)trigger to 58 ns in the AWG.
# so the delay of MW wrt trigger is 50 ns - Machiel 2014-06-23
'''
spin_of = -104e-9-27e-9 # I adjust the offset of the IQ to match lt2, so the DD scripts work
                        # TODO make more general
'''
qt.pulsar.define_channel(id='ch1_marker1',
                         name='MW_pulsemod',
                         type='marker',
                         high=2.0,
                      2 : 10/5000.}

positioner_lt1 = qt.instruments.create('positioner_lt1', 'NewportAgilisUC2_v2', 
        address = 'COM6', maxjog_cfg=pos_maxjog_cfg_lt1, maxpr_cfg=pos_maxpr_cfg_lt1,
        step_deg_cfg=pos_step_deg_cfg_lt1 )
rejecter_lt1 = qt.instruments.create('rejecter_lt1', 'laser_reject0r', positioner=positioner_lt1, 
        adwin=adwin_lt1, red_laser= MatisseAOM_lt1)

#### make a remote pulsar and configure it
from measurement.lib.pulsar import pulse, pulselib, element, pulsar

try:
    del qt.pulsar_remote
except:
    pass
qt.pulsar_remote = pulsar.Pulsar()
qt.pulsar_remote.AWG = qt.instruments['AWG_lt1']

### channels

# for the remote LDE setup. effectively this is the relative delay between SP AOM and MWs.
spin_of = -69e-9

# RF
qt.pulsar_remote.define_channel(id='ch1', name='RF', type='analog', high=1.0,
    low=-1.0, offset=0., delay=spin_of+165e-9, active=True)

# MW
qt.pulsar_remote.define_channel(id='ch1_marker1', name='MW_pulsemod', type='marker', 
    high=2.0, low=0, offset=0., delay=spin_of+(44+165)*1e-9, active=True)
qt.pulsar_remote.define_channel(id='ch3', name='MW_Imod', type='analog', high=0.9,