Skip to content

Commit

Permalink
Update documentation and condition
Browse files Browse the repository at this point in the history
  • Loading branch information
r-mb authored Feb 13, 2025
1 parent a052a1f commit d270b3f
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions src/sage/coding/linear_rank_metric.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,9 @@ def to_matrix_representation(v, sub_field=None, basis=None):
specified, it is the prime subfield `\GF{p}` of `\GF{q^m}`
- ``basis`` -- (default: ``None``) a basis of `\GF{q^m}` as a vector space over
``sub_field``. If not specified, given that `q = p^s`, let `\beta` be a generator
of the multiplicative group of `\GF{q^m}`.
The default basis is then `1,\beta,\ldots,\beta^{m-1}`.
``sub_field``. If not specified, the default basis is
`1,\beta,\ldots,\beta^{m-1}` where `\beta` is the generator of the
multiplicative group of `\GF{q^m}` given by Sage.
EXAMPLES::
Expand Down Expand Up @@ -199,9 +199,9 @@ def from_matrix_representation(w, base_field=None, basis=None):
``w``.
- ``basis`` -- (default: ``None``) a basis of `\GF{q^m}` as a vector space over
`\GF{q}`. If not specified, given that `q = p^s`, let `\beta` be a generator
of the multiplicative group of `\GF{q^m}`.
The default basis is then `1,\beta,\ldots,\beta^{m-1}`.
`\GF{q}`. If not specified, the default basis is
`1,\beta,\ldots,\beta^{m-1}` where `\beta` is the generator of the
multiplicative group of `\GF{q^m}` given by Sage.
EXAMPLES::
Expand Down Expand Up @@ -241,9 +241,9 @@ def rank_weight(c, sub_field=None, basis=None):
specified, it is the prime subfield `\GF{p}` of `\GF{q^m}`
- ``basis`` -- (default: ``None``) a basis of `\GF{q^m}` as a vector space over
``sub_field``. If not specified, given that `q = p^s`, let
`1,\beta,\ldots,\beta^{sm-1}` be the basis that SageMath uses to
represent `\GF{q^m}`. The default basis is then `1,\beta,\ldots,\beta^{m-1}`
``sub_field``. If not specified, the default basis is
`1,\beta,\ldots,\beta^{m-1}` where `\beta` is the generator of the
multiplicative group of `\GF{q^m}` given by Sage.
EXAMPLES::
Expand Down Expand Up @@ -279,9 +279,9 @@ def rank_distance(a, b, sub_field=None, basis=None):
specified, it is the prime subfield `\GF{p}` of `\GF{q^m}`
- ``basis`` -- (default: ``None``) a basis of `\GF{q^m}` as a vector space over
``sub_field``. If not specified, given that `q = p^s`, let `\beta` be a generator
of the multiplicative group of `\GF{q^m}`.
The default basis is then `1,\beta,\ldots,\beta^{m-1}`.
``sub_field``. If not specified, the default basis is
`1,\beta,\ldots,\beta^{m-1}` where `\beta` is the generator of the
multiplicative group of `\GF{q^m}` given by Sage.
EXAMPLES::
Expand Down Expand Up @@ -380,9 +380,9 @@ def __init__(self, base_field, sub_field, length, default_encoder_name,
- ``default_decoder_name`` -- the name of the default decoder of ``self``
- ``basis`` -- (default: ``None``) a basis of `\GF{q^m}` as a vector space over
``sub_field``. If not specified, given that `q = p^s`, let `\beta` be a generator
of the multiplicative group of `\GF{q^m}`.
The default basis is then `1,\beta,\ldots,\beta^{m-1}`.
``sub_field``. If not specified, the default basis is
`1,\beta,\ldots,\beta^{m-1}` where `\beta` is the generator of the
multiplicative group of `\GF{q^m}` given by Sage.
EXAMPLES:
Expand Down Expand Up @@ -588,29 +588,29 @@ def rank_weight_of_vector(self, word):
2
"""
return rank_weight(word, self.sub_field())

def rank_support_of_vector(self, word, sub_field=None, basis=None):
r"""
Return the rank support of ``word`` over ``sub_field``, i.e. the vector space over
``sub_field`` generated by its coefficients.
If ``word`` is a vector over some field `\GF{q^m}`, and ``sub_field`` is a subfield of
`\GF{q^m}`, the function converts it into a matrix over ``sub_field``, with
respect to the basis ``basis``.
Return the rank support of ``word`` over ``sub_field``, i.e. the vector space over
``sub_field`` generated by its coefficients.
If ``word`` is a vector over some field `\GF{q^m}`, and ``sub_field`` is a subfield of
`\GF{q^m}`, the function converts it into a matrix over ``sub_field``, with
respect to the basis ``basis``.
INPUT:
- ``word`` -- a vector over the ``base_field`` of ``self``
- ``word`` -- a vector over the ``base_field`` of ``self``.
- ``sub_field`` -- (default: ``None``) a sub field of the ``base_field`` of ``self``; if not
specified, it is the prime subfield `\GF{p}` of the ``base_field`` of ``self``
- ``sub_field`` -- (default: ``None``) a sub field of the
``base_field`` of ``self``; if not specified, it is the prime
subfield `\GF{p}` of the ``base_field`` of ``self``.
- ``basis`` -- (default: ``None``) a basis of ``base_field`` of
``self`` as a vector space over ``sub_field``. If not specified,
the default basis is `1,\beta,\ldots,\beta^{m-1}`, where `\beta` is
the generator of the multiplicative group of `\GF{q^m}` given by Sage.
- ``basis`` -- (default: ``None``) a basis of ``base_field`` of ``self`` as a vector space over
``sub_field``.
If not specified, given that `q = p^s`, let `\beta` be a generator of the multiplicative group
of `\GF{q^m}`. The default basis is then `1,\beta,\ldots,\beta^{m-1}`.
EXAMPLES::
sage: G = Matrix(GF(64), [[1,1,0], [0,0,1]])
Expand All @@ -636,9 +636,9 @@ def rank_support_of_vector(self, word, sub_field=None, basis=None):
Vector space of degree 3 and dimension 1 over Finite Field of size 2
Basis matrix:
[0 0 1]
TESTS::
sage: C.rank_support_of_vector(a)
Traceback (most recent call last):
...
Expand All @@ -651,7 +651,7 @@ def rank_support_of_vector(self, word, sub_field=None, basis=None):
"""
if not isinstance(word, Vector):
raise TypeError("input must be a vector")
if sub_field != None:
if sub_field is not None:
if self.base_field().degree() % sub_field.degree() != 0:
raise TypeError(f"the input subfield {sub_field} is not a subfield of {self.base_field()}")
return to_matrix_representation(word, sub_field, basis).column_module()
Expand Down Expand Up @@ -747,9 +747,9 @@ def __init__(self, generator, sub_field=None, basis=None):
specified, it is the prime field of ``base_field``
- ``basis`` -- (default: ``None``) a basis of `\GF{q^m}` as a vector space over
``sub_field``. If not specified, given that `q = p^s`, let `\beta` be a generator
of the multiplicative group of `\GF{q^m}`.
The default basis is then `1,\beta,\ldots,\beta^{m-1}`.
``sub_field``. If not specified, the default basis is
`1,\beta,\ldots,\beta^{m-1}` where `\beta` is the generator of the
multiplicative group of `\GF{q^m}` given by Sage.
EXAMPLES::
Expand Down

0 comments on commit d270b3f

Please sign in to comment.