From be3afbe2eba6cc7072cc3fa6627f88a46cdd303a Mon Sep 17 00:00:00 2001 From: "Blake R. Johnson" Date: Fri, 10 Jun 2016 16:04:31 -0400 Subject: [PATCH] Set isTimeAmp in Pulse constructor. Examines the shapeFun for the special "square" and "constant" pulse shapes. --- QGL/Compiler.py | 2 +- QGL/PulseSequencer.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/QGL/Compiler.py b/QGL/Compiler.py index e3fb8357..21b4ef0d 100644 --- a/QGL/Compiler.py +++ b/QGL/Compiler.py @@ -551,7 +551,7 @@ def isZero(self): def schedule(channel, pulse, blockLength, alignment): ''' Converts a Pulse or a CompositePulses into an aligned sequence of Pulses - by injecting TAPulses before and/or after such that the resulting sequence + by injecting Ids before and/or after such that the resulting sequence duration is `blockLength`. alignment = "left", "right", or "center" ''' diff --git a/QGL/PulseSequencer.py b/QGL/PulseSequencer.py index b0d41d32..28e6a3e4 100644 --- a/QGL/PulseSequencer.py +++ b/QGL/PulseSequencer.py @@ -57,6 +57,9 @@ def __init__(self, label, channel, shapeParams, amp=1.0, phase=0, frameChange=0) for param in requiredParams: if param not in shapeParams.keys(): raise NameError("shapeParams must include {0}".format(param)) + if (self.shapeParams['shapeFun'] == PulseShapes.constant or + self.shapeParams['shapeFun'] == PulseShapes.square): + self.isTimeAmp = True def __repr__(self): return "Pulse({0}, {1}, {2}, {3}, {4}, {5})".format( @@ -132,7 +135,6 @@ def TAPulse(label, channel, length, amp, phase=0, frameChange=0): ''' params = {'length': length, 'shapeFun': PulseShapes.constant} p = Pulse(label, channel, params, amp, phase, frameChange) - p.isTimeAmp = True return p class CompositePulse(object):