BBN-Q / libaps

C/C++ driver for BBN APSv1
Apache License 2.0
2 stars 1 forks source link

DAC-II Generates multiple waveforms per trigger #3

Open calebjordan opened 8 years ago

calebjordan commented 8 years ago

I'm trying to generate a single gaussian pulse per trigger. What I'm getting is a pulse train filling up ~26 us. I tried playing with aps.setRepeatMode() with no results.

pulse

img_1152 1 Green is pulse, Yellow is slaveTrig.

The APS is receiving a 1kHz trigger. Any ideas as to what's causing this? I can add a ~30us Id(), but this makes the plots impossible to see and shouldn't be necessary.

PyQlab

q1 = QubitFactory('q1')
seqs = [[Id(q1), Utheta(q1, amp=1)]]
files = compile_to_hardware(seqs, 'Bias/bias')
plot_pulse_files(files)

Qlab

aps = APS();
aps.connect('A6001nBT');
aps.stop();
aps.loadConfig('C:/Users/Caleb/Development/BBN/AWG/Bias/bias-APS.h5');
aps.run()

Config

Instruments.instrDict.APS

"APS": {
      "address": "A6001nBT", 
      "channels": [
        {
          "amplitude": 1.0, 
          "enabled": true, 
          "label": "", 
          "offset": 0.0, 
          "x__class__": "AWGChannel", 
          "x__module__": "instruments.AWGBase"
        }, 
        {
          "amplitude": 1.0, 
          "enabled": true, 
          "label": "", 
          "offset": 0.0, 
          "x__class__": "AWGChannel", 
          "x__module__": "instruments.AWGBase"
        }, 
        {
          "amplitude": 0.5, 
          "enabled": true, 
          "label": "", 
          "offset": 0.0168, 
          "x__class__": "AWGChannel", 
          "x__module__": "instruments.AWGBase"
        }, 
        {
          "amplitude": 0.5, 
          "enabled": true, 
          "label": "", 
          "offset": -0.0014, 
          "x__class__": "AWGChannel", 
          "x__module__": "instruments.AWGBase"
        }
      ], 
      "delay": 0.0, 
      "enabled": true, 
      "isMaster": true, 
      "label": "APS", 
      "miniLLRepeat": 0, 
      "numChannels": 4, 
      "samplingRate": 1200000000.0, 
      "seqFile": "C:/Users/Caleb/Development/BBN/AWG/Bias/bias-APS.h5", 
      "seqForce": true, 
      "triggerInterval": 0.01, 
      "triggerSource": "External", 
      "x__class__": "APS", 
      "x__module__": "instruments.drivers.APS"
    }

ChannelParams.json

