Skip to content

diag(flapw/xps): stage-2a Madelung deficit attribution (report, no Coulomb-layer change) - #463

Merged
wladerer merged 1 commit into
mainfrom
fix/flapw-weinert-formulation
Sep 9, 2026
Merged

diag(flapw/xps): stage-2a Madelung deficit attribution (report, no Coulomb-layer change)#463
wladerer merged 1 commit into
mainfrom
fix/flapw-weinert-formulation

Conversation

@wladerer

@wladerer wladerer commented Sep 9, 2026

Copy link
Copy Markdown
Owner

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_multi
change, 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_ext deficit lives in
scf._weinert_multi (the interstitial Weinert reconstruction). Direct comparison of the
interstitial 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)

O R_MT (Bohr) gradwave dC0_ext Elk dC0_ext gap
1.00 +0.736 +2.903 2.17
1.40 +2.814 +4.794 1.98

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_hart swings −3..−20 eV between the atoms — corrupted.

Two independent causes

  1. Dominant (~1.3–1.45 eV): Ti sphere charge (a semicore choice, not Coulomb). At
    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.
  2. Secondary (~0.4–0.7 eV): unmasked interstitial density. gradwave feeds the full
    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_multi change reaches the target (Elk +2.90/+4.79 + O1s sign flip), and
the masking prototype changes v_hart everywhere — hence the l=2 EFG lattice term — with
unverified EFG impact (and the naive real-space mask aliases). Per the guardrail, the Coulomb
layer is left untouched.

Follow-up levers (owner decision)

  • Mask ρ_I inside _weinert_multi with a band-limited Θ_I and re-converge (does the SCF
    feedback also pull the Ti charge toward Elk's?), gated on an EFG (corundum V_zz, torture)
    re-validation.
  • Treat Ti 3s as valence (the dominant lever) — a semicore change with its own EFG/core-level
    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

…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
@wladerer
wladerer merged commit da6b870 into main Sep 9, 2026
6 checks passed
@wladerer
wladerer deleted the fix/flapw-weinert-formulation branch September 9, 2026 22:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant