fixed tracking of column swaps and also adjusted column swaps when ma… #236
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…king an FEC matrix systematic
Description
bugfix pull request to fix one bug.
Fixed Bug
the problem that shall be fixed is a wrong tracking of the column swaps behind a call to sionna.fec.utils.pcm2gm, more specifically in sionna.fec.utils.make_systematic . there, parts of a matrix get swapped correctly, but the tracked column swaps do not reflect the swaps actually performed. the swap-tracking is wrong. this is easy to see when using sionna.fec.utils.pcm2gm and telling it to check its own result for correctness. it fails for certain cases. one such case is in the below file, which is a minimum runnable example that demonstrates the bug:
https://github.com/daniel-x/sionna_daniel-x/blob/fix_column_swap_tracking_demo/bug_demo_pcm2gm_wrong_column_swap_tracking.py
(the bug demo is intentionally NOT part of the pull request, because it shall not end up in the main branch)
Solution
the current version with the bug does a blockwise swap of matrix regions. it is not straightforward to see how to reflect this with individual column swaps (though it is possible). this was likely the reason for the bug.
the solution replaces the blockwise swap of matrix regions by individual column swaps and tracks all swaps correctly. this has 3 effects:
Point 3. might break tests, although the result is still valid. In this case, the tests need to be examined carefully and adjusted if the results are still correct.
Necessity for the change
The code currently fails to calculate the correct generator matrices for valid check matrices of certain kinds. This makes it hard to test other error correction codes and compare them using sionna, making interoperability a burden, hence users might switch to other tools or libraries or cause confusion. To make sionna more usable, the change should be pulled.
Checklist
[+] Detailed description
[-] Added references to issues and discussions
[-] Added / modified documentation as needed
[-] Added / modified unit tests as needed
[ ] Passes all tests
[+] Lint the code
[+] Performed a self review
[ ] Ensure you Signed-off the commits. Required to accept contributions!
[-] Co-authored with someone? Add Co-authored-by: user@domain and ensure they signed off their commits too.