Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Ristè committed Apr 11, 2018
1 parent 33651f9 commit eff4e7d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions QGL/PatternUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import pickle
from copy import copy

from .PulseSequencer import Pulse, TAPulse, PulseBlock, CompositePulse, CompoundGate, align_p
from .PulseSequencer import Pulse, TAPulse, PulseBlock, CompositePulse, CompoundGate, align
from .PulsePrimitives import BLANK
from . import ControlFlow
from . import BlockLabel
Expand Down Expand Up @@ -201,7 +201,7 @@ def add_digitizer_trigger(seqs):
trig_chan = chan.trig_chan
if not (hasattr(seq[ct], 'pulses') and
trig_chan in seq[ct].pulses.keys()):
seq[ct] = align_p('left', seq[ct], TAPulse("TRIG", trig_chan, trig_chan.pulse_params['length'], 1.0, 0.0, 0.0))
seq[ct] = align('left', seq[ct], TAPulse("TRIG", trig_chan, trig_chan.pulse_params['length'], 1.0, 0.0, 0.0))


def contains_measurement(entry):
Expand All @@ -227,7 +227,7 @@ def add_slave_trigger(seqs, slaveChan):
while ct < len(seq) - 1:
if isinstance(seq[ct], ControlFlow.Wait):
try:
seq[ct + 1] = align_p('left', seq[ct + 1], TAPulse("TRIG", slaveChan, slaveChan.pulse_params['length'], 1.0, 0.0, 0.0))
seq[ct + 1] = align('left', seq[ct + 1], TAPulse("TRIG", slaveChan, slaveChan.pulse_params['length'], 1.0, 0.0, 0.0))
except:
seq.insert(ct + 1, TAPulse("TRIG", slaveChan,
slaveChan.pulse_params['length'],
Expand Down
12 changes: 6 additions & 6 deletions QGL/PulsePrimitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -753,18 +753,18 @@ def MeasEcho(qM, qD, delay, piShift=None, phase=0):
measChan = ChannelLibraries.MeasFactory('M-%s' % qM.label)
if piShift:
if piShift > 0:
measEcho = align(
measEcho =
(MEAS(qM) + TAPulse('Id', measChan, delay, 0)) *
reduce(operator.mul,
[Id(q, piShift) + U(q, phase=phase) for q in qD]))
[Id(q, piShift) + U(q, phase=phase) for q in qD])
elif piShift < 0:
measEcho = align(
measEcho =
(MEAS(qM) + TAPulse('Id', measChan, delay, 0)) *
reduce(operator.mul,
[U(q, phase=phase) + Id(q, -piShift) for q in qD]))
[U(q, phase=phase) + Id(q, -piShift) for q in qD])
else:
measEcho = align((MEAS(qM) + TAPulse('Id', measChan, delay, 0)) *
reduce(operator.mul, [U(q, phase=phase) for q in qD]))
measEcho = (MEAS(qM) + TAPulse('Id', measChan, delay, 0)) *
reduce(operator.mul, [U(q, phase=phase) for q in qD])
measEcho.label = 'MEAS' #to generate the digitizer trigger
return measEcho

Expand Down
2 changes: 1 addition & 1 deletion QGL/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from .ChannelLibraries import QubitFactory, MeasFactory, EdgeFactory, MarkerFactory, ChannelLibrary, channelLib
from .PulsePrimitives import *
from .Compiler import compile_to_hardware, set_log_level
from .PulseSequencer import align, align_p
from .PulseSequencer import align, align
from .ControlFlow import repeat, repeatall, qif, qwhile, qdowhile, qfunction, qwait, qsync, Barrier
from .BasicSequences import *
from .Plotting import output_file, output_notebook, show, build_waveforms, plot_waveforms
Expand Down
2 changes: 1 addition & 1 deletion tests/test_Compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_add_slave_trigger(self):
assert (seq1 == [qwait(), t, label, X90(q1)])

PatternUtils.add_slave_trigger([seq2], trigger)
assert (seq2 == [qwait(), align_p('left', X90(q1), t)])
assert (seq2 == [qwait(), align('left', X90(q1), t)])

def test_concatenate_entries(self):
q1 = self.q1
Expand Down
2 changes: 1 addition & 1 deletion tests/test_QGL.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def generate(self):
self.sequences['operators'] = [X90(q1), X(q1) * Y(q2), CNOT_simple(q1, q2),
Xm(q2), Y(q1) * X(q2)]

self.sequences['align'] = [align_p('right',
self.sequences['align'] = [align('right',
X90(q1), Xtheta(q2, amp=0.5, length=100e-9)), Y90(q1) * Y90(q2)]

flipFlop = X(q1) + X(q1)
Expand Down

0 comments on commit eff4e7d

Please sign in to comment.