• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

johanjoensson / rspt2spectra / 35778083680
82%

Build:
DEFAULT BRANCH: master
Ran 22 Sep 2026 08:07PM UTC
Jobs 4
Files 16
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Sep 2026 07:53PM UTC coverage: 81.727% (+2.5%) from 79.211%
35778083680

push

github

johanjoensson
Constrain hybridization fits to the symmetries of the data

The star-bath fit is stochastic, so any symmetry Delta(w) happens to have was
only reproduced to within the fit residual. Detect them per block and impose
them exactly.

Three families, all real-linear conditions on the Hermitian residues: orbital
degeneracy (residues confined to the *-algebra generated by the data),
antiunitary symmetry (reality and time reversal / Kramers), and particle-hole
(mirrored poles with A_{-e} = A_{+e}^T and C = -C^T).

Writing A_b = sum_p a_bp S_p with real a and an orthonormal Hermitian basis,
Tr(S_p S_q) = delta_pq is real, so the constrained normal equations decouple
across p: every coefficient column solves the same real (n_b+1)x(n_b+1) system.
That is the exact constrained optimum -- projecting the unconstrained solve is
not equivalent, since the Gram matrix is complex off-diagonal while the
coefficients are real -- and it is cheaper than the old lstsq whenever there is
symmetry to exploit. Particle-hole splits the basis by transpose parity into
two such systems.

Enforcement is on by default; --no-enforce-symmetry and --symmetry-tol control
it, and -v reports what was detected per block with its measured residual.
Particle-hole is only enforced when the fit window reaches above the Fermi
level, since mirroring puts half the poles at +e.

Two bugs fixed along the way.

hyb_fit's realvalue_v tested Hermiticity, not realness. Every physical
hybridization is Hermitian, so it was always true and A = A.real was forced
unconditionally, wrongly truncating complex residues on spin-orbit blocks. The
antiunitary family subsumes it correctly.

Inter-block particle-hole detection compared blocks at the same frequency index
rather than mirrored ones. Kramers-Kronig makes that unsatisfiable, so the
relation was never detected and build_full_bath's particle-hole branch was dead
code. Detection, build_greens_function, build_matrix, build_full_bath and
assemble_h0's constant ... (continued)

631 of 697 new or added lines in 7 files covered. (90.53%)

4 existing lines in 1 file now uncovered.

2442 of 2988 relevant lines covered (81.73%)

3.27 hits per line

Uncovered Changes

Lines Coverage ∆ File
36
86.21
src/rspt2spectra/symmetries.py
13
76.07
11.17% src/rspt2spectra/hyb_fit.py
12
41.27
-0.08% src/rspt2spectra/scripts/build_h0.py
4
91.74
-0.01% src/rspt2spectra/block_structure.py
1
98.41
0.42% src/rspt2spectra/offdiagonal.py

Coverage Regressions

Lines Coverage ∆ File
4
41.27
-0.08% src/rspt2spectra/scripts/build_h0.py
Jobs
ID Job ID Ran Files Coverage
1 python-3.14 - 35778083680.1 22 Sep 2026 08:07PM UTC 16
81.71
GitHub Action Run
2 python-3.11 - 35778083680.2 22 Sep 2026 08:07PM UTC 16
81.73
GitHub Action Run
3 python-3.12 - 35778083680.3 22 Sep 2026 08:07PM UTC 16
81.73
GitHub Action Run
4 python-3.13 - 35778083680.4 22 Sep 2026 08:07PM UTC 16
81.73
GitHub Action Run
Source Files on build 35778083680
  • Tree
  • List 16
  • Changed 6
  • Source Changed 6
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #35778083680
  • b2c0bf70 on github
  • Prev Build on master (#33256169623)
  • Next Build on master (#35778731128)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc