Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def gst_2Qgate_map(q1, q2):
return {"Gxi": X90(q1)*Id(q2),
"Gyi": Y90(q1)*Id(q2),
"Gii": Id(q1)*Id(q2),
"Gix": Id(q1)*X90(q2),
"Giy": Id(q1)*Y90(q2),
"Gcnot": CNOT_CR(q2,q1)}
if GSTTools.PYGSTI_PRESENT:
import pygsti
from pygsti.construction import std1Q_XYI, std2Q_XYICNOT
from itertools import product
from QGL.GSTTools import SingleQubitCliffordGST, gst_map_2Q
# note the use of the germs_lite!
gs = std2Q_XYICNOT
gs_target = std2Q_XYICNOT.gs_target.copy()
prep_fiducials = std2Q_XYICNOT.prepStrs
effect_fiducials = std2Q_XYICNOT.effectStrs
gs_germs = std2Q_XYICNOT.germs_lite
#maxLengths = [1,2,4,8,16]
maxLengths = [1,2]
print('Creating GST sequences...')
listOfExperiments = pygsti.construction.make_lsgst_experiment_list(gs_target.gates.keys(), prep_fiducials, effect_fiducials, gs_germs, maxLengths)
else:
# list of GST gate strings
listOfExperiments = list(np.load('tests/test_data/awg/TestAPS2/GST/GST2Q/listOfExperiments.npy'))
seqs = list(GSTTools.gst_map_2Q(listOfExperiments, (self.q1, self.q2), qgl_map = gst_2Qgate_map(self.q1, self.q2), append_meas=True))
filenames = compile_to_hardware(seqs, 'GST/GST2Q')