Repository navigation
Commit 4e9c8aa
Make the diagonal of Diagonal tangents projected onto Hermitian real (#723)
* Make the diagonal of Diagonal tangents projected onto Hermitian real
ProjectTo{Hermitian} kept the imaginary part of a Diagonal tangent, so
its result was not Hermitian and disagreed with the dense path. Take the
real part with oftype, like LinearAlgebra.hermitian(::Number), so the
element type is kept also for e.g. quaternions and Unitful quantities.
Fixes #722.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Skip the real part for real Diagonal tangents onto Hermitian
A real input diagonal is already real after projection, so this avoids
a second copy. Also check the value for a real tangent, that Symmetric
keeps a complex diagonal, and the allocations for a real tangent onto a
complex Hermitian.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Rename complex Hermitian projector in allocation test and trim comment
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 2a1e65e commit 4e9c8aa
3 files changed
Lines changed: 37 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
| 486 | + | |
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
490 | 500 | | |
491 | 501 | | |
492 | 502 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
317 | 334 | | |
318 | 335 | | |
319 | 336 | | |
| |||
499 | 516 | | |
500 | 517 | | |
501 | 518 | | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
502 | 527 | | |
503 | 528 | | |
504 | 529 | | |
| |||
0 commit comments