Octopus
wannier.F90
Go to the documentation of this file.
1!! Copyright (C) A Buccheri, J Reimann. 2026
2!!
3!! This Source Code Form is subject to the terms of the Mozilla Public
4!! License, v. 2.0. If a copy of the MPL was not distributed with this
5!! file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
7#include "global.h"
8
9module wannier_oct_m
10 use, intrinsic :: iso_fortran_env
11
13 use comm_oct_m
14 use debug_oct_m
16 use fft_oct_m
17 use global_oct_m
18 use grid_oct_m
19 use io_oct_m
20 use ions_oct_m
23 use mesh_oct_m
26 use mpi_oct_m
30 use parser_oct_m
33 use space_oct_m
37 use types_oct_m
38 use unit_oct_m
40 use wfs_elec_oct_m, only: wfs_elec_t
42
43 implicit none
44 private
45
46 public :: wannier_load_restart, &
48 wan_opts_t, &
49 wan_proj_t, &
52
53 type :: wan_opts_t
54 integer :: num_bands
55 integer :: num_wann
56 logical :: use_scdm
57 real(real64) :: scdm_mu
58 real(real64) :: scdm_sigma
59 real(real64) :: threshold
60 character(len=80) :: prefix
61 integer :: restart_from
62 logical :: plot, wannierize, calc_overlaps, dump_inputs
63 logical :: spinors = .false.
64 integer, allocatable :: spin_proj_component(:)
65 end type wan_opts_t
66
67 type wan_proj_t
68
70 integer :: l, m, s
71 integer :: radial = 1
72 real(real64) :: site(3)
73 real(real64) :: s_qaxis(3) = (/0.0_real64, 0.0_real64, 1.0_real64/)
74 real(real64) :: z(3) = (/0.0_real64, 0.0_real64, 1.0_real64/)
75 real(real64) :: x(3) = (/1.0_real64, 0.0_real64, 0.0_real64/)
76 real(real64) :: zona = 1.0_real64
77 end type wan_proj_t
78
79contains
80
86 subroutine wannier_load_restart(namespace, mc, space, st, gr, kpoints, restart_states)
87 type(namespace_t), intent(in) :: namespace
88 type(multicomm_t), intent(in) :: mc
89 class(space_t), intent(inout) :: space
90 type(states_elec_t), intent(inout) :: st
91 class(mesh_t), intent(inout) :: gr
92 type(kpoints_t), intent(inout) :: kpoints
93 integer, optional, intent(in) :: restart_states
94 ! Defaults to ground state
95
96 integer :: restart_states_, ierr, nik, dim, nst
97 type(restart_t) :: restart
98
99 restart_states_ = optional_default(restart_states, restart_gs)
100
101 call states_elec_allocate_wfns(st, gr, wfs_type = type_cmplx)
102 call restart%init(namespace, restart_states_, restart_type_load, mc, ierr, gr)
103
104 if (ierr /= 0) then
105 write(message(1),'(a)') 'Error opening restart file'
106 call messages_fatal(1)
107 endif
108
109 call states_elec_look(restart, nik, dim, nst, ierr)
110 if (st%d%ispin == spin_polarized) nik = nik / 2
111 if (dim /= st%d%dim .or. nik /= kpoints%reduced%npoints .or. nst /= st%nst) then
112 write(message(1),'(a)') 'Restart structure not commensurate.'
113 call messages_fatal(1)
114 end if
115
116 call states_elec_load(restart, namespace, space, st, gr, kpoints, ierr, label = ": wannier90")
117 call restart%end()
118
119 end subroutine wannier_load_restart
120
121
122 subroutine wan_opts_parse(namespace, wannier_opts)
123 type(namespace_t), intent(in) :: namespace
124 type(wan_opts_t), intent(inout) :: wannier_opts
125
126 logical :: read_from_td
127
128 !%Variable Wannier90NumWann
129 !%Type integer
130 !%Default 1
131 !%Section Utilities::oct-wannier90
132 !%Description
133 !% Number of wannier function
134 !%End
135 call parse_variable(namespace, 'Wannier90NumWann', 1, wannier_opts%num_wann)
136
137 !%Variable Wannier90NumBands
138 !%Type integer
139 !%Default 1
140 !%Section Utilities::oct-wannier90
141 !%Description
142 !% Number of bands considered for wannierization
143 !%End
144 call parse_variable(namespace, 'Wannier90NumBands', 1, wannier_opts%num_bands)
145
146 !%Variable Wannier90Prefix
147 !%Type string
148 !%Default w90
149 !%Section Utilities::oct-wannier90
150 !%Description
151 !% Prefix for wannier90 files
152 !%End
153 call parse_variable(namespace, 'Wannier90Prefix', 'w90', wannier_opts%prefix)
154 if (wannier_opts%prefix == 'w90') then
155 message(1) = "oct-wannier90: the prefix is set by default to w90"
157 end if
159 !%Variable Wannier90UseTD
160 !%Type logical
161 !%Default no
162 !%Section Utilities::oct-wannier90
163 !%Description
164 !% By default oct-wannier90 uses the ground-state states to compute the necessary information.
165 !% By setting this variable to yes, oct-wannier90 will use the TD states instead.
166 !%End
167 call parse_variable(global_namespace, 'Wannier90UseTD', .false., read_from_td)
168 if (read_from_td) then
169 wannier_opts%restart_from = restart_td
170 else
171 wannier_opts%restart_from = restart_gs
172 end if
173
174 !%Variable Wannier90DumpFiles
175 !%Type logical
176 !%Default no
177 !%Section Utilities::oct-wannier90
178 !%Description
179 !% Whether or not to dump intermediate files to disk.
180 !% Files are: .amn, .mmn, .eig and .win with inputs.
181 !%End
182 call parse_variable(global_namespace, 'Wannier90DumpFiles', .true., wannier_opts%dump_inputs)
183
184 !%Variable Wannier90Wannierize
185 !%Type logical
186 !%Default yes
187 !%Section Utilities::oct-wannier90
188 !%Description
189 !% Whether or not to perform the wannierization step (including disentanglement).
190 !%End
191 call parse_variable(global_namespace, 'Wannier90Wannierize', .true., wannier_opts%wannierize)
192
193 !%Variable Wannier90Plot
194 !%Type logical
195 !%Default no
196 !%Section Utilities::oct-wannier90
197 !%Description
198 !% If set to yes, oct-wannier90 will generate the wannier functions of a real space
199 !% grid and write them to file.
200 !%End
201 call parse_variable(global_namespace, 'Wannier90Plot', .true., wannier_opts%plot)
202
203 !%Variable Wannier90CalcOverlaps
204 !%Type logical
205 !%Default yes
206 !%Section Utilities::oct-wannier90
207 !%Description
208 !% Whether or not to calculate the amn and mmn matrices from octopus states.
209 !% By setting this variable to no, oct-wannier90 will attempt to read them from files
210 !%End
211 call parse_variable(global_namespace, 'Wannier90CalcOverlaps', .true., wannier_opts%calc_overlaps)
212
213 !%Variable Wannier90UseSCDM
214 !%Type logical
215 !%Default no
216 !%Section Utilities::oct-wannier90
217 !%Description
218 !% By default oct-wannier90 uses the projection method to generate the .amn file.
219 !% By setting this variable to yes, oct-wannier90 will use SCDM method instead.
220 !%End
221 call parse_variable(namespace, 'Wannier90UseSCDM', .false., wannier_opts%use_scdm)
222 if (wannier_opts%use_scdm) then
223 !%Variable SCDMsigma
224 !%Type float
225 !%Default 0.2
226 !%Section Utilities::oct-wannier90
227 !%Description
228 !% Broadening of SCDM smearing function.
229 !%End
230 call parse_variable(namespace, 'SCDMsigma', 0.2_real64, wannier_opts%scdm_sigma)
231
232 !%Variable SCDMmu
233 !%Type float
234 !%Section Utilities::oct-wannier90
235 !%Description
236 !% Energy range up to which states are considered for SCDM.
237 !%End
238 call parse_variable(namespace, 'SCDMmu', m_huge, wannier_opts%scdm_mu)
239 end if
240
241 ! We use the variable AOThreshold to deterine the threshold on the radii of the atomic orbitals
242 ! TODO: Have the threshold for wannier functions different than for AO
243 call parse_variable(namespace, 'AOThreshold', 0.001_real64, wannier_opts%threshold)
244
245 end subroutine wan_opts_parse
246
247 ! TODO: Removed SCDM - Should reintroduce once the code is working
248
249 subroutine wannier_create_amn(wan_opts, exclude_list, &
250 band_index, space, mesh, latt, st, kpoints, &
251 spin_channel, num_proj, proj_input, projection)
252 type(wan_opts_t), intent(in) :: wan_opts
253 class(space_t), intent(in) :: space
254 class(mesh_t), intent(in) :: mesh
255 type(lattice_vectors_t), intent(in) :: latt
256 type(states_elec_t), intent(in) :: st
257 type(kpoints_t), intent(in) :: kpoints
258 logical, intent(in) :: exclude_list(:)
259 integer, intent(in) :: band_index(:)
260 integer, intent(in) :: spin_channel
261 integer, intent(in) :: num_proj
262 type(wan_proj_t), intent(in) :: proj_input(:)
263
264 complex(real64), contiguous, intent(out) :: projection(:, :, :)
265
266 integer :: ist, ik, idim, iw, ip, ik_real, iband, num_kpts
267 real(real64) :: center(3), kpoint(3)
268
269 complex(real64), allocatable :: psi(:,:), phase(:)
270 real(real64), allocatable :: ylm(:)
271 type(orbitalset_t), allocatable :: orbitals(:)
272
273 push_sub(wannier_create_amn)
274 call profiling_in("W90_AMN")
275
276 if (st%parallel_in_states) then
277 call messages_not_implemented("w90_amn output with states parallelization")
278 end if
279
280 message(1) = "Info: Computing the projection matrix"
281 call messages_info(1)
282
283 assert(num_proj == size(proj_input))
284
285 num_kpts = product(kpoints%nik_axis(1:3))
286
287 ! Precompute orbitals
288 safe_allocate(orbitals(1:num_proj))
289 do iw=1, num_proj
290 call orbitalset_init(orbitals(iw))
291
292 orbitals(iw)%norbs = 1
293 orbitals(iw)%ndim = 1
294 orbitals(iw)%radius = -log(wan_opts%threshold)
295 orbitals(iw)%use_submesh = .false.
296
297 ! cartesian coordinate of orbital center
298 center(1:3) = latt%red_to_cart(proj_input(iw)%site(1:3))
299 call submesh_init(orbitals(iw)%sphere, space, mesh, latt, center, orbitals(iw)%radius)
300
301 ! get dorb as submesh points
302 safe_allocate(ylm(1:orbitals(iw)%sphere%np))
303 ! (this is a routine from pwscf)
304 call ylm_wannier(ylm, proj_input(iw)%l, proj_input(iw)%m, &
305 orbitals(iw)%sphere%r, orbitals(iw)%sphere%rel_x, orbitals(iw)%sphere%np)
306
307 if (proj_input(iw)%radial > 1) then
308 call messages_not_implemented("oct-wannier90: r/=1 for the radial part")
309 end if
310
311 ! apply radial function
312 do ip = 1, orbitals(iw)%sphere%np
313 ylm(ip) = ylm(ip) * m_two * exp(-orbitals(iw)%sphere%r(ip))
314 end do
315
316 ! NOTE(Alex) One can probably fill directly into zorb, and avoid allocating ylm
317 safe_allocate(orbitals(iw)%zorb(1:orbitals(iw)%sphere%np, 1, 1))
318 orbitals(iw)%zorb(1:orbitals(iw)%sphere%np, 1, 1) = ylm(1:orbitals(iw)%sphere%np)
319 safe_deallocate_a(ylm)
320
321 safe_allocate(orbitals(iw)%phase(1:orbitals(iw)%sphere%np, st%d%kpt%start:st%d%kpt%end))
322 orbitals(iw)%phase = m_z0
323 safe_allocate(orbitals(iw)%eorb_mesh(1:mesh%np, 1, 1, st%d%kpt%start:st%d%kpt%end))
324 orbitals(iw)%eorb_mesh = m_z0
325
326 call orbitalset_update_phase(orbitals(iw), space%dim, st%d%kpt, kpoints, st%d%ispin == spin_polarized, &
327 kpt_max = num_kpts)
328 end do
329
330 ! Compute the projections
331 safe_allocate(psi(1:mesh%np, 1:st%d%dim))
332 safe_allocate(phase(1:mesh%np))
333 projection = m_zero
334
335 do ik = 1, num_kpts
336 kpoint(1:space%dim) = kpoints%get_point(ik)
337 do ip = 1, mesh%np
338 phase(ip) = exp(-m_zi * sum(mesh%x(1:space%dim, ip) * kpoint(1:space%dim)))
339 end do
340
341 !For spin-polarized calculations, we select the right k-point
342 if (st%d%ispin == spin_polarized) then
343 ik_real = (ik-1)*2 + spin_channel
344 else
345 ik_real = ik
346 end if
347
348 ! TODO(Alex) ist and iw loops need interchanging to optimise array access
349 do ist = 1, st%nst
350 if (exclude_list(ist)) cycle
351 iband = band_index(ist)
352
353 if(ik_real >= st%d%kpt%start .and. ik_real <= st%d%kpt%end) then
354 call states_elec_get_state(st, mesh, ist, ik_real, psi)
355
356 do idim = 1, st%d%dim
357 do ip = 1, mesh%np
358 psi(ip, idim) = psi(ip, idim)*phase(ip)
359 end do
360 end do
361
362 do iw = 1, num_proj
363 idim = 1
364 if (wan_opts%spinors) idim = wan_opts%spin_proj_component(iw)
365 !At the moment the orbitals do not depend on idim
366 !The idim index for eorb_mesh would be for a spin-resolved orbital like j=1/2
367 projection(iband, iw, ik) = zmf_dotp(mesh, psi(1:mesh%np, idim), &
368 orbitals(iw)%eorb_mesh(1:mesh%np, 1, 1, ik_real), reduce = .false.)
369 end do
370
371 call profiling_in("W90_AMN_REDUCE")
372 call mesh%allreduce(projection(iband, :, ik))
373 call profiling_out("W90_AMN_REDUCE")
374 end if
375
376 if(st%d%kpt%parallel) then
377 call comm_allreduce(st%d%kpt%mpi_grp, projection(iband, :, ik))
378 end if
379
380 end do !ist
381 end do !ik
382
383 safe_deallocate_a(psi)
384 safe_deallocate_a(phase)
385
386 do iw = 1, num_proj
387 call orbitalset_end(orbitals(iw))
388 end do
389 safe_deallocate_a(orbitals)
390
391 call profiling_out("W90_AMN")
392
393 pop_sub(wannier_create_amn)
394
395 end subroutine wannier_create_amn
396
405 subroutine wannier_create_mmn(exclude_list, band_index, mesh, st, ions, &
406 spin_channel, nnlist, nncell, overlap)
407 logical, intent(in) :: exclude_list(:)
408 integer, intent(in) :: band_index(:)
409 class(mesh_t), intent(in) :: mesh
410 type(states_elec_t), target, intent(in) :: st
411 type(ions_t), intent(in) :: ions
412 integer, intent(in) :: spin_channel
413 integer, intent(in) :: nnlist(:,:)
414 integer, intent(in) :: nncell(:,:,:)
415
416 complex(real64), contiguous, intent(out) :: overlap(:, :, :, :)
417
418 integer :: ist, jst, ik, ip, iknn, idim, ibind
419 integer :: ik_oct, iknn_oct, inn
420 integer :: ik_loc
421 integer :: iband, jband, inode, node_fr, node_to
422 real(real64) :: gcart(3)
423 integer :: g(3)
424
425 integer :: nntot, num_kpts
426
427 complex(real64), allocatable :: psim(:,:), psin(:,:), phase(:)
428 type(wfs_elec_t), pointer :: batch
429 type(mpi_request) :: send_req
430
431 push_sub(wannier_create_mmn)
432
433 call profiling_in("W90_MMN")
434
435
436 nntot = size(nnlist, 2)
437 num_kpts = size(nnlist, 1)
438 assert(size(nnlist, 1) == num_kpts)
439 assert(size(nncell, 1) == 3)
440 assert(size(nncell, 2) == num_kpts)
441 assert(size(nncell, 3) == nntot)
442
443 if (st%parallel_in_states) then
444 call messages_not_implemented("w90_mmn output with states parallelization")
445 end if
446
447 message(1) = "Info: Computing the overlap matrix for wannerisation"
448 call messages_info(1)
449
450 overlap = m_zero
451 safe_allocate(psim(1:mesh%np, 1:st%d%dim))
452 safe_allocate(psin(1:mesh%np, 1:st%d%dim))
453 safe_allocate(phase(1:mesh%np))
454
455 if (st%d%kpt%parallel) ik_loc = 0
456
457 ! loop over the pairs specified in the nnk tuple
458 do ik = 1, num_kpts
459 do inn = 1, nntot
460
461 iknn = nnlist(ik, inn)
462 g(1:3) = nncell(:, ik, inn)
463
464 ! For spin-polarized calculations, we select the right k-point
465 if (st%d%ispin == spin_polarized) then
466 ik_oct = (ik-1)*2 + spin_channel
467 iknn_oct = (iknn-1)*2 + spin_channel
468 else
469 ik_oct = ik
470 iknn_oct = iknn
471 end if
472
473 ! If the k-point is local, compute the phase e^{-i G.r}
474 if(ik_oct >= st%d%kpt%start .and. ik_oct <= st%d%kpt%end) then
475 ! Wannier90 treats everything fully periodic
476 ! Conversion is done with the 3D "correct" klattice
477 call kpoints_to_absolute(ions%latt, real(g, real64) , gcart)
478
479 ! Phase that gives u_{n,k+G}(r) from u_{nk}(r)
480 ! Here the minus sign of Octopus cancels with minus sign of the input G
481 ! (ik and iknn correspond in the list to minus the k-points in Octopus)
482 if (any(g /= 0)) then
483 do ip = 1, mesh%np
484 phase(ip) = exp(-m_zi*dot_product(mesh%x(1:3, ip), gcart(1:3)))
485 end do
486 end if
487 end if
488
489 ! Loop over distributed bands
490 do jst = 1, st%nst
491 if (exclude_list(jst)) cycle
492 jband = band_index(jst)
493
494 if (st%d%kpt%parallel) then
495 node_fr = -1
496 node_to = -1
497 do inode = 0, st%d%kpt%mpi_grp%size-1
498 if(iknn_oct >= st%st_kpt_task(inode,3) .and. iknn_oct <= st%st_kpt_task(inode,4)) then
499 node_fr = inode
500 end if
501 if(ik_oct >= st%st_kpt_task(inode,3) .and. ik_oct <= st%st_kpt_task(inode,4)) then
502 node_to = inode
503 end if
504 end do
505 assert(node_fr > -1)
506 assert(node_to > -1)
507 send_req = mpi_request_null
508 ! We have locally the k-point
509 if (state_kpt_is_local(st, jst, iknn_oct)) then
510 call states_elec_get_state(st, mesh, jst, iknn_oct, psin)
511 ! We send it only if we don`t want to use it locally
512 if(node_to /= st%d%kpt%mpi_grp%rank) then
513 call st%d%kpt%mpi_grp%isend(psin, mesh%np*st%d%dim, mpi_double_complex, node_to, send_req)
514 end if
515 end if
516 ! We receive the desired state, only if it is not a local one
517 if(node_to == st%d%kpt%mpi_grp%rank .and. node_to /= node_fr) then
518 call st%d%kpt%mpi_grp%recv(psin, mesh%np*st%d%dim, mpi_double_complex, node_fr)
519 end if
520 if (send_req /= mpi_request_null) then
521 call st%d%kpt%mpi_grp%wait(send_req)
522 end if
523 else
524 call states_elec_get_state(st, mesh, jst, iknn_oct, psin)
525 end if
526
527 if(ik_oct >= st%d%kpt%start .and. ik_oct <= st%d%kpt%end) then
528
529 ! Do not apply the phase if the phase factor is 1
530 if (any(g /= 0)) then
531 do idim = 1, st%d%dim
532 do ip = 1, mesh%np
533 psin(ip, idim) = psin(ip, idim) * phase(ip)
534 end do
535 end do
536 end if
537
538 ! See Eq. (25) in PRB 56, 12847 (1997)
539 ! Loop over local k-points
540 do ist = 1, st%nst
541 if (exclude_list(ist)) cycle
542 iband = band_index(ist)
543
544 batch => st%group%psib(st%group%iblock(ist), ik_oct)
545
546 select case (batch%status())
547 case (batch_not_packed)
548 overlap(iband, jband, inn, ik) = m_z0
549 do idim = 1, st%d%dim
550 ibind = batch%inv_index((/ist, idim/))
551 overlap(iband, jband, inn, ik) = overlap(iband, jband, inn, ik) + &
552 zmf_dotp(mesh, batch%zff_linear(:, ibind), psin(:,idim), reduce = .false.)
553 end do
554 !Not properly done at the moment
556 call states_elec_get_state(st, mesh, ist, ik_oct, psim)
557 overlap(iband, jband, inn, ik) = zmf_dotp(mesh, st%d%dim, psim, psin, reduce = .false.)
558 end select
559 end do !ist
560 end if
561
562 call profiling_in("W90_MMN_REDUCE")
563 call mesh%allreduce(overlap(:, jband, inn, ik))
564 call profiling_out("W90_MMN_REDUCE")
565
566 if(st%d%kpt%parallel) then
567 call comm_allreduce(st%d%kpt%mpi_grp, overlap(:, jband, inn, ik))
568 end if
569 end do !jst
570 end do !inn
571
572 ! This contains a necessary remap: wannier90 only stores the local m_matrix, so it stores
573 ! only the first nk_rank kpoints in the matrix. The following block remaps from the global
574 ! kpoint to the local kpoint
575 if (st%d%kpt%parallel) then
576 if (st%d%ispin == spin_polarized) then
577 ik_oct = (ik-1)*2 + spin_channel
578 else
579 ik_oct = ik
580 end if
581 if (ik_oct >= st%d%kpt%start .and. ik_oct <= st%d%kpt%end) then
582 ik_loc = ik_loc + 1
583 if (ik_loc /= ik) then
584 overlap(:, :, :, ik_loc) = overlap(:, :, :, ik)
585 end if
586 end if
587 end if
588 end do !ik
589
590 safe_deallocate_a(psim)
591 safe_deallocate_a(psin)
592 safe_deallocate_a(phase)
593
594 call profiling_out("W90_MMN")
595
596 pop_sub(wannier_create_mmn)
597
598 end subroutine wannier_create_mmn
599
600end module wannier_oct_m
double log(double __x) __attribute__((__nothrow__
double exp(double __x) __attribute__((__nothrow__
This module implements batches of mesh functions.
Definition: batch.F90:135
integer, parameter, public batch_not_packed
functions are stored in CPU memory, unpacked order
Definition: batch.F90:286
integer, parameter, public batch_device_packed
functions are stored in device memory in packed order
Definition: batch.F90:286
integer, parameter, public batch_packed
functions are stored in CPU memory, in transposed (packed) order
Definition: batch.F90:286
integer, parameter, public spin_polarized
Fast Fourier Transform module. This module provides a single interface that works with different FFT ...
Definition: fft.F90:120
real(real64), parameter, public m_two
Definition: global.F90:193
real(real64), parameter, public m_huge
Definition: global.F90:209
real(real64), parameter, public m_zero
Definition: global.F90:191
complex(real64), parameter, public m_z0
Definition: global.F90:201
complex(real64), parameter, public m_zi
Definition: global.F90:205
This module implements the underlying real-space grid.
Definition: grid.F90:119
Definition: io.F90:116
subroutine, public kpoints_to_absolute(latt, kin, kout)
Definition: kpoints.F90:1137
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:120
subroutine, public messages_not_implemented(feature, namespace)
Definition: messages.F90:1067
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:161
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:409
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
Definition: messages.F90:593
This module handles the communicators for the various parallelization strategies.
Definition: multicomm.F90:147
type(namespace_t), public global_namespace
Definition: namespace.F90:135
subroutine, public orbitalset_init(this)
Definition: orbitalset.F90:210
subroutine, public orbitalset_end(this)
Definition: orbitalset.F90:236
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...
Definition: orbitalset.F90:286
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
Definition: profiling.F90:631
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
Definition: profiling.F90:554
integer, parameter, public restart_gs
Definition: restart.F90:156
integer, parameter, public restart_td
Definition: restart.F90:156
integer, parameter, public restart_type_load
Definition: restart.F90:183
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, 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)
Definition: submesh.F90:227
type(type_t), public type_cmplx
Definition: types.F90:136
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Definition: unit.F90:134
This module defines the unit system, used for input and output.
subroutine, public wannier_create_amn(wan_opts, exclude_list, band_index, space, mesh, latt, st, kpoints, spin_channel, num_proj, proj_input, projection)
Definition: wannier.F90:347
subroutine, public wannier_create_mmn(exclude_list, band_index, mesh, st, ions, spin_channel, nnlist, nncell, overlap)
Kohn-Sham State Overlap Matrix.
Definition: wannier.F90:502
subroutine, public wan_opts_parse(namespace, wannier_opts)
Definition: wannier.F90:218
subroutine, public wannier_load_restart(namespace, mc, space, st, gr, kpoints, restart_states)
Load Octopus restart data from disk.
Definition: wannier.F90:182
subroutine, public ylm_wannier(ylm, l, mr, rr, xx, nr)
Describes mesh distribution to nodes.
Definition: mesh.F90:187
The states_elec_t class contains all electronic wave functions.
this structure emulates the proj_type used by wannier90 library it is needed in the calculation of th...
Definition: wannier.F90:162
batches of electronic states
Definition: wfs_elec.F90:141
int true(void)