Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError happened when use Cp2kBaseWorkChain to do a NEB calculation #107

Open
xjf729 opened this issue Jun 4, 2020 · 1 comment
Open

Comments

@xjf729
Copy link

xjf729 commented Jun 4, 2020

Environment

aiida-core version 1.2.1
aiida-cp2k version 1.1.0

Error Report

When I use Cp2kBaseWorkChain for a NEB calculation, error happened in parse step.

*** 1 LOG MESSAGES:
+-> REPORT at 2020-06-04 03:17:35.625606+00:00
 | [1474|Cp2kCalculation|on_except]: Traceback (most recent call last):
 |   File "/anaconda3/envs/aiidav1/lib/python3.7/site-packages/plumpy/process_states.py", line 220, in execute
 |     result = self.run_fn(*self.args, **self.kwargs)
 |   File "/anaconda3/envs/aiidav1/lib/python3.7/site-packages/aiida/engine/processes/calcjobs/calcjob.py", line 263, in parse
 |     exit_code = execmanager.parse_results(self, retrieved_temporary_folder)
 |   File "/anaconda3/envs/aiidav1/lib/python3.7/site-packages/aiida/engine/daemon/execmanager.py", line 439, in parse_results
 |     exit_code = parser.parse(**parse_kwargs)
 |   File "/anaconda3/envs/aiidav1/lib/python3.7/site-packages/aiida_cp2k/parsers/__init__.py", line 39, in parse
 |     returned = self._parse_trajectory()
 |   File "/anaconda3/envs/aiidav1/lib/python3.7/site-packages/aiida_cp2k/parsers/__init__.py", line 91, in _parse_trajectory
 |     return StructureData(ase=Atoms(**parse_cp2k_trajectory(output_string)))
 |   File "/anaconda3/envs/aiidav1/lib/python3.7/site-packages/ase/atoms.py", line 208, in __init__
 |     self.new_array('numbers', symbols2numbers(symbols), int)
 |   File "/anaconda3/envs/aiidav1/lib/python3.7/site-packages/ase/symbols.py", line 20, in symbols2numbers
 |     numbers.append(atomic_numbers[s])
 | KeyError: '.E+'

Possible Reason

I think the reason maybe in def parse_cp2k_trajectory code.

Because you parse the COORD section in *-1.restart file, however, the COORD section in *-1.restart of NEB don't have information of chemical symbols, then E+ is regarded as chemical symbol. The COORD section in *-1.restart of NEB like follows.

&COORD
    6.7740185951757121E+00    5.9999999787312079E+00    6.2143687594147634E+00
    5.2259808444671396E+00    6.0000000393828854E+00    6.2143688063089808E+00
    4.8129448743603360E+00    5.9999999500883883E+00    5.1990521657080473E+00
    4.8126645585662970E+00    6.8792360991874624E+00    6.7218712281724748E+00
    4.8126646095750898E+00    5.1207639721373717E+00    6.7218712678906591E+00
    7.1870544024378509E+00    5.9999999775529664E+00    5.1990520561417144E+00
    7.1873347582418425E+00    6.8792360937843435E+00    6.7218711966487747E+00
    7.1873347372392553E+00    5.1207638983179260E+00    6.7218712597601877E+00
&END COORD

I think parse the last frame of *-pos-1.xyz file maybe a better choice.

@dev-zero
Copy link
Contributor

dev-zero commented Oct 7, 2020

I tend to agree here: whenever we can let CP2K write a (more or less) standardized file format we should do that and use a parser for the specific file. The other option would be to use the cp2k-input-tools to parse the restart file (which is an input file).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants