diff --git a/QGL/Compiler.py b/QGL/Compiler.py index 04a6bfe8..612357bd 100644 --- a/QGL/Compiler.py +++ b/QGL/Compiler.py @@ -236,7 +236,7 @@ def generate_waveforms(physicalWires): wfs[ch][pulse.hashshape()] = pulse.shape return wfs -def get_clifford_type(wire, allowed_types=("RandomAC")): +def get_clifford_type(wire, allowed_types=("RandomAC", "RandomClifford")): rt_pulses = [] for pulse in flatten(wire): if isinstance(pulse, Pulse) and pulse.isRunTime: diff --git a/QGL/PulsePrimitives.py b/QGL/PulsePrimitives.py index a648e044..a4c879a3 100644 --- a/QGL/PulsePrimitives.py +++ b/QGL/PulsePrimitives.py @@ -24,7 +24,6 @@ from .PulseSequencer import Pulse, TAPulse, CompoundGate, align from functools import wraps, reduce - def overrideDefaults(chan, updateParams, ignoredStrParams=['isRunTime', 'maddr', 'moffset']): '''Helper function to update any parameters passed in and fill in the defaults otherwise.''' # The default parameter list depends on the channel type so pull out of channel @@ -116,7 +115,7 @@ def Utheta(qubit, else: # linearly scale based upon the 'pi/2' amplitude amp = (angle / (pi/2)) * qubit.pulse_params['pi2Amp'] - return Pulse(label, qubit, params, amp, phase, 0.0, ignoredStrParams, frequency=frequency, **kwargs) + return Pulse(label, qubit, params, amp, phase, 0.0, ignoredStrParams, frequency=frequency) # generic pulses around X, Y, and Z axes @@ -340,6 +339,10 @@ def arb_axis_drag(qubit, return Pulse(kwargs["label"] if "label" in kwargs else "ArbAxis", qubit, params, 1.0, aziAngle, frameChange) +def RandomClifford(qubit): + params = overrideDefaults(qubit, {}) + return Pulse("RandomClifford", qubit, params, isRunTime=True) + def RandomAC(qubit): params = overrideDefaults(qubit, {}) return Pulse("RandomAC", qubit, params, isRunTime=True) @@ -349,6 +352,11 @@ def RandomDiAC(qubit): params["length"] *= 2.0 return Pulse("RandomDiAC", qubit, params, isRunTime=True) +from . import Cliffords + +def Clifford(qubit, cliffNum): + return reduce(operator.add, [p for p in Cliffords.clifford_seq(cliffNum, qubit)]) + def AC(qubit, cliffNum): """ diff --git a/QGL/RandomCliffordTools.py b/QGL/RandomCliffordTools.py index 82288031..6d202835 100644 --- a/QGL/RandomCliffordTools.py +++ b/QGL/RandomCliffordTools.py @@ -35,7 +35,7 @@ default_clifford_options = {"offset": 0x0, "spacing": 0x1, "seed": 0x31} -VALID_CLIFFORD_TYPES = ('RandomAC',) +VALID_CLIFFORD_TYPES = ('RandomAC', 'RandomClifford') def generate_clifford_jump_table(cliff_wires, jt_label = None): """Generate the jump table that will be used to call into the clifford set""" diff --git a/QGL/drivers/APS2Pattern.py b/QGL/drivers/APS2Pattern.py index a833780f..20bb84fc 100644 --- a/QGL/drivers/APS2Pattern.py +++ b/QGL/drivers/APS2Pattern.py @@ -652,6 +652,7 @@ def inject_modulation_cmds(seqs): mod_seq = [] pending_frame_update = False + force_phase_update = False #check to see if we are in a subroutine by using last instruction as return as a tell #if so, ensure frame updates do not get dropped