[Wien] Fixing Atomic Positions During Geometry minimization:constraint failed!

Laurence Marks laurence.marks at gmail.com
Wed May 7 11:44:01 CEST 2025


Maybe a toy example will help.

Suppose you have a set of balls (atoms) each connected to a flat floor by a
spring, and not connected to each other. To simplify they only move
vertically. Your code gives you the gradient at any position, which is
effectively what the mixer does. You get the gradient at the current
position, move them all a little then get the gradient again. From the
change in gradient you get all the second derivatives. From the first and
second derivative you can find the minimum energy/equilibrium position.

This takes three steps, *independent of how many balls there are*. There is
only one eigenvalue/eigenvector.

Now add more springs in pairs, i.e. atom 1&2, 3&4, 5&6 etc. This now gives
you many 2x2 matrices for the second derivatives, so you need 4 steps,
again independent of the number of balls.

Extrapolate. The number of steps scales with the complexity of the
connecting springs and their response to movement, i.e. phonon modes.

___
Emeritus Professor Laurence Marks (Laurie)
Department of Materials Science and Engineering, Northwestern University
www.numis.northwestern.edu
"Research is to see what everybody else has seen, and to think what nobody
else has thought" Albert Szent-Györgyi

On Wed, May 7, 2025, 04:10 Laurence Marks <laurence.marks at gmail.com> wrote:

