Preserve qNEP charge_mode (1 vs 2) through Model read/write roundtrip
Model collapsed qNEP charge_mode 1 and 2 into a single model_type
string (potential_with_charges), so write() always emitted the
unrecognized header nep4_potential_with_charges instead of
nep4_charge1/nep4_charge2. Since charge_mode 1 and 2 select different
Ewald-summation algorithms in GPUMD, this silently produced wrong physics
on read_model() -> write() roundtrips. A zbl + charge combination also
dropped the charge suffix entirely.
Changes
- Add an explicit
charge_modefield toModel, populated on read and used bywrite()to reconstruct the correct header. - Wire
charge_modethroughaugment(charge_head=True, charge_mode=...)andprune(charge_head=True). - Add tests covering header roundtrips for
charge_mode1 and 2, invalidcharge_modevalues, and a CPUNEP/GPUNEP prediction-equivalence check comparing original vs. roundtrippednep.txtfiles for both modes.