Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

css_decode_sim giving wrong results #61

Open
qodesign opened this issue Jan 19, 2025 · 0 comments
Open

css_decode_sim giving wrong results #61

qodesign opened this issue Jan 19, 2025 · 0 comments

Comments

@qodesign
Copy link

Still trying to duplicate the curves in figure 5 of your paper : https://arxiv.org/abs/2005.07016

test0.json
test1.json

but now I'm seeing something that doesn't make sense : lower physical error rate is producing higher logical error rate :

import numpy as np
import bposd
from bposd.css import css_code
from bposd.hgp import hgp
from bposd.css_decode_sim import css_decode_sim
import ldpc.codes
from ldpc.bposd_decoder import BpOsdDecoder

def TestOsd(codeid,osdopts):
 if(codeid==1):
  h=[
   [1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0],
   [0,0,1,0,0,0,1,1,0,0,0,0,1,0,0,0],
   [0,0,0,1,1,0,1,0,0,0,0,0,0,1,0,0],
   [0,0,0,0,0,1,0,0,1,1,0,0,0,0,0,1],
   [0,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0],
   [0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,0],
   [1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1],
   [0,0,0,1,0,1,0,0,0,0,1,0,1,0,0,0],
   [0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,1],
   [0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0],
   [0,1,0,0,0,0,1,0,0,0,1,0,0,0,1,0],
   [1,0,1,0,0,0,0,0,0,1,0,0,0,0,1,0]]
 if(codeid==2):
  h=[
   [0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1],
   [0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,1],
   [0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,1,1,0,0,0],
   [0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,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1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0],
   [0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0],
   [0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0],
   [1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0],
   [0,0,1,0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0],
   [0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,1,0,0],
   [0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,1,0,0,0,0,0,0],
   [0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1,0,0,0]]
 code=hgp(h1=h,h2=h,compute_distance=True)
 code.test()
 if(osdopts==0):
  osd_options = {
    "error_rate": 0.01,
    "target_runs": 1000,
    "bp_method": "minimum_sum",
    "ms_scaling_factor": 0,
    "osd_method": "osd0",
    "osd_order": 0,
    "channel_update": None,
    "seed": 60,
    "max_iter": 0,
    "output_file": "test0.json",
  }
 if(osdopts==1):
  osd_options = {
    "error_rate": 0.001,
    "target_runs": 1000,
    "bp_method": "minimum_sum",
    "ms_scaling_factor": 0,
    "osd_method": "osd0",
    "osd_order": 0,
    "channel_update": None,
    "seed": 60,
    "max_iter": 0,
    "output_file": "test1.json",
  }
 lk = css_decode_sim(hx=code.hx, hz=code.hz, **osd_options)

TestOsd(1,0)
TestOsd(1,1)

with error_rate=0.01 the results are in test0.json (attached but pulled out this partial data )
"bp_logical_error_rate": 0.04700000000000004,
"error_rate": 0.01,

with error_rate=0.001, (from test1.json) :
"bp_logical_error_rate": 0.21399999999999997,
"error_rate": 0.001,

This can't be right...you'd expect lower logical error rate with lower phyiscal error rate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant