Skip to content

Split more methods for MatrixElem into seperate ones for MatElem and MatRingElem#2325

Merged
lgoettgens merged 14 commits into
Nemocas:masterfrom
JohnAAbbott:JAA/remove-issquare-MatRingElem
Mar 6, 2026
Merged

Split more methods for MatrixElem into seperate ones for MatElem and MatRingElem#2325
lgoettgens merged 14 commits into
Nemocas:masterfrom
JohnAAbbott:JAA/remove-issquare-MatRingElem

Conversation

@JohnAAbbott
Copy link
Copy Markdown
Collaborator

Removed is_square(::MatRingElem to see what breaks.

@fingolfin fingolfin changed the title Jaa/remove issquare mat ring elem Remove is_square(::MatRingElem) Feb 3, 2026
Comment thread docs/src/mpoly_interface.md Outdated
@fingolfin
Copy link
Copy Markdown
Member

One of the first breakages is in function Base.inv(M::MatrixElem{T}) where {T <: FieldElement} -> time to untangle MatrixElem some more.

@JohnAAbbott
Copy link
Copy Markdown
Collaborator Author

I'm puzzled about the state of this PR: there seem to be many modifications which I certainly did not make.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 10, 2026

Codecov Report

❌ Patch coverage is 65.00000% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.11%. Comparing base (9be424a) to head (2afdbf5).
⚠️ Report is 27 commits behind head on master.

Files with missing lines Patch % Lines
src/MatRing.jl 44.00% 14 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2325      +/-   ##
==========================================
- Coverage   88.15%   88.11%   -0.04%     
==========================================
  Files         126      128       +2     
  Lines       32093    32879     +786     
==========================================
+ Hits        28290    28972     +682     
- Misses       3803     3907     +104     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fingolfin

This comment was marked as outdated.

@JohnAAbbott

This comment was marked as outdated.

@fingolfin

This comment was marked as resolved.

@JohnAAbbott JohnAAbbott force-pushed the JAA/remove-issquare-MatRingElem branch from af4392c to 3132110 Compare February 11, 2026 13:15
@JohnAAbbott JohnAAbbott changed the title Remove is_square(::MatRingElem) Remove is_square(::MatRingElem); to apply to MatRingElem work with underlying matrix Feb 11, 2026
@JohnAAbbott JohnAAbbott added the release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes label Feb 11, 2026
@JohnAAbbott
Copy link
Copy Markdown
Collaborator Author

QUESTION
Of those functions which I split into two, several are not called with MatRingElem arguments in the tests. Which ones do we want to be able to apply directly to a MatRingElem value?
The functions changed are:

  • inv, pseudo_inv, is_invertible, is_invertible_with_inverse
  • charpoly, is_nilpotent
  • is_symmetric
  • tr, hessenberg, hessenberg!, is_hessenberg

The first two groups probably make sense; I am less convinced about the last two groups.

I did also introduce a (buggy?) version of charpoly_hessenberg! for MatRingElem, but since I do not know what it should do, it is likely incorrect. Does anyone know if it is really useful to have charpoly_hessenberg! operate on MatRingElem?

@JohnAAbbott JohnAAbbott marked this pull request as ready for review February 12, 2026 12:18
JohnAAbbott and others added 4 commits February 12, 2026 13:47
Removed unintended change
Undo unintended edit
…ott/AbstractAlgebra.jl into JAA/remove-issquare-MatRingElem
Comment thread src/MatRing.jl
#
################################################################################

is_square(a::MatRingElem) = true # FIXME: remove this once we untangled MatRingElem and MatrixElement etc.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I see correctly, this line is the only breaking part of the PR. Thus, IMO, it would make sense to split this PR into two as the rest of it can be merged right now

@fingolfin
Copy link
Copy Markdown
Member

@JohnAAbbott let's work on this together this afternoon, maybe factor out the non-breaking parts and merge them right away?

@JohnAAbbott
Copy link
Copy Markdown
Collaborator Author

I have reinstated the definition of is_square, so this PR should no longer trigger the "breaking change" alarm!

@lgoettgens lgoettgens removed the release notes: use title For PRs: the title of this PR is suitable for direct use in the release notes label Mar 4, 2026
@lgoettgens lgoettgens changed the title Remove is_square(::MatRingElem); to apply to MatRingElem work with underlying matrix Split more methods for MatrixElem into seperate ones for MatElem and MatRingElem Mar 4, 2026
@lgoettgens lgoettgens added the release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes label Mar 4, 2026
Comment thread src/Matrix.jl Outdated
return d
end

function tr(x::MatRingElem{T}) where T <: NCRingElement
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think in previous similar PRs these split off methods for MatRingElem were always put in the file src/MatRing.jl. Could you please do the same for the changes in this PR?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Moved

Copy link
Copy Markdown
Member

@lgoettgens lgoettgens left a comment

Choose a reason for hiding this comment

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

Thanks!

@lgoettgens lgoettgens merged commit 6c4cf51 into Nemocas:master Mar 6, 2026
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes: not needed PRs introducing changes that are wholly irrelevant to the release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants