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

Fixed issue causing the quotient of vector subspaces to throw an exception when divisor is the zero space #39574

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

Conversation

Noel-Roemmele
Copy link
Contributor

Fixes #39507. Fixed issue where the quotient of vector spaces was throwing an error if the divisor was the zero space. Implemented the change suggested by Dave Morris on the initial bug fix request. Also added a doctest to ensure the bug is fixed.

📝 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

Copy link

github-actions bot commented Feb 23, 2025

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

@DaveWitteMorris
Copy link
Member

I think it would be better to have a slightly more comprehensive test, so I would suggest changing the dimension of V from 2 to 3. (And then A would be V.subspace([(1,0,0)]).)

Also, please put print(x) on a new line. Actually, I think it would be better (use less space) to just make a list of the elements, instead of printing them one per line, such as replacing the for loop with list(A/B).

And please merge the latest beta.

I could not reproduce the doctest failure in src/sage/coding/linear_code.py locally, so I don't think it is related to this PR, and I hope it will disappear when the CI runs on this branch again.

@Noel-Roemmele
Copy link
Contributor Author

I've merged with the new beta and added the doctest changes Dave Morris suggested.

@DaveWitteMorris
Copy link
Member

Oops, my mistake. I intended for A/B to be 2-dimensional so the doctest would be "slightly more comprehensive". So please change A to be the span of two vectors. To make it more interesting, they should probably not both be standard basis vectors, so perhaps V.subspace([(0,1,0), (1,1,1)]).

@Noel-Roemmele
Copy link
Contributor Author

I've changed A to be the span of two vectors as suggested by Dave Morris.

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.

Quotient of vector subspaces throws exception when divisor is the zero space
2 participants