Make the diagonal of Hermitian matrix functions and generic Bunch-Kaufman inverses exactly real #1994
All Vouch review confidence checks passed
Residual risk 0.06 = Change Risk (0.38) × (1 − Review Confidence (0.84)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.38 · 46 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.78 · 5 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.230
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
8 items
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 99.58%. Comparing base (
bc33f3c) to head (f0fd505).:warning: Report is 10 commits behind head on master.
<details><summary>Additional details and impacted files</summary>
@@ Coverage Diff @@
## master #1994 +/- ##
=======================================
Coverage 99.58% 99.58%
=======================================
Files 35 35
Lines 18699 18711 +12
=======================================
+ Hits 18622 18634 +12
Misses 77 77
</details>
:umbrella: View full report in Codecov by Harness.
:loudspeaker: Have feedback on the report? Share it here.
<details><summary> :rocket: New features to boost your workflow: </summary>
</details>
Should we be calling hermitianpart! instead?
That's extra effort, but probably negligible compared to the eigendecompositions.
It reduced the code a little bit, so hermitianpart is included.
_spectralwrap!(A, retmat) = wrappertype(A)(_hermitianpart!(retmat))
since it mutates an argument?
Good point.
Approved
Approved these changes.
stevengj
dkarrasch
For a Hermitian
A,cos,sin,tan, their hyperbolic and inverse variants,acosh,logandsincoscomputeV Diagonal(f.(λ)) V', which is Hermitian only up to rounding. TheHermitianresult hides that, but the dense methods copy the parent withcopytri!, so their results are not Hermitian. The same holds forinvof a generic Hermitian Bunch-Kaufman factorization. These results are now made exactly Hermitian withhermitianpart!.The generic
invof aCholeskyorCholeskyPivotedfactorization (e.g. forComplex{BigFloat}or quaternions) fell back to solving for the identity, so neither its triangles nor its diagonal were exactly Hermitian. It is now made exactly Hermitian withhermitianpart!as well.This is not a regression (1.10 behaves the same).
exp,sqrtand real powers already had an exactly real diagonal.https://claude.ai/code/session_012douRorupKk8wH4zTpqpCx
---
_Generated by Claude Code_