[QE-users] Possible bug in the magnetization report in xml file

Pietro Davide Delugas pdelugas at sissa.it
Fri Aug 15 19:19:42 CEST 2025


Hello,
Thank you for reporting this. Indeed, there is a small bug. But you didn't tell the whole story exactly ...

I have run your test, and this is what I get in the XML for the scf run

<magnetization>
      <lsda>true</lsda>
      <noncolin>false</noncolin>
      <spinorbit>false</spinorbit>
      <total>9.999999999999025E-001</total>
      <absolute>1.183533535462579E+000</absolute>
      <Scalar_Site_Magnetic_Moments nat="63">
        .....
Which is the correct printout

Only if I run an NSCF calculation with two pools do I indeed get what you got.

 <magnetization>
      <lsda>true</lsda>
      <noncolin>false</noncolin>
      <spinorbit>false</spinorbit>
      <total>1.999999999999807E+000</total>
      <absolute>0.000000000000000E+000</absolute>

If I run it with four, the value would be four times the right value.

In the case of nscf calculations, 7.2 used to print all zeros or random non-initialised values. Now it reads the value from the density files and print it, only we are propagating this value to other processes in the wrong way.
So, for older versions, use scf calculations, if you use nscf, don't use pools, or if you use pools, correct the value inside the XML by dividing it by the number of pools you have used.
We will fix it in the new version, even if it were to be released today ...
thanks again
best regards
Pietro

________________________________
From: users <users-bounces at lists.quantum-espresso.org> on behalf of Abdul Muhaymin via users <users at lists.quantum-espresso.org>
Sent: Friday, August 15, 2025 11:56
To: users at lists.quantum-espresso.org <users at lists.quantum-espresso.org>
Subject: [QE-users] Possible bug in the magnetization report in xml file

Hello,

I want to report a possible bug about the magnetization in the xml
files. For an example, in the SCF output file, I am getting correct
total magnetization = 1 mu_B/cell and absolute magnetization = 1.18
mu_B/cell. However, in the OUTDIR/PREFIX.xml and in the
OUTDIR/PREFIX/save/data-file-schema.xml - in these two files the total
magnetization is given as 2 while absolute magnetization is given as 0
(this is incorrect).

data-file-scheme.xml:
     <magnetization>
       <lsda>true</lsda>
       <noncolin>false</noncolin>
       <spinorbit>false</spinorbit>
       <total>2.000000000000038E+000</total>
       <absolute>0.000000000000000E+000</absolute>
     </magnetization>

scf.out:
!    total energy              =  -4732.89719036 Ry
      estimated scf accuracy    <          7.7E-09 Ry

      total magnetization       =     1.00 Bohr mag/cell
      absolute magnetization    =     1.18 Bohr mag/cell

This is not an isolated case. In almost all calculations, this mismatch
of magnetization between the output file and the xml files happens. I am
using QE v7.4.1. This creates problem for post-processing codes such as
WEST code which reads the total magnetization from the xml output to
apply quasiparticle corrections and so on. I attached the output files.
When I inspected my previous calculation, I noticed that this problem
didn't occur in v7.2.

Sincerely,
Abdul Muhaymin
Graduate student, Institute of Material Science and Nanotechnology
Bilkent University, Ankara
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20250815/585733ff/attachment.html>


More information about the users mailing list