Stage 1: generic two-center model (overlap S = I + 2C)#5
Open
cortner wants to merge 11 commits into
Open
Conversation
Implements the linear two-center overlap model end-to-end: - blocks.jl: OrbitalBasis (per-species shells) and global matrix block bookkeeping (OrbitalLayout, shell_range). - overlap.jl: OverlapModel + assemble_S. On-site S_ii = identity; off-site S_ij is a bond-harmonic expansion recoupled via transform_Λ, summing only proper-parity (l+l'+Λ even) channels since a single bond vector is a proper tensor. Hermiticity by post-hoc symmetrization ½(S+Sᵀ). - Bond radial basis via ACEpotentials.Models.ace_learnable_Rnlrzz; angular basis via Polynomials4ML real spherical harmonics. Adds ACEpotentials / Polynomials4ML / Random deps and the §12 symmetry suite restricted to S: rotation, inversion (+parity), Hermiticity, permutation, cutoff smoothness (311 tests total).
A single bond vector supplies only even-(l+l'+Λ) channels, which is complete for a two-center quantity (the count matches Slater-Koster). Reword the comments accordingly; :proper -> :even. No behaviour change.
Follow-up to the BlockCoupling refactor on #4: the parities field is gone, so the overlap model computes the even-(l+l'+L) check via channel_parity at the point it selects channels.
Design revision: the overlap and Hamiltonian models are independent structs with independent hypers, parameters, and forward passes. Rationale: initial focus is experimentation with possibly unrelated forms of S and H, and S is much cheaper than H. Shared building blocks (coupling, embeddings, block bookkeeping) remain at the code level. Stage 1's OverlapModel already follows this design.
- Rename overlap.jl -> twocenter.jl, OverlapModel -> TwoCenterModel, assemble_S -> assemble: the model is a generic linear bond-only two-center model (generalized Slater-Koster table), not overlap- specific. It now assembles the purely off-site matrix; callers add their on-site term (overlap: S = I + assemble(model, ...)). - Graph input per plan sec 3.3: graph(model, sys) and assemble(model, G::ETGraph, W) via ET.Atoms.interaction_graph (NeighbourLists-backed, PBC incl. self-image bonds, Gamma-point). bondlist retained as the brute-force free-cluster cross-check. - New deps: NeighbourLists, Unitful (both already in the dep tree); test extras AtomsBase, AtomsBuilder. - Tests: renamed to test_twocenter.jl; new graph+PBC testset (free- cluster cross-check, PBC Hermiticity, translation-with-wrap, rotation of positions and cell). Plan/design docs updated.
Member
Author
|
On hold. This staged implementation has become hard to review and will be restarted from scratch. The PR stays open for reference, but it should not be merged or updated for now. |
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 1 of the linear 2-center model (plan in
agents/plan_lin2c.md, design §8). Base:main(#4 merged).What this adds
src/linear2c/blocks.jl—OrbitalBasis(per-species shell lists) and global matrix block bookkeeping (OrbitalLayout,shell_range,species_norb,maxL).src/linear2c/twocenter.jl—TwoCenterModel+assemble: a generic linear bond-only two-center model (a generalized Slater–Koster table), of which the overlap matrix is the first instantiation:Λ, bond harmonicsφ^b_{nΛ}(r_ji) = R^b_{nΛ}(r) Y_{Λ}(r̂)are contracted with learnable per-(species-pair, shell-pair, Λ) coefficients and recoupled to the(m,m')block viatransform_Λ(Stage 0). Callers add their own on-site term — overlap:S = I + assemble(model, …).l+l'+Λ) channels contribute — complete for any single-bond quantity.X ← ½(X+Xᵀ).graph(model, sys)/assemble(model, G::ETGraph, W)viaET.Atoms.interaction_graph(NeighbourLists-backed). Periodic-image bonds — including self-images — accumulate into the same block (Γ-point convention). A brute-forcebondlistis retained as the free-cluster cross-check.ACEpotentials.Models.ace_learnable_Rnlrzz(the decided dependency; species asIntatomic numbers); angular basis fromPolynomials4MLreal spherical harmonics.NeighbourLists,Unitful(both already in the dependency tree); test extrasAtomsBase,AtomsBuilder.Notes / decisions in play
SandHare separate, independent models — no single model producing the pair(H, S). The initial focus is experimentation with possibly unrelated forms ofSandH, andSis much cheaper; they share building blocks only (agents/plan_lin2c.md§3.6,docs/src/twocenter.md§§1, 8, 10, 11, 14).OverlapModel/assemble_S→ genericTwoCenterModel/assemble; on-site handling moved to the caller.ET.EdgeEmbed(whose pooled layout targets the env basis) — recorded as a deviation in the plan. Lux-layer glue is Stage-5 scope.Polynomials4MLreal-SH ordering (degree-lblock at(l²+1):(l+1)², ascendingm) is equivariant withO3.D_from_angles(·,real), consistent with the coupling from Stage 0.Tests (351 total)
§12 suite restricted to the 2C model: rotational equivariance, inversion equivariance + parity signs, Hermiticity, permutation equivariance, cutoff smoothness (
C¹envelope, vanishing beyondr_cut), plus the new graph + PBC set: free-cluster graph path ≡ brute-force bondlist, PBC Hermiticity (self-image bonds), translation invariance under wrap, rotational equivariance with rotated cell.🤖 Generated with Claude Code