aiida-quantumespresso
aiida-quantumespresso copied to clipboard
`PwParser`: Parse structures from XML instead of `stdout`
I've noticed that in more recent versions of Quantum ESPRESSO (have to check from which version exactly), the structure is also in the XML output:
<step n_step="1">
<scf_conv>
<convergence_achieved>true</convergence_achieved>
<n_scf_steps>10</n_scf_steps>
<scf_error>0.000000000000000e0</scf_error>
</scf_conv>
<atomic_structure nat="2" alat="5.354555981662e0">
<atomic_positions>
<atom name="Fe" index="1">0.000000000000000e0 0.000000000000000e0 0.000000000000000e0</atom>
<atom name="Fe" index="2">2.677277990831121e0 2.677277990831121e0 2.677277990831121e0</atom>
</atomic_positions>
<cell>
<a1>5.354555981662241e0 0.000000000000000e0 0.000000000000000e0</a1>
<a2>0.000000000000000e0 5.354555981662241e0 0.000000000000000e0</a2>
<a3>0.000000000000000e0 0.000000000000000e0 5.354555981662241e0</a3>
</cell>
</atomic_structure>
<total_energy>
<etot>-3.292707564170990e2</etot>
<eband>-1.591327167812315e1</eband>
<ehart>6.540299538320787e1</ehart>
<vtxc>-3.582380599363634e1</vtxc>
<etxc>-3.482422169431405e1</etxc>
<ewald>-1.739908530725683e2</ewald>
<demet>-4.317397130168570e-3</demet>
</total_energy>
<forces rank="2" dims="3 2" order="F">
0.000000000000000e0 0.000000000000000e0 0.000000000000000e0
0.000000000000000e0 0.000000000000000e0 0.000000000000000e0
</forces>
</step>
Hence, it would probably be good to move to parsing this from the XML, as this is more robust, especially when we have to support both SIRIUS-enabled and regular QE.
Also a step towards https://github.com/aiidateam/aiida-quantumespresso/issues/353. Note that this issue is rather general, and cannot be closed anytime soon since some important output (e.g. the atomic magnetic moments) is not yet in the XML. Perhaps we can make this issue a place where we keep track of things that we would like to see parsed from the XML, and then check if it's there, and if not open an issue on the QE repo.
Will probably also fix this TODO here:
https://github.com/aiidateam/aiida-quantumespresso/blob/8542ab170a5ec9a459eb9b5a69c7d4b996f41eed/aiida_quantumespresso/parsers/parse_xml/parse.py#L425
Basically, I'll try to add all information in the steps
output in the XML to the output_trajectory
node. This will require merging it with the output_trajectory
parsed from the stdout
.
Alright, digging through the parser code some more, I finally saw that the final structure is parsed from the XML. Bumping down the priority a bit then, since I only really needed that one for the SIRIUS direct minimization runs. ^^