Skip to content

Develop - #12

Merged
knc6 merged 13 commits into
mainfrom
develop
Jul 5, 2026
Merged

Develop#12
knc6 merged 13 commits into
mainfrom
develop

Conversation

@knc6

@knc6 knc6 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

No description provided.

knc6 added 13 commits May 22, 2026 01:13
- examples/lammps/ALIGNN_FF_LAMMPS_Colab.ipynb: end-to-end Colab notebook
  (install ALIGNN, build LAMMPS with pair_alignn, download default mps model,
  relax Si, run NVE + melt-quench, plot results). Linked in README.
- scripts/torch/lammps_package/: drop-in ML-ALIGNN LAMMPS package mirroring
  the LAMMPS source tree (src/ML-ALIGNN, cmake module, doc page, example),
  with install steps and an upstream-PR checklist.
The notebook called get_model.py / build_si.py / *.in which were untracked,
so a fresh clone (and the Colab run) couldn't find them. Commit the example
source/input files (not the generated .pt/.data/.lammpstrj artifacts), and
fix the notebook to clone the develop branch where these examples live and
to read the atom count from si.data instead of hardcoding it.
get_prediction now uses the DGL-free pure-torch path when pure_torch=True
or when DGL is not installed. Adds load_pure_torch_model,
get_figshare_model_pure, and get_prediction_pure, plus a --pure_torch CLI
flag. Pure models are pulled from all_models_alignn_atomwise.json (mps,
formation_energy_peratom, mbj_bandgap, bulk_modulus_kv, ...), built with
build_pure_torch_graph, and run via ALIGNNAtomWisePure(_Smooth).
pair_style now gets <cutoff> <max_neighbors> (both read from the model
config if unset), matching what the model was trained with. Adds
--fail-force/--fail-energy thresholds and a non-zero exit on gross
pair_alignn-vs-Python mismatch so it can be used as a pre-MD gate.
pair_alignn.cpp computed periodic cell offsets with diagonal box lengths
only (round(disp/h_i)), which is wrong for non-orthogonal boxes. A 3x3x3
supercell of JVASP-1002 (the 2-atom primitive FCC cell) is triclinic, so
shifts were wrong on ~90% of ghost edges (edge-vector errors up to ~23 A),
producing garbage forces and exploding MD (T -> 1e6 K).

Replace with an exact triangular back-substitution against the LAMMPS
lower-triangular lattice rows; reduces to diagonal rounding for orthogonal
boxes. Applied to both the dev pair style and the ML-ALIGNN package copy.

Also: build_si.py now uses the conventional (cubic) cell so its supercell
stays orthogonal -> works correctly even with an already-compiled binary.
Verified: ASE NVE on the cubic cell conserves energy (~0.15 meV/atom over
250 fs); triclinic shift recovery is exact (2000/2000) vs 196/2000 before.
The ASE AlignnAtomwiseCalculator builds a DGL neighbor graph, which differs
(~0.1 eV/A) from the pure-torch k-nearest graph that pair_alignn implements
and the mps model was trained with (neighbor_strategy=pure_torch). Comparing
against it produced false gate failures. Default reference is now 'pure'
(build_pure_torch_graph + forward_tensors_z), the apples-to-apples baseline;
--reference ase keeps the old behavior.
@knc6
knc6 merged commit 367bc55 into main Jul 5, 2026
2 checks passed
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