@@ -376,48 +376,57 @@ namespace LDPC4QKD {
376376 std::string ecc_type; // this is redundant with `code_id`
377377 };
378378
379- // ! Selects a suitable code among the degree-distribution-based N=819k codes (ids 6-14) //!
380- // ! Branches below are based on aff3ct simulations in `codes/aff3ct_fer_simulations/raw_output`.
381- // ! Only directly-confirmed-safe points are used, in ascending rate order.
379+ // ! Selects a suitable code among the degree-distribution-based N=819k codes (ids 6-14)
380+ // ! Branches below are based on simulations of the default decoder in the repository.
382381 // ! TODO do interpolation, simulate our improved decoder
382+ // ! TODO comment on heuristic
383383 // !
384- // ! \return the suitable code specification, or `std::nullopt` if `ch_param_estimate` is outside the supported QBER range.
384+ // ! \return the suitable code specification,
385+ // ! or `std::nullopt` if `ch_param_estimate` is outside the supported QBER range.
385386 inline std::optional<SuitableCodeChoice> select_819k_code (double ch_param_estimate) {
386387 std::size_t code_id;
387388 std::size_t n_line_combs;
388- if (ch_param_estimate <= 0.0070 ) {
389+ if (ch_param_estimate <= 0.0054 ) {
389390 code_id = 6 ; n_line_combs = 10240 ; // P1, rate-adapted to rate 0.0875
390- } else if (ch_param_estimate <= 0.0104 ) {
391+ } else if (ch_param_estimate <= 0.0094 ) {
391392 code_id = 6 ; n_line_combs = 0 ; // P1 native, rate 0.10
392- } else if (ch_param_estimate <= 0.0190 ) {
393+ } else if (ch_param_estimate <= 0.0162 ) {
394+ code_id = 7 ; n_line_combs = 10240 ; // P15, rate-adapted to rate 0.1375
395+ } else if (ch_param_estimate <= 0.0173 ) {
393396 code_id = 7 ; n_line_combs = 0 ; // P15 native, rate 0.15
394- } else if (ch_param_estimate <= 0.0250 ) {
397+ } else if (ch_param_estimate <= 0.0179 ) {
395398 code_id = 8 ; n_line_combs = 10240 ; // P2, rate-adapted to rate 0.1875
396- } else if (ch_param_estimate <= 0.0284 ) {
399+ } else if (ch_param_estimate <= 0.0252 ) {
397400 code_id = 8 ; n_line_combs = 0 ; // P2 native, rate 0.20
398- } else if (ch_param_estimate <= 0.0340 ) {
401+ } else if (ch_param_estimate <= 0.0289 ) {
399402 code_id = 9 ; n_line_combs = 10240 ; // P25, rate-adapted to rate 0.2375
400- } else if (ch_param_estimate <= 0.0380 ) {
403+ } else if (ch_param_estimate <= 0.0323 ) {
401404 code_id = 9 ; n_line_combs = 0 ; // P25 native, rate 0.25
402- } else if (ch_param_estimate <= 0.0478 ) {
403- code_id = 10 ; n_line_combs = 0 ; // P3 native, rate 0.30 (its rate-adapted variants are bad)
404- } else if (ch_param_estimate <= 0.0520 ) {
405- code_id = 11 ; n_line_combs = 30720 ; // P35, rate-adapted to rate 0.3125
406- } else if (ch_param_estimate <= 0.0550 ) {
405+ } else if (ch_param_estimate <= 0.0370 ) {
406+ code_id = 10 ; n_line_combs = 30720 ; // P3, rate-adapted to rate 0.2625
407+ } else if (ch_param_estimate <= 0.0397 ) {
408+ code_id = 10 ; n_line_combs = 20480 ; // P3, rate-adapted to rate 0.275
409+ } else if (ch_param_estimate <= 0.0427 ) {
410+ code_id = 10 ; n_line_combs = 10240 ; // P3, rate-adapted to rate 0.2875
411+ } else if (ch_param_estimate <= 0.0446 ) {
412+ code_id = 10 ; n_line_combs = 0 ; // P3 native, rate 0.30
413+ } else if (ch_param_estimate <= 0.0467 ) {
407414 code_id = 11 ; n_line_combs = 20480 ; // P35, rate-adapted to rate 0.325
408- } else if (ch_param_estimate <= 0.0580 ) {
415+ } else if (ch_param_estimate <= 0.0498 ) {
409416 code_id = 11 ; n_line_combs = 10240 ; // P35, rate-adapted to rate 0.3375
410- } else if (ch_param_estimate <= 0.0600 ) {
417+ } else if (ch_param_estimate <= 0.0560 ) {
411418 code_id = 11 ; n_line_combs = 0 ; // P35 native, rate 0.35
412- } else if (ch_param_estimate <= 0.0706 ) {
413- code_id = 12 ; n_line_combs = 0 ; // P4 native, rate 0.40 (its rate-adapted variants are bad)
414- } else if (ch_param_estimate <= 0.0844 ) {
419+ } else if (ch_param_estimate <= 0.0598 ) {
420+ code_id = 12 ; n_line_combs = 30720 ; // P4, rate-adapted to rate 0.3625
421+ } else if (ch_param_estimate <= 0.0656 ) {
422+ code_id = 12 ; n_line_combs = 20480 ; // P4, rate-adapted to rate 0.375
423+ } else if (ch_param_estimate <= 0.0666 ) {
424+ code_id = 12 ; n_line_combs = 0 ; // P4 native, rate 0.40
425+ } else if (ch_param_estimate <= 0.0796 ) {
415426 code_id = 13 ; n_line_combs = 0 ; // P45 native, rate 0.45 (its rate-adapted variants are bad)
416- } else if (ch_param_estimate <= 0.0900 ) {
417- code_id = 14 ; n_line_combs = 30720 ; // P5, rate-adapted to rate 0.4625
418- } else if (ch_param_estimate <= 0.0960 ) {
419- code_id = 14 ; n_line_combs = 10240 ; // P5, rate-adapted to rate 0.4875
420- } else if (ch_param_estimate <= 0.0984 ) {
427+ } else if (ch_param_estimate <= 0.0914 ) {
428+ code_id = 14 ; n_line_combs = 20480 ; // P5, rate-adapted to rate 0.475
429+ } else if (ch_param_estimate <= 0.0928 ) {
421430 code_id = 14 ; n_line_combs = 0 ; // P5 native, rate 0.50
422431 } else {
423432 return std::nullopt ; // ch_param_estimate outside supported QBER range for 819k codes
0 commit comments