[Pw_forum] spin polarized lowdin charges

Francesco Antoniella francesco.antoniella at aquila.infn.it
Thu Apr 29 13:40:02 CEST 2004


Il gio, 2004-04-29 alle 08:07, Cyrille Barreteau ha scritto:
> Dear pwscf users,
> 
> I am doing a calculation of a magnetic Fe (cuboctahedron) cluster and I would 
> like to get the magnetic decomposition on  each atomic site of the cluster.
>  From projwfc.x I am able to get the total Lowdin charge decomposition
> (see below) but I would also like the up and down spin charge decomposition.
> How can I obtain this information?
> 
>   thanks,
> 
>       cyrille
> 
> Lowdin Charges:
> 
>    Atom #   1: total charge =   7.4091, s, p, d, f =   0.8321  0.0000  6.5770
>    Atom #   2: total charge =   7.9526, s, p, d, f =   0.8952  0.0000  7.0574
>    Atom #   3: total charge =   7.9526, s, p, d, f =   0.8952  0.0000  7.0574
>    Atom #   4: total charge =   7.9526, s, p, d, f =   0.8952  0.0000  7.0574
>    Atom #   5: total charge =   7.9526, s, p, d, f =   0.8952  0.0000  7.0574
>    Atom #   6: total charge =   7.9526, s, p, d, f =   0.8952  0.0000  7.0574
>    Atom #   7: total     !



This is the modification of the code 
---->put this in the variables declaration
 charges_up(:,:), charges_down(:,:) 
in place of :
charges(:,:)

---->put this in the lowdin charges calc
     allocate ( charges_up (nat, 0:lmax_wfc ) )
     allocate ( charges_down (nat, 0:lmax_wfc ) )
     charges_up=0.0
     charges_down=0.0
     do ik = 1, nkstot  
        do ibnd = 1, nbnd
           do nwfc = 1, natomwfc
              na= nlmchi(nwfc)%na
              l = nlmchi(nwfc)%l
              if((.not.(lsda)).or.((lsda).and.(ik.le.(nkstot/2)))) then
                 charges_up(na,l) = charges_up(na,l) + wg (ibnd,ik) * &
                      proj (nwfc, ibnd, ik)
              else 
                 charges_down(na,l) = charges_down(na,l) + wg (ibnd,ik)
* &
                      proj (nwfc, ibnd, ik)
              end if
              enddo
        end do
     end do
     !
     write (4, '(/"Lowdin Charges: "/)')
     !
     psum = 0.0
     do na = 1, nat
        totcharge_up = 0.d0
        totcharge_down = 0.d0
        do l = 0, lmax_wfc
           totcharge_up = totcharge_up + charges_up(na,l)
           totcharge_down = totcharge_down + charges_down(na,l)
        end do
        psum = psum + totcharge_up+totcharge_down
        if(.not.(lsda)) then
        write (4, '(5x,"Atom # ",i3,": total charge = ",f8.4, &
             &                ", s, p, d = ",4f8.4    )') &
             na, totcharge_up, ( charges_up(na,l), l= 0,lmax_wfc)
     else 
        write (4, '(5x,"Atom # ",i3,": total charge spin up   = ",f8.4,
&
             &                ", s, p, d = ",4f8.4    )') &
             na, totcharge_up, ( charges_up(na,l), l= 0,lmax_wfc)
        write (4, '(5x,"       ",i3,": total charge spin down = ",f8.4,
&
             &                ", s, p, d = ",4f8.4    )') &
             na, totcharge_down, ( charges_down(na,l), l= 0,lmax_wfc)
        write (4, '(5x,"       ",i3,": total pol.  (up-down)  = ",f8.4,
&
             &                ", s, p, d = ",4f8.4    )') &
             na, totcharge_up-totcharge_down,&
             ( charges_up(na,l)-charges_down(na,l), l= 0,lmax_wfc)
     end if
     end do
     psum = psum / nelec
     write (4, '(5x,"Spilling Parameter: ",f8.4)') 1.0 - psum  





More information about the users mailing list