Opened 6 years ago

Closed 6 years ago

#21691 closed enhancement (fixed)

Shorter printing of core linear code objects

Reported by: Johan Rosenkilde Owned by:
Priority: major Milestone: sage-7.5
Component: coding theory Keywords: linear_code, beginner
Cc: David Lucas, Julien Lavauzelle Merged in:
Authors: Johan Rosenkilde Reviewers: Julien Lavauzelle
Report Upstream: N/A Work issues:
Branch: 2316e35 (Commits, GitHub, GitLab) Commit: 2316e35a9b43ea0b60a58679424e4e49745c34b0
Dependencies: Stopgaps:

Status badges


The central objects for linear codes in Sage prints unnecessarily long, even though there are established conventions for shorter description. This ticket proposes a change to that:

Linear code of length 7, dimension 3 over Finite Field of size 2^3
   should be
[7, 3] linear code over GF(8)

Printing GF(8) is the only controversial thing here, from a Sage POV. The argument is that linear codes are always over finite fields, so it is unnecessarily verbose to insist on the long printing. (formally, using LinearCode over a ring has not been deprecated yet, see #20387, but a code over a ring is not a "linear code" in the classical sense)

Other proposed changes are:

  • Generalized Reed-Solomon Code -> Reed-Solomon Code (whenever the column multipliers are all-1)
  • Extended code coming from <bla> -> Extension of <bla>
  • Punctured code coming from <bla> -> Puncturing of <bla>
  • Subfield subcode over <subfield> coming from <code> -> Subfield subcode of <bla> down to <subfield>

Related objects (e.g. encoders and decoders) have been shortened similarly (though much more could be done here).

An unrelated change which I put here anyway is a polishing of AbstractLinearCode's class doc, and improved error messages for its encoder() and decoder() methods.

Change History (9)

comment:1 Changed 6 years ago by Johan Rosenkilde

Branch: u/jsrn/improve_linear_code_messages

comment:2 Changed 6 years ago by Johan Rosenkilde

Commit: dafdadff926e0b78471da5fd104349959718d842
Status: newneeds_review

New commits:

77772c3Better error message for encode and decoder
d2f4c18Improve some class doc in AbstractLinearCode
dafdadfShortened printing of many linear code objects.

comment:3 Changed 6 years ago by Julien Lavauzelle

Branch: u/jsrn/improve_linear_code_messagesu/jlavauzelle/improve_linear_code_messages

comment:4 Changed 6 years ago by Julien Lavauzelle

Commit: dafdadff926e0b78471da5fd104349959718d842ba19b0c4904d6da1a7819fa8ba3fbe71a9257523
Milestone: sage-7.4sage-7.5
Reviewers: Julien Lavauzelle

Hi Johan,

Nice changes, it makes it really more readable. I only have one suggestion for punctured codes. You wrote for instance: Puncturing of [11, 5] linear code over GF(7) punctured (...) but I think writing "Puncturing/punctured" only once would be even easier to read. However I'm not that fluent in english, so maybe I'm wrong...

I also made 3 optional doctests pass in and merge with the latest beta (7.5.beta1).


New commits:

4d65268Merge branch 'u/jsrn/improve_linear_code_messages' of git:// into 21691_shorter_printing
a3b2b66Merged with latest beta (7.5.beta1).
ba19b0cFixed doctest on optional guava package.

comment:5 Changed 6 years ago by Johan Rosenkilde

Hi Julien, Thanks for the review and good catch with the optional doctests. I agree with you on the puncturing. What about Puncturing of [11, 5] linear code over GF(7) at positions [1,2]?

I would make the change, but I'm running some heavy computations and I'm worried that I'll break something by recompiling and experimenting. Could you do it?

Best, Johan

comment:6 Changed 6 years ago by git

Commit: ba19b0c4904d6da1a7819fa8ba3fbe71a92575232316e35a9b43ea0b60a58679424e4e49745c34b0

Branch pushed to git repo; I updated commit sha1. New commits:

2316e35Improved punctured codes representation and fixed doctests.

comment:7 Changed 6 years ago by Julien Lavauzelle

Hi Johan,

I did that change. Patchbot also found doctest failures in some crazy tutorials (one about linear codes and ciphers, the other about graphs...). I fixed them.

I'll wait your green light on my changes to give the positive review.



comment:8 Changed 6 years ago by Johan Rosenkilde

Status: needs_reviewpositive_review

It looks great, thanks a lot! Johan

comment:9 Changed 6 years ago by Volker Braun

Branch: u/jlavauzelle/improve_linear_code_messages2316e35a9b43ea0b60a58679424e4e49745c34b0
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.