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_mode field to Model, populated on read and used by write() to reconstruct the correct header.
  • Wire charge_mode through augment(charge_head=True, charge_mode=...) and prune(charge_head=True).
  • Add tests covering header roundtrips for charge_mode 1 and 2, invalid charge_mode values, and a CPUNEP/GPUNEP prediction-equivalence check comparing original vs. roundtripped nep.txt files for both modes.

Merge request reports

Loading