Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge of previous 'rank metric channel' enhancement #39117

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

jlavauzelle
Copy link
Contributor

This PR aims at merging and updating an enhancement that was written in #32330 a few years ago. The previous branch was very close to be added at that time.

As a reminder, the goal of #32330 was to add a StaticRankErrorChannel class that allows to generate an error of a given "rank weight", and to add it to a codeword.

There are some additional minor changes compared to the previous branch:

  • I added a requirement on the error rank (should be less or equal to the extension degree)
  • I cleaned the generation of the error
  • I added more appropriate tests, with parameters which correspond to what we usually expect for rank-metric codes
  • I updated the tests in the Gabidulin code decoder, in order to use the new class StaticRankErrorChannel (as a side effect, this update improves the decoder's tests which only covered a very specific case)

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

#32330: the original work

Copy link

github-actions bot commented Dec 10, 2024

Documentation preview for this PR (built with commit ae52e87; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

It can be either an integer of a tuple. If a tuple is passed as
argument, the rank of the error will be a random integer between the
two bounds of the tuple.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

message. It can be

It can be either an integer or a tuple?

- ``relative_field`` -- The field to which the extension is relative.
If not given, it will default to the prime_subfield of the ambient space
base_field.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``prime_subfield`` or just the prime subfield?

``base_field`` or just the base field?


We construct a StaticRankErrorChannel which adds error of rank 2
to any transmitted message::

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:class:`StaticRankErrorChannel`?

r"""
TESTS:

If the number of errors exceeds the dimension of the input space,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about

r"""
Initialize.

TESTS:

?

super(StaticRankErrorChannel, self).__init__(space, space)
if rank_errors[1] > space.dimension():
raise ValueError("There might be errors of rank larger than the dimension of the input space.")
self._rank_errors = rank_errors
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ValueError("there might be errors of rank larger than the dimension of the input space")

?

else:
if relative_field not in Fields():
raise ValueError("relative_field must be a Field and %s is not." % relative_field)
if not relative_field.is_subring(self._base_field):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

must be a field

?

%s is not"

?

if rank_errors[1] > self._extension_degree:
raise ValueError("There might be errors of rank larger than the field extension degree.")
self._map_to_field = vec_to_field

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ValueError("there might be errors of rank larger than the field extension degree")

or

ValueError("there could be errors of rank larger than the field extension degree")

?

no_err = self.rank_errors()
return "Channel creating error of rank %s over %s, of input and output space %s"\
% (format_interval(no_err), self._relative_field, self.input_space())

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%s" \

no_err = self.rank_errors()
return "\\textnormal{Channel creating error of rank %s over %s, of input and output space %s}"\
% (format_interval(no_err), self._relative_field, self.input_space())

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a space before \

pick a random integer between the bounds of the tuple and use it as the number of errors.

This method does not check if ``message`` belongs to the input space of``self``.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

of ``self``

OUTPUT:

- a vector of the output space

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OUTPUT: a vector of the output space

rank_errors = (rank_errors, rank_errors)
if not isinstance(rank_errors, (tuple, list)):
raise ValueError("rank_errors must be a tuple, a list, an Integer or a Python int")
super(StaticRankErrorChannel, self).__init__(space, space)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ValueError("rank_errors must be a tuple, a list, or an integer")

?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants