NEP_CPU produces incorrect results when a single NEP instance is reused to compute multiple structures sequentially in charge mode. This bug does not occur when creating a new NEP instance for each structure.
The issue is caused by improper state management in the EwaldNep class. The num_kpoints_max variable only increases and never decreases, causing it to retain the maximum k-point count from previous calculations rather than using the current structure's actual k-point count.
NEP_CPU produces incorrect results when a single NEP instance is reused to compute multiple structures sequentially in charge mode. This bug does not occur when creating a new NEP instance for each structure.
The issue is caused by improper state management in the EwaldNep class. The num_kpoints_max variable only increases and never decreases, causing it to retain the maximum k-point count from previous calculations rather than using the current structure's actual k-point count.