diff --git a/QGL/PatternUtils.py b/QGL/PatternUtils.py index 3cbac307..48bb4972 100644 --- a/QGL/PatternUtils.py +++ b/QGL/PatternUtils.py @@ -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 @@ -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): @@ -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'], diff --git a/QGL/PulsePrimitives.py b/QGL/PulsePrimitives.py index 21ea75e3..151d96f3 100644 --- a/QGL/PulsePrimitives.py +++ b/QGL/PulsePrimitives.py @@ -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 diff --git a/QGL/__init__.py b/QGL/__init__.py index 4a0e9673..c66ce01f 100644 --- a/QGL/__init__.py +++ b/QGL/__init__.py @@ -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 diff --git a/tests/test_Compiler.py b/tests/test_Compiler.py index 246c5de5..8c1bd9c7 100644 --- a/tests/test_Compiler.py +++ b/tests/test_Compiler.py @@ -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 diff --git a/tests/test_QGL.py b/tests/test_QGL.py index 702e7976..89615e54 100644 --- a/tests/test_QGL.py +++ b/tests/test_QGL.py @@ -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)