Exemplo n.º 1
0
 def test_stdpractice_gst_raises_on_bad_mode(self):
     with self.assertRaises(ValueError):
         result = ls.do_stdpractice_gst(self.ds,
                                        self.model,
                                        self.fiducials,
                                        self.fiducials,
                                        self.germs,
                                        self.maxLens,
                                        modes="Foobar")
Exemplo n.º 2
0
 def test_stdpractice_gst_pickle_output(self):
     with BytesIO() as pickle_stream:
         result = ls.do_stdpractice_gst(self.ds,
                                        self.model,
                                        self.fiducials,
                                        self.fiducials,
                                        self.germs,
                                        self.maxLens,
                                        modes="Target",
                                        output_pkl=pickle_stream)
         self.assertTrue(len(pickle_stream.getvalue()) > 0)
Exemplo n.º 3
0
 def test_stdpractice_gst_Target(self):
     result = ls.do_stdpractice_gst(self.ds,
                                    self.model,
                                    self.fiducials,
                                    self.fiducials,
                                    self.germs,
                                    self.maxLens,
                                    modes="Target",
                                    modelsToTest={"Test": self.mdl_guess},
                                    comm=None,
                                    memLimit=None,
                                    verbosity=5)
Exemplo n.º 4
0
    def test_stdpractice_gst_file_args(self, ds_path, model_path,
                                       fiducial_path, germ_path):
        io.write_dataset(ds_path, self.ds, self.lsgstStrings[-1])
        io.write_model(self.model, model_path)
        io.write_circuit_list(fiducial_path, self.fiducials)
        io.write_circuit_list(germ_path, self.germs)

        result = ls.do_stdpractice_gst(ds_path,
                                       model_path,
                                       fiducial_path,
                                       fiducial_path,
                                       germ_path,
                                       self.maxLens,
                                       modes="TP",
                                       comm=None,
                                       memLimit=None,
                                       verbosity=5)
Exemplo n.º 5
0
 def test_stdpractice_gst_advanced_options(self):
     result = ls.do_stdpractice_gst(
         self.ds,
         self.model,
         self.fiducials,
         self.fiducials,
         self.germs,
         self.maxLens,
         modes="TP",
         comm=None,
         memLimit=None,
         verbosity=5,
         advancedOptions={
             'all': {
                 'objective': 'chi2',
                 'badFitThreshold':
                 -100,  # so we create a robust estimate and convey guage opt to it.
                 'onBadFit': ["robust"]
             }
         })
Exemplo n.º 6
0
 def test_stdpractice_gst_gaugeOptTarget(self):
     myGaugeOptSuiteDict = {
         'MyGaugeOpt': {
             'itemWeights': {
                 'gates': 1,
                 'spam': 0.0001
             }
         }
     }
     result = ls.do_stdpractice_gst(self.ds,
                                    self.model,
                                    self.fiducials,
                                    self.fiducials,
                                    self.germs,
                                    self.maxLens,
                                    modes="TP",
                                    comm=None,
                                    memLimit=None,
                                    verbosity=5,
                                    gaugeOptTarget=self.mdl_guess,
                                    gaugeOptSuite=myGaugeOptSuiteDict)
Exemplo n.º 7
0
 def test_stdpractice_gst_gaugeOptTarget_warns_on_target_override(self):
     myGaugeOptSuiteDict = {
         'MyGaugeOpt': {
             'itemWeights': {
                 'gates': 1,
                 'spam': 0.0001
             },
             'targetModel': self.
             model  # to test overriding internal target model (prints a warning)
         }
     }
     with self.assertWarns(Warning):
         result = ls.do_stdpractice_gst(self.ds,
                                        self.model,
                                        self.fiducials,
                                        self.fiducials,
                                        self.germs,
                                        self.maxLens,
                                        modes="TP",
                                        comm=None,
                                        memLimit=None,
                                        verbosity=5,
                                        gaugeOptTarget=self.mdl_guess,
                                        gaugeOptSuite=myGaugeOptSuiteDict)