Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#20840 closed enhancement (fixed)

Automatically add generic encoders/decoders to any linear code class

Reported by: David Lucas Owned by:
Priority: major Milestone: sage-7.3
Component: coding theory Keywords: beginner
Cc: Johan Rosenkilde Merged in:
Authors: David Lucas Reviewers: Johan Sebastian Rosenkilde Nielsen
Report Upstream: N/A Work issues:
Branch: 6d01e05 (Commits, GitHub, GitLab) Commit:
Dependencies: Stopgaps:

Status badges


Some encoders/decoders (e.g. Syndrome decoders) are "generic" encoders/decoders which work for any linear code family. This ticket implements a very small change which automatically add these generic decoders to any code family assuming one adds a line related to this encoder/decoder into AbstractLinearCode's constructor. Before, one had to manually add one's encoder/decoder in any module which contains a linear code class.

Change History (7)

comment:1 Changed 6 years ago by David Lucas

Branch: u/dlucas/automatically_add_generic_encoders_and_decoders_to_any_linear_code

comment:2 Changed 6 years ago by David Lucas

Authors: David Lucas
Commit: ad1cadd4b0c2a46d8ba4b14fa4a7dd2bc79e1842
Status: newneeds_review

I implemented the feature described above. I also added a dedicated note in the thematic tutorial which explains how to create new objects in sage/coding.

This is now open for review.

New commits:

55f8771Added automatic registration for generic encoder/decoders
550c584Added a note to document this feature in related tutorial
ad1caddfixed broken doctest in the introductory tutorial

comment:3 Changed 6 years ago by Johan Rosenkilde

I don't think it makes sense to let all codes have ParityCheckEncoder, the reason being that for any code where the default encoder is something else, say A, then ParityCheckEncoder behaves exactly like SystematicEncoder.

This is because ParityCheckEncoder.generator_matrix calls code.parity_check_matrix().right_kernel() which always returned a matrix in reduced row echelon form, i.e. the same systematic generator matrix that SystematicEncoder uses.

comment:4 Changed 6 years ago by David Lucas

Commit: ad1cadd4b0c2a46d8ba4b14fa4a7dd2bc79e18426d01e050cbe41cab1e65ec5144da9e0276dcc8f4

Good point. I made the suggested change and fixed doctests accordingly. I also removed generic decoders from the list of imports in, and as they are no longer needed there.


New commits:

8dc72f5Parity check encoder is no longer systematically imported. Reinstated it in
46485e6Removed useless imports
6d01e05Fixed broken doctests

comment:5 Changed 6 years ago by Johan Rosenkilde

Reviewers: Johan S. R. Nielsen
Status: needs_reviewpositive_review

Looks good, green light. But found two unrelated small bugs in Sage while testing this ticket :-)

comment:6 Changed 6 years ago by Volker Braun

Branch: u/dlucas/automatically_add_generic_encoders_and_decoders_to_any_linear_code6d01e050cbe41cab1e65ec5144da9e0276dcc8f4
Resolution: fixed
Status: positive_reviewclosed

comment:7 Changed 6 years ago by Jeroen Demeyer

Commit: 6d01e050cbe41cab1e65ec5144da9e0276dcc8f4
Reviewers: Johan S. R. NielsenJohan Sebastian Rosenkilde Nielsen
Note: See TracTickets for help on using tickets.