codes.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:neural-decoder 作者: Krastanov 项目源码 文件源码
def sample(L, p, samples=1000, cutoff=200):
    '''Repeated single shot corrections for the toric code with perfect measurements.

    Return an array of nb of cycles until failure for a given L and p.'''
    results = []
    for _ in trange(samples, desc='%d; %.2f'%(L,p), leave=False):
        code = ToricCode(L)
        i = 1
        while code.step_error_and_perfect_correction(p) and i<cutoff:
            i+=1
        results.append(i)
    return np.array(results, dtype=int)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号