-
-
Notifications
You must be signed in to change notification settings - Fork 648
Issue #40513, #40514: Allow zero code and add intersection method #40564
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
base: develop
Are you sure you want to change the base?
Conversation
Looks like the automated "build documentation (PDF)" check is failing. The error log shows:
It seems the build script is not converting my username to lowercase, which is causing the process to fail. This appears to be an issue with the CI workflow rather than the code in this PR. |
I think the file abstract_code would also reject zero linear code |
The changes for |
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.
LGTM
And can you test the dual code of zero linear code? @Hapsa21 |
And it is better for all tests. you can add the zero linear code in it |
…sa21/sage into fix-linear-code-intersection
f7c5b97
to
7e86f9e
Compare
I've added the test for the dual of the zero code and pushed the commit. |
Use (on this note, if you got the suggestion to use What's the reason behind the behavioral change? As far as I can see, neither of them use zero code or intersection method? |
@user202729 the changes in To fix the zero code bug, I had to make |
I think we can construct zero linear codes from dual codes. But we can not construct a zero linear code directly. I think we can allow direct construct a zero linear code if there are no conflict with the system. |
Documentation preview for this PR (built with commit 7e86f9e; changes) is ready! 🎉 |
…on, and fix CI
972ab65
to
0cb098b
Compare
some operations like decode and encode are compatible with zero linear code? |
I've added the tests for encode and decode with the zero code. Thanks for the suggestion! |
And just see this. @orlitzky Do you think we need to permit the construction of zero linear code? I think it is ok. Because we can use dual code to construct a zero linear code. But now the sage prevents our construct a zero linear code directly. If there are no conflicts. I think it can be |
This pull request resolves two issues by allowing the creation of the zero linear code and adding a method to compute the intersection of two codes.
__init__
method forLinearCode
is updated to correctly handle zero matrices and zero-dimensional vector space inputs, creating a valid[n, 0]
code instead of raising an error.intersection()
method is added toLinearCode
, implemented using the identityC1 ∩ C2 = (C1_dual + C2_dual)_dual
.All relevant doctests have been added or updated to reflect these changes.
Checklist
Dependencies
None.