Commit d7287ef
Han Wang
fix(dpa4): atom exclusion and stat capabilities must reach the composition
Two more capabilities the ZBL composition dropped.
atom_exclude_types was NOT forwarded, and my earlier commit 749fd49
justified that with the claim that forwarding would double-apply. That was
wrong. The composition's own atom_excl was None, the learned child masked
only itself, and the analytical child never heard about the exclusion, so
an atom the user excluded still collected its share of the ZBL energy: on
an Ni-O dimer at 0.9 A, excluding type 1 moved the energy only 80.553 ->
80.201 while the ~80 eV analytical term stayed. Masking to zero is
idempotent, so the child keeping its own copy is harmless -- forwarding
applies it once, at the layer that owns the shared graph. Now 80.201 ->
40.219; the residual is correct, being Ni's half of a pair term whose
other half belonged to the excluded atom, exactly as an excluded atom
still contributes to its neighbours' learned energies.
get_intensive and get_compute_stats_distinguish_types fell through to the
base defaults instead of asking the children, so a bridged model would fit
its out-stat bias with the wrong extensivity and the wrong
type-distinguishing rule. Aggregated deliberately differently: intensive
iff EVERY child is (a sum cannot be intensive while one child scales),
type-distinguishing if ANY child needs it (the stricter rule is safe for
children that do not care).
The atom-exclusion regression fails without the fix. The stat-capability
one does NOT discriminate for an energy DPA4 -- its children happen to
agree with the base defaults -- so it is a structural pin only.1 parent 7537e6a commit d7287ef
4 files changed
Lines changed: 97 additions & 0 deletions
File tree
- deepmd
- dpmodel
- atomic_model
- model
- pt_expt/model
- source/tests/common/dpmodel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
612 | 612 | | |
613 | 613 | | |
614 | 614 | | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
615 | 636 | | |
616 | 637 | | |
617 | 638 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
157 | 165 | | |
158 | 166 | | |
159 | 167 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
245 | 253 | | |
246 | 254 | | |
247 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
0 commit comments