Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#20840 closed enhancement (fixed)

Automatically add generic encoders/decoders to any linear code class

Reported by: dlucas Owned by:
Priority: major Milestone: sage-7.3
Component: coding theory Keywords: beginner
Cc: jsrn 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

Description

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 5 years ago by dlucas

  • Branch set to u/dlucas/automatically_add_generic_encoders_and_decoders_to_any_linear_code

comment:2 Changed 5 years ago by dlucas

  • Authors set to David Lucas
  • Commit set to ad1cadd4b0c2a46d8ba4b14fa4a7dd2bc79e1842
  • Status changed from new to needs_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 5 years ago by jsrn

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 5 years ago by dlucas

  • Commit changed from ad1cadd4b0c2a46d8ba4b14fa4a7dd2bc79e1842 to 6d01e050cbe41cab1e65ec5144da9e0276dcc8f4

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

David


New commits:

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

comment:5 Changed 5 years ago by jsrn

  • Reviewers set to Johan S. R. Nielsen
  • Status changed from needs_review to positive_review

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

comment:6 Changed 5 years ago by vbraun

  • Branch changed from u/dlucas/automatically_add_generic_encoders_and_decoders_to_any_linear_code to 6d01e050cbe41cab1e65ec5144da9e0276dcc8f4
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:7 Changed 5 years ago by jdemeyer

  • Commit 6d01e050cbe41cab1e65ec5144da9e0276dcc8f4 deleted
  • Reviewers changed from Johan S. R. Nielsen to Johan Sebastian Rosenkilde Nielsen
Note: See TracTickets for help on using tickets.