24 use,
intrinsic :: iso_fortran_env
84 real(real64) :: site(3)
85 real(real64) :: s_qaxis(3) = [0.0_real64, 0.0_real64, 1.0_real64]
86 real(real64) :: z(3) = [0.0_real64, 0.0_real64, 1.0_real64]
87 real(real64) :: x(3) = [1.0_real64, 0.0_real64, 0.0_real64]
88 real(real64) :: zona = 1.0_real64
98 type(namespace_t),
intent(in) :: namespace
99 type(multicomm_t),
intent(in) :: mc
100 class(space_t),
intent(inout) :: space
101 type(states_elec_t),
intent(inout) :: st
102 class(mesh_t),
intent(inout) :: gr
103 type(kpoints_t),
intent(inout) :: kpoints
104 integer,
optional,
intent(in) :: restart_states
107 integer :: restart_states_, ierr, nik, dim, nst
108 type(restart_t) :: restart
112 message(1) =
'Invalid restart_states value; expected RESTART_GS or RESTART_TD.'
120 write(
message(1),
'(a)')
'Error opening restart file'
126 if (dim /= st%d%dim)
then
127 write(
message(1),
'(a)')
'Restart structure not commensurate, since spin dimensions differ.'
129 else if (nik /= kpoints%reduced%npoints)
then
130 write(
message(1),
'(a)')
'Restart structure not commensurate, since number of k-points differ.'
132 else if (nst /= st%nst)
then
133 write(
message(1),
'(a)')
'Restart structure not commensurate, since number of states differ.'
137 call states_elec_load(restart, namespace, space, st, gr, kpoints, fixed_occ=st%restart_fixed_occ , &
138 ierr=ierr, label =
": wannier90")
150 band_index, space, mesh, latt, st, kpoints, &
151 spin_channel, num_proj, proj_input, projection)
152 type(wannier_opts_t),
intent(in) :: wan_opts
153 class(space_t),
intent(in) :: space
154 class(mesh_t),
intent(in) :: mesh
155 type(lattice_vectors_t),
intent(in) :: latt
156 type(states_elec_t),
intent(in) :: st
157 type(kpoints_t),
intent(in) :: kpoints
158 integer,
contiguous,
intent(in) :: band_index(:)
159 integer,
intent(in) :: spin_channel
160 integer,
intent(in) :: num_proj
161 type(wannier_calc_proj_t),
contiguous,
intent(in) :: proj_input(:)
163 complex(real64),
contiguous,
intent(out) :: projection(:, :, :)
165 integer :: ist, ik, idim, iw, ip, ik_real, iband, num_kpts
166 real(real64) :: center(3), kpoint(3)
168 complex(real64),
allocatable :: psi(:,:), phase(:)
169 real(real64),
allocatable :: ylm(:)
170 type(orbitalset_t),
allocatable :: orbitals(:)
175 if (st%parallel_in_states)
then
179 message(1) =
"Info: Computing the projection matrix"
182 assert(num_proj ==
size(proj_input))
184 num_kpts = kpoints%full%npoints
187 safe_allocate(orbitals(1:num_proj))
191 orbitals(iw)%norbs = 1
192 orbitals(iw)%ndim = 1
193 orbitals(iw)%radius = -
log(wan_opts%threshold)
194 orbitals(iw)%use_submesh = .false.
197 center(1:3) = latt%red_to_cart(proj_input(iw)%site(1:3))
198 call submesh_init(orbitals(iw)%sphere, space, mesh, latt, center, orbitals(iw)%radius)
201 safe_allocate(ylm(1:orbitals(iw)%sphere%np))
203 call ylm_wannier(ylm, proj_input(iw)%l, proj_input(iw)%m, &
204 orbitals(iw)%sphere%r, orbitals(iw)%sphere%rel_x, orbitals(iw)%sphere%np)
206 if (proj_input(iw)%radial /= 1)
then
211 do ip = 1, orbitals(iw)%sphere%np
212 ylm(ip) = ylm(ip) *
m_two *
exp(-orbitals(iw)%sphere%r(ip))
216 safe_allocate(orbitals(iw)%zorb(1:orbitals(iw)%sphere%np, 1:1, 1:1))
217 orbitals(iw)%zorb(1:orbitals(iw)%sphere%np, 1, 1) = ylm(1:orbitals(iw)%sphere%np)
218 safe_deallocate_a(ylm)
220 safe_allocate(orbitals(iw)%phase(1:orbitals(iw)%sphere%np, st%d%kpt%start:st%d%kpt%end))
221 orbitals(iw)%phase =
m_z0
222 safe_allocate(orbitals(iw)%eorb_mesh(1:mesh%np, 1:1, 1:1, st%d%kpt%start:st%d%kpt%end))
223 orbitals(iw)%eorb_mesh =
m_z0
230 safe_allocate(psi(1:mesh%np, 1:st%d%dim))
231 safe_allocate(phase(1:mesh%np))
235 kpoint(1:space%dim) = kpoints%get_point(ik)
237 phase(ip) =
exp(-
m_zi * sum(mesh%x(1:space%dim, ip) * kpoint(1:space%dim)))
240 ik_real = st%d%get_k_spin_index(ik, spin_channel)
243 do ist = 1,
size(band_index)
244 iband = band_index(ist)
246 if(ik_real >= st%d%kpt%start .and. ik_real <= st%d%kpt%end)
then
249 do idim = 1, st%d%dim
251 psi(ip, idim) = psi(ip, idim)*phase(ip)
257 if (wan_opts%spinors) idim = wan_opts%spin_proj_component(iw)
260 projection(iband, iw, ik) =
zmf_dotp(mesh, psi(1:mesh%np, idim), &
261 orbitals(iw)%eorb_mesh(1:mesh%np, 1, 1, ik_real), reduce = .false.)
265 call mesh%allreduce(projection(ist, :, ik))
269 if(st%d%kpt%parallel)
then
276 safe_deallocate_a(psi)
277 safe_deallocate_a(phase)
282 safe_deallocate_a(orbitals)
300 spin_channel, nnlist, nncell, overlap)
301 integer,
contiguous,
intent(in) :: band_index(:)
302 class(
mesh_t),
intent(in) :: mesh
305 integer,
intent(in) :: spin_channel
306 integer,
contiguous,
intent(in) :: nnlist(:,:)
307 integer,
contiguous,
intent(in) :: nncell(:,:,:)
309 complex(real64),
contiguous,
intent(out) :: overlap(:, :, :, :)
311 integer :: ist, jst, ik, ip, iknn, idim, ibind
312 integer :: ik_oct, iknn_oct, inn
314 integer :: iband, jband, inode, node_fr, node_to
315 real(real64) :: gcart(3)
318 integer :: nntot, num_kpts
320 complex(real64),
allocatable :: psim(:,:), psin(:,:), phase(:)
322 type(mpi_request) :: send_req
329 nntot =
size(nnlist, 2)
330 num_kpts =
size(nnlist, 1)
331 assert(
size(nnlist, 1) == num_kpts)
332 assert(
size(nncell, 1) == 3)
333 assert(
size(nncell, 2) == num_kpts)
334 assert(
size(nncell, 3) == nntot)
336 if (st%parallel_in_states)
then
340 message(1) =
"Info: Computing the overlap matrix for wannierisation"
344 safe_allocate(psim(1:mesh%np, 1:st%d%dim))
345 safe_allocate(psin(1:mesh%np, 1:st%d%dim))
346 safe_allocate(phase(1:mesh%np))
353 ik_oct = st%d%get_k_spin_index(ik, spin_channel)
354 if (ik_oct >= st%d%kpt%start .and. ik_oct <= st%d%kpt%end) ik_loc = ik_loc + 1
358 iknn = nnlist(ik, inn)
359 g(1:3) = nncell(:, ik, inn)
360 iknn_oct = st%d%get_k_spin_index(iknn, spin_channel)
363 if(ik_oct >= st%d%kpt%start .and. ik_oct <= st%d%kpt%end)
then
371 if (any(g /= 0))
then
373 phase(ip) =
exp(-
m_zi*dot_product(mesh%x(1:3, ip), gcart(1:3)))
379 do jst = 1,
size(band_index)
380 jband = band_index(jst)
382 if (st%d%kpt%parallel)
then
385 do inode = 0, st%d%kpt%mpi_grp%size-1
386 if(iknn_oct >= st%st_kpt_task(inode,3) .and. iknn_oct <= st%st_kpt_task(inode,4))
then
389 if(ik_oct >= st%st_kpt_task(inode,3) .and. ik_oct <= st%st_kpt_task(inode,4))
then
395 send_req = mpi_request_null
400 if(node_to /= st%d%kpt%mpi_grp%rank)
then
401 call st%d%kpt%mpi_grp%isend(psin, mesh%np*st%d%dim, mpi_double_complex, node_to, send_req)
405 if(node_to == st%d%kpt%mpi_grp%rank .and. node_to /= node_fr)
then
406 call st%d%kpt%mpi_grp%recv(psin, mesh%np*st%d%dim, mpi_double_complex, node_fr)
408 if (send_req /= mpi_request_null)
then
409 call st%d%kpt%mpi_grp%wait(send_req)
415 if(ik_oct >= st%d%kpt%start .and. ik_oct <= st%d%kpt%end)
then
418 if (any(g /= 0))
then
419 do idim = 1, st%d%dim
421 psin(ip, idim) = psin(ip, idim) * phase(ip)
428 do iband = 1,
size(band_index)
429 ist = band_index(iband)
431 batch => st%group%psib(st%group%iblock(ist), ik_oct)
433 select case (batch%status())
435 overlap(iband, jst, inn, ik_loc) =
m_z0
436 do idim = 1, st%d%dim
437 ibind = batch%inv_index((/ist, idim/))
438 overlap(iband, jst, inn, ik_loc) = overlap(iband, jst, inn, ik_loc) + &
439 zmf_dotp(mesh, batch%zff_linear(:, ibind), psin(:,idim), reduce = .false.)
444 overlap(iband, jst, inn, ik_loc) =
zmf_dotp(mesh, st%d%dim, psim, psin, reduce = .false.)
449 call mesh%allreduce(overlap(:, jst, inn, ik_loc))
456 assert(ik_loc ==
size(overlap, 4))
458 safe_deallocate_a(psim)
459 safe_deallocate_a(psin)
460 safe_deallocate_a(phase)
474 real(real64),
contiguous,
intent(inout) :: centers(:, :)
476 integer :: w90_xyz, iw
477 character(len=2) :: dum
482 assert(
size(centers, 2) == wan_opts%num_wann)
483 assert(
size(centers, 1) == 3)
485 inquire(file=trim(adjustl(wan_opts%prefix))//
'_centres.xyz',exist=exist)
486 if (.not. exist)
then
487 message(1) =
'Cannot find the Wannier90 file seedname_centres.xyz.'
496 do iw = 1, wan_opts%num_wann
497 read(w90_xyz, *) dum, centers(1:3, iw)
513 complex(real64),
contiguous,
intent(inout) :: u_matrix(:, :, :)
514 complex(real64),
contiguous,
intent(inout) :: u_dis_matrix(:, :, :)
516 integer :: w90_u_mat, w90_u_dis, ik, ib, iw, iw2, nik, nwann, nib
518 logical :: exist, have_disentangled
520 num_kpts = product(kpoints%nik_axis(1:3))
524 inquire(file=trim(adjustl(wan_opts%prefix))//
'_u.mat',exist=exist)
525 if (.not. exist)
then
526 message(1) =
'Cannot find the Wannier90 seedname_u.mat file.'
534 read(w90_u_mat, *) nik, nwann, nwann
535 if (nik /= num_kpts .or. nwann /= wan_opts%num_wann)
then
536 message(1) =
"The U matrix has inconsistent shape."
545 read(w90_u_mat,
'(f15.10,sp,f15.10)') ((u_matrix(iw, iw2, ik), iw=1, wan_opts%num_wann), iw2=1, wan_opts%num_wann)
550 inquire(file=trim(adjustl(wan_opts%prefix))//
'_u_dis.mat',exist=have_disentangled)
551 if (have_disentangled)
then
559 read(w90_u_dis, *) nik, nwann, nib
560 if (nik /= num_kpts .or. nwann /= wan_opts%num_wann .or. nib /= wan_opts%num_bands)
then
561 message(1) =
'The u_dis matrix has inconsistent shape.'
570 read(w90_u_dis,
'(f15.10,sp,f15.10)') ((u_dis_matrix(ib, iw, ik), ib=1, wan_opts%num_bands), iw=1, wan_opts%num_wann)
586 character(len=*),
intent(in) :: header_start
587 character(len=*),
intent(out) :: header
589 integer :: date_time(8)
593 call date_and_time(values=date_time)
594 write(header,
'(a,i4,a1,i2.2,a1,i2.2,a,i2.2,a1,i2.2,a1,i2.2)') &
595 header_start, date_time(1),
'/', date_time(2),
'/', date_time(3), &
596 ' at ', date_time(5),
':', date_time(6),
':', date_time(7)
605 character(len=*),
intent(in) :: dir
606 character(len=*),
intent(in) :: prefix
607 real(real64),
intent(in) :: centers(:, :)
608 class(
ions_t),
intent(in) :: ions
610 integer :: w90_xyz, iw, ia, ind
611 character(len=512) :: header
615 w90_xyz =
io_open(trim(adjustl(dir))//
'/'//trim(adjustl(prefix))//
'_centres.xyz',
global_namespace, action=
'write', die=.false.)
616 if (w90_xyz == -1)
then
617 message(1) =
'Unable to open output file '//trim(adjustl(prefix))//
'_centres.xyz for writing.'
621 write(w90_xyz,
'(i6)')
size(centers, 2) + ions%natoms
623 write (w90_xyz, *) trim(header)
625 do iw = 1,
size(centers, 2)
626 write(w90_xyz,
'("X",6x,3(f14.8,3x))') &
629 do ia = 1, ions%natoms
630 write(w90_xyz,
'(a2,5x,3(f14.8,3x))') trim(ions%atom(ia)%label), &
644 character(len=*),
intent(in) :: dir
645 character(len=*),
intent(in) :: prefix
647 complex(real64),
contiguous,
intent(in) :: u_matrix(:, :, :)
648 complex(real64),
contiguous,
intent(in) :: u_dis_matrix(:, :, :)
650 integer :: w90_u_mat, w90_u_dis
651 logical :: have_disentangled
652 integer :: i, j, nkp, num_wann, num_bands, num_kpts
653 character(len=512) :: header
655 num_kpts =
size(u_matrix, 3)
656 num_wann =
size(u_matrix, 1)
657 num_bands =
size(u_dis_matrix, 1)
658 assert(num_kpts ==
size(kpoints%reduced%red_point, 2))
664 w90_u_mat =
io_open(trim(adjustl(dir))//
'/'//trim(adjustl(prefix))//
'_u.mat',
global_namespace, action=
'write', die=.false.)
665 if (w90_u_mat == -1)
then
666 message(1) =
'Unable to open output file '//trim(adjustl(prefix))//
'_u.mat for writing.'
670 write (w90_u_mat, *) trim(header)
671 write (w90_u_mat, *) num_kpts, num_wann, num_wann
675 write (w90_u_mat,
'(f15.10,sp,f15.10,sp,f15.10)') -kpoints%reduced%red_point(1:3, nkp)
676 write (w90_u_mat,
'(f15.10,sp,f15.10)') ((u_matrix(i, j, nkp), i=1, num_wann), j=1, num_wann)
681 inquire(file=trim(trim(adjustl(prefix))//
'_u_dis.mat'),exist=have_disentangled)
682 if (have_disentangled)
then
684 w90_u_dis =
io_open(trim(adjustl(dir))//
'/'//trim(adjustl(prefix))//
'_u_dis.mat', &
686 if (w90_u_dis == -1)
then
687 message(1) =
'Unable to open output file '//trim(adjustl(prefix))//
'_u_dis.mat for writing.'
691 write (w90_u_dis, *) trim(header)
692 write (w90_u_dis, *) num_kpts, num_wann, num_bands
695 write (w90_u_dis,
'(f15.10,sp,f15.10,sp,f15.10)') -kpoints%reduced%red_point(1:3, nkp)
696 write (w90_u_dis,
'(f15.10,sp,f15.10)') ((u_dis_matrix(i, j, nkp), i=1, num_bands), j=1, num_wann)
708 character(len=*),
intent(in) :: dir
709 character(len=*),
intent(in) :: prefix
710 real(real64),
intent(in) :: spreads(:)
712 integer :: w90_xyz, iw
713 character(len=512) :: header
717 w90_xyz =
io_open(trim(adjustl(dir))//
'/'//trim(adjustl(prefix))//
'_spreads.xyz',
global_namespace, action=
'write', die=.false.)
718 if (w90_xyz == -1)
then
719 message(1) =
'Unable to open output file '//trim(adjustl(prefix))//
'_spreads.xyz for writing.'
724 write (w90_xyz, *) trim(header)
726 do iw = 1,
size(spreads, 1)
741 character(len=*),
intent(in) :: dir
742 character(len=*),
intent(in) :: prefix
743 integer,
contiguous,
intent(in) :: irvec(:, :)
744 integer,
contiguous,
intent(in) :: ndegen(:)
745 complex(real64),
contiguous,
intent(in) :: ham_r(:, :, :)
747 integer :: w90_hr_dat
748 integer :: i, j, irpt
749 character(len=512) :: header
750 integer :: nrpts, n_wannier
754 nrpts =
size(ham_r, 3)
755 n_wannier =
size(ham_r, 1)
756 assert(
size(irvec, 2) == nrpts)
757 assert(
size(ndegen, 1) == nrpts)
759 w90_hr_dat =
io_open(trim(adjustl(dir))//
'/'//trim(adjustl(prefix))//
'_hr.dat',
global_namespace, action=
'write', die=.false.)
760 if (w90_hr_dat == -1)
then
761 message(1) =
'Unable to open output file '//trim(adjustl(prefix))//
'_hr.dat for writing.'
766 write (w90_hr_dat, *) trim(header)
768 write (w90_hr_dat, *)
size(ham_r, 1)
769 write (w90_hr_dat, *) nrpts
770 write (w90_hr_dat,
'(15I5)') (ndegen(i), i=1, nrpts)
774 write (w90_hr_dat,
'(5I5,2F12.6)') irvec(:, irpt), j, i, &
787 ws_distance_tol, ndegen)
result(in_cell)
788 integer,
intent(in) :: rvec(3)
789 real(real64),
intent(in) :: real_metric(3, 3)
790 integer,
intent(in) :: mp_grid(3)
791 integer,
intent(in) :: ws_search_size(3)
792 real(real64),
intent(in) :: ws_distance_tol
793 integer,
optional,
intent(out) :: ndegen
795 integer :: i1, i2, i3, icnt
797 real(real64) :: dist_min, dist_to_origin
798 real(real64) :: dist(product(2*ws_search_size + 3))
804 do i1 = -ws_search_size(1) - 1, ws_search_size(1) + 1
805 do i2 = -ws_search_size(2) - 1, ws_search_size(2) + 1
806 do i3 = -ws_search_size(3) - 1, ws_search_size(3) + 1
808 ndiff = rvec - [i1, i2, i3] * mp_grid
809 dist(icnt) = dot_product(real(ndiff, real64), matmul(real_metric, real(ndiff, real64)))
814 dist_to_origin = dot_product(real(rvec, real64), matmul(real_metric, real(rvec, real64)))
815 dist_min = minval(dist)
817 in_cell = abs(dist_to_origin - dist_min) < ws_distance_tol**2
818 if (
present(ndegen)) ndegen = count(abs(dist - dist_min) < ws_distance_tol**2)
827 real(real64),
intent(in) :: real_lattice(3,3)
828 integer,
intent(in) :: mp_grid(3)
829 integer,
intent(in) :: ws_search_size(3)
830 real(real64),
intent(in) :: ws_distance_tol
831 integer,
intent(out) :: nrpts
833 integer :: n1, n2, n3
834 real(real64) :: real_metric(3, 3)
838 real_metric = matmul(transpose(real_lattice), real_lattice)
841 do n1 = -ws_search_size(1)*mp_grid(1), ws_search_size(1)*mp_grid(1)
842 do n2 = -ws_search_size(2)*mp_grid(2), ws_search_size(2)*mp_grid(2)
843 do n3 = -ws_search_size(3)*mp_grid(3), ws_search_size(3)*mp_grid(3)
845 ws_search_size, ws_distance_tol))
then
860 nrpts, irvec, ndegen)
861 real(real64),
intent(in) :: real_lattice(3,3)
862 integer,
intent(in) :: mp_grid(3)
863 integer,
intent(in) :: ws_search_size(3)
864 real(real64),
intent(in) :: ws_distance_tol
865 integer,
intent(in) :: nrpts
866 integer,
intent(out) :: irvec(3, nrpts)
867 integer,
intent(out) :: ndegen(nrpts)
869 integer :: n1, n2, n3, irpt, ndeg
870 real(real64) :: real_metric(3, 3)
874 real_metric = matmul(transpose(real_lattice), real_lattice)
877 do n1 = -ws_search_size(1)*mp_grid(1), ws_search_size(1)*mp_grid(1)
878 do n2 = -ws_search_size(2)*mp_grid(2), ws_search_size(2)*mp_grid(2)
879 do n3 = -ws_search_size(3)*mp_grid(3), ws_search_size(3)*mp_grid(3)
881 ws_search_size, ws_distance_tol, ndeg))
then
883 irvec(:, irpt) = [n1, n2, n3]
889 assert(irpt == nrpts)
893 if (abs(sum(
m_one/ndegen) - product(mp_grid)) > 1e-8_real64)
then
894 message(1) =
"Error computing the Wigner-Seitz points."
908 integer,
contiguous,
intent(in) :: band_index(:)
910 real(real64),
intent(in) :: dt
911 complex(real64),
contiguous,
intent(inout) :: phase(:,:)
917 do ik = 1,
size(phase, 2)
918 do ist = 1,
size(band_index)
919 phase(ist, ik) = phase(ist, ik) *
exp(
m_zi * st%eigenval(band_index(ist), ik) * dt)
934 u_matrix, irvec, ham_r)
936 class(
mesh_t),
intent(in) :: mesh
941 complex(real64),
contiguous,
intent(in) :: u_matrix(:, :, :)
942 integer,
contiguous,
intent(in) :: irvec(:, :)
943 complex(real64),
contiguous,
intent(out) :: ham_r(:, :, :)
945 integer :: nk, nrpts, ik, irpt, iq, ikl
946 real(real64) :: rdotk
947 complex(real64),
allocatable :: hmss(:, :), ham_k_local(:, :, :)
951 nk = kpoints%full%npoints
952 nrpts =
size(ham_r, 3)
954 safe_allocate(hmss(1:wannier_opts%num_bands, 1:wannier_opts%num_bands))
955 safe_allocate(ham_k_local(1:wannier_opts%num_wann, 1:wannier_opts%num_wann, 1:st%d%kpt%nlocal()))
957 assert(wannier_opts%num_bands == st%nst)
958 if (wannier_opts%num_bands /= wannier_opts%num_wann)
then
965 do iq = st%d%kpt%start, st%d%kpt%end
966 ik = st%d%get_kpoint_index(iq)
967 ikl = iq - st%d%kpt%start + 1
969 ham_k_local(:, :, ikl) = matmul(transpose(conjg(u_matrix(:, :, ik))), matmul(hmss, u_matrix(:, :, ik)))
976 do iq = st%d%kpt%start, st%d%kpt%end
977 ik = st%d%get_kpoint_index(iq)
978 ikl = iq - st%d%kpt%start + 1
979 rdotk =
m_two*
m_pi*dot_product(kpoints%reduced%red_point(1:3, ik), real(irvec(1:3, irpt), real64))
980 ham_r(:, :, irpt) = ham_r(:, :, irpt) + (
exp(
m_zi*rdotk)/real(nk, real64)) * ham_k_local(:, :, ikl)
985 if (st%d%kpt%parallel)
then
989 safe_deallocate_a(hmss)
990 safe_deallocate_a(ham_k_local)
double log(double __x) __attribute__((__nothrow__
double exp(double __x) __attribute__((__nothrow__
This module implements batches of mesh functions.
integer, parameter, public batch_not_packed
functions are stored in CPU memory, unpacked order
integer, parameter, public batch_device_packed
functions are stored in device memory in packed order
integer, parameter, public batch_packed
functions are stored in CPU memory, in transposed (packed) order
integer, parameter, public spin_polarized
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_pi
some mathematical constants
complex(real64), parameter, public m_z0
complex(real64), parameter, public m_zi
real(real64), parameter, public m_one
subroutine, public write_standard_xyz_file(namespace, fname, pos, species, header)
Write a standard xyz file with atom labels and positions (in Angstrom).
subroutine, public io_close(iunit, grp)
integer function, public io_open(file, namespace, action, status, form, position, die, recl, grp)
subroutine, public kpoints_to_absolute(latt, kin, kout)
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
subroutine, public messages_not_implemented(feature, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
This module handles the communicators for the various parallelization strategies.
type(namespace_t), public global_namespace
subroutine, public orbitalset_init(this)
subroutine, public orbitalset_end(this)
subroutine, public orbitalset_update_phase(os, dim, kpt, kpoints, spin_polarized, vec_pot, vec_pot_var, kpt_max)
Build the phase correction to the global phase in case the orbital crosses the border of the simulato...
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
integer, parameter, public restart_gs
integer, parameter, public restart_td
integer, parameter, public restart_type_load
logical function, public state_kpt_is_local(st, ist, ik)
check whether a given state (ist, ik) is on the local node
subroutine, public states_elec_allocate_wfns(st, mesh, wfs_type, skip, packed)
Allocates the KS wavefunctions defined within a states_elec_t structure.
subroutine, public states_elec_look(restart, nik, dim, nst, ierr)
Reads the 'states' file in the restart directory, and finds out the nik, dim, and nst contained in it...
This module handles reading and writing restart information for the states_elec_t.
subroutine, public states_elec_load(restart, namespace, space, st, mesh, kpoints, fixed_occ, ierr, iter, lr, lowest_missing, label, verbose, skip)
returns in ierr: <0 => Fatal error, or nothing read =0 => read all wavefunctions >0 => could only rea...
subroutine, public submesh_init(this, space, mesh, latt, center, rc)
subroutine, public zsubspace_diag_hamiltonian(namespace, mesh, st, hm, ik, hmss, overlap)
Diagonalises the Hamiltonian in the subspace defined by the states.
type(type_t), parameter, public type_cmplx
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
This module defines the unit system, used for input and output.
type(unit_t), public unit_angstrom
For XYZ files.
type(unit_t), public unit_ev
For output energies in eV.
Wannier90 related calculations.
subroutine, public wannier_calc_write_centers(dir, prefix, centers, ions)
Write wannier centers to file.
subroutine, public wannier_calc_wigner_seitz_fill(real_lattice, mp_grid, ws_search_size, ws_distance_tol, nrpts, irvec, ndegen)
Calculate coordinates and degeneracies of R-points in the Wigner-Seitz cell.
subroutine, public wannier_calc_read_centers(wan_opts, centers)
Read wannier centers.
subroutine, public wannier_calc_wigner_seitz_count(real_lattice, mp_grid, ws_search_size, ws_distance_tol, nrpts)
Count the number of R-points in the Wigner-Seitz cell.
subroutine, public wannier_calc_write_hr_file(dir, prefix, irvec, ndegen, ham_r)
Write H(R) in the Wannier basis to a _hr.dat file.
subroutine, public wannier_calc_update_phase(band_index, st, dt, phase)
Accumulate the phase picked up by the KS states in TD run.
subroutine, public wannier_calc_write_u_matrices(dir, prefix, kpoints, u_matrix, u_dis_matrix)
Write U and U_dis matrices to file.
subroutine, public wannier_calc_create_amn(wan_opts, band_index, space, mesh, latt, st, kpoints, spin_channel, num_proj, proj_input, projection)
Calculation of Wannier90 Projection Matrix.
logical function wannier_calc_r_in_wigner_seitz_cell(rvec, real_metric, mp_grid, ws_search_size, ws_distance_tol, ndegen)
Check whether a lattice point lies in the Wigner-Seitz cell of the superlattice.
subroutine, public wannier_calc_create_mmn(band_index, mesh, st, latt, spin_channel, nnlist, nncell, overlap)
Kohn-Sham State Overlap Matrix.
subroutine, public wannier_calc_read_u_matrices(wan_opts, kpoints, u_matrix, u_dis_matrix)
Read wannier transformation matrix.
subroutine wannier_calc_get_header(header_start, header)
Build a file header containing the current date and time.
subroutine, public wannier_calc_compute_ham_r(namespace, mesh, st, hm, kpoints, wannier_opts, u_matrix, irvec, ham_r)
Compute the time-dependent Hamiltonian in the Wannier basis in real space.
subroutine, public wannier_calc_write_spreads(dir, prefix, spreads)
Write wannier spreads to file.
subroutine, public wannier_calc_load_restart(namespace, mc, space, st, gr, kpoints, restart_states)
Load Octopus restart data from disk.
subroutine, public ylm_wannier(ylm, l, mr, rr, xx, nr)
Describes mesh distribution to nodes.
The states_elec_t class contains all electronic wave functions.
Mocks the projection type from wannier90.
batches of electronic states