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

Rameswar Bhattacharjee rb1820 at georgetown.edu
Mon Sep 15 01:23:25 CEST 2025


Der Pietro,
If I understand correctly, you mean I have to use two fermi energies for
alpha and beta channels to scale my (E-EF). I got two fermi energies from
my nscf method and I am using them for my alpha and beta band, respectively.

Please correct me if I am doing something wrong or missing something from
your point.

Thanks
Rameswar

On Wed, Sep 10, 2025 at 7:58 PM Pietro Davide Delugas <pdelugas at sissa.it>
wrote:

> Good.
> Remember that if you want to compare the bands of the two spin channels
> you will  need also to shift with respect to the other so to that the two
> fermi levels match.
>
> Il 10 set 2025 10:36 PM, Rameswar Bhattacharjee <rb1820 at georgetown.edu>
> ha scritto:
> Dear Pietro
> Thank you very much for your suggestions. Now I used this strategy for one
> system and got band structures for up and down electrons. I really
> appreciate your expert advice to solve this issue.
>
> Rameswar
>
> On Mon, Sep 8, 2025 at 1:25 PM Pietro Davide Delugas <pdelugas at sissa.it>
> wrote:
>
>> Dear Rameswar
>>
>> It is very simple
>>
>> open the file <prefix>.save/data-file-schema.xml
>>
>> search for a line like
>> <two_fermi_energies>7.608312845405552E-001
>>  5.253841076666873E-001</two_fermi_energies>
>>
>> and either remove it completely or  comment it out like this
>> <!--two_fermi_energies>7.608312845405552E-001
>>  5.253841076666873E-001</two_fermi_energies—>
>> Bands should then work fine.
>> Pietro
>> ------------------------------
>> *From:* users <users-bounces at lists.quantum-espresso.org> on behalf of
>> Rameswar Bhattacharjee <rb1820 at georgetown.edu>
>> *Sent:* Saturday, September 6, 2025 18:19
>> *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 Pietro,
>> I am sorry for my late response as I was out and had limited access to
>> the internet. Thank you very much for your response. I tried to use
>> total_magnetization for the scf and for the following nscf and bands, I
>> removed that. However, as you suspected the error remains.
>>
>> I understand that you might fix it if I send you the xml file but I need
>> to run several systems and am looking for a solution. Is there any way you
>> can guide me to remove the error by myself? I can also send you the xml if
>> you kindly fix it and let me know the steps.
>>
>> Thanks you
>> Rameswar
>>
>> On Wed, Sep 3, 2025 at 10:50 AM Pietro Davide Delugas <pdelugas at sissa.it>
>> wrote:
>>
>> 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> 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> 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)
>> users mailing list users at lists.quantum-espresso.orghttps://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)
>> users mailing list 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
>>
>> _______________________________________________________________________________
>> 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)
>> users mailing list users at lists.quantum-espresso.org
>> https://lists.quantum-espresso.org/mailman/listinfo/users
>>
>>
>>
>> --
>> Rameswar Bhattacharjee
>> Assistant Research Professor
>> Department of Chemistry
>> 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)
>> users mailing list users at lists.quantum-espresso.org
>> https://lists.quantum-espresso.org/mailman/listinfo/users
>>
>
>
> --
> Rameswar Bhattacharjee
> Assistant Research Professor
> Department of Chemistry
> 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)
> users mailing list users at lists.quantum-espresso.org
> https://lists.quantum-espresso.org/mailman/listinfo/users



-- 
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/20250914/3249242e/attachment.html>


More information about the users mailing list