-
Notifications
You must be signed in to change notification settings - Fork 182
Description
As discussed in deepmodeling/deepmd-kit#1518 , deepmd-kit accept initial systems (DFT results) with less elements type.
However, when try to input similarly to "sys_configs" in param.json when using qe pwscf, it is stuck at step 02.fp, because file dpgen/generator/lib/pwscf.py
allow only POSCAR file with same number of element with "type_map" in param.json, and produce AssertionError if not.
(line 83-86)
ntypes = len(atom_names)
assert(ntypes == len(atom_names))
assert(ntypes == len(atom_masses))
assert(ntypes == len(pps))
This can be solved by modify line 2096 - 2097 of dpgen/generator/run.py
sys_data['atom_masses'] = jdata['mass_map']
ret = make_pwscf_input(sys_data, fp_pp_files, fp_params, user_input = user_input)
to
sys_data['atom_masses'] = []
pps = []
for iii in sys_data['atom_names']:
sys_data['atom_masses'].append(jdata['mass_map'][jdata['type_map'].index(iii)])
pps.append(fp_pp_files[jdata['type_map'].index(iii)])
ret = make_pwscf_input(sys_data, pps, fp_params, user_input = user_input)
I wish this help others.
Please tell me if I did something dumb.