Closed inmzhang closed 8 months ago
Hi. Could you try setting the bp_method='ps_log'
for the simulations in v1? I think the speed of the two versions should be more comparable once this change has been made.
The bp_method='ps'
method uses a version of BP where the messages are computed using probability ratios, rather than log probability ratios. This is quicker, as you can avoid computing the archtanh(x) function need for the LLR version. I haven't implemented the optimised version of product sum for V2, but it is on my todo list.
Cheers, Joschka
Thanks for your reply. After I set bp_method='ps_log'
for v1, the speed of the two version is close.
To test
BpOsdDecoder
inldpc_v2
branch, I sampled and decoded some surface code circuits withsinter
.For the baseline, I used
stimbposd.sinter_decoders()
(which internally usedldpc.bposd_decoder
in v1) to decode the samplings. For v2, awared of #32 , I added theSinterCompiledBpOsdDecoder
as below to use withsinter
:The
MAX_BP_ITERS
/BP_METHOD
/OSD_ORDER
were selected to be consistent with the default ones instimbposd
.Then, I ran the sampling with the following script:
I compared the decoding accuracy and time per shot with v1/v2 implementations, and here is the result:
We can clearly see for the surface code with distance > 3, the decoding time of v2 implementation is slower than v1. I'm not sure whether all the conditions/arguments were equally set in this benchmark for v1 and v2 and I might missed something important.
The environment I used for the test is Ubuntu22.04LTS and Python3.11.4.