Skip to content

Discrepancy in BpOsd decoder default_method between Python bindings docs and underlying C++ implementation#100

Open
jfoliveiraramos wants to merge 1 commit intoquantumgizmos:mainfrom
jfoliveiraramos:fix/bposd-default-method
Open

Discrepancy in BpOsd decoder default_method between Python bindings docs and underlying C++ implementation#100
jfoliveiraramos wants to merge 1 commit intoquantumgizmos:mainfrom
jfoliveiraramos:fix/bposd-default-method

Conversation

@jfoliveiraramos
Copy link
Copy Markdown

@jfoliveiraramos jfoliveiraramos commented Mar 6, 2026

closes #99

Description

There appears to be a mismatch between the Python bindings documentation and the actual behaviour in the underlying C++ code for the BpOsd decoder.

In the Python stub (src_python/ldpc/bp_decoder/__init__.pyi, line 408), the __cinit__ method is depicted as:

def __cinit__(self, pcm: Union[np.ndarray, spmatrix], error_rate: Optional[float] = None,
             error_channel: Optional[List[float]] = None, max_iter: Optional[int] = 0, bp_method: Optional[str] = 'minimum_sum',
             ms_scaling_factor: Optional[float] = 1.0, cutoff: Optional[float] = np.inf, sigma: float = 2.0, **kwargs): ...

However, it seems that the actual C++ implementation is still using product_sum as the default (src_cpp/bp.hpp, line 77)

BpDecoder(
        BpSparse &parity_check_matrix,
        std::vector<double> channel_probabilities,
        int maximum_iterations = 0,
        BpMethod bp_method = PRODUCT_SUM,
        ...

Changes

Assuming the documentation reflects the intended use, these changes change the default value for bp_method for the BPDecoder class in src_cpp/bp.hpp.

@quantumgizmos
Copy link
Copy Markdown
Owner

Hi Joao,

Thanks for pointing this out. I'll test later today.

Joschka

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

Successfully merging this pull request may close these issues.

Discrepancy in BpOsd decoder default_method between Python bindings docs and underlying C++ implementation

2 participants