diag(flapw/xps): stage-2a Madelung deficit attribution (report, no Coulomb-layer change) - #463
Merged
Merged
Conversation
…g deficit Diagnose the wrong-signed within-cell O1s core-level shift on the Ti+2O demo by comparing the interstitial Coulomb POTENTIAL (not just the site constants) against matched-basis Elk 11.0.2. Confirms gradwave dC0_ext(long-short) is ~2 eV below Elk (+0.74/+2.81 vs +2.90/+4.79 at O R_MT 1.00/1.40) and localizes the gap to v_hart's l=0 surface value (the own-monopole subtraction matches; in-sphere charges agree). The deficit has two independent causes: - DOMINANT (~1.3-1.45 eV): gradwave's Ti in-sphere charge is ~0.8 e higher than Elk's (19.52 vs 18.67-18.75 e at matched 1.70075-Bohr R_MT) because scf._CORE["Ti"] freezes the Ti 3s as localized core while Elk treats 3s as valence. A less-negative Ti weakens the Madelung-field difference at the two O. NOT a _weinert_multi bug. - SECONDARY (~0.4-0.7 eV): gradwave feeds the UNMASKED plane-wave interstitial density to _weinert_multi (+25..+32 e continuation inside the small Ti MT -> a huge -27 e deficit pseudocharge, catastrophic cancellation), while Elk masks rho_I to the interstitial (rhoir=0 in MTs, measured). Masking recovers part of the gap; the unmasked variant is grid-converged at the wrong value. Scaling gradwave's Ti charge to Elk's WITH masking reproduces Elk (+4.82 vs +4.79 at R 1.40), confirming the attribution. Verdict: no single _weinert_multi change reaches the target, and the masking prototype changes v_hart (hence the l=2 EFG lattice term) with unverified EFG impact, so per the stage-2 guardrail nothing is merged into the Coulomb layer. Diagnosis + reproducers + the two follow-up levers are documented in xps_madelung_stage2a.md. No src/ changes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018j6BBnPtBSjkrnASSc52mT
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.
Stage 2a — diagnose the wrong-signed within-cell O1s core-level shift
Diagnosis only. No
src/changes — this adds reproducers + a findings doc(
experiments/autoapw/xps_madelung_stage2a.md) and stops short of a_weinert_multichange, per the stage-2 guardrail. For review, not auto-merge.
What was asked vs what was found
The task premise was that the entire ~2 eV
C0_extdeficit lives inscf._weinert_multi(the interstitial Weinert reconstruction). Direct comparison of theinterstitial Coulomb potential against matched-basis Elk 11.0.2 shows the premise is only
partly right: the Weinert layer is the smaller cause.
Confirmed gap (both codes, same decomposition, matched basis)
In-sphere O charges match, so the analytic own-monopole term matches; the whole gap is in
v_hart's l=0 surface value. Elk's VCLIR is nearly flat (~+1.4 eV) across the interstitial;gradwave's
v_hartswings −3..−20 eV between the atoms — corrupted.Two independent causes
matched R_MT (1.70075 Bohr) gradwave's Ti holds ~0.8 e more than Elk (19.52 vs 18.67–18.75)
because
_CORE["Ti"]freezes the Ti 3s as localized core while Elk treats 3s as valence.A less-negative Ti weakens the near/far-O Madelung-field difference. Not fixable in
_weinert_multi.plane-wave density to
_weinert_multi(+25..+32 e continuation inside the small Ti MT →a −27 e deficit pseudocharge, catastrophic cancellation); Elk masks ρ_I to the interstitial
(rhoir = 0 in MTs, measured). Masking recovers part of the gap; the unmasked variant is
grid-converged at the wrong value.
Scaling gradwave's Ti charge to Elk's with masking reproduces Elk (+4.82 vs +4.79 at
R 1.40), confirming the attribution.
Why nothing is merged
No single
_weinert_multichange reaches the target (Elk +2.90/+4.79 + O1s sign flip), andthe masking prototype changes
v_harteverywhere — hence the l=2 EFG lattice term — withunverified EFG impact (and the naive real-space mask aliases). Per the guardrail, the Coulomb
layer is left untouched.
Follow-up levers (owner decision)
_weinert_multiwith a band-limited Θ_I and re-converge (does the SCFfeedback also pull the Ti charge toward Elk's?), gated on an EFG (corundum V_zz, torture)
re-validation.
consequences; belongs in its own investigation.
Full numbers, mechanism, and reproduce commands in
experiments/autoapw/xps_madelung_stage2a.md.🤖 Generated with Claude Code
https://claude.ai/code/session_018j6BBnPtBSjkrnASSc52mT