The Elk Code
bdipoleu.f90
Go to the documentation of this file.
1 
2 ! Copyright (C) 2024 Wenhan Chen, J. K. Dewhurst and S. Sharma.
3 ! This file is distributed under the terms of the GNU General Public License.
4 ! See the file COPYING for license details.
5 
6 subroutine bdipoleu
7 use modmain
8 use modulr
9 implicit none
10 ! local variables
11 integer iq,ifq
12 real(8) cb,t0
13 complex(8) zv(3),z1
14 if (.not.ncmag) then
15  write(*,*)
16  write(*,'("Error(bdipoleu): non-collinear magnetism required for inclusion &
17  &of the dipole field")')
18  write(*,*)
19  stop
20 end if
21 ! prefactor for the electron spin dipole magnetic field
22 cb=gfacte/(4.d0*solsc)
23 ! prefector which allows term to be added directly to ULR Kohn-Sham B-field
24 t0=-bdipscf*fourpi*cb**2
25 do ifq=1,nfqrz
26  iq=iqrzf(ifq)
27 ! compute B(Q) = 4π (gₛ/4c)² [ m(Q) - Q (Q⋅m(Q))/Q² ]
28  if (iq > 1) then
29  zv(1:3)=momtotqu(1:3,ifq)/omega
30  z1=vqc(1,iq)*zv(1)+vqc(2,iq)*zv(2)+vqc(3,iq)*zv(3)
31  z1=z1/qc(iq)**2
32  zv(1:3)=zv(1:3)-z1*vqc(1:3,iq)
33  bdipq(1:3,ifq)=t0*zv(1:3)
34  else
35  bdipq(1:3,ifq)=0.d0
36  end if
37 end do
38 end subroutine
39 
subroutine bdipoleu
Definition: bdipoleu.f90:7
real(8), dimension(:), allocatable qc
Definition: modmain.f90:552
complex(8), dimension(:,:), allocatable bdipq
Definition: modulr.f90:83
real(8) omega
Definition: modmain.f90:20
integer, dimension(:), allocatable iqrzf
Definition: modmain.f90:546
real(8), dimension(:,:), allocatable vqc
Definition: modmain.f90:550
real(8), parameter gfacte
Definition: modmain.f90:1277
real(8) solsc
Definition: modmain.f90:1253
integer nfqrz
Definition: modmain.f90:542
real(8) bdipscf
Definition: modmain.f90:648
real(8), parameter fourpi
Definition: modmain.f90:1234
Definition: modulr.f90:6
logical ncmag
Definition: modmain.f90:242
complex(8), dimension(:,:), allocatable momtotqu
Definition: modulr.f90:63