@@ -91,8 +91,8 @@ def create_RB_seqs(numQubits: int,
91
91
92
92
return seqs
93
93
94
- def SingleQubitRB (qubit : Channels .LogicalChannel ,
95
- seqs : List [List [int ]],
94
+ def SingleQubitRB (qubit : Channels .LogicalChannel ,
95
+ seqs : List [List [int ]],
96
96
cliff_type : str = 'std' ,
97
97
purity : bool = False ,
98
98
showPlot : bool = False ,
@@ -166,10 +166,10 @@ def SingleQubitRB(qubit: Channels.LogicalChannel,
166
166
plot_pulse_files (metafile )
167
167
return metafile
168
168
169
- def SingleQubitLeakageRB (qubit : Channels .LogicalChannel ,
169
+ def SingleQubitLeakageRB (qubit : Channels .LogicalChannel ,
170
170
seqs : List [List [int ]],
171
- pi2args : Mapping [int , str ],
172
- cliff_type : str = 'std' ,
171
+ pi2args : Mapping [int , str ],
172
+ cliff_type : str = 'std' ,
173
173
showPlot : bool = False ) -> str :
174
174
"""
175
175
Single qubit randomized benchmarking using 90 and 180 generators to
@@ -254,14 +254,14 @@ def SingleQubitLeakageRB(qubit: Channels.LogicalChannel,
254
254
255
255
256
256
257
- def TwoQubitRB (q1 : Channels .LogicalChannel ,
258
- q2 : Channels .LogicalChannel ,
259
- seqs : List [List [int ]],
257
+ def TwoQubitRB (q1 : Channels .LogicalChannel ,
258
+ q2 : Channels .LogicalChannel ,
259
+ seqs : List [List [int ]],
260
260
meas_qubits : Iterable [Channels .LogicalChannel ] = None ,
261
261
cliff_type : str = 'std' ,
262
262
showPlot : bool = False ,
263
263
suffix : str = "" ,
264
- add_cals : bool = True ) -> str :
264
+ add_cals : bool = True , swap : bool = False ) -> str :
265
265
"""
266
266
Two qubit randomized benchmarking using 90 and 180 single qubit generators
267
267
and ZX90.
@@ -303,7 +303,7 @@ def TwoQubitRB(q1: Channels.LogicalChannel,
303
303
seqsBis = []
304
304
for seq in seqs :
305
305
seqsBis .append (reduce (operator .add ,
306
- [TwoQubitClifford (q2 , q1 , c , kind = cliff_type )
306
+ [TwoQubitClifford (q2 , q1 , c , kind = cliff_type , swap )
307
307
for c in seq ]))
308
308
309
309
#Add the measurement to all sequences
@@ -324,22 +324,22 @@ def TwoQubitRB(q1: Channels.LogicalChannel,
324
324
seqsBis += create_cal_seqs ((q1 , q2 ), 2 , measChans = meas_qubits )
325
325
axis_descriptor .append (cal_descriptor ((q1 , q2 ), 2 ))
326
326
327
- metafile = compile_to_hardware (seqsBis , 'RB/RB' ,
328
- axis_descriptor = axis_descriptor ,
329
- suffix = suffix ,
327
+ metafile = compile_to_hardware (seqsBis , 'RB/RB' ,
328
+ axis_descriptor = axis_descriptor ,
329
+ suffix = suffix ,
330
330
extra_meta = {'sequences' :seqs })
331
331
332
332
if showPlot :
333
333
plot_pulse_files (metafile )
334
334
return metafile
335
335
336
- def TwoQubitLeakageRB (q1 : Channels .LogicalChannel ,
337
- q2 : Channels .LogicalChannel ,
338
- meas_qubit : Iterable [Channels .LogicalChannel ],
339
- seqs : List [List [int ]],
340
- pi2args : Mapping [int , str ],
341
- cliff_type : str = 'std' ,
342
- showPlot : bool = False ) -> str :
336
+ def TwoQubitLeakageRB (q1 : Channels .LogicalChannel ,
337
+ q2 : Channels .LogicalChannel ,
338
+ meas_qubit : Iterable [Channels .LogicalChannel ],
339
+ seqs : List [List [int ]],
340
+ pi2args : Mapping [int , str ],
341
+ cliff_type : str = 'std' ,
342
+ showPlot : bool = False , swap : bool = False ) -> str :
343
343
"""
344
344
Two qubit randomized benchmarking using 90 and 180 single qubit generators
345
345
and ZX90 to measure leakage outside the qubit subspace. See https://
@@ -381,7 +381,7 @@ def TwoQubitLeakageRB(q1: Channels.LogicalChannel,
381
381
seqsBis = []
382
382
for seq in seqs :
383
383
combined_seq = reduce (operator .add ,
384
- [TwoQubitClifford (q2 , q1 , c , kind = cliff_type )
384
+ [TwoQubitClifford (q2 , q1 , c , kind = cliff_type , swap )
385
385
for c in seq ])
386
386
387
387
# Append sequence with tomography ids and measurement
@@ -391,11 +391,11 @@ def TwoQubitLeakageRB(q1: Channels.LogicalChannel,
391
391
seqsBis .append (combined_seq + [X90 (meas_qubit ), X90 (meas_qubit ), MEAS (meas_qubit )])
392
392
393
393
# Add the calibration sequences
394
- seqsBis .append ([Id (meas_qubit ), Id (meas_qubit ), Id (meas_qubit ),
394
+ seqsBis .append ([Id (meas_qubit ), Id (meas_qubit ), Id (meas_qubit ),
395
395
Id (meas_qubit ), MEAS (meas_qubit )])
396
- seqsBis .append ([X90 (meas_qubit ), X90 (meas_qubit ), Id (meas_qubit ),
396
+ seqsBis .append ([X90 (meas_qubit ), X90 (meas_qubit ), Id (meas_qubit ),
397
397
Id (meas_qubit ), MEAS (meas_qubit )])
398
- seqsBis .append ([X90 (meas_qubit ), X90 (meas_qubit ), X90 (meas_qubit , ** pi2args ),
398
+ seqsBis .append ([X90 (meas_qubit ), X90 (meas_qubit ), X90 (meas_qubit , ** pi2args ),
399
399
X90 (meas_qubit , ** pi2args ), MEAS (meas_qubit )])
400
400
401
401
axis_descriptor = [
@@ -421,10 +421,10 @@ def TwoQubitLeakageRB(q1: Channels.LogicalChannel,
421
421
plot_pulse_files (metafile )
422
422
return metafile
423
423
424
- def SimultaneousRB (qubits : Iterable [Channels .LogicalChannel ],
425
- seqs : List [List [int ]],
426
- showPlot : bool = False ,
427
- cliff_type : str = 'std' ,
424
+ def SimultaneousRB (qubits : Iterable [Channels .LogicalChannel ],
425
+ seqs : List [List [int ]],
426
+ showPlot : bool = False ,
427
+ cliff_type : str = 'std' ,
428
428
add_cals : bool = True ) -> str :
429
429
"""
430
430
Simultaneous randomized benchmarking on multiple qubits.
@@ -493,7 +493,7 @@ def SimultaneousRB(qubits: Iterable[Channels.LogicalChannel],
493
493
######################### Depricated ##########################################
494
494
###############################################################################
495
495
496
- # from stackoverflow:
496
+ # from stackoverflow:
497
497
# https://stackoverflow.com/questions/287871/how-to-print-colored-text-in-python
498
498
class bcolors :
499
499
HEADER = '\033 [95m'
@@ -687,7 +687,7 @@ def SingleQubitIRB_AC(qubit, seqFile, showPlot=False):
687
687
>>> mf
688
688
'/path/to/exp/exp-meta.json'
689
689
"""
690
-
690
+
691
691
# warn the user
692
692
deprication (unmaintained_str )
693
693
@@ -755,7 +755,7 @@ def SingleQubitRBT(qubit,
755
755
to compiled machine files
756
756
"""
757
757
#Setup a pulse library
758
-
758
+
759
759
# warn the user
760
760
deprication (unmaintained_str )
761
761
0 commit comments