Opened 5 years ago

Closed 5 years ago

#21691 closed enhancement (fixed)

Shorter printing of core linear code objects

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

Description

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

  • Branch set to u/jsrn/improve_linear_code_messages

comment:2 Changed 5 years ago by jsrn

  • Commit set to dafdadff926e0b78471da5fd104349959718d842
  • Status changed from new to needs_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 5 years ago by jlavauzelle

  • Branch changed from u/jsrn/improve_linear_code_messages to u/jlavauzelle/improve_linear_code_messages

comment:4 Changed 5 years ago by jlavauzelle

  • Commit changed from dafdadff926e0b78471da5fd104349959718d842 to ba19b0c4904d6da1a7819fa8ba3fbe71a9257523
  • Milestone changed from sage-7.4 to sage-7.5
  • Reviewers set to 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 guava.py and merge with the latest beta (7.5.beta1).

Julien


New commits:

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

comment:5 Changed 5 years ago by jsrn

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

  • Commit changed from ba19b0c4904d6da1a7819fa8ba3fbe71a9257523 to 2316e35a9b43ea0b60a58679424e4e49745c34b0

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

2316e35Improved punctured codes representation and fixed doctests.

comment:7 Changed 5 years ago by jlavauzelle

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.

Best,

Julien

comment:8 Changed 5 years ago by jsrn

  • Status changed from needs_review to positive_review

It looks great, thanks a lot! Johan

comment:9 Changed 5 years ago by vbraun

  • Branch changed from u/jlavauzelle/improve_linear_code_messages to 2316e35a9b43ea0b60a58679424e4e49745c34b0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.