Skip to content

Commit

Permalink
Add RandomClifford to set of random pulses. -GR
Browse files Browse the repository at this point in the history
  • Loading branch information
gribeill committed Jul 19, 2019
1 parent 1651cf2 commit e7b6aac
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion QGL/Compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 10 additions & 2 deletions QGL/PulsePrimitives.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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):
"""
Expand Down
2 changes: 1 addition & 1 deletion QGL/RandomCliffordTools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down
1 change: 1 addition & 0 deletions QGL/drivers/APS2Pattern.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e7b6aac

Please sign in to comment.