Using I_CONSTRAINED_M

Queries about input and output files, running specific calculations, etc.


Moderators: Global Moderator, Moderator

Post Reply
Message
Author
mtardieux
Newbie
Newbie
Posts: 18
Joined: Wed Aug 02, 2023 3:10 pm

Using I_CONSTRAINED_M

#1 Post by mtardieux » Tue Feb 03, 2026 3:31 pm

Dear VASP forum,

I would like to run calculations in which I constrain the magnetic moment of a magnetic atom to different values. In particular, I would like to perform a series of five calculations, each with a different target magnetic moment ranging from 0 μB to 5 μB.
I consulted the VASP wiki and found information on the use of I_CONSTRAINED_M to constrain the magnetic moment. In my calculations, I would like to constrain both the direction of the magnetic moment (out of plane) and its magnitude (I_CONSTRAINED_M = 2). From my understanding, this is set using M_CONSTR.

My questions are the following:

  • Is the INCAR I'm using correct? (example given below for a constrained magnetic moment of 3 μB, where only the first atom is magnetic)
    Do we still need to specify MAGMOM in the INCAR when using constrained magnetic moments, and if so, how should it be set?

Code: Select all

ISYM = 0
ENCUT = 350
EDIFF = 1E-6
NELM = 200
ISMEAR = -5
SIGMA = 0.05
GGA = PE

LSORBIT = .TRUE.
LNONCOLLINEAR = .TRUE.
SAXIS = 0 0 1
LORBIT = 11

I_CONSTRAINED_M = 2
M_CONSTR = 0 0 3  0 0 0  0 0 0  0 0 0  0 0 0  0 0 0  0 0 0
LAMBDA = 10
RWIGS = 1.323 1.577 1.535
MAGMOM = 0 0 3  0 0 0  0 0 0  0 0 0  0 0 0  0 0 0  0 0 0
AMIX          = 0.1
BMIX          = 0.00001
AMIX_MAG      = 0.2
BMIX_MAG      = 0.00001
  • Additionally, how and where can I check the converged magnetic moment on the atom of interest?

Thank you for your help,
Marie


andreas.singraber
Global Moderator
Global Moderator
Posts: 371
Joined: Mon Apr 26, 2021 7:40 am

Re: Using I_CONSTRAINED_M

#2 Post by andreas.singraber » Thu Feb 05, 2026 3:35 pm

Hello Marie!

To the best of my knowledge your INCAR file is fine. MAGMOM is definitely needed here because it initializes magnetic moments while I_CONSTRAINED_M + M_CONSTR + LAMBDA tries to maintain a given value. We recommend to set MAGMOM to the same or slightly higher values than the ones in M_CONSTR.

The output of the constrained local moments approach should be given in the OSZICAR file, see this example on our Wiki: https://vasp.at/wiki/Constraining_local ... ic_moments (note that this is for I_CONSTRAINED_M = 1).

Please note that for a given magnetic moment constraint the value of LAMBDA needs to be scanned carefully to get the correct total energy. In practice, LAMBDA should be slowly increased as mentioned on our Wiki page for I_CONSTRAINED_M:

The weight λ, with which the penalty terms enter into the total energy expression and the Hamiltonian in the above is specified through the LAMBDA tag.

As is probably clear from the above, applying constraints by means of a penalty functional contributes to the total energy. This contribution, however, decreases with increasing LAMBDA and can in principle be made vanishingly small [1]. Increasing LAMBDA stepwise, from one run to another (slowly so the solution remains stable) one thus converges towards the DFT total energy for a given magnetic configuration.

For details on how this could look like please consult the publication cited on the same page (http://doi.org/10.1103/PhysRevB.91.054420).

All the best,
Andreas Singraber


mtardieux
Newbie
Newbie
Posts: 18
Joined: Wed Aug 02, 2023 3:10 pm

Re: Using I_CONSTRAINED_M

#3 Post by mtardieux » Mon Feb 09, 2026 12:19 pm

Hello Andreas,

Thanks a lot for your reply.
I'll test all that and let you know if I encounter issues.

Best regards,
Marie


mtardieux
Newbie
Newbie
Posts: 18
Joined: Wed Aug 02, 2023 3:10 pm

Re: Using I_CONSTRAINED_M

#4 Post by mtardieux » Tue Feb 17, 2026 8:24 pm

Hi,
I have a follow-up question. Would it be possible to also constrain the magnetic moment of the magnetic atom to 0 μB?

Best regards,
Marie


andreas.singraber
Global Moderator
Global Moderator
Posts: 371
Joined: Mon Apr 26, 2021 7:40 am

Re: Using I_CONSTRAINED_M

#5 Post by andreas.singraber » Thu Feb 19, 2026 2:45 pm

Hello Marie,

well, if you intend to get a non-magnetic solution then it would be best to perform a non-spin-polarized calculation. However, the solution will typically not be identical to the one obtained when constraining all magnetic moments to zero. Also, I guess you rather want to "suppress" an individual moment, to continue your sequence of calculations down towards 0 μB.

In principle I_CONSTRAINED_M = 2 can be used to constrain moments also to (almost) zero. However, since entering zeros for a particular ion in M_CONSTR is already used to signal that there should be no constraining we have to trick the VASP routine which is processing the input. The values from the INCAR file are compared against a "tiny" number (1.0E-5) and if all three components of an ion are below this threshold, the constraint is not imposed for the respective ion. Hence, if you want to impose an almost zero magnetic moment constraint for a given ion you can set a number slightly above the threshold, e.g. 2.0E-5, and the constraint should be active. Typically, this should be close enough to zero. If not, then unfortunately the threshold cannot be modified without recompilation. If you find it to be really necessary to go below 1.0E-5 then you could update the variable TINY at the top of the constrmag.F file (line 27 in VASP 6.5.1) which hard-codes the threshold and then recompile VASP.

Hope this helps!

All the best,
Andreas Singraber


mtardieux
Newbie
Newbie
Posts: 18
Joined: Wed Aug 02, 2023 3:10 pm

Re: Using I_CONSTRAINED_M

#6 Post by mtardieux » Fri Feb 20, 2026 3:45 pm

Hello Andreas,

Ok perfect, good to know! I'll try constraining the moment to the value you suggested.
Thank you very much :)

Best wishes,
Marie


Post Reply