[Pw_forum] question about constrained magnetization

Gabriele Sclauzero sclauzer at sissa.it
Thu Dec 3 14:49:47 CET 2009



Cyrille Barreteau wrote:
> Gabriele Sclauzero wrote:
> 
>> Dear Cyrille,
>>
>> Cyrille Barreteau wrote:
>>  
>>
>>> Dear all,
>>>
>>> I want to perform a calculation using the penalization technique.
>>> In an unconstrained scf calculation the input_magnetization(i) (i=1,ntyp)
>>> variable contains the m/n initial value of atom of type i, and this 
>>> quantity should
>>> obviously belong to [-1,1] interval.
>>> To perform a constrained magnetization of "atomic type" I have to
>>> set the variable constrained_magnetization='atomic' and the magnetization
>>> will be the one given by input_magnetization(i).
>>> Therefore now input_magnetization(i) is no longer m/n but m only.
>>> However it seems that the range of input_magnetization has not been
>>> modified and is still within [-1,1] interval.
>>> If ever I set input_magnetization(i)>1 then the code automatically
>>> replace it by 1 and I cannot explore values larger than 1.
>>>    
>>>
>>  
>>
> Dear Gabriele,
> 
> With your quick fix now the input_magnetization is no longer the 
> magnetization m but m/n
> as it is when there is no penalization.  Therefore we avoid the problem 
> due to the [-1,1] interval
> however this makes things a litlle "crooked" since the charge n is not 
> precisely now (the charge
> inside the sphere does not integrate to the total charge per atom..).
> However with a little of mental gymnastic we can manage to obtain what 
> we want:-)

You are right, perhaps it is more practical to fix the magnetization (i.e. local magnetic 
moment) rather than the "atomic spin polarization".
I think that the problem arises from the fact that the starting_magnetization keyword is 
used for two different things, which maybe should be called starting_spin_polarization for 
the unconstrained calculations and target_magnetization for constrained ones (of "atomic" 
type).
Another quick fix that should meet your needs could be the following: let the 
PW/add_bfield.f90 subroutine as the original and in PW/input.f90 move the check on 
starting_magnetization
   DO nt = 1, ntyp
      !
      IF ( starting_magnetization(nt) == sm_not_set ) THEN
         starting_magnetization(nt) = 0.0_dp
      ELSE IF ( starting_magnetization(nt) > 1.0_dp ) THEN
         starting_magnetization(nt) = 1.0_dp
      ELSE IF ( starting_magnetization(nt) <-1.0_dp ) THEN
         starting_magnetization(nt) =-1.0_dp
      END IF
      !
   END DO

AFTER the block of initialization of the magnetic contraints:

   SELECT CASE( TRIM( constrained_magnetization ) )
   CASE( 'none' )
      !
      i_cons = 0
      !
   CASE( 'total' )
      !
   ...
   END SELECT

Probably, the choice of the initial atomic spin polarization will not be the optimal one 
for a better convergence to the target magnetization.
You can use this temporary solution until a more satisfactory implementation will be 
conceived and carried out.


Thanks,


Gabriele



> 
> thanks
>   cyrille
> 

-- 


o ------------------------------------------------ o
| Gabriele Sclauzero, PhD Student                  |
| c/o:   SISSA & CNR-INFM Democritos,              |
|        via Beirut 2-4, 34014 Trieste (Italy)     |
| email: sclauzer at sissa.it                         |
| phone: +39 040 3787 511                          |
| skype: gurlonotturno                             |
o ------------------------------------------------ o


More information about the Pw_forum mailing list