Skip to content

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

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

Conversation

Hapsa21
Copy link

@Hapsa21 Hapsa21 commented Aug 9, 2025

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.

All relevant doctests have been added or updated to reflect these changes.

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

None.

@Hapsa21
Copy link
Author

Hapsa21 commented Aug 10, 2025

Looks like the automated "build documentation (PDF)" check is failing. The error log shows:

buildx failed with: ERROR: failed to build: invalid tag ".../Hapsa21/sage/...": repository name must be lowercase

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.

@cxzhong
Copy link
Contributor

cxzhong commented Aug 10, 2025

I think the file abstract_code would also reject zero linear code

@Hapsa21
Copy link
Author

Hapsa21 commented Aug 10, 2025

The changes for abstract_code.py are now included, and all the local tests are passing.

Copy link
Contributor

@cxzhong cxzhong left a comment

Choose a reason for hiding this comment

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

LGTM

@cxzhong
Copy link
Contributor

cxzhong commented Aug 10, 2025

And can you test the dual code of zero linear code? @Hapsa21

@cxzhong
Copy link
Contributor

cxzhong commented Aug 10, 2025

And it is better for all tests. you can add the zero linear code in it

@Hapsa21 Hapsa21 force-pushed the fix-linear-code-intersection branch from f7c5b97 to 7e86f9e Compare August 10, 2025 20:52
@Hapsa21
Copy link
Author

Hapsa21 commented Aug 10, 2025

I've added the test for the dual of the zero code and pushed the commit.

@user202729
Copy link
Contributor

user202729 commented Aug 11, 2025

Use Issue instead of Trac.

(on this note, if you got the suggestion to use Trac from AI: read https://doc.sagemath.org/html/en/developer/ instead of asking AI.)

What's the reason behind the behavioral change? As far as I can see, neither of them use zero code or intersection method?

@Hapsa21 Hapsa21 changed the title Trac #40513, #40514: Allow zero code and add intersection method Issue #40513, #40514: Allow zero code and add intersection method Aug 11, 2025
@Hapsa21
Copy link
Author

Hapsa21 commented Aug 11, 2025

@user202729 the changes in abstract_code.py are a side effect.

To fix the zero code bug, I had to make LinearCode always use a standard (echelon form) matrix. This caused the example outputs in the old abstract_code.py tests to change, so I updated them to match the new correct behavior.

@cxzhong
Copy link
Contributor

cxzhong commented Aug 11, 2025

Use Issue instead of Trac.

(on this note, if you got the suggestion to use Trac from AI: read https://doc.sagemath.org/html/en/developer/ instead of asking AI.)

What's the reason behind the behavioral change? As far as I can see, neither of them use zero code or intersection method?

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.

Copy link

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

@cxzhong
Copy link
Contributor

cxzhong commented Aug 13, 2025

some operations like decode and encode are compatible with zero linear code?

@Hapsa21
Copy link
Author

Hapsa21 commented Aug 13, 2025

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!

@cxzhong
Copy link
Contributor

cxzhong commented Aug 16, 2025

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

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.

Intersections of linear codes Allow the construction of the zero linear code
3 participants