Skip to content

test(surface_energy): physical bonded-slab γ gate (Al(100)) - #462

Merged
wladerer merged 2 commits into
mainfrom
test/surface-energy-physical-slab
Sep 9, 2026
Merged

test(surface_energy): physical bonded-slab γ gate (Al(100))#462
wladerer merged 2 commits into
mainfrom
test/surface-energy-physical-slab

Conversation

@wladerer

@wladerer wladerer commented Sep 9, 2026

Copy link
Copy Markdown
Owner

What

Adds tests/integration/test_surface_energy_physical.py — a @slow integration gate that validates the physics of the surface_energy task on a genuinely bonded metal slab, closing a gap left by the existing test_surface_energy_task.py (which guards only the plumbing on a non-physical stack of isolated Si atoms, whose γ is correctly negative).

Why

The isolated-atom toy sweep never exercises the sign/magnitude of the intercept→γ map: a sign flip in the Fiorentini-Methfessel intercept, or a wrong n_surfaces divisor, would still pass every existing test. This gate runs the task on an Al(100) slab thickness sweep (3/4/5 layers, vacuum, standard periodic boundary) and asserts:

  • γ > 0 (a stable bonded surface costs energy to create),
  • γ within a broad ±50% physical band [0.030, 0.100] eV/Ų around the known PBE Al(100) value (≈ 0.056–0.062 eV/Ų / 0.9–1.0 J/m²; Da Silva et al. PRB 73, 205409 (2006); Tran et al. Sci. Data 3, 160080 (2016)),
  • the summary γ is exactly the FM fit of the returned sweep, and
  • the FM-vs-direct-subtraction identity holds per thickness.

Al PAW (3 valence e⁻) is used rather than the Al ONCV fixture (11 e⁻, 2s2p semicore) to keep the sweep cheap.

Result

Measured γ ≈ 0.070 eV/Ų (1.12 J/m²) on asus — positive and the right magnitude. The driver's sign and n_surfaces factor are correct; no bug exposed. Test passes on asus.

New file only — does not touch test_surface_energy_task.py (concurrently edited by #455).

🤖 Generated with Claude Code

https://claude.ai/code/session_018j6BBnPtBSjkrnASSc52mT

wladerer and others added 2 commits September 9, 2026 14:03
The existing surface_energy task test guards only the plumbing on a
non-physical stack of isolated Si atoms (γ correctly comes out negative
for non-interacting atoms). That leaves the intercept→γ physics unguarded:
a sign flip in the Fiorentini-Methfessel intercept or a wrong n_surfaces
divisor would still pass.

Add a @slow integration gate that runs the task on a genuinely bonded
Al(100) slab thickness sweep (3/4/5 layers, Al PAW = 3 valence e⁻ to keep
it cheap) and asserts γ is physical: γ > 0 and within a broad ±50% band
around the known PBE Al(100) value (≈0.056–0.062 eV/Ų / 0.9–1.0 J/m²).
Keeps the FM-vs-direct-subtraction identity check and a fit-consistency
check against the returned sweep.

Measured γ ≈ 0.070 eV/Ų (1.12 J/m²) — positive, right magnitude; no
driver sign/factor bug.

New file (does not touch test_surface_energy_task.py, concurrently edited
by PR #455).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018j6BBnPtBSjkrnASSc52mT
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018j6BBnPtBSjkrnASSc52mT
@wladerer
wladerer enabled auto-merge (squash) September 9, 2026 21:35
@wladerer
wladerer merged commit 4c3eab0 into main Sep 9, 2026
15 checks passed
@wladerer
wladerer deleted the test/surface-energy-physical-slab branch September 9, 2026 22:12
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