Skip to content

Commit

Permalink
Changed the stress and forces to be eV/A and GPa
Browse files Browse the repository at this point in the history
  • Loading branch information
Minotakm committed May 3, 2024
1 parent 05eea67 commit 642a077
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/aiida_quantumespresso/parsers/parse_xml/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,9 +602,11 @@ def parse_step_to_trajectory(trajectory, data, skip_structure=False):
if 'forces' in data and '$' in data['forces']:
forces = np.array(data['forces']['$'])
dimensions = data['forces']['@dims'] # Like [3, 2], should be reversed to reshape the forces array
forces = forces * CONSTANTS.haBohr_to_eVA
trajectory['forces'].append(forces.reshape(dimensions[::-1]))

if 'stress' in data and '$' in data['stress']:
stress = np.array(data['stress']['$'])
dimensions = data['stress']['@dims'] # Like [3, 3], should be reversed to reshape the stress array
stress = stress * CONSTANTS.haBohr3_to_GPa
trajectory['stress'].append(stress.reshape(dimensions[::-1]))

0 comments on commit 642a077

Please sign in to comment.