24 use,
intrinsic :: iso_fortran_env
83 real(real64) :: site(3)
84 real(real64) :: s_qaxis(3) = [0.0_real64, 0.0_real64, 1.0_real64]
85 real(real64) :: z(3) = [0.0_real64, 0.0_real64, 1.0_real64]
86 real(real64) :: x(3) = [1.0_real64, 0.0_real64, 0.0_real64]
87 real(real64) :: zona = 1.0_real64
97 type(namespace_t),
intent(in) :: namespace
98 type(multicomm_t),
intent(in) :: mc
99 class(space_t),
intent(inout) :: space
100 type(states_elec_t),
intent(inout) :: st
101 class(mesh_t),
intent(inout) :: gr
102 type(kpoints_t),
intent(inout) :: kpoints
103 integer,
optional,
intent(in) :: restart_states
106 integer :: restart_states_, ierr, nik, dim, nst
107 type(restart_t) :: restart
111 message(1) =
'Invalid restart_states value; expected RESTART_GS or RESTART_TD.'
119 write(
message(1),
'(a)')
'Error opening restart file'
125 if (dim /= st%d%dim)
then
126 write(
message(1),
'(a)')
'Restart structure not commensurate, since spin dimensions differ.'
128 else if (nik /= kpoints%reduced%npoints)
then
129 write(
message(1),
'(a)')
'Restart structure not commensurate, since number of k-points differ.'
131 else if (nst /= st%nst)
then
132 write(
message(1),
'(a)')
'Restart structure not commensurate, since number of states differ.'
136 call states_elec_load(restart, namespace, space, st, gr, kpoints, fixed_occ=st%restart_fixed_occ , &
137 ierr=ierr, label =
": wannier90")
149 band_index, space, mesh, latt, st, kpoints, &
150 spin_channel, num_proj, proj_input, projection)
151 type(wannier_opts_t),
intent(in) :: wan_opts
152 class(space_t),
intent(in) :: space
153 class(mesh_t),
intent(in) :: mesh
154 type(lattice_vectors_t),
intent(in) :: latt
155 type(states_elec_t),
intent(in) :: st
156 type(kpoints_t),
intent(in) :: kpoints
157 integer,
contiguous,
intent(in) :: band_index(:)
158 integer,
intent(in) :: spin_channel
159 integer,
intent(in) :: num_proj
160 type(wannier_calc_proj_t),
contiguous,
intent(in) :: proj_input(:)
162 complex(real64),
contiguous,
intent(out) :: projection(:, :, :)
164 integer :: ist, ik, idim, iw, ip, ik_real, iband, num_kpts
165 real(real64) :: center(3), kpoint(3)
167 complex(real64),
allocatable :: psi(:,:), phase(:)
168 real(real64),
allocatable :: ylm(:)
169 type(orbitalset_t),
allocatable :: orbitals(:)
174 if (st%parallel_in_states)
then
178 message(1) =
"Info: Computing the projection matrix"
181 assert(num_proj ==
size(proj_input))
183 num_kpts = kpoints%full%npoints
186 safe_allocate(orbitals(1:num_proj))
190 orbitals(iw)%norbs = 1
191 orbitals(iw)%ndim = 1
192 orbitals(iw)%radius = -
log(wan_opts%threshold)
193 orbitals(iw)%use_submesh = .false.
196 center(1:3) = latt%red_to_cart(proj_input(iw)%site(1:3))
197 call submesh_init(orbitals(iw)%sphere, space, mesh, latt, center, orbitals(iw)%radius)
200 safe_allocate(ylm(1:orbitals(iw)%sphere%np))
202 call ylm_wannier(ylm, proj_input(iw)%l, proj_input(iw)%m, &
203 orbitals(iw)%sphere%r, orbitals(iw)%sphere%rel_x, orbitals(iw)%sphere%np)
205 if (proj_input(iw)%radial /= 1)
then
210 do ip = 1, orbitals(iw)%sphere%np
211 ylm(ip) = ylm(ip) *
m_two *
exp(-orbitals(iw)%sphere%r(ip))
215 safe_allocate(orbitals(iw)%zorb(1:orbitals(iw)%sphere%np, 1:1, 1:1))
216 orbitals(iw)%zorb(1:orbitals(iw)%sphere%np, 1, 1) = ylm(1:orbitals(iw)%sphere%np)
217 safe_deallocate_a(ylm)
219 safe_allocate(orbitals(iw)%phase(1:orbitals(iw)%sphere%np, st%d%kpt%start:st%d%kpt%end))
220 orbitals(iw)%phase =
m_z0
221 safe_allocate(orbitals(iw)%eorb_mesh(1:mesh%np, 1:1, 1:1, st%d%kpt%start:st%d%kpt%end))
222 orbitals(iw)%eorb_mesh =
m_z0
229 safe_allocate(psi(1:mesh%np, 1:st%d%dim))
230 safe_allocate(phase(1:mesh%np))
234 kpoint(1:space%dim) = kpoints%get_point(ik)
236 phase(ip) =
exp(-
m_zi * sum(mesh%x(1:space%dim, ip) * kpoint(1:space%dim)))
239 ik_real = st%d%get_k_spin_index(ik, spin_channel)
242 do ist = 1,
size(band_index)
243 iband = band_index(ist)
245 if(ik_real >= st%d%kpt%start .and. ik_real <= st%d%kpt%end)
then
248 do idim = 1, st%d%dim
250 psi(ip, idim) = psi(ip, idim)*phase(ip)
256 if (wan_opts%spinors) idim = wan_opts%spin_proj_component(iw)
259 projection(iband, iw, ik) =
zmf_dotp(mesh, psi(1:mesh%np, idim), &
260 orbitals(iw)%eorb_mesh(1:mesh%np, 1, 1, ik_real), reduce = .false.)
264 call mesh%allreduce(projection(ist, :, ik))
268 if(st%d%kpt%parallel)
then
275 safe_deallocate_a(psi)
276 safe_deallocate_a(phase)
281 safe_deallocate_a(orbitals)
299 spin_channel, nnlist, nncell, overlap)
300 integer,
contiguous,
intent(in) :: band_index(:)
301 class(
mesh_t),
intent(in) :: mesh
304 integer,
intent(in) :: spin_channel
305 integer,
contiguous,
intent(in) :: nnlist(:,:)
306 integer,
contiguous,
intent(in) :: nncell(:,:,:)
308 complex(real64),
contiguous,
intent(out) :: overlap(:, :, :, :)
310 integer :: ist, jst, ik, ip, iknn, idim, ibind
311 integer :: ik_oct, iknn_oct, inn
313 integer :: iband, jband, inode, node_fr, node_to
314 real(real64) :: gcart(3)
317 integer :: nntot, num_kpts
319 complex(real64),
allocatable :: psim(:,:), psin(:,:), phase(:)
321 type(mpi_request) :: send_req
328 nntot =
size(nnlist, 2)
329 num_kpts =
size(nnlist, 1)
330 assert(
size(nnlist, 1) == num_kpts)
331 assert(
size(nncell, 1) == 3)
332 assert(
size(nncell, 2) == num_kpts)
333 assert(
size(nncell, 3) == nntot)
335 if (st%parallel_in_states)
then
339 message(1) =
"Info: Computing the overlap matrix for wannierisation"
343 safe_allocate(psim(1:mesh%np, 1:st%d%dim))
344 safe_allocate(psin(1:mesh%np, 1:st%d%dim))
345 safe_allocate(phase(1:mesh%np))
352 ik_oct = st%d%get_k_spin_index(ik, spin_channel)
353 if (ik_oct >= st%d%kpt%start .and. ik_oct <= st%d%kpt%end) ik_loc = ik_loc + 1
357 iknn = nnlist(ik, inn)
358 g(1:3) = nncell(:, ik, inn)
359 iknn_oct = st%d%get_k_spin_index(iknn, spin_channel)
362 if(ik_oct >= st%d%kpt%start .and. ik_oct <= st%d%kpt%end)
then
370 if (any(g /= 0))
then
372 phase(ip) =
exp(-
m_zi*dot_product(mesh%x(1:3, ip), gcart(1:3)))
378 do jst = 1,
size(band_index)
379 jband = band_index(jst)
381 if (st%d%kpt%parallel)
then
384 do inode = 0, st%d%kpt%mpi_grp%size-1
385 if(iknn_oct >= st%st_kpt_task(inode,3) .and. iknn_oct <= st%st_kpt_task(inode,4))
then
388 if(ik_oct >= st%st_kpt_task(inode,3) .and. ik_oct <= st%st_kpt_task(inode,4))
then
394 send_req = mpi_request_null
399 if(node_to /= st%d%kpt%mpi_grp%rank)
then
400 call st%d%kpt%mpi_grp%isend(psin, mesh%np*st%d%dim, mpi_double_complex, node_to, send_req)
404 if(node_to == st%d%kpt%mpi_grp%rank .and. node_to /= node_fr)
then
405 call st%d%kpt%mpi_grp%recv(psin, mesh%np*st%d%dim, mpi_double_complex, node_fr)
407 if (send_req /= mpi_request_null)
then
408 call st%d%kpt%mpi_grp%wait(send_req)
414 if(ik_oct >= st%d%kpt%start .and. ik_oct <= st%d%kpt%end)
then
417 if (any(g /= 0))
then
418 do idim = 1, st%d%dim
420 psin(ip, idim) = psin(ip, idim) * phase(ip)
427 do iband = 1,
size(band_index)
428 ist = band_index(iband)
430 batch => st%group%psib(st%group%iblock(ist), ik_oct)
432 select case (batch%status())
434 overlap(iband, jst, inn, ik_loc) =
m_z0
435 do idim = 1, st%d%dim
436 ibind = batch%inv_index((/ist, idim/))
437 overlap(iband, jst, inn, ik_loc) = overlap(iband, jst, inn, ik_loc) + &
438 zmf_dotp(mesh, batch%zff_linear(:, ibind), psin(:,idim), reduce = .false.)
443 overlap(iband, jst, inn, ik_loc) =
zmf_dotp(mesh, st%d%dim, psim, psin, reduce = .false.)
448 call mesh%allreduce(overlap(:, jst, inn, ik_loc))
455 assert(ik_loc ==
size(overlap, 4))
457 safe_deallocate_a(psim)
458 safe_deallocate_a(psin)
459 safe_deallocate_a(phase)
473 real(real64),
contiguous,
intent(inout) :: centers(:, :)
475 integer :: w90_xyz, iw
476 character(len=2) :: dum
481 assert(
size(centers, 2) == wan_opts%num_wann)
482 assert(
size(centers, 1) == 3)
484 inquire(file=trim(adjustl(wan_opts%prefix))//
'_centres.xyz',exist=exist)
485 if (.not. exist)
then
486 message(1) =
'Cannot find the Wannier90 file seedname_centres.xyz.'
495 do iw = 1, wan_opts%num_wann
496 read(w90_xyz, *) dum, centers(1:3, iw)
512 complex(real64),
contiguous,
intent(inout) :: u_matrix(:, :, :)
513 complex(real64),
contiguous,
intent(inout) :: u_dis_matrix(:, :, :)
515 integer :: w90_u_mat, w90_u_dis, ik, ib, iw, iw2, nik, nwann, nib
517 logical :: exist, have_disentangled
519 num_kpts = product(kpoints%nik_axis(1:3))
523 inquire(file=trim(adjustl(wan_opts%prefix))//
'_u.mat',exist=exist)
524 if (.not. exist)
then
525 message(1) =
'Cannot find the Wannier90 seedname_u.mat file.'
533 read(w90_u_mat, *) nik, nwann, nwann
534 if (nik /= num_kpts .or. nwann /= wan_opts%num_wann)
then
535 message(1) =
"The U matrix has inconsistent shape."
544 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)
549 inquire(file=trim(adjustl(wan_opts%prefix))//
'_u_dis.mat',exist=have_disentangled)
550 if (have_disentangled)
then
558 read(w90_u_dis, *) nik, nwann, nib
559 if (nik /= num_kpts .or. nwann /= wan_opts%num_wann .or. nib /= wan_opts%num_bands)
then
560 message(1) =
'The u_dis matrix has inconsistent shape.'
569 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)
585 character(len=*),
intent(in) :: header_start
586 character(len=*),
intent(out) :: header
588 integer :: date_time(8)
592 call date_and_time(values=date_time)
593 write(header,
'(a,i4,a1,i2.2,a1,i2.2,a,i2.2,a1,i2.2,a1,i2.2)') &
594 header_start, date_time(1),
'/', date_time(2),
'/', date_time(3), &
595 ' at ', date_time(5),
':', date_time(6),
':', date_time(7)
604 character(len=*),
intent(in) :: dir
605 character(len=*),
intent(in) :: prefix
606 real(real64),
contiguous,
intent(in) :: centers(:, :)
607 class(
ions_t),
intent(in) :: ions
609 integer :: w90_xyz, iw, ia, ind
610 character(len=512) :: header
614 w90_xyz =
io_open(trim(adjustl(dir))//
'/'//trim(adjustl(prefix))//
'_centres.xyz',
global_namespace, action=
'write', die=.false.)
615 if (w90_xyz == -1)
then
616 message(1) =
'Unable to open output file '//trim(adjustl(prefix))//
'_centres.xyz for writing.'
620 write(w90_xyz,
'(i6)')
size(centers, 2) + ions%natoms
622 write (w90_xyz, *) trim(header)
624 do iw = 1,
size(centers, 2)
625 write(w90_xyz,
'("X",6x,3(f14.8,3x))') &
628 do ia = 1, ions%natoms
629 write(w90_xyz,
'(a2,5x,3(f14.8,3x))') trim(ions%atom(ia)%label), &
643 character(len=*),
intent(in) :: dir
644 character(len=*),
intent(in) :: prefix
646 complex(real64),
contiguous,
intent(in) :: u_matrix(:, :, :)
647 complex(real64),
contiguous,
intent(in) :: u_dis_matrix(:, :, :)
649 integer :: w90_u_mat, w90_u_dis
650 logical :: have_disentangled
651 integer :: i, j, nkp, num_wann, num_bands, num_kpts
652 character(len=512) :: header
654 num_kpts =
size(u_matrix, 3)
655 num_wann =
size(u_matrix, 1)
656 num_bands =
size(u_dis_matrix, 1)
657 assert(num_kpts ==
size(kpoints%reduced%red_point, 2))
663 w90_u_mat =
io_open(trim(adjustl(dir))//
'/'//trim(adjustl(prefix))//
'_u.mat',
global_namespace, action=
'write', die=.false.)
664 if (w90_u_mat == -1)
then
665 message(1) =
'Unable to open output file '//trim(adjustl(prefix))//
'_u.mat for writing.'
669 write (w90_u_mat, *) trim(header)
670 write (w90_u_mat, *) num_kpts, num_wann, num_wann
674 write (w90_u_mat,
'(f15.10,sp,f15.10,sp,f15.10)') -kpoints%reduced%red_point(1:3, nkp)
675 write (w90_u_mat,
'(f15.10,sp,f15.10)') ((u_matrix(i, j, nkp), i=1, num_wann), j=1, num_wann)
680 inquire(file=trim(trim(adjustl(prefix))//
'_u_dis.mat'),exist=have_disentangled)
681 if (have_disentangled)
then
683 w90_u_dis =
io_open(trim(adjustl(dir))//
'/'//trim(adjustl(prefix))//
'_u_dis.mat', &
685 if (w90_u_dis == -1)
then
686 message(1) =
'Unable to open output file '//trim(adjustl(prefix))//
'_u_dis.mat for writing.'
690 write (w90_u_dis, *) trim(header)
691 write (w90_u_dis, *) num_kpts, num_wann, num_bands
694 write (w90_u_dis,
'(f15.10,sp,f15.10,sp,f15.10)') -kpoints%reduced%red_point(1:3, nkp)
695 write (w90_u_dis,
'(f15.10,sp,f15.10)') ((u_dis_matrix(i, j, nkp), i=1, num_bands), j=1, num_wann)
707 character(len=*),
intent(in) :: dir
708 character(len=*),
intent(in) :: prefix
709 real(real64),
contiguous,
intent(in) :: spreads(:)
711 integer :: w90_xyz, iw
712 character(len=512) :: header
716 w90_xyz =
io_open(trim(adjustl(dir))//
'/'//trim(adjustl(prefix))//
'_spreads.xyz',
global_namespace, action=
'write', die=.false.)
717 if (w90_xyz == -1)
then
718 message(1) =
'Unable to open output file '//trim(adjustl(prefix))//
'_spreads.xyz for writing.'
723 write (w90_xyz, *) trim(header)
725 do iw = 1,
size(spreads, 1)
740 character(len=*),
intent(in) :: dir
741 character(len=*),
intent(in) :: prefix
742 integer,
contiguous,
intent(in) :: irvec(:, :)
743 integer,
contiguous,
intent(in) :: ndegen(:)
744 complex(real64),
contiguous,
intent(in) :: ham_r(:, :, :)
746 integer :: w90_hr_dat
747 integer :: i, j, irpt
748 character(len=512) :: header
749 integer :: nrpts, n_wannier
753 nrpts =
size(ham_r, 3)
754 n_wannier =
size(ham_r, 1)
755 assert(
size(irvec, 2) == nrpts)
756 assert(
size(ndegen, 1) == nrpts)
758 w90_hr_dat =
io_open(trim(adjustl(dir))//
'/'//trim(adjustl(prefix))//
'_hr.dat',
global_namespace, action=
'write', die=.false.)
759 if (w90_hr_dat == -1)
then
760 message(1) =
'Unable to open output file '//trim(adjustl(prefix))//
'_hr.dat for writing.'
765 write (w90_hr_dat, *) trim(header)
767 write (w90_hr_dat, *)
size(ham_r, 1)
768 write (w90_hr_dat, *) nrpts
769 write (w90_hr_dat,
'(15I5)') (ndegen(i), i=1, nrpts)
773 write (w90_hr_dat,
'(5I5,2F12.6)') irvec(:, irpt), j, i, &
786 ws_distance_tol, ndegen)
result(in_cell)
787 integer,
intent(in) :: rvec(3)
788 real(real64),
intent(in) :: real_metric(3, 3)
789 integer,
intent(in) :: mp_grid(3)
790 integer,
intent(in) :: ws_search_size(3)
791 real(real64),
intent(in) :: ws_distance_tol
792 integer,
optional,
intent(out) :: ndegen
794 integer :: i1, i2, i3, icnt
796 real(real64) :: dist_min, dist_to_origin
797 real(real64) :: dist(product(2*ws_search_size + 3))
803 do i1 = -ws_search_size(1) - 1, ws_search_size(1) + 1
804 do i2 = -ws_search_size(2) - 1, ws_search_size(2) + 1
805 do i3 = -ws_search_size(3) - 1, ws_search_size(3) + 1
807 ndiff = rvec - [i1, i2, i3] * mp_grid
808 dist(icnt) = dot_product(real(ndiff, real64), matmul(real_metric, real(ndiff, real64)))
813 dist_to_origin = dot_product(real(rvec, real64), matmul(real_metric, real(rvec, real64)))
814 dist_min = minval(dist)
816 in_cell = abs(dist_to_origin - dist_min) < ws_distance_tol**2
817 if (
present(ndegen)) ndegen = count(abs(dist - dist_min) < ws_distance_tol**2)
826 real(real64),
intent(in) :: real_lattice(3,3)
827 integer,
intent(in) :: mp_grid(3)
828 integer,
intent(in) :: ws_search_size(3)
829 real(real64),
intent(in) :: ws_distance_tol
830 integer,
intent(out) :: nrpts
832 integer :: n1, n2, n3
833 real(real64) :: real_metric(3, 3)
837 real_metric = matmul(transpose(real_lattice), real_lattice)
840 do n1 = -ws_search_size(1)*mp_grid(1), ws_search_size(1)*mp_grid(1)
841 do n2 = -ws_search_size(2)*mp_grid(2), ws_search_size(2)*mp_grid(2)
842 do n3 = -ws_search_size(3)*mp_grid(3), ws_search_size(3)*mp_grid(3)
844 ws_search_size, ws_distance_tol))
then
859 nrpts, irvec, ndegen)
860 real(real64),
intent(in) :: real_lattice(3,3)
861 integer,
intent(in) :: mp_grid(3)
862 integer,
intent(in) :: ws_search_size(3)
863 real(real64),
intent(in) :: ws_distance_tol
864 integer,
intent(in) :: nrpts
865 integer,
intent(out) :: irvec(3, nrpts)
866 integer,
intent(out) :: ndegen(nrpts)
868 integer :: n1, n2, n3, irpt, ndeg
869 real(real64) :: real_metric(3, 3)
873 real_metric = matmul(transpose(real_lattice), real_lattice)
876 do n1 = -ws_search_size(1)*mp_grid(1), ws_search_size(1)*mp_grid(1)
877 do n2 = -ws_search_size(2)*mp_grid(2), ws_search_size(2)*mp_grid(2)
878 do n3 = -ws_search_size(3)*mp_grid(3), ws_search_size(3)*mp_grid(3)
880 ws_search_size, ws_distance_tol, ndeg))
then
882 irvec(:, irpt) = [n1, n2, n3]
888 assert(irpt == nrpts)
892 if (abs(sum(
m_one/ndegen) - product(mp_grid)) > 1e-8_real64)
then
893 message(1) =
"Error computing the Wigner-Seitz points."
908 u_matrix, irvec, ham_r)
910 class(
mesh_t),
intent(in) :: mesh
915 complex(real64),
contiguous,
intent(in) :: u_matrix(:, :, :)
916 integer,
contiguous,
intent(in) :: irvec(:, :)
917 complex(real64),
contiguous,
intent(out) :: ham_r(:, :, :)
919 integer :: nk, nrpts, ik, irpt, iq, ikl
920 real(real64) :: rdotk
921 complex(real64),
allocatable :: hmss(:, :), ham_k_local(:, :, :)
925 nk = kpoints%full%npoints
926 nrpts =
size(ham_r, 3)
928 safe_allocate(hmss(1:wannier_opts%num_bands, 1:wannier_opts%num_bands))
929 safe_allocate(ham_k_local(1:wannier_opts%num_wann, 1:wannier_opts%num_wann, 1:st%d%kpt%nlocal()))
931 assert(wannier_opts%num_bands == st%nst)
932 if (wannier_opts%num_bands /= wannier_opts%num_wann)
then
939 do iq = st%d%kpt%start, st%d%kpt%end
940 ik = st%d%get_kpoint_index(iq)
941 ikl = iq - st%d%kpt%start + 1
943 ham_k_local(:, :, ikl) = matmul(transpose(conjg(u_matrix(:, :, ik))), matmul(hmss, u_matrix(:, :, ik)))
950 do iq = st%d%kpt%start, st%d%kpt%end
951 ik = st%d%get_kpoint_index(iq)
952 ikl = iq - st%d%kpt%start + 1
953 rdotk =
m_two*
m_pi*dot_product(kpoints%reduced%red_point(1:3, ik), real(irvec(1:3, irpt), real64))
954 ham_r(:, :, irpt) = ham_r(:, :, irpt) + (
exp(
m_zi*rdotk)/real(nk, real64)) * ham_k_local(:, :, ikl)
959 if (st%d%kpt%parallel)
then
963 safe_deallocate_a(hmss)
964 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_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