コード例 #1
0
ファイル: fpgassbspec.py プロジェクト: yiwenchu/qrlab
from pulseseq import sequencer, pulselib
import sys
import time
import fpgapulses
import fpgameasurement
import YngwieEncoding as ye

N = 101                   # Number of elements in sequence
REPRATE_DELAY = 1200000
CAVPULSE = True
DISP = np.sqrt(2)
dfs = np.linspace(-14e6, 2e6, N)
mask = (dfs != 0)
periods = np.zeros_like(dfs)
periods[mask] = 1e9 / dfs[mask]
m = fpgameasurement.FPGAMeasurement('SSBspec', xs=dfs/1e6, fit_func='gaussian', rrec=False)

s = sequencer.Sequence()

# Old-style
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'))
コード例 #2
0
# Simple script to setup a readout sequence.
# Call m.start_exp() after running this to start FPGA

from pulseseq import sequencer, pulselib
import fpgapulses
import fpgameasurement

REPRATE_DELAY = 250000  # Delay to get a reasonable repetition rate
m = fpgameasurement.FPGAMeasurement('RO')

s = sequencer.Sequence()
s.append(sequencer.Delay(200, label='start'))
#s.append(m.qubit.rotate(np.pi,0))
s.append(fpgapulses.LongMeasurementPulse(label='measure'))
s.append(sequencer.Delay(REPRATE_DELAY, jump='start'))

m.set_seq(s, 1)
m.generate()
コード例 #3
0
ファイル: fpgaT1.py プロジェクト: yiwenchu/qrlab
import numpy as np
from pulseseq import sequencer, pulselib
import sys
import time
import fpgapulses
import fpgameasurement
import YngwieEncoding as ye

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),
コード例 #4
0
ファイル: fpgacool.py プロジェクト: yiwenchu/qrlab
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()
コード例 #5
0
ファイル: fpgawigfunc.py プロジェクト: yiwenchu/qrlab
import numpy as np
from pulseseq import sequencer, pulselib
import sys
import time
import fpgapulses
import fpgameasurement
from YngwieEncoding import *

DMAX = 2
BG = 1
NI = 21
NQ = 21
m = fpgameasurement.FPGAMeasurement('Wfunc',
                                    xs=np.linspace(-DMAX, DMAX, NQ),
                                    ys=np.linspace(-DMAX, DMAX, NI),
                                    qubit_gaussian_chop=5,
                                    bg=BG)
stateprep = m.cavity.displace(1 * np.exp(1j * np.pi / 4))
wigevens = fpgapulses.FPGADetunedSum(m.qubit.rotate.Ipulse,
                                     periods=qubit_periods[0::2],
                                     amps=qubit_amps[0::2])
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
コード例 #6
0
import numpy as np
from pulseseq import sequencer, pulselib
import mclient
import fpgapulses

import fpgameasurement
REPRATE_DELAY = 1000000  # Delay to get a reasonable repetition rate
SELECTIVE = True  # Will calibrate long cavity pulse
UPDATE = True

disps = np.linspace(0.0, 2.0, 26)

m = fpgameasurement.FPGAMeasurement('dispcal',
                                    xs=disps,
                                    probabilities=True,
                                    fit_func='displacement_cal',
                                    fit_func_kwargs=dict(n=0))

s = sequencer.Sequence()
s.append(sequencer.Delay(256, label='start'))
for disp in disps:
    #    s.append(sequencer.Constant(1000, 1, chan='m0'))
    s.append(sequencer.Delay(REPRATE_DELAY))
    if not SELECTIVE:
        s.append(m.cavity.displace(disp))
    else:
        s.append(m.cavity.displace_selective(disp))
    s.append(sequencer.Delay(200))
    s.append(m.qubit.rotate_selective(np.pi, 0))
    s.append(fpgapulses.LongMeasurementPulse())
    s.append(sequencer.Delay(REPRATE_DELAY))
コード例 #7
0
import numpy as np
from pulseseq import sequencer, pulselib
import fpgapulses

import fpgameasurement
REPRATE_DELAY = 1000000  # Delay to get a reasonable repetition rate

