Fix nested MatrixSpace scalar actions and coercions - #42607
Open
cxzhong wants to merge 2 commits into
Open
Conversation
|
Documentation preview for this PR (built with commit 269f2e7; changes) is ready! 🎉 |
cxzhong
marked this pull request as ready for review
August 3, 2026 04:57
vincentmacri
removed their request for review
August 4, 2026 16:35
Member
|
I imagine you're inferred this but just to be explicit: if I remove a request for review from me that just means I don't have the capacity for it at the moment and so you should try to request someone else. Please continue requesting reviews from me if you think it is a relevant part of the code that I can review, but I need to prioritize based on the amount of work and my own interest in the PR. I like to make sure I have enough time for when PRs that are especially interesting to me come in, like your recent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes the concrete nested-
MatrixSpaceaction and coercion bugs identified while investigating #16247. It intentionally leaves the broaderModules(R)category-design issue open.Root cause
When both operands belonged to matrix spaces,
MatrixSpace._get_action_selected matrix multiplication before considering that one matrix space was the other's base ring. Square nested matrix spaces also let the generic matrix constructor interpret a base-ring matrix as outer entries instead of using the canonical scalar embedding.Changes
MatrixMatrixActionwhen one matrix space canonically coerces into the other's base ring.S -> base ring -> targetcoercion path for matrix spaces and other matrix-like parents such as matrix groups.an_element()from coordinate dictionaries when entries are matrices, avoiding the flat-versus-nested sequence ambiguity.Validation
All 1839 doctests passed. Nested parent and element
TestSuitechecks also passed after excluding the existing unsupported_test_minpolycheck for matrices over a non-domain matrix ring.📝 Checklist
⌛ Dependencies
None.