Skip to content

Commit

Permalink
Merge pull request #253 from BBN-Q/fix/frame-update
Browse files Browse the repository at this point in the history
Apply frame change at start of seq. if necessary
  • Loading branch information
Diego Ristè committed Feb 10, 2020
2 parents d03eb73 + 3442687 commit 0daa7a7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions QGL/Compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,14 @@ def flatten_to_pulses(obj):
updated_frameChange = wires[chan][-ct].frameChange + block.pulses[chan].frameChange
wires[chan][-ct] = wires[chan][-ct]._replace(frameChange=updated_frameChange)
break
# if no non-TA entry, add frame change at first available opportunity, from the start moving forward
if ct == len(wires[chan]):
for ct2 in range(len(wires[chan])):
if hasattr(wires[chan][ct2], 'frameChange'):
if hasattr(wires[chan][ct2], 'isTimeAmp') and wires[chan][ct2].isTimeAmp:
updated_frameChange = wires[chan][ct2].frameChange + block.pulses[chan].frameChange
wires[chan][ct2] = wires[chan][ct2]._replace(frameChange=updated_frameChange)
break # if the first pulse is not an Id left, it should have already been updated
continue
# add the pulses per channel
for chan in channels:
Expand Down

0 comments on commit 0daa7a7

Please sign in to comment.