[QE-users] Question on using bands.x with nspin=2 and total_magnetization=1

Pietro Davide Delugas pdelugas at sissa.it
Wed Sep 3 16:49:36 CEST 2025


dear Rameswar
The bands program is usually called after a pw run with calculation='bands'. This is a non-self-consistent calculation, so it is not necessary to specify the total magnetisation constraint in its input. pw reads the density, initialises the KS Hamiltonian and computes the eigenvalues. Removing total magnetisation will likely avoid the error.
It might be, though, that the two Fermi levels are still reported in the XML file, and this may cause the bands to fail.
in that case just send me the XML file, I will try to fix it manually.
For the future, we will look into bands to see the reason for this block and remove it.
pietro
________________________________
From: users <users-bounces at lists.quantum-espresso.org> on behalf of Rameswar Bhattacharjee <rb1820 at georgetown.edu>
Sent: Wednesday, September 3, 2025 16:33
To: Quantum ESPRESSO users Forum <users at lists.quantum-espresso.org>
Subject: Re: [QE-users] Question on using bands.x with nspin=2 and total_magnetization=1


Dear QE community,

I would greatly appreciate your advice on this. Basically, I am trying to perform a band structure calculation for a unit cell that contains an unpaired electron and is therefore paramagnetic. Could you please suggest the proper way to handle this setup?

Thank you for your guidance.

Best regards,

On Sun, Aug 31, 2025 at 5:03 PM Rameswar Bhattacharjee <rb1820 at georgetown.edu<mailto:rb1820 at georgetown.edu>> wrote:
Dear Dr Paulatto,
Thank you very much for your response. Actually, the error I am getting is as below'

---------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     Error in routine bands (1):
    The bands code with constrained magnetization has not been tested
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--------------------------------------------------------

And I was wrong earlier, the error also appears even if I do not use spin_component. I think this error shows as I have "total_magnetization=1" in my scf input.  Now, my system has -2 charge and the spin multiplicity is 2.  When I used starting_magnetization instead of total_magnetization, all the calculations were fine but I did not get the right magnetic moment as I expected.

Basically, I did an scf, nscf, bands and then used a post procession calculation using bands.x to generate the ".dat" file for the band structure. The first three job competed successfully and the error appears only in the last post procession calculation for which the input is below:

---------------

&BANDS

  prefix = 'crystal_from_cif',

  outdir='./scratch'

  filband = 'bands.dat'

/

---------------

I am also attaching the other inputs for you to take a quick look. Please note that the coordinates are not complete in the inputs

I am also curious to know about your comment above "It depends on what you want to achieve." Could you please elaborate this a bit more?

Your advice would be highly appreciated.

Thanks
Rameswar

On Sun, Aug 31, 2025 at 3:54 PM Lorenzo Paulatto <lorenzo.paulatto at cnrs.fr<mailto:lorenzo.paulatto at cnrs.fr>> wrote:


  *   Should I use the spin_component keyword to specify up-spin or down-spin bands, or is it recommended to simply run bands.x without this keyword?

It depends on what you want to achieve.

  *   I tried using spin_component=1 and 2, but I encountered errors in both cases. On the other hand, when I ran bands.x without the spin_component keyword, the job completed normally.

Which error?

Could you please advise on the correct way to handle this situation? Any guidance or clarification would be greatly appreciated.

The correct way is to provide the full input and output of the calculation that is giving you trouble. And, more in general, if you think that a specific output is wrong, you should explain why you think so.

kind regards

Thank you in advance for your help.

Best regards,
Rameswar Bhattacharjee

--
Rameswar Bhattacharjee
Georgetown University
Washington, DC 20057



_______________________________________________________________________________
The Quantum ESPRESSO Foundation stands in solidarity with all civilians worldwide who are victims of terrorism, military aggression, and indiscriminate warfare.
--------------------------------------------------------------------------------
Quantum ESPRESSO is supported by MaX (www.max-centre.eu<http://www.max-centre.eu>)
users mailing list users at lists.quantum-espresso.org<mailto:users at lists.quantum-espresso.org>
https://lists.quantum-espresso.org/mailman/listinfo/users

--
Dr. Lorenzo Paulatto
IR IMPMC - CNRS UMR 7590 / Sorbonne Université / MNHN
phone: +33 (0)1 442 79822 / telegram: lpaulatto
http://www.impmc.upmc.fr/~paulatto/ - https://anharmonic.github.io/
23-24/423 B115, 4 place Jussieu 75252 Paris CX 05
_______________________________________________________________________________
The Quantum ESPRESSO Foundation stands in solidarity with all civilians worldwide who are victims of terrorism, military aggression, and indiscriminate warfare.
--------------------------------------------------------------------------------
Quantum ESPRESSO is supported by MaX (www.max-centre.eu<http://www.max-centre.eu>)
users mailing list users at lists.quantum-espresso.org<mailto:users at lists.quantum-espresso.org>
https://lists.quantum-espresso.org/mailman/listinfo/users


--
Rameswar Bhattacharjee
Georgetown University
Washington, DC 20057


--
Rameswar Bhattacharjee
Assistant Research Professor
Department of Chemistry
Georgetown University
Washington, DC 20057
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20250903/9c01cacb/attachment.html>


More information about the users mailing list