Skip to content

Commit e16bee4

Browse files
committed
revert unncessary change
1 parent d500a54 commit e16bee4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

pygsti/algorithms/core.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,13 +1007,11 @@ def _do_runopt(objective, optimizer, printer):
10071007
tm = _time.time()
10081008
nDataParams = objective.num_data_params() # TODO - cache this somehow in term-based calcs...
10091009
profiler.add_time("run_gst_fit: num data params", tm)
1010-
desc = objective.description
1010+
10111011
chi2_k_qty = opt_result.chi2_k_distributed_qty # total chi2 or 2*deltaLogL
1012-
if chi2_k_qty > 0:
1012+
desc = objective.description
10131013
# reject GST model if p-value < threshold (~0.05?)
1014-
pvalue = 1.0 - _stats.chi2.cdf(chi2_k_qty, nDataParams - nModelParams)
1015-
else:
1016-
pvalue = 0.0
1014+
pvalue = 1.0 - _stats.chi2.cdf(chi2_k_qty, nDataParams - nModelParams)
10171015
printer.log("%s = %g (%d data params - %d (approx) model params = expected mean of %g; p-value = %g)" %
10181016
(desc, chi2_k_qty, nDataParams, nModelParams, nDataParams - nModelParams, pvalue), 1)
10191017

0 commit comments

Comments
 (0)