NBANDS is surprisingly low

Problems running VASP: crashes, internal errors, "wrong" results.


Moderators: Global Moderator, Moderator

Locked
Message
Author
asrosen
Newbie
Newbie
Posts: 27
Joined: Wed Oct 18, 2023 4:51 pm

NBANDS is surprisingly low

#1 Post by asrosen » Tue Aug 19, 2025 4:33 pm

I am running a VASP 6.5.1 calculation and am getting the following in the OUTCAR:

Code: Select all

 -----------------------------------------------------------------------------
|                                                                             |
|     EEEEEEE  RRRRRR   RRRRRR   OOOOOOO  RRRRRR      ###     ###     ###     |
|     E        R     R  R     R  O     O  R     R     ###     ###     ###     |
|     E        R     R  R     R  O     O  R     R     ###     ###     ###     |
|     EEEEE    RRRRRR   RRRRRR   O     O  RRRRRR       #       #       #      |
|     E        R   R    R   R    O     O  R   R                               |
|     E        R    R   R    R   O     O  R    R      ###     ###     ###     |
|     EEEEEEE  R     R  R     R  OOOOOOO  R     R     ###     ###     ###     |
|                                                                             |
|     The number of bands is not sufficient to hold all electrons. I am       |
|     sorry, but this calculation does not make sense. If you want to         |
|     calculate only selected states, you need to set either EFERMI or        |
|     EREF. EREF specifies around which energy states are supposed to be      |
|     calculated.                                                             |
|     I found NBANDS = 80, NELECT = 176.                                      |
|                                                                             |
|       ---->  I REFUSE TO CONTINUE WITH THIS SICK JOB ... BYE!!! <----       |
|                                                                             |
 -----------------------------------------------------------------------------

However, it is not immediately clear to me why NBANDS is being set so low by VASP and causing this error. As I understand it, the default NBANDS value in VASP is max(NELECT/2 + NIONS/2, NELECT*0.6), which for this system would be max(176/2 + 24/2, 176*0.6) = max(100, 105.6) = 106 if we are rounding. Then, there are additional modifications to NBANDS where it is supposed to be increased until it is divisible by the value of NCORE, which we have set as 14. So, I would naively expect the default NBANDS to be 112. There is also further increasing to account for the initial magnetic moments according to the manual, but I don't know what that means exactly. In any case this is all, of course, very different than the default of 80 shown above, which causes a problem.

Can you explain why VASP is setting NBANDS to such a problematically low number? The input/output files are attached.

You do not have the required permissions to view the files attached to this post.

ferenc_karsai
Global Moderator
Global Moderator
Posts: 581
Joined: Mon Nov 04, 2019 12:44 pm

Re: NBANDS is surprisingly low

#2 Post by ferenc_karsai » Fri Aug 22, 2025 8:08 am

For ISPIN>1 or non-collinear calculations also the sum of atomic magnetic moments is (sum+1 and divided by 2 to be precise) added to determine NBANDS.
If one has negative moments in the INCAR file as in your case ("MAGMOM = 8-6.8910 40.0740 4*0.0130 ..." in the INCAR) this sum can become negative and is falsely lowering NBANDS. Instead of the sum of the actual values the absolute value should be taken. We will investigate if this is the best fix in future releases.

For the moment you should simply set NBANDS manually or don't use negative values for MAGMOM.

To obtain the default values for NBANDS with negative MAGMOM do the following:

-) You can set in your INCAR file only positive magnetic moments
"MAGMOM = 86.8910 40.0740 40.0130 40.0170 40.0130"
-) Run VASP in dry mode (this will set default parameters but won't do actual calculations)
mpirun -np desired_number_of_cores vasp_exec --dry-run
-) Extract NBANDS from OUTCAR file
-) Set NBANDS in the INCAR file and use original magnetic moments
"MAGMOM = 8
-6.8910 40.0740 40.0130 40.0170 40.0130"


ferenc_karsai
Global Moderator
Global Moderator
Posts: 581
Joined: Mon Nov 04, 2019 12:44 pm

Re: NBANDS is surprisingly low

#3 Post by ferenc_karsai » Fri Aug 22, 2025 12:20 pm

This bug will be fixed in the new release and I have created a known issue for this on the VASP wiki page:
https://vasp.at/wiki/Known_issues


asrosen
Newbie
Newbie
Posts: 27
Joined: Wed Oct 18, 2023 4:51 pm

Re: NBANDS is surprisingly low

#4 Post by asrosen » Fri Aug 22, 2025 12:25 pm

Thank you for looking into this and for the forthcoming bug fix!


Locked