Skip to content

Commit

Permalink
Set isTimeAmp in Pulse constructor.
Browse files Browse the repository at this point in the history
Examines the shapeFun for the special "square" and "constant" pulse shapes.
  • Loading branch information
blakejohnson committed Jun 10, 2016
1 parent 501f08f commit be3afbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion QGL/Compiler.py
Expand Up @@ -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"
'''
Expand Down
4 changes: 3 additions & 1 deletion QGL/PulseSequencer.py
Expand Up @@ -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(
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit be3afbe

Please sign in to comment.