How to use the pygsti.construction function in pyGSTi

To help you get started, we’ve selected a few pyGSTi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BBN-Q / QGL / tests / test_Sequences.py View on Github external
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')
        self.compare_sequences('GST2Q')
github BBN-Q / QGL / tests / test_Sequences.py View on Github external
raise unittest.SkipTest("FIX ME -- Figure out pygsti integration for Travis.")

        self.set_awg_dir('GST')
        # list of GST gate strings
        if GSTTools.PYGSTI_PRESENT:
            # generate the gate gatestrings
            import pygsti
            from pygsti.construction import std1Q_XYI

            #Create a data set
            gs_target = std1Q_XYI.gs_target
            fiducials = std1Q_XYI.fiducials
            germs = std1Q_XYI.germs
            maxLengths = [1,2,4]

            listOfExperiments = pygsti.construction.make_lsgst_experiment_list(gs_target.gates.keys(), fiducials, fiducials, germs, maxLengths)
        else:
            listOfExperiments = list(np.load('tests/test_data/awg/TestAPS2/GST/GST/listOfExperiments.npy'))

        seqs = list(GSTTools.gst_map_1Q(listOfExperiments, self.q1))
        filenames = compile_to_hardware(seqs, 'GST/GST')
        self.compare_sequences('GST')