Skip to content

Commit

Permalink
Add diatomic two qubit RB sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
gribeill committed Jan 30, 2020
1 parent ac9a060 commit 623f8b5
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 1 deletion.
38 changes: 38 additions & 0 deletions QGL/BasicSequences/RB.py
Expand Up @@ -174,6 +174,44 @@ def TwoQubitRB(q1, q2, seqs, showPlot=False, suffix="", add_cals=True):
plot_pulse_files(metafile)
return metafile

def TwoQubitRB_DiAC(q1, q2, seqs, showPlot=False, suffix="", add_cals=True):
"""Two qubit randomized benchmarking using 90 and 180 single qubit generators and ZX90
Parameters
----------
qubit : logical channel to implement sequence (LogicalChannel)
seqs : list of lists of Clifford group integers
showPlot : whether to plot (boolean)
suffix : suffix to apply to sequence file names
"""
seqsBis = []
for seq in seqs:
seqsBis.append(reduce(operator.add, [clifford_seq_diatomic(c, q2, q1)
for c in seq]))

#Add the measurement to all sequences
for seq in seqsBis:
seq.append(MEAS(q1) * MEAS(q2))

axis_descriptor = [{
'name': 'length',
'unit': None,
'points': list(map(len, seqs)),
'partition': 1
}]

#Tack on the calibration sequences
if add_cals:
seqsBis += create_cal_seqs((q1, q2), 2)
axis_descriptor.append(cal_descriptor((q1, q2), 2))

metafile = compile_to_hardware(seqsBis, 'RB/RB', axis_descriptor = axis_descriptor, suffix = suffix, extra_meta = {'sequences':seqs})

if showPlot:
plot_pulse_files(metafile)
return metafile


def TwoQubitLeakageRB(q1, q2, meas_qubit, seqs, pi2args, showPlot=False):
"""Two qubit randomized benchmarking using 90 and 180 single qubit generators and ZX90 to
measure leakage outside the qubit subspace.
Expand Down
2 changes: 1 addition & 1 deletion QGL/BasicSequences/__init__.py
Expand Up @@ -2,7 +2,7 @@
from .T1T2 import Ramsey, InversionRecovery
from .FlipFlop import FlipFlop
from .SPAM import SPAM
from .RB import create_RB_seqs, SingleQubitRB, SingleQubitRB_AC, SingleQubitRB_DiAC, SingleQubitIRB_AC, SimultaneousRB_AC, SingleQubitRBT, TwoQubitRB
from .RB import create_RB_seqs, SingleQubitRB, SingleQubitRB_AC, SingleQubitRB_DiAC, SingleQubitIRB_AC, SimultaneousRB_AC, SingleQubitRBT, TwoQubitRB, TwoQubitRB_DiAC
from .Decoupling import HahnEcho, CPMG
from .helpers import create_cal_seqs, delay_descriptor, cal_descriptor
from .CR import EchoCRPhase, EchoCRLen, EchoCRAmp, PiRabi
Expand Down
10 changes: 10 additions & 0 deletions QGL/Cliffords.py
Expand Up @@ -222,6 +222,16 @@ def clifford_seq(c, q1, q2=None):
seq += [Cx2(c[2][0], c[2][1], q1, q2)]
return seq

def clifford_seq_diatomic(c, q1, q2):
c = C2Seqs[c]

seq = [DiAC(q1, c[0][0], compiled=False)*DiAC(q2, c[0][1], compiled=False)]
if c[1]:
seq += entangling_seq(c[1], q1, q2)
if c[2]:
seq += [DiAC(q1, c[2][0], compiled=False)*DiAC(q2, c[2][1], compiled=False)]
return seq


@memoize
def clifford_mat(c, numQubits):
Expand Down

0 comments on commit 623f8b5

Please sign in to comment.