#18617: Implement polynomial number_of_terms method (and deprecate
hamming_weight)
-------------------------------------+-------------------------------------
Reporter: bruno | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.8
Component: commutative | Resolution:
algebra | Merged in:
Keywords: polynomial | Reviewers:
Authors: Bruno Grenet | Work issues:
Report Upstream: N/A | Commit:
Branch: | 60ee12ccb9e642959b02199d3cec81126fff64aa
u/bruno/hamming_weight_number_of_terms| Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by bruno):
Replying to [comment:4 jdemeyer]:
> There are precedents for calling the number of non-zero terms "weight"
(but not "Hamming weight" as far as I know, which seems to be reserved for
vectors):
>
> 1. the function `irreducible_element()` in
`src/sage/rings/polynomial/polynomial_ring.py` has a
`algorithm="minimal_weight"` option
> 2. [https://eprint.iacr.org/2007/423.pdf]
> 3. NTL has a `weight` function for polynomials over `GF(2)`
All your examples are for polynomials over `GF(2)`! (For 1., this is
specified in the docstring: {{{Only implemented for `p = 2`}}}.) I agree
that in this special case, the term "weight" may be quite common, but my
impression is that it is pretty rare for other base rings.
Other possibilities, in different communities, include "sparsity" (for
instance in the complexity theory community) or "0-norm". Yet, I guess the
name "number_of_terms" is the one most people will find by "tab
exploration".
Note that I have nothing against creating aliases, for "weight",
"sparsity", and maybe to change the `norm` method to make it return the
number of terms (rather than an Exception) when its argument is 0.
--
Ticket URL: <http://trac.sagemath.org/ticket/18617#comment:7>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.