{
  "channelDict": {
    "APS-12": {
      "AWG": "APS", 
      "IChannel": "", 
      "QChannel": "", 
      "ampFactor": 1.0, 
      "delay": 0.0, 
      "enabled": true, 
      "generator": "MXG", 
      "label": "APS-12", 
      "phaseSkew": 0.0, 
      "x__class__": "PhysicalQuadratureChannel", 
      "x__module__": "QGL.Channels"
    }, 
    "APS-1m1": {
      "AWG": "APS", 
      "delay": 0.0, 
      "enabled": true, 
      "gateBuffer": 0.0, 
      "gateMinWidth": 1e-09, 
      "label": "APS-1m1", 
      "x__class__": "PhysicalMarkerChannel", 
      "x__module__": "QGL.Channels"
    }, 
    "APS-2m1": {
      "AWG": "APS", 
      "delay": 0.0, 
      "enabled": true, 
      "gateBuffer": 0.0, 
      "gateMinWidth": 1e-09, 
      "label": "APS-2m1", 
      "x__class__": "PhysicalMarkerChannel", 
      "x__module__": "QGL.Channels"
    }, 
    "APS-34": {
      "AWG": "APS", 
      "IChannel": "", 
      "QChannel": "", 
      "ampFactor": 0.65, 
      "delay": 0.0, 
      "enabled": true, 
      "generator": "Labbrick", 
      "label": "APS-34", 
      "phaseSkew": -30.0, 
      "x__class__": "PhysicalQuadratureChannel", 
      "x__module__": "QGL.Channels"
    }, 
    "APS-3m1": {
      "AWG": "APS", 
      "delay": 0.0, 
      "enabled": true, 
      "gateBuffer": 0.0, 
      "gateMinWidth": 1e-09, 
      "label": "APS-3m1", 
      "x__class__": "PhysicalMarkerChannel", 
      "x__module__": "QGL.Channels"
    }, 
    "APS-4m1": {
      "AWG": "APS", 
      "delay": 0.0, 
      "enabled": true, 
      "gateBuffer": 0.0, 
      "gateMinWidth": 1e-09, 
      "label": "APS-4m1", 
      "x__class__": "PhysicalMarkerChannel", 
      "x__module__": "QGL.Channels"
    }, 
    "M-q1": {
      "autodyneFreq": 19000000.0, 
      "enabled": true, 
      "frequency": 19000000.0, 
      "gateChan": "MTrig", 
      "label": "M-q1", 
      "measType": "autodyne", 
      "physChan": "APS-34", 
      "pulseParams": {
        "amp": 1.0, 
        "cutoff": 2, 
        "length": 1e-06, 
        "shapeFun": "tanh", 
        "sigma": 1e-09
      }, 
      "trigChan": "MTrig", 
      "x__class__": "Measurement", 
      "x__module__": "QGL.Channels"
    }, 
    "MTrig": {
      "enabled": true, 
      "label": "MTrig", 
      "physChan": "APS-3m1", 
      "pulseParams": {
        "length": 5e-07, 
        "shapeFun": "square"
      }, 
      "x__class__": "LogicalMarkerChannel", 
      "x__module__": "QGL.Channels"
    }, 
    "digitizerTrig": {
      "enabled": true, 
      "label": "digitizerTrig", 
      "physChan": "APS-4m1", 
      "pulseParams": {
        "length": 1e-07, 
        "shapeFun": "square"
      }, 
      "x__class__": "LogicalMarkerChannel", 
      "x__module__": "QGL.Channels"
    }, 
    "jpm1": {
      "enabled": true, 
      "frequency": 0.0, 
      "gateChan": "q1Trig", 
      "label": "jpm1", 
      "physChan": "APS-12", 
      "pulseParams": {
        "amp": 1.0, 
        "buffer": 0.0, 
        "cutoff": 2, 
        "dragScaling": 0, 
        "length": 5e-09, 
        "shapeFun": "gaussian", 
        "sigma": 5e-09
      }, 
      "x__class__": "JPM", 
      "x__module__": "QGL.JPMChannels"
    }, 
    "q1": {
      "enabled": true, 
      "frequency": 0.0, 
      "gateChan": "q1Trig", 
      "label": "q1", 
      "physChan": "APS-12", 
      "pulseParams": {
        "cutoff": 2, 
        "dragScaling": 0, 
        "length": 2e-08, 
        "pi2Amp": 0.5, 
        "piAmp": 1.0, 
        "shapeFun": "gaussian", 
        "sigma": 5e-09
      }, 
      "x__class__": "Qubit", 
      "x__module__": "QGL.Channels"
    }, 
    "q1Trig": {
      "enabled": true, 
      "label": "q1Trig", 
      "physChan": "APS-2m1", 
      "pulseParams": {
        "length": 1e-07, 
        "shapeFun": "square"
      }, 
      "x__class__": "LogicalMarkerChannel", 
      "x__module__": "QGL.Channels"
    }, 
    "slaveTrig": {
      "enabled": true, 
      "label": "slaveTrig", 
      "physChan": "APS-1m1", 
      "pulseParams": {
        "length": 1e-07, 
        "shapeFun": "square"
      }, 
      "x__class__": "LogicalMarkerChannel", 
      "x__module__": "QGL.Channels"
    }
  }, 
  "version": 3, 
  "x__class__": "ChannelLibrary", 
  "x__module__": "QGL.Channels"
}
caryan commented 8 years ago

@calebjordan thanks for the detailed issue. APS.loadConfig only loads a sequence file so it's not clear to me how your setting all the other parameters for the APS - in particular the setRunMode or triggerSource. It looks to me like you're just playing out the entire 32k sample waveform library.

Could you try something like (from memory and not tested live):

aps = APS();
aps.connect('A6001nBT');
aps.stop();
aps.loadConfig('C:/Users/Caleb/Development/BBN/AWG/Bias/bias-APS.h5');
aps.setRunMode(1,1);
aps.setRunMode(1,3);
aps.triggerSource = 'external';
aps.run()
calebjordan commented 8 years ago

@caryan , adding setRunMode lines doesn't change anything. I still have to make my pulses add up to ~30us or I get repeated waveforms.

I also don't quite understand what those lines do. According to read the docs,

setRunMode(channel, mode)

Inputs integer channel - target channel (1-4); integer mode - RUN_WAVEFORM (0) or RUN_SEQUENCE (1)

Description Sets the run mode to either directly output the contents of waveform memory, or to function as a pulse sequencer, stepping through the loaded link list entries.

Are the arguments just swapped in aps.setRunMode(1,3);? And aren't I trying to play a waveform, rather than a sequence?

I've tried every combination of setRunMode and setRepeatMode. Nothing seems to change this behavior.

caryan commented 8 years ago

@calebjordan if can you add the h5 sequence file you're trying to play to the issue I can try it here and see what's going on.

calebjordan commented 8 years ago

Here's a sample .h5.

slow-APS.zip

Compiled Pulse: pulse2

Matlab Code

>> aps = APS();aps.connect('A6001nBT');
>> aps.stop();aps.setRunMode(1, 1);aps.setRunMode(1, 3);
>> aps.triggerSource = 'external'
>> aps.stop();aps.loadConfig('C:/Users/Caleb/Development/BBN/AWG/Bias/slow-APS.h5');aps.run()

Result: img_1188 1

blakejohnson commented 8 years ago

Yes, Colm swapped the argument order. It should be aps.setRunMode(3,1). Or spelled differently, aps.setRunMode(3, aps.RUN_SEQUENCE).

If you call loadConfig(), then you are using sequence mode. loadWaveform() is used for waveform mode.

matthewware commented 8 years ago

Could this have anything to do with the hardware being a DACII and not an APS? I wasn't able to reproduce this behavior with an APS unit. I will try in a bit with a DACII.

calebjordan commented 8 years ago

I also get the same result when running with expManager, which I imagine would intelligently configure things. And this happens with both of these DACIIs.