> Addendum: why fixing atoms does not do what you might think.
>
> Some people think that if they fix some atoms then the calculations will
> converge faster. This is incorrect, and is based upon a misunderstanding of
> minimization.
>
> In general the speed of minimization does not depend upon the number of
> variable atom positions. For just atoms it depends upon the phonon
> spectrum, and in MSR1a it depends upon the joint atom-electron dielectric
> spectrum, specifically the number of eigenvalue bands and their widths.
> (Rigorously it depends upon the number and width of the eigenvalues of the
> true Jacobian, and also of the current approximation of the Jacobian.)
> Insulators converge faster because their spectra are simpler.
>
> When you fix some atoms it does not follow that you simplify the spectra,
> in fact you may be creating anomalous dielectric bands. You are also now
> doing a constrained optimization, and these are almost always slower and
> less well conditioned.
>
> Plus fixing one surface may create a dipole, electronic defect states in
> the gap and other non-physical mess.
>
> ___
> Emeritus Professor Laurence Marks (Laurie)
> Department of Materials Science and Engineering, Northwestern University
> www.numis.northwestern.edu
> "Research is to see what everybody else has seen, and to think what nobody
> else has thought" Albert Szent-Györgyi
>
> On Wed, May 7, 2025, 03:49 Laurence Marks <laurence.marks at gmail.com>
> wrote:
>
>> Depending upon which version is used the center of mass fixing may be
>> inactive when atoms are fixed, which is why I asked about that. Plus the
>> other questions, as some of the procedure used does not seem right.
>>
>> ___
>> Emeritus Professor Laurence Marks (Laurie)
>> Department of Materials Science and Engineering, Northwestern University
>> www.numis.northwestern.edu
>> "Research is to see what everybody else has seen, and to think what
>> nobody else has thought" Albert Szent-Györgyi
>>
>> On Wed, May 7, 2025, 03:36 Peter Blaha <peter.blaha at tuwien.ac.at> wrote:
>>
>>> mixer tries to keep the center of mass constant (to avoid that all atoms
>>> move in some direction, although their distances are in equilibrium).
>>>
>>> At the moment, you cannot switch this off, although it would make sense
>>> if an atom is constrained in a certain direction (Laurie: I know, you
>>> don't like these constraint positions, but it might be a valuable
>>> modification to use the center of mass in a certain direction only if no
>>> positions are constrained).
>>>
>>> In general I would NOT recommend to fix only one side of the slab, at
>>> least not if you have mirror symmetry along z. You have then a
>>> calculation with a relaxed and an unrelaxed surface !
>>>
>>> What makes sense, is to fix the middle layers of a slab....
>>>
>>> Am 07.05.2025 um 10:21 schrieb Hadjer MEZIANI via Wien:
>>> > Dear wien2k users,
>>> > I am performing geometry minimization (MSR1a) of the TiO₂ surface to
>>> > relax the top layer while keeping the bottom layers fixed, using
>>> > WIEN2k_24.1. I followed these steps:
>>> > 1-Generate struct
>>> > 2- init-lapw
>>> > 3-mini.positions(w2web) and i edit case.inM after that i run pairhase;
>>> > copy .minpair to .minrestart and delete .min_hess.
>>> > 4- run scf with activate optimize positions(MSR1a) with -fc 20.
>>> > I constrained the atoms in the bottom layers by setting `delta=0`, but
>>> > these atoms are still displaced during the minimization.
>>> >
>>> > .inM file in the following way:
>>> > PORT 2.00 0.35 2.00    # PORT/NEWT;  tolf, Initial Trust Radius, tolfa
>>> > 0.0 0.0 0.0 1.0   #Atom    1 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom    2 Generated by pairhess
>>> > 1.0 1.0 1.0 1.0   #Atom    3 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom    4 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom    5 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom    6 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom    7 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom    8 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom    9 Generated by pairhess
>>> > 1.0 1.0 1.0 1.0   #Atom   10 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   11 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   12 Generated by pairhess
>>> > 1.0 1.0 1.0 1.0   #Atom   13 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   14 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   15 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   16 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   17 Generated by pairhess
>>> > 1.0 1.0 1.0 1.0   #Atom   18 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   19 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   20 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   21 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   22 Generated by pairhess
>>> > 1.0 1.0 1.0 1.0   #Atom   23 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   24 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   25 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   26 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   27 Generated by pairhess
>>> > 1.0 1.0 1.0 1.0   #Atom   28 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   29 Generated by pairhess
>>> > 0.0 0.0 0.0 1.0   #Atom   30 Generated by pairhess
>>> > For example, atom 1 has changed position even though it was fixed in
>>> > `.inM`. See output:
>>> > --- atom dependend parameter POS -----------
>>> > in  1 files:
>>> > :POS001: ATOM   -1 X,Y,Z = 0.50000 0.00000 0.04398  MULT= 1  ZZ=
>>> 22.000  Ti
>>> > :POS001: ATOM   -1 X,Y,Z = 0.50000 1.00000 0.04397  MULT= 1  ZZ=
>>> 22.000  Ti
>>> > :POS001: ATOM   -1 X,Y,Z = 0.50000 1.00000 0.04396  MULT= 1  ZZ=
>>> 22.000  Ti
>>> > :POS001: ATOM   -1 X,Y,Z = 0.50000 1.00000 0.04389  MULT= 1  ZZ=
>>> 22.000  Ti
>>> > :POS001: ATOM   -1 X,Y,Z = 0.50000 0.00000 0.04382  MULT= 1  ZZ=
>>> 22.000  Ti
>>> > :POS001: ATOM   -1 X,Y,Z = 0.50000-0.00000 0.04337  MULT= 1  ZZ=
>>> 22.000  Ti
>>> > ......
>>> > My question is: how can i keep positions of these atoms unchanged
>>> during
>>> > structure minimzation!
>>> > Any suggesting are highly welcome
>>> > Thank you in advence
>>> > M. Hadjer
>>> >
>>> >
>>> >
>>> >
>>> > _______________________________________________
>>> > Wien mailing list
>>> > Wien at zeus.theochem.tuwien.ac.at
>>> > http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
>>> > SEARCH the MAILING-LIST at:
>>> http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html
>>>
>>> --
>>> -----------------------------------------------------------------------
>>> Peter Blaha,  Inst. f. Materials Chemistry, TU Vienna, A-1060 Vienna
>>> Phone: +43-158801165300
>>> Email: peter.blaha at tuwien.ac.at
>>> WWW:   http://www.imc.tuwien.ac.at      WIEN2k: http://www.wien2k.at
>>> -------------------------------------------------------------------------
>>>
>>> _______________________________________________
>>> Wien mailing list
>>> Wien at zeus.theochem.tuwien.ac.at
>>> http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
>>> SEARCH the MAILING-LIST at:
>>> http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://zeus.theochem.tuwien.ac.at/pipermail/wien/attachments/20250507/67743e45/attachment.htm>


More information about the Wien mailing list