Skip to content

Commit c658cc0

Browse files
author
root
committed
abacus: fix bug in make_abacus_scf_stru
1 parent 86bfe1b commit c658cc0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

dpgen/generator/lib/abacus_scf.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,16 @@ def make_abacus_scf_stru(
213213
):
214214
sys_data_copy = copy.deepcopy(sys_data)
215215
# re-construct the path of files by pporb + file name
216-
fp_pp_files = [os.path.join(pporb, i) for i in fp_pp_files]
216+
# when element in sys_data is part of type_map/fp_pp_files
217+
# we need to only pass the pp_file in sys_data, but not all pp_files
218+
if type_map is None:
219+
type_map = sys_data_copy.data["atom_names"]
220+
221+
fp_pp_files = [os.path.join(pporb, fp_pp_files[type_map.index(atom_name)]) for atom_name in sys_data_copy.data["atom_names"]]
222+
217223
if fp_orb_files is not None:
218-
fp_orb_files = [os.path.join(pporb, i) for i in fp_orb_files]
224+
fp_orb_files = [os.path.join(pporb, fp_orb_files[type_map.index(atom_name)]) for atom_name in sys_data_copy.data["atom_names"]]
225+
219226
if fp_dpks_descriptor is not None:
220227
fp_dpks_descriptor = os.path.join(pporb, fp_dpks_descriptor)
221228

0 commit comments

Comments
 (0)