-
-
Notifications
You must be signed in to change notification settings - Fork 516
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
base: develop
Are you sure you want to change the base?
Merge of previous 'rank metric channel' enhancement #39117
Conversation
…StaticRankErrorChannel
Documentation preview for this PR (built with commit ae52e87; changes) is ready! 🎉 |
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. | ||
|
There was a problem hiding this comment.
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. | ||
|
There was a problem hiding this comment.
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:: | ||
|
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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 | ||
|
There was a problem hiding this comment.
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()) | ||
|
There was a problem hiding this comment.
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()) | ||
|
There was a problem hiding this comment.
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``. | ||
|
There was a problem hiding this comment.
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 | ||
|
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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")
?
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:
StaticRankErrorChannel
(as a side effect, this update improves the decoder's tests which only covered a very specific case)📝 Checklist
⌛ Dependencies
#32330: the original work