delays = np.round(np.linspace(0, 800, 41))
m = fpgameasurement.FPGAMeasurement('cavT1',
                                    xs=delays,
                                    fit_func='cohstate_decay',
                                    fit_func_kwargs=dict(n=0))

s = sequencer.Sequence()
s.append(sequencer.Delay(256, label='start'))
for delay in delays:
    #    s.append(sequencer.Constant(1000, 1, chan='m0'))
    s.append(m.cavity.displace(2.0))  #*np.exp(1j*np.pi/4)))
    if delay != 0:
        s.append(sequencer.Delay(delay * 1000))
    s.append(m.qubit.rotate(np.pi, 0))
    s.append(fpgapulses.LongMeasurementPulse())
    s.append(sequencer.Delay(REPRATE_DELAY - delay * 1000))
s.append(sequencer.Delay(256, jump='start'))

m.set_seq(s, len(delays))
#m.generate(plot=True)
m.start_exp()
m.plot_se()
コード例 #8
0
ファイル: fpgaQfunc.py プロジェクト: yiwenchu/qrlab
import numpy as np
from pulseseq import sequencer, pulselib
import sys
import time
import fpgapulses
import fpgameasurement
from YngwieEncoding import *

DMAX = 2.0
BG = False
NI = 21
NQ = 21
m = fpgameasurement.FPGAMeasurement('Qfunc', xs=np.linspace(-DMAX,DMAX,NQ), ys=np.linspace(-DMAX,DMAX,NI))
stateprep = m.cavity.displace(1.0*np.exp(1j*0*np.pi/4))

REPRATE_DELAY = 2000000      # 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), master_counter0=NI))
s.append(fpgapulses.RegOp(RegisterInstruction.MOVI(2, +Q0), label='Qreset'))
s.append(fpgapulses.RegOp(RegisterInstruction.MOVI(1, -Q0), master_counter1=NQ))
コード例 #9
0
ファイル: fpgaT2.py プロジェクト: yiwenchu/qrlab
import fpgameasurement
import YngwieEncoding as ye

N = 81  # Number of elements in sequence
DT = 750
ECHO = False
DELTA = 0
delays = np.arange(N) * DT
REPRATE_DELAY = 500000  # Delay to get a reasonable repetition rate

if DELTA != 0:
    fitf = 'exp_decay_sine'
else:
    fitf = 'exp_decay' if ECHO else 'exp_decay_sine'

m = fpgameasurement.FPGAMeasurement('T2', xs=delays / 1000., fit_func=fitf)

s = sequencer.Sequence()

# FPGA style, using R13 as dynamic instruction length,
# doesn't include software detuning though.
# There's a bug in pulseseq which requires the extra label _1/_2: we need
# to make sure that the generated delays are not joined.
if 0:
    s.append(
        fpgapulses.RegOp(ye.RegisterInstruction.MOVI(13, 0),
                         master_counter0=N,
                         label='reset'))

    s.append(sequencer.Constant(512, 1, value=1, chan='m0', label='start'))
    s.append(m.qubit.rotate(np.pi / 2, 0, label='_1'))
コード例 #10
0
ファイル: fpgarabi.py プロジェクト: yiwenchu/qrlab
from YngwieEncoding import *

N = 41
UPDATE = True
SELECTIVE = False

if SELECTIVE:
    MAXAMP = 0.1
else:
    MAXAMP = 1.0
amps = np.linspace(0, MAXAMP, N)

# After tuning up single-shot histogramming
m = fpgameasurement.FPGAMeasurement('rabi',
                                    xs=amps,
                                    fit_func='sine',
                                    fit_func_kwargs=dict(dphi=-np.pi / 2),
                                    probabilities=True)

COOL = False

# For initial tune-up, without probabilities
#m = fpgameasurement.FPGAMeasurement('rabi', xs=amps, fit_func='sine', probabilities=False)
#COOL = False

REPRATE_DELAY = 400000  # Delay to get a reasonable repetition rate
PULSE_REP = 1

s = sequencer.Sequence()

# Old-fashioned method