예제 #1
0
 def test_optimize_integer_fiducials_slack_insufficient_fiducials(self):
     insuff_fids = pc.circuit_list([('Gx',)])
     weights = np.ones(len(insuff_fids), 'i')
     fiducials = fs.optimize_integer_fiducials_slack(
         self.model, insuff_fids, fixedSlack=0.1,
         initialWeights=weights, **self.options
     )
     self.assertIsNone(fiducials)
예제 #2
0
 def test_optimize_integer_fiducials_slack_force_empty(self):
     fiducials = fs.optimize_integer_fiducials_slack(
         self.model, self.fiducials, slackFrac=0.1, fixedNum=4,
         forceEmpty=False, **self.options
     )
예제 #3
0
 def test_optimize_integer_fiducials_slack_low_max_iterations(self):
     fiducials = fs.optimize_integer_fiducials_slack(
         self.model, self.fiducials, slackFrac=0.1, maxIter=1,
         **self.options
     )
예제 #4
0
 def test_optimize_integer_fiducials_slack_worst_score_func(self):
     fiducials = fs.optimize_integer_fiducials_slack(
         self.model, self.fiducials, slackFrac=0.1,
         scoreFunc='worst', **self.options
     )
예제 #5
0
 def test_optimize_integer_fiducials_slack_fixed_num(self):
     fiducials = fs.optimize_integer_fiducials_slack(
         self.model, self.fiducials, slackFrac=0.1, fixedNum=4,
         **self.options
     )
예제 #6
0
 def test_optimize_integer_fiducials_slack_initial_weights(self):
     weights = np.ones(len(self.fiducials), 'i')
     fiducials = fs.optimize_integer_fiducials_slack(
         self.model, self.fiducials, fixedSlack=0.1,
         initialWeights=weights, **self.options
     )
예제 #7
0
 def test_optimize_integer_fiducials_slack_return_all(self):
     fiducials, weights, scores = fs.optimize_integer_fiducials_slack(
         self.model, self.fiducials, slackFrac=0.1, returnAll=True,
         **self.options
     )
예제 #8
0
 def test_optimize_integer_fiducials_slack_fixed(self):
     fiducials = fs.optimize_integer_fiducials_slack(
         self.model, self.fiducials, fixedSlack=0.1, **self.options
     )
예제 #9
0
 def test_optimize_integer_fiducials_slack_frac(self):
     fiducials = fs.optimize_integer_fiducials_slack(
         self.model, self.fiducials, slackFrac=0.1, **self.options
     )
예제 #10
0
 def setUp(self):
     super(_TestFiducialListBase, self).setUp()
     self.fiducials_list = fs.optimize_integer_fiducials_slack(
         self.model, self.fiducials,
         prepOrMeas=self.prep_or_meas, slackFrac=0.1
     )
예제 #11
0
 def test_optimize_integer_fiducials_slack_raises_on_missing_method(self):
     with self.assertRaises(Exception):
         fs.optimize_integer_fiducials_slack(self.model, self.fiducials, fixedSlack=0.1)
예제 #12
0
 def test_optimize_integer_fiducials_slack_raises_on_missing_slack_param(self):
     with self.assertRaises(ValueError):
         fs.optimize_integer_fiducials_slack(self.model, self.fiducials, **self.options)