From 96875622c6b0e6f98a91ddeecaaa17b66dbc5a87 Mon Sep 17 00:00:00 2001 From: "Martin R. Albrecht" Date: Wed, 26 Oct 2022 10:31:17 +0100 Subject: [PATCH] fix the fix --- estimator/gb.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/estimator/gb.py b/estimator/gb.py index b0c0021..5200f77 100644 --- a/estimator/gb.py +++ b/estimator/gb.py @@ -121,22 +121,21 @@ def cost_Gaussian_like(cls, params, success_probability=0.99, omega=2, log_level assert C >= 1 # if C is too small, we ignore it # Pr[success]^m = Pr[overall success] single_prob = AroraGB.ps_single(C) - if success_probability > single_prob: - m_req = log(success_probability, 2) / log(single_prob, 2) - m_req = floor(m_req) + if single_prob == 1: + m_can = 2**31 # some arbitrary max else: - m_req = 1 - - if m_req > params.m: + m_can = log(success_probability, 2) / log(single_prob, 2) + m_can = floor(m_can) + if m_can > params.m: break - current = gb_cost(params.n, [(d, m_req)] + dn, omega) + current = gb_cost(params.n, [(d, m_can)] + dn, omega) if current["dreg"] == oo: continue current["t"] = t - current["m"] = m_req + current["m"] = m_can current.register_impermanent(t=False, m=True) current = current.reorder("rop", "m", "dreg", "t")