Octopus
lda_u.F90
Go to the documentation of this file.
1!! Copyright (C) 2016-2020 N. Tancogne-Dejean
2!!
3!! This program is free software; you can redistribute it and/or modify
4!! it under the terms of the GNU General Public License as published by
5!! the Free Software Foundation; either version 2, or (at your option)
6!! any later version.
7!!
8!! This program is distributed in the hope that it will be useful,
9!! but WITHOUT ANY WARRANTY; without even the implied warranty of
10!! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11!! GNU General Public License for more details.
12!!
13!! You should have received a copy of the GNU General Public License
14!! along with this program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18
19#include "global.h"
20
21module lda_u_oct_m
22 use accel_oct_m
25 use batch_oct_m
27 use comm_oct_m
28 use debug_oct_m
32 use energy_oct_m
33 use global_oct_m
34 use grid_oct_m
36 use ions_oct_m
40 use loct_oct_m
43 use math_oct_m
44 use mesh_oct_m
47 use mpi_oct_m
53 use parser_oct_m
55 use phase_oct_m
58 use space_oct_m
67 use types_oct_m
70
71 implicit none
72
73 private
74
75 public :: &
76 lda_u_t, &
77 lda_u_init, &
84 lda_u_end, &
102 dlda_u_force, &
103 zlda_u_force, &
104 dlda_u_rvu, &
105 zlda_u_rvu, &
114
115
116 integer, public, parameter :: &
117 DFT_U_NONE = 0, &
118 dft_u_empirical = 1, &
119 dft_u_acbn0 = 2
120
121 integer, public, parameter :: &
122 DFT_U_FLL = 0, &
123 dft_u_amf = 1, &
124 dft_u_mix = 2
125
126
129 type lda_u_t
130 private
131 integer, public :: level = dft_u_none
132
133 ! DFT+U basic variables
134 real(real64), allocatable, public :: dn(:,:,:,:)
135 real(real64), allocatable :: dV(:,:,:,:)
136
137 ! ACBN0 variables
138 complex(real64), allocatable, public :: zn(:,:,:,:)
139 complex(real64), allocatable :: zV(:,:,:,:)
140 real(real64), allocatable, public :: dn_alt(:,:,:,:)
141 complex(real64), allocatable, public :: zn_alt(:,:,:,:)
142
143 real(real64), allocatable :: renorm_occ(:,:,:,:,:)
144
145 ! Coulomb integrales
146 real(real64), allocatable, public :: coulomb(:,:,:,:,:)
147 ! !<(for the ACBN0 functional)
148 complex(real64), allocatable, public :: zcoulomb(:,:,:,:,:,:,:)
149 ! !< (for the ACBN0 functional with spinors)
150
151 class(orbitalbasis_t), allocatable, public :: basis
152 type(orbitalset_t), pointer, public :: orbsets(:) => null()
153 integer, public :: norbsets = 0
154
155 integer, public :: nspins = 0
156 integer, public :: spin_channels = 0
157 integer :: nspecies = 0
158 integer, public :: maxnorbs = 0
159 integer :: max_np = 0
160
161 logical :: useAllOrbitals = .false.
162 logical :: skipSOrbitals = .true.
163 logical :: freeze_occ = .false.
164 logical :: freeze_u = .false.
165 logical, public :: intersite = .false.
166 real(real64) :: intersite_radius = m_zero
167 logical, public :: basisfromstates = .false.
168 real(real64) :: acbn0_screening = m_one
169 integer, allocatable :: basisstates(:)
170 integer, allocatable :: basisstates_os(:)
171 ! !! the state specified in basisstate(:)
172 logical :: rot_inv = .false.
173 integer :: double_couting = dft_u_fll
174 integer :: sm_poisson = sm_poisson_direct
175 real(real64), allocatable :: dc_alpha(:)
176
177 type(lattice_vectors_t), pointer :: latt
178
179 type(distributed_t) :: orbs_dist
180 type(mpi_grp_t) :: grp
181
182 ! Intersite interaction variables
183 integer, public :: maxneighbors = 0
184 real(real64), allocatable, public :: dn_ij(:,:,:,:,:), dn_alt_ij(:,:,:,:,:), dn_alt_ii(:,:,:,:,:)
185 complex(real64), allocatable, public :: zn_ij(:,:,:,:,:), zn_alt_ij(:,:,:,:,:), zn_alt_ii(:,:,:,:,:)
186
187 ! Symmetrization-related variables
188 logical :: symmetrize_occ_matrices
189 integer, allocatable :: inv_map_symm(:,:)
190 integer :: nsym
191 real(real64), allocatable :: symm_weight(:,:,:,:)
192 end type lda_u_t
194contains
195
196 ! ---------------------------------------------------------
197 subroutine lda_u_init(this, namespace, space, level, gr, ions, st, mc, kpoints)
198 type(lda_u_t), target, intent(inout) :: this
199 type(namespace_t), intent(in) :: namespace
200 class(space_t), intent(in) :: space
201 integer, intent(in) :: level
202 type(grid_t), intent(in) :: gr
203 type(ions_t), target, intent(in) :: ions
204 type(states_elec_t), intent(in) :: st
205 type(multicomm_t), intent(in) :: mc
206 type(kpoints_t), intent(in) :: kpoints
208 integer :: is, ierr
209 type(block_t) :: blk
211 push_sub(lda_u_init)
213 assert(.not. (level == dft_u_none))
214
215 call messages_print_with_emphasis(msg="DFT+U", namespace=namespace)
216 if (gr%parallel_in_domains) call messages_experimental("dft+u parallel in domains", namespace=namespace)
217 this%level = level
219 this%latt => ions%latt
221 this%grp = mc%master_grp
222
223 !%Variable DFTUBasisFromStates
224 !%Type logical
225 !%Default no
226 !%Section Hamiltonian::DFT+U
227 !%Description
228 !% If set to yes, Octopus will construct the localized basis from
229 !% user-defined states. The states are taken at the Gamma point (or the first k-point of the
230 !% states in the restart_proj folder.
231 !% The states are defined via the block DFTUBasisStates
232 !%End
233 call parse_variable(namespace, 'DFTUBasisFromStates', .false., this%basisfromstates)
234 if (this%basisfromstates) call messages_experimental("DFTUBasisFromStates", namespace=namespace)
236 !%Variable DFTUDoubleCounting
237 !%Type integer
238 !%Default dft_u_fll
239 !%Section Hamiltonian::DFT+U
240 !%Description
241 !% This variable selects which DFT+U
242 !% double counting term is used.
243 !%Option dft_u_fll 0
244 !% (Default) The Fully Localized Limit (FLL)
245 !%Option dft_u_amf 1
246 !% (Experimental) Around mean field double counting, as defined in PRB 44, 943 (1991) and PRB 49, 14211 (1994).
247 !%Option dft_u_mix 2
248 !% (Experimental) Mixed double countind term as introduced by Petukhov et al., PRB 67, 153106 (2003).
249 !% This recovers the FLL and AMF as limiting cases.
250 !%End
251 call parse_variable(namespace, 'DFTUDoubleCounting', dft_u_fll, this%double_couting)
252 call messages_print_var_option('DFTUDoubleCounting', this%double_couting, namespace=namespace)
253 if (this%double_couting /= dft_u_fll) call messages_experimental("DFTUDoubleCounting /= dft_u_ffl", namespace=namespace)
254 if (st%d%ispin == spinors .and. this%double_couting /= dft_u_fll) then
255 call messages_not_implemented("AMF and MIX double counting with spinors", namespace=namespace)
256 end if
258 !%Variable DFTUPoissonSolver
259 !%Type integer
260 !%Section Hamiltonian::DFT+U
261 !%Description
262 !% This variable selects which Poisson solver
263 !% is used to compute the Coulomb integrals over a submesh.
264 !% These are non-periodic Poisson solvers.
265 !% The FFT Poisson solver with spherical cutoff is used by default.
266 !%
267 !%Option dft_u_poisson_direct 0
268 !% Direct Poisson solver. Slow but working in all cases.
269 !%Option dft_u_poisson_isf 1
270 !% (Experimental) ISF Poisson solver on a submesh.
271 !% This does not work for non-orthogonal cells nor domain parallelization.
272 !%Option dft_u_poisson_psolver 2
273 !% (Experimental) PSolver Poisson solver on a submesh.
274 !% This does not work for non-orthogonal cells nor domain parallelization.
275 !% Requires the PSolver external library.
276 !%Option dft_u_poisson_fft 3
277 !% (Default) FFT Poisson solver on a submesh.
278 !% This uses the 0D periodic version of the FFT kernels.
279 !%End
280 call parse_variable(namespace, 'DFTUPoissonSolver', sm_poisson_fft, this%sm_poisson)
281 call messages_print_var_option('DFTUPoissonSolver', this%sm_poisson, namespace=namespace)
282 if (this%sm_poisson /= sm_poisson_direct .and. this%sm_poisson /= sm_poisson_fft) then
283 call messages_experimental("DFTUPoissonSolver different from dft_u_poisson_direct", namespace=namespace)
284 call messages_experimental("and dft_u_poisson_fft", namespace=namespace)
285 end if
286 if (this%sm_poisson == sm_poisson_isf) then
287 if (gr%parallel_in_domains) then
288 call messages_not_implemented("DFTUPoissonSolver=dft_u_poisson_isf with domain parallelization", namespace=namespace)
289 end if
290 if (ions%latt%nonorthogonal) then
291 call messages_not_implemented("DFTUPoissonSolver=dft_u_poisson_isf with non-orthogonal cells", namespace=namespace)
292 end if
293 end if
294 if (this%sm_poisson == sm_poisson_psolver) then
295#if !(defined HAVE_PSOLVER)
296 message(1) = "The PSolver Poisson solver cannot be used since the code was not compiled with the PSolver library."
297 call messages_fatal(1, namespace=namespace)
298#endif
299 if (gr%parallel_in_domains) then
300 call messages_not_implemented("DFTUPoissonSolver=dft_u_poisson_psolver with domain parallelization", namespace=namespace)
301 end if
302 if (ions%latt%nonorthogonal) then
303 call messages_not_implemented("DFTUPoissonSolver=dft_u_poisson_psolver with non-orthogonal cells", namespace=namespace)
304 end if
305 end if
306
307 if (this%level == dft_u_acbn0) then
308 !%Variable UseAllAtomicOrbitals
309 !%Type logical
310 !%Default no
311 !%Section Hamiltonian::DFT+U
312 !%Description
313 !% If set to yes, Octopus will determine the effective U for all atomic orbitals
314 !% from the peusopotential. Only available with ACBN0 functional.
315 !% It is strongly recommended to set AOLoewdin=yes when using the option.
316 !%End
317 call parse_variable(namespace, 'UseAllAtomicOrbitals', .false., this%useAllOrbitals)
318 if (this%useAllOrbitals) call messages_experimental("UseAllAtomicOrbitals", namespace=namespace)
319
320 !%Variable SkipSOrbitals
321 !%Type logical
322 !%Default no
323 !%Section Hamiltonian::DFT+U
324 !%Description
325 !% If set to yes, Octopus will determine the effective U for all atomic orbitals
326 !% from the peusopotential but s orbitals. Only available with ACBN0 functional.
327 !%End
328 call parse_variable(namespace, 'SkipSOrbitals', .true., this%skipSOrbitals)
329 if (.not. this%SkipSOrbitals) call messages_experimental("SkipSOrbitals", namespace=namespace)
330
331 !%Variable ACBN0Screening
332 !%Type float
333 !%Default 1.0
334 !%Section Hamiltonian::DFT+U
335 !%Description
336 !% If set to 0, no screening will be included in the ACBN0 functional, and the U
337 !% will be estimated from bare Hartree-Fock. If set to 1 (default), the full screening
338 !% of the U, as defined in the ACBN0 functional, is used.
339 !%End
340 call parse_variable(namespace, 'ACBN0Screening', m_one, this%acbn0_screening)
341 call messages_print_var_value('ACBN0Screening', this%acbn0_screening, namespace=namespace)
342
343 !%Variable ACBN0RotationallyInvariant
344 !%Type logical
345 !%Section Hamiltonian::DFT+U
346 !%Description
347 !% If set to yes, Octopus will use for U and J a formula which is rotationally invariant.
348 !% This is different from the original formula for U and J.
349 !% This is activated by default, except in the case of spinors, as this is not yet implemented in this case.
350 !%End
351 call parse_variable(namespace, 'ACBN0RotationallyInvariant', st%d%ispin /= spinors, this%rot_inv)
352 call messages_print_var_value('ACBN0RotationallyInvariant', this%rot_inv, namespace=namespace)
353 if (this%rot_inv .and. st%d%ispin == spinors) then
354 call messages_not_implemented("Rotationally invariant ACBN0 with spinors", namespace=namespace)
355 end if
356
357 !%Variable ACBN0IntersiteInteraction
358 !%Type logical
359 !%Default no
360 !%Section Hamiltonian::DFT+U
361 !%Description
362 !% If set to yes, Octopus will determine the effective intersite interaction V
363 !% Only available with ACBN0 functional.
364 !% It is strongly recommended to set AOLoewdin=yes when using the option.
365 !%End
366 call parse_variable(namespace, 'ACBN0IntersiteInteraction', .false., this%intersite)
367 call messages_print_var_value('ACBN0IntersiteInteraction', this%intersite, namespace=namespace)
368 if (this%intersite) call messages_experimental("ACBN0IntersiteInteraction", namespace=namespace)
369
370 if (this%intersite) then
371
372 !This is a non local operator. To make this working, one probably needs to apply the
373 ! symmetries to the generalized occupation matrices
374 if (kpoints%use_symmetries) then
375 call messages_not_implemented("Intersite interaction with kpoint symmetries", namespace=namespace)
376 end if
377
378 !%Variable ACBN0IntersiteCutoff
379 !%Type float
380 !%Section Hamiltonian::DFT+U
381 !%Description
382 !% The cutoff radius defining the maximal intersite distance considered.
383 !% Only available with ACBN0 functional with intersite interaction.
384 !%End
385 call parse_variable(namespace, 'ACBN0IntersiteCutoff', m_zero, this%intersite_radius, unit = units_inp%length)
386 if (abs(this%intersite_radius) < m_epsilon) then
387 call messages_write("ACBN0IntersiteCutoff must be greater than 0")
388 call messages_fatal(1, namespace=namespace)
389 end if
390
391 end if
392
393 end if
394
395 ! DFT+U with ultrasoft/PAW (generalized overlap) uses the S-augmented occupation
396 ! <phi|S|psi~> (and the S-dressed +U operator). The following sub-paths additionally
397 ! need an augmentation that is not yet implemented and are fenced here.
398 if (st%requires_generalized_overlap) then
399 if (this%intersite) then
400 call messages_not_implemented("Intersite DFT+U with ultrasoft/PAW", namespace=namespace)
401 end if
402 if (this%basisfromstates) then
403 call messages_not_implemented("DFTUBasisFromStates with ultrasoft/PAW", namespace=namespace)
404 end if
405 ! The empirical +U occupation and operator are fully S-augmented (and the orbitals are
406 ! S-normalized). ACBN0 additionally needs the augmentation of the Coulomb integrals (the
407 ! orbital pair density gains a Q contribution), which is not implemented, so ACBN0 is fenced.
408 if (this%level == dft_u_acbn0) then
409 call messages_not_implemented("ACBN0 (computed U/J) with ultrasoft/PAW; use dft_u_empirical", &
410 namespace=namespace)
411 end if
412 end if
413
414 call lda_u_write_info(this, namespace=namespace)
415
416 if (.not. this%basisfromstates) then
417
418 call orbitalbasis_init(this%basis, namespace, space%periodic_dim)
419
420 ! Loewdin orthonormalization with ultrasoft/PAW would need the S metric
421 if (st%requires_generalized_overlap .and. this%basis%orthogonalization) then
422 call messages_not_implemented("AOLoewdin orthonormalization with ultrasoft/PAW", &
423 namespace=namespace)
424 end if
425
426 if (states_are_real(st)) then
427 call dorbitalbasis_build(this%basis, namespace, ions, gr, st%d%kpt, st%d%dim, &
428 this%skipSOrbitals, this%useAllOrbitals)
429 else
430 call zorbitalbasis_build(this%basis, namespace, ions, gr, st%d%kpt, st%d%dim, &
431 this%skipSOrbitals, this%useAllOrbitals)
432 end if
433 this%orbsets => this%basis%orbsets
434 this%norbsets = this%basis%norbsets
435 this%maxnorbs = this%basis%maxnorbs
436 this%max_np = this%basis%max_np
437 this%nspins = st%d%nspin
438 this%spin_channels = st%d%spin_channels
439 this%nspecies = ions%nspecies
440
441 !We allocate the necessary ressources
442 if (states_are_real(st)) then
443 call dlda_u_allocate(this, st)
444 else
445 call zlda_u_allocate(this, st)
446 end if
447
448 if (gr%parallel_in_domains) then
449 call distributed_init_serial(this%orbs_dist, this%norbsets)
450 else
451 call distributed_init(this%orbs_dist, this%norbsets, mpi_world%comm, "orbsets")
452 end if
453
454 else
455
456 !%Variable DFTUBasisStates
457 !%Type block
458 !%Default none
459 !%Section Hamiltonian::DFT+U
460 !%Description
461 !% This block starts by a line containing a single integer describing the number of
462 !% orbital sets. One orbital set is a group of orbitals on which one adds a Hubbard U.
463 !% Each following line of this block contains the index of a state to be used to construct the
464 !% localized basis, followed by the index of the corresponding orbital set.
465 !% See DFTUBasisFromStates for details.
466 !%End
467 if (parse_block(namespace, 'DFTUBasisStates', blk) == 0) then
468 call parse_block_integer(blk, 0, 0, this%norbsets)
469 this%maxnorbs = parse_block_n(blk)-1
470 if (this%maxnorbs <1) then
471 write(message(1),'(a,i3,a,i3)') 'DFTUBasisStates must contains at least one state.'
472 call messages_fatal(1, namespace=namespace)
473 end if
474 safe_allocate(this%basisstates(1:this%maxnorbs))
475 safe_allocate(this%basisstates_os(1:this%maxnorbs))
476 do is = 1, this%maxnorbs
477 call parse_block_integer(blk, is, 0, this%basisstates(is))
478 call parse_block_integer(blk, is, 1, this%basisstates_os(is))
479 end do
480 call parse_block_end(blk)
481 else
482 write(message(1),'(a,i3,a,i3)') 'DFTUBasisStates must be specified if DFTUBasisFromStates=yes'
483 call messages_fatal(1, namespace=namespace)
484 end if
485
486 if (states_are_real(st)) then
487 call dorbitalbasis_build_empty(this%basis, gr, st%d%dim, this%norbsets, this%basisstates_os)
488 else
489 call zorbitalbasis_build_empty(this%basis, gr, st%d%dim, this%norbsets, this%basisstates_os)
490 end if
491
492 this%max_np = gr%np
493 this%nspins = st%d%nspin
494 this%spin_channels = st%d%spin_channels
495 this%nspecies = 1
496
497 this%orbsets => this%basis%orbsets
498
499 call distributed_init_serial(this%orbs_dist, this%norbsets)
500
501 !We allocate the necessary ressources
502 if (states_are_real(st)) then
503 call dlda_u_allocate(this, st)
504 else
505 call zlda_u_allocate(this, st)
506 end if
507
508 call lda_u_loadbasis(this, namespace, space, st, gr, mc, ierr)
509 if (ierr /= 0) then
510 message(1) = "Unable to load DFT+U basis from selected states."
511 call messages_fatal(1)
512 end if
513
514 end if
515
516 ! Symmetrization of the occupation matrices
517 this%symmetrize_occ_matrices = st%symmetrize_density .or. kpoints%use_symmetries
518 if (this%basisfromstates) this%symmetrize_occ_matrices = .false.
519 if (this%symmetrize_occ_matrices) then
520 call build_symmetrization_map(this, ions, gr)
521 end if
522
523 safe_allocate(this%dc_alpha(this%norbsets))
524 this%dc_alpha = m_one
525
526 call messages_print_with_emphasis(namespace=namespace)
527
528 pop_sub(lda_u_init)
529 end subroutine lda_u_init
530
531
532 ! ---------------------------------------------------------
533 subroutine lda_u_init_coulomb_integrals(this, namespace, space, gr, st, psolver)
534 type(lda_u_t), target, intent(inout) :: this
535 type(namespace_t), intent(in) :: namespace
536 class(space_t), intent(in) :: space
537 type(grid_t), intent(in) :: gr
538 type(states_elec_t), intent(in) :: st
539 type(poisson_t), intent(in) :: psolver
540
541 logical :: complex_coulomb_integrals
542 integer :: ios
543 integer :: norbs
544
546
547 norbs = this%maxnorbs
548
549 if (.not. this%basisfromstates) then
550
551 if (this%level == dft_u_acbn0) then
552
553 complex_coulomb_integrals = .false.
554 do ios = 1, this%norbsets
555 if (this%orbsets(ios)%ndim > 1) complex_coulomb_integrals = .true.
556 end do
557
558 if (.not. complex_coulomb_integrals) then
559 write(message(1),'(a)') 'Computing the Coulomb integrals of the localized basis.'
560 call messages_info(1, namespace=namespace)
561 safe_allocate(this%coulomb(1:norbs,1:norbs,1:norbs,1:norbs, 1:this%norbsets))
562 if (states_are_real(st)) then
563 call dcompute_coulomb_integrals(this, namespace, space, gr, psolver)
564 else
565 call zcompute_coulomb_integrals(this, namespace, space, gr, psolver)
566 end if
567 else
568 assert(.not. states_are_real(st))
569 write(message(1),'(a)') 'Computing complex Coulomb integrals of the localized basis.'
570 call messages_info(1, namespace=namespace)
571 safe_allocate(this%zcoulomb(1:norbs, 1:norbs, 1:norbs, 1:norbs, 1:st%d%dim, 1:st%d%dim, 1:this%norbsets))
572 call compute_complex_coulomb_integrals(this, gr, st, psolver, namespace, space)
573 end if
574 end if
575
576 else
577 write(message(1),'(a)') 'Computing the Coulomb integrals of the localized basis.'
578 call messages_info(1, namespace=namespace)
579 safe_allocate(this%coulomb(1:norbs, 1:norbs, 1:norbs, 1:norbs, 1:this%norbsets))
580 if (states_are_real(st)) then
581 call dcompute_coulomb_integrals(this, namespace, space, gr, psolver)
582 else
583 call zcompute_coulomb_integrals(this, namespace, space, gr, psolver)
584 end if
585
586 end if
587
589
590 end subroutine lda_u_init_coulomb_integrals
591
592
593 ! ---------------------------------------------------------
594 subroutine lda_u_end(this)
595 implicit none
596 type(lda_u_t), intent(inout) :: this
597
598 push_sub(lda_u_end)
599
600 this%level = dft_u_none
601
602 safe_deallocate_a(this%dn)
603 safe_deallocate_a(this%zn)
604 safe_deallocate_a(this%dn_alt)
605 safe_deallocate_a(this%zn_alt)
606 safe_deallocate_a(this%dV)
607 safe_deallocate_a(this%zV)
608 safe_deallocate_a(this%coulomb)
609 safe_deallocate_a(this%zcoulomb)
610 safe_deallocate_a(this%renorm_occ)
611 safe_deallocate_a(this%dn_ij)
612 safe_deallocate_a(this%zn_ij)
613 safe_deallocate_a(this%dn_alt_ij)
614 safe_deallocate_a(this%zn_alt_ij)
615 safe_deallocate_a(this%dn_alt_ii)
616 safe_deallocate_a(this%zn_alt_ii)
617 safe_deallocate_a(this%basisstates)
618 safe_deallocate_a(this%basisstates_os)
619 safe_deallocate_a(this%dc_alpha)
620 safe_deallocate_a(this%inv_map_symm)
621 safe_deallocate_a(this%symm_weight)
622
623 nullify(this%orbsets)
624 call orbitalbasis_end(this%basis)
625
626 this%max_np = 0
627
628 if (.not. this%basisfromstates) then
629 call distributed_end(this%orbs_dist)
630 end if
631
632 pop_sub(lda_u_end)
633 end subroutine lda_u_end
634
635 ! ---------------------------------------------------------
640 subroutine lda_u_rebind_after_copy(this, ions)
641 type(lda_u_t), target, intent(inout) :: this
642 type(ions_t), target, intent(in) :: ions
643
644 integer :: ios, ispec
645
647
648 if (this%level == dft_u_none) then
650 return
651 end if
652
653 this%latt => ions%latt
654
655 if (allocated(this%basis%orbsets)) then
656 this%orbsets => this%basis%orbsets
657 else
658 nullify(this%orbsets)
660 return
661 end if
662
663 do ios = 1, this%norbsets
664 if (.not. associated(this%orbsets(ios)%spec)) cycle
665
666 ispec = this%orbsets(ios)%spec_index
667 if (ispec < 1 .or. ispec > ions%nspecies) then
668 call messages_not_implemented("lda_u_rebind_after_copy with invalid species index")
669 end if
670 if (.not. associated(ions%species(ispec)%s)) then
671 call messages_not_implemented("lda_u_rebind_after_copy with unassociated ion species")
672 end if
673 this%orbsets(ios)%spec => ions%species(ispec)%s
674 end do
675
677 end subroutine lda_u_rebind_after_copy
678
679 ! ---------------------------------------------------------
685 subroutine lda_u_accel_rebuild(this, kpt)
686 type(lda_u_t), intent(inout) :: this
687 type(distributed_t), intent(in) :: kpt
688
689 integer :: ios, ik
690
691 push_sub(lda_u_accel_rebuild)
692
693 if (.not. accel_is_enabled()) then
694 pop_sub(lda_u_accel_rebuild)
695 return
696 end if
697
698 if (this%level == dft_u_none .or. .not. associated(this%orbsets)) then
699 pop_sub(lda_u_accel_rebuild)
700 return
701 end if
702
703 do ios = 1, this%norbsets
704 call accel_detach_buffer(this%orbsets(ios)%dbuff_orb)
705 call accel_detach_buffer(this%orbsets(ios)%zbuff_orb)
706 call accel_detach_buffer(this%orbsets(ios)%sphere%buff_map)
707
708 if (allocated(this%orbsets(ios)%buff_eorb)) then
709 do ik = lbound(this%orbsets(ios)%buff_eorb, dim=1), ubound(this%orbsets(ios)%buff_eorb, dim=1)
710 call accel_detach_buffer(this%orbsets(ios)%buff_eorb(ik))
711 end do
712 safe_deallocate_a(this%orbsets(ios)%buff_eorb)
713 end if
714
715 if (allocated(this%orbsets(ios)%dorb)) then
716 call dorbitalset_transfer_to_device(this%orbsets(ios), kpt, this%orbsets(ios)%allocated_on_mesh)
717 else if (allocated(this%orbsets(ios)%zorb)) then
718 call zorbitalset_transfer_to_device(this%orbsets(ios), kpt, this%orbsets(ios)%allocated_on_mesh)
719 else
720 call messages_not_implemented("lda_u_accel_rebuild with missing orbital arrays")
721 end if
722 end do
723
724 pop_sub(lda_u_accel_rebuild)
725 end subroutine lda_u_accel_rebuild
726
727 ! When moving the ions, the basis must be reconstructed
728 subroutine lda_u_update_basis(this, space, gr, ions, st, psolver, namespace, kpoints, has_phase, aug_overlap)
729 type(lda_u_t), target, intent(inout) :: this
730 class(space_t), intent(in) :: space
731 type(grid_t), intent(in) :: gr
732 type(ions_t), target, intent(in) :: ions
733 type(states_elec_t), intent(in) :: st
734 type(poisson_t), intent(in) :: psolver
735 type(namespace_t), intent(in) :: namespace
736 type(kpoints_t), intent(in) :: kpoints
737 logical, intent(in) :: has_phase
738 type(nonlocal_pseudopotential_t), intent(in) :: aug_overlap
739
740 integer :: ios, maxorbs, nspin
741
742 if(this%level == dft_u_none) return
743
744 push_sub(lda_u_update_basis)
745
746 if(.not. this%basisfromstates) then
747 !We clean the orbital basis, to be able to reconstruct it
748 call orbitalbasis_end(this%basis)
749 nullify(this%orbsets)
750
751 !We now reconstruct the basis
752 if (states_are_real(st)) then
753 call dorbitalbasis_build(this%basis, namespace, ions, gr, st%d%kpt, st%d%dim, &
754 this%skipSOrbitals, this%useAllOrbitals, verbose = .false.)
755 else
756 call zorbitalbasis_build(this%basis, namespace, ions, gr, st%d%kpt, st%d%dim, &
757 this%skipSOrbitals, this%useAllOrbitals, verbose = .false.)
758 end if
759 this%orbsets => this%basis%orbsets
760 this%max_np = this%basis%max_np
761
762 ! Ultrasoft/PAW: AONormalize=yes means <phi|S|phi> = 1, so the
763 ! occupation <phi|S|psi~> is not over-counted. Done before the Bloch phases are set.
764 if (st%requires_generalized_overlap .and. this%basis%normalize) then
765 if (states_are_real(st)) then
766 call dlda_u_normalize_orbitals_uspp(this, gr%der%mesh, aug_overlap)
767 else
768 call zlda_u_normalize_orbitals_uspp(this, gr%der%mesh, aug_overlap)
769 end if
770 end if
771 end if
772
773 !In case of intersite interaction we need to reconstruct the basis
774 if (this%intersite) then
775 this%maxneighbors = 0
776 do ios = 1, this%norbsets
777 call orbitalset_init_intersite(this%orbsets(ios), namespace, space, this%grp, ios, ions, gr%der, psolver, &
778 this%orbsets, this%norbsets, this%maxnorbs, this%intersite_radius, st%d%kpt, has_phase, &
779 this%sm_poisson, this%basisfromstates, this%basis%combine_j_orbitals)
780 this%maxneighbors = max(this%maxneighbors, this%orbsets(ios)%nneighbors)
781 end do
782
783 maxorbs = this%maxnorbs
784 nspin = this%nspins
785
786 if (states_are_real(st)) then
787 safe_deallocate_a(this%dn_ij)
788 safe_allocate(this%dn_ij(1:maxorbs,1:maxorbs,1:nspin,1:this%norbsets,1:this%maxneighbors))
789 this%dn_ij(1:maxorbs,1:maxorbs,1:nspin,1:this%norbsets,1:this%maxneighbors) = m_zero
790 safe_deallocate_a(this%dn_alt_ij)
791 safe_allocate(this%dn_alt_ij(1:maxorbs,1:maxorbs,1:nspin,1:this%norbsets,1:this%maxneighbors))
792 this%dn_alt_ij(1:maxorbs,1:maxorbs,1:nspin,1:this%norbsets,1:this%maxneighbors) = m_zero
793 safe_deallocate_a(this%dn_alt_ii)
794 safe_allocate(this%dn_alt_ii(1:2,1:maxorbs,1:nspin,1:this%norbsets,1:this%maxneighbors))
795 this%dn_alt_ii(1:2,1:maxorbs,1:nspin,1:this%norbsets,1:this%maxneighbors) = m_zero
796 else
797 safe_deallocate_a(this%zn_ij)
798 safe_allocate(this%zn_ij(1:maxorbs,1:maxorbs,1:nspin,1:this%norbsets,1:this%maxneighbors))
799 this%zn_ij(1:maxorbs,1:maxorbs,1:nspin,1:this%norbsets,1:this%maxneighbors) = m_z0
800 safe_deallocate_a(this%zn_alt_ij)
801 safe_allocate(this%zn_alt_ij(1:maxorbs,1:maxorbs,1:nspin,1:this%norbsets,1:this%maxneighbors))
802 this%zn_alt_ij(1:maxorbs,1:maxorbs,1:nspin,1:this%norbsets,1:this%maxneighbors) = m_z0
803 safe_deallocate_a(this%zn_alt_ii)
804 safe_allocate(this%zn_alt_ii(1:2,1:maxorbs,1:nspin,1:this%norbsets,1:this%maxneighbors))
805 this%zn_alt_ii(1:2,1:maxorbs,1:nspin,1:this%norbsets,1:this%maxneighbors) = m_z0
806 end if
807 end if
808
809 ! We rebuild the phase for the orbital projection, similarly to the one of the pseudopotentials
810 ! In case of a laser field, the phase is recomputed in hamiltonian_elec_update
811 if (has_phase) then
812 call lda_u_build_phase_correction(this, space, st%d, gr%der%boundaries, namespace, kpoints)
813 else
814 if(.not. this%basisfromstates) then
815 !In case there is no phase, we perform the orthogonalization here
816 if(this%basis%orthogonalization) then
817 call dloewdin_orthogonalize(this%basis, st%d%kpt, namespace)
818 else
819 if(debug%info .and. space%is_periodic()) then
820 call dloewdin_info(this%basis, st%d%kpt, namespace)
821 end if
822 end if
823 end if
824 end if
825
826 ! Rebuild the Coulomb integrals
827 if (allocated(this%coulomb)) then
828 safe_deallocate_a(this%coulomb)
829 end if
830 if (allocated(this%zcoulomb)) then
831 safe_deallocate_a(this%zcoulomb)
832 end if
833 call lda_u_init_coulomb_integrals(this, namespace, space, gr, st, psolver)
834
835 pop_sub(lda_u_update_basis)
836
837 end subroutine lda_u_update_basis
838
839 ! Interface for the X(update_occ_matrices) routines
842 subroutine lda_u_update_occ_matrices(this, namespace, mesh, st, phase, energy, aug_overlap)
843 type(lda_u_t), intent(inout) :: this
844 type(namespace_t), intent(in) :: namespace
845 class(mesh_t), intent(in) :: mesh
846 type(states_elec_t), intent(inout) :: st
847 type(phase_t), intent(in) :: phase
848 type(energy_t), intent(inout) :: energy
849 type(nonlocal_pseudopotential_t), intent(in) :: aug_overlap
850
851 if (this%level == dft_u_none .or. this%freeze_occ) return
853
854 if (states_are_real(st)) then
855 call dupdate_occ_matrices(this, namespace, mesh, st, energy%dft_u, aug_overlap)
856 else
857 if (phase%is_allocated()) then
858 call zupdate_occ_matrices(this, namespace, mesh, st, energy%dft_u, aug_overlap, phase)
859 else
860 call zupdate_occ_matrices(this, namespace, mesh, st, energy%dft_u, aug_overlap)
861 end if
862 end if
863
865 end subroutine lda_u_update_occ_matrices
866
867
869 subroutine lda_u_build_phase_correction(this, space, std, boundaries, namespace, kpoints, vec_pot, vec_pot_var)
870 type(lda_u_t), intent(inout) :: this
871 class(space_t), intent(in) :: space
872 type(states_elec_dim_t), intent(in) :: std
873 type(boundaries_t), intent(in) :: boundaries
874 type(namespace_t), intent(in) :: namespace
875 type(kpoints_t), intent(in) :: kpoints
876 real(real64), optional, allocatable, intent(in) :: vec_pot(:)
877 real(real64), optional, allocatable, intent(in) :: vec_pot_var(:, :)
878
879 integer :: ios
880
881 if (boundaries%spiralBC) call messages_not_implemented("DFT+U with spiral boundary conditions", &
882 namespace=namespace)
883
885
886 write(message(1), '(a)') 'Debug: Building the phase correction for DFT+U orbitals.'
887 call messages_info(1, namespace=namespace, debug_only=.true.)
888
889 do ios = 1, this%norbsets
890 call orbitalset_update_phase(this%orbsets(ios), space%dim, std%kpt, kpoints, &
891 (std%ispin==spin_polarized), vec_pot, vec_pot_var)
892 call orbitalset_update_phase_shift(this%orbsets(ios), space%dim, std%kpt, kpoints, &
893 (std%ispin==spin_polarized), vec_pot, vec_pot_var)
894 end do
895
896 if (.not. this%basisfromstates) then
897 if (this%basis%orthogonalization) then
898 call zloewdin_orthogonalize(this%basis, std%kpt, namespace)
899 else
900 if (debug%info .and. space%is_periodic()) call zloewdin_info(this%basis, std%kpt, namespace)
901 end if
902 end if
903
905
906 end subroutine lda_u_build_phase_correction
907
908 ! ---------------------------------------------------------
909 subroutine compute_acbno_u_kanamori(this, st, kanamori)
910 type(lda_u_t), intent(in) :: this
911 type(states_elec_t), intent(in) :: st
912 real(real64), contiguous, intent(out) :: kanamori(:,:)
913
914 if (this%nspins == 1) then
915 if (states_are_real(st)) then
916 call dcompute_acbno_u_kanamori_restricted(this, kanamori)
917 else
918 call zcompute_acbno_u_kanamori_restricted(this, kanamori)
919 end if
920 else
921 if (states_are_real(st)) then
922 call dcompute_acbno_u_kanamori(this, kanamori)
923 else
924 call zcompute_acbno_u_kanamori(this, kanamori)
925 end if
926 end if
927
928
929 end subroutine compute_acbno_u_kanamori
930
931 ! ---------------------------------------------------------
932 subroutine lda_u_freeze_occ(this)
933 type(lda_u_t), intent(inout) :: this
934
935 this%freeze_occ = .true.
936 end subroutine lda_u_freeze_occ
937
938 ! ---------------------------------------------------------
939 subroutine lda_u_freeze_u(this)
940 type(lda_u_t), intent(inout) :: this
942 this%freeze_u = .true.
943 end subroutine lda_u_freeze_u
944
945 ! ---------------------------------------------------------
946 subroutine lda_u_set_effectiveu(this, Ueff)
947 type(lda_u_t), intent(inout) :: this
948 real(real64), contiguous, intent(in) :: ueff(:)
949
950 integer :: ios
951
952 push_sub(lda_u_set_effectiveu)
953
954 do ios = 1,this%norbsets
955 this%orbsets(ios)%Ueff = ueff(ios)
956 end do
957
958 pop_sub(lda_u_set_effectiveu)
959 end subroutine lda_u_set_effectiveu
960
961 ! ---------------------------------------------------------
962 subroutine lda_u_get_effectiveu(this, Ueff)
963 type(lda_u_t), intent(in) :: this
964 real(real64), contiguous, intent(inout) :: ueff(:)
965
966 integer :: ios
967
968 push_sub(lda_u_get_effectiveu)
969
970 do ios = 1,this%norbsets
971 ueff(ios) = this%orbsets(ios)%Ueff
972 end do
973
974 pop_sub(lda_u_get_effectiveu)
975 end subroutine lda_u_get_effectiveu
976
977 ! ---------------------------------------------------------
978 subroutine lda_u_set_effectivev(this, Veff)
979 type(lda_u_t), intent(inout) :: this
980 real(real64), contiguous, intent(in) :: veff(:)
982 integer :: ios, ncount
983
984 push_sub(lda_u_set_effectivev)
985
986 ncount = 0
987 do ios = 1, this%norbsets
988 this%orbsets(ios)%V_ij(1:this%orbsets(ios)%nneighbors,0) = veff(ncount+1:ncount+this%orbsets(ios)%nneighbors)
989 ncount = ncount + this%orbsets(ios)%nneighbors
990 end do
991
992 pop_sub(lda_u_set_effectivev)
993 end subroutine lda_u_set_effectivev
994
995 ! ---------------------------------------------------------
996 subroutine lda_u_get_effectivev(this, Veff)
997 type(lda_u_t), intent(in) :: this
998 real(real64), contiguous, intent(inout) :: veff(:)
999
1000 integer :: ios, ncount
1001
1002 push_sub(lda_u_get_effectivev)
1003
1004 ncount = 0
1005 do ios = 1, this%norbsets
1006 veff(ncount+1:ncount+this%orbsets(ios)%nneighbors) = this%orbsets(ios)%V_ij(1:this%orbsets(ios)%nneighbors,0)
1007 ncount = ncount + this%orbsets(ios)%nneighbors
1008 end do
1009
1010 pop_sub(lda_u_get_effectivev)
1012
1013 ! ---------------------------------------------------------
1014 subroutine lda_u_write_info(this, iunit, namespace)
1015 type(lda_u_t), intent(in) :: this
1016 integer, optional, intent(in) :: iunit
1017 type(namespace_t), optional, intent(in) :: namespace
1019 push_sub(lda_u_write_info)
1020
1021 write(message(1), '(1x)')
1022 call messages_info(1, iunit=iunit, namespace=namespace)
1023 if (this%level == dft_u_empirical) then
1024 write(message(1), '(a)') "Method:"
1025 write(message(2), '(a)') " [1] Dudarev et al., Phys. Rev. B 57, 1505 (1998)"
1026 call messages_info(2, iunit=iunit, namespace=namespace)
1027 else
1028 if (.not. this%intersite) then
1029 write(message(1), '(a)') "Method:"
1030 write(message(2), '(a)') " [1] Agapito et al., Phys. Rev. X 5, 011006 (2015)"
1031 else
1032 write(message(1), '(a)') "Method:"
1033 write(message(2), '(a)') " [1] Tancogne-Dejean, and Rubio, Phys. Rev. B 102, 155117 (2020)"
1034 end if
1035 call messages_info(2, iunit=iunit, namespace=namespace)
1036 end if
1037 write(message(1), '(a)') "Implementation:"
1038 write(message(2), '(a)') " [1] Tancogne-Dejean, Oliveira, and Rubio, Phys. Rev. B 69, 245133 (2017)"
1039 write(message(3), '(1x)')
1040 call messages_info(3, iunit=iunit, namespace=namespace)
1041
1042 pop_sub(lda_u_write_info)
1043
1044 end subroutine lda_u_write_info
1045
1046 ! ---------------------------------------------------------
1047 subroutine lda_u_loadbasis(this, namespace, space, st, mesh, mc, ierr)
1048 type(lda_u_t), intent(inout) :: this
1049 type(namespace_t), intent(in) :: namespace
1050 class(space_t), intent(in) :: space
1051 type(states_elec_t), intent(in) :: st
1052 class(mesh_t), intent(in) :: mesh
1053 type(multicomm_t), intent(in) :: mc
1054 integer, intent(out) :: ierr
1055
1056 integer :: err, wfns_file, is, ist, idim, ik, ios, iorb
1057 type(restart_t) :: restart_gs
1058 character(len=256) :: lines(3)
1059 character(len=256), allocatable :: restart_file(:, :)
1060 logical, allocatable :: restart_file_present(:, :)
1061 character(len=12) :: filename
1062 character(len=1) :: char
1063 character(len=50) :: str
1064 type(orbitalset_t), pointer :: os
1065 integer, allocatable :: count(:)
1066 real(real64) :: norm, center(space%dim)
1067 real(real64), allocatable :: dpsi(:,:,:)
1068 complex(real64), allocatable :: zpsi(:,:,:)
1069
1070
1071 push_sub(lda_u_loadbasis)
1072
1073 ierr = 0
1074
1075 message(1) = "Debug: Loading DFT+U basis from states."
1076 call messages_info(1, debug_only=.true.)
1077
1078 call restart_gs%init(namespace, restart_proj, restart_type_load, mc, err, mesh=mesh)
1079
1080 ! If any error occurred up to this point then it is not worth continuing,
1081 ! as there something fundamentally wrong with the restart files
1082 if (err /= 0) then
1083 call restart_gs%end()
1084 message(1) = "Error loading DFT+U basis from states, cannot proceed with the calculation"
1085 call messages_fatal(1)
1087 return
1088 end if
1089 ! only supported for obf format
1090 if (restart_gs%file_format_states /= option__restartfileformatstates__obf) then
1091 message(1) = "Error: loading DFT+U basis only supported for OBF restart format"
1092 message(2) = "Please set RestartFileFormatStates = obf and re-run the GS calculation."
1093 call messages_fatal(2)
1094 end if
1095
1096 ! open files to read
1097 wfns_file = restart_gs%open('wfns')
1098 call restart_gs%read(wfns_file, lines, 2, err)
1099 if (err /= 0) then
1100 ierr = ierr - 2**5
1101 else if (states_are_real(st)) then
1102 read(lines(2), '(a)') str
1103 if (str(2:8) == 'Complex') then
1104 message(1) = "Cannot read real states from complex wavefunctions."
1105 call messages_fatal(1, namespace=namespace)
1106 else if (str(2:5) /= 'Real') then
1107 message(1) = "Restart file 'wfns' does not specify real/complex; cannot check compatibility."
1108 call messages_warning(1, namespace=namespace)
1109 end if
1110 end if
1111 ! complex can be restarted from real, so there is no problem.
1112
1113 ! If any error occurred up to this point then it is not worth continuing,
1114 ! as there something fundamentally wrong with the restart files
1115 if (err /= 0) then
1116 call restart_gs%close(wfns_file)
1117 call restart_gs%end()
1118 message(1) = "Error loading DFT+U basis from states, cannot proceed with the calculation"
1120 pop_sub(lda_u_loadbasis)
1121 return
1122 end if
1123
1124 safe_allocate(restart_file(1:st%d%dim, 1:st%nst))
1125 safe_allocate(restart_file_present(1:st%d%dim, 1:st%nst))
1126 restart_file_present = .false.
1127
1128 ! Next we read the list of states from the files.
1129 ! Errors in reading the information of a specific state from the files are ignored
1130 ! at this point, because later we will skip reading the wavefunction of that state.
1131 do
1132 call restart_gs%read(wfns_file, lines, 1, err)
1133 if (err == 0) then
1134 read(lines(1), '(a)') char
1135 if (char == '%') then
1136 !We reached the end of the file
1137 exit
1138 else
1139 read(lines(1), *) ik, char, ist, char, idim, char, filename
1140 end if
1141 end if
1142
1143 if (any(this%basisstates==ist) .and. ik == 1) then
1144 restart_file(idim, ist) = trim(filename)
1145 restart_file_present(idim, ist) = .true.
1146 end if
1147 end do
1148 call restart_gs%close(wfns_file)
1149
1150 !We loop over the states we need
1151 safe_allocate(count(1:this%norbsets))
1152 count = 0
1153 do is = 1, this%maxnorbs
1154 ist = this%basisstates(is)
1155 ios = this%basisstates_os(is)
1156 count(ios) = count(ios)+1
1157 do idim = 1, st%d%dim
1158
1159 if (.not. restart_file_present(idim, ist)) then
1160 write(message(1), '(a,i3,a)') "Cannot read states ", ist, "from the projection folder"
1161 call messages_fatal(1, namespace=namespace)
1162 end if
1163
1164 if (states_are_real(st)) then
1165 call restart_gs%read_mesh_function(restart_file(idim, ist), mesh, &
1166 this%orbsets(ios)%dorb(:,idim,count(ios)), err)
1167 else
1168 call restart_gs%read_mesh_function(restart_file(idim, ist), mesh, &
1169 this%orbsets(ios)%zorb(:,idim,count(ios)), err)
1170 end if
1171 if (err /= 0) then
1172 message(1) = "Error loading mesh function "//trim(restart_file(idim, ist))
1173 call messages_fatal(1)
1174 end if
1175 end do
1176 end do
1177 safe_deallocate_a(count)
1178 safe_deallocate_a(restart_file)
1179 safe_deallocate_a(restart_file_present)
1180 call restart_gs%end()
1181
1182 ! Normalize the orbitals. This is important if we use Wannier orbitals instead of KS states
1183 if(this%basis%normalize) then
1184 do ios = 1, this%norbsets
1185 do iorb = 1, this%orbsets(ios)%norbs
1186 if (states_are_real(st)) then
1187 norm = dmf_nrm2(mesh, st%d%dim, this%orbsets(ios)%dorb(:,:,iorb))
1188 call lalg_scal(mesh%np, st%d%dim, m_one/norm, this%orbsets(ios)%dorb(:,:,iorb))
1189 else
1190 norm = zmf_nrm2(mesh, st%d%dim, this%orbsets(ios)%zorb(:,:,iorb))
1191 call lalg_scal(mesh%np, st%d%dim, m_one/norm, this%orbsets(ios)%zorb(:,:,iorb))
1192 end if
1193 end do
1194 end do
1195 end if
1196
1197 ! We rotate the orbitals in the complex plane to have them as close as possible to real functions
1198 if(states_are_complex(st) .and. st%d%dim == 1) then
1199 do ios = 1, this%norbsets
1200 do iorb = 1, this%orbsets(ios)%norbs
1201 call zmf_fix_phase(mesh, this%orbsets(ios)%zorb(:,1,iorb))
1202 end do
1203 end do
1204 end if
1205
1206 ! We determine the center of charge by computing <w|r|w>
1207 ! We could also determine the spread by \Omega = <w|r^2|w> - <w|r|w>^2
1208 do ios = 1, this%norbsets
1209 if (states_are_real(st)) then
1210 call dorbitalset_get_center_of_mass(this%orbsets(ios), space, mesh, this%latt)
1211 else
1212 call zorbitalset_get_center_of_mass(this%orbsets(ios), space, mesh, this%latt)
1213 end if
1214 end do
1215
1216 message(1) = "Debug: Converting the Wannier states to submeshes."
1217 call messages_info(1, debug_only=.true.)
1218
1219 ! We now transfer the states to a submesh centered on the center of mass of the Wannier orbitals
1220 this%max_np = 0
1221 do ios = 1, this%norbsets
1222 os => this%orbsets(ios)
1223 center = os%sphere%center
1224 safe_deallocate_a(os%sphere%center)
1225 if (states_are_real(st)) then
1226 safe_allocate(dpsi(1:mesh%np, 1:os%ndim, 1:os%norbs))
1227 dpsi(1:mesh%np, 1:os%ndim, 1:os%norbs) = os%dorb(1:mesh%np, 1:os%ndim, 1:os%norbs)
1228
1229 safe_deallocate_a(os%dorb)
1230 !We initialise the submesh corresponding to the orbital
1231 call submesh_init(os%sphere, space, mesh, this%latt, center, os%radius)
1232 safe_allocate(os%dorb(1:os%sphere%np, 1:os%ndim, 1:os%norbs))
1233 do iorb = 1, os%norbs
1234 do idim = 1, os%ndim
1235 call dsubmesh_copy_from_mesh(os%sphere, dpsi(:,idim,iorb), os%dorb(:,idim, iorb))
1236 end do
1237 end do
1238 safe_deallocate_a(dpsi)
1239 else
1240 safe_allocate(zpsi(1:mesh%np, 1:os%ndim, 1:os%norbs))
1241 zpsi(1:mesh%np, 1:os%ndim, 1:os%norbs) = os%zorb(1:mesh%np, 1:os%ndim, 1:os%norbs)
1242 safe_deallocate_a(os%zorb)
1243 !We initialise the submesh corresponding to the orbital
1244 call submesh_init(os%sphere, space, mesh, this%latt, center, os%radius)
1245 safe_allocate(os%zorb(1:os%sphere%np, 1:os%ndim, 1:os%norbs))
1246 do iorb = 1, os%norbs
1247 do idim = 1, os%ndim
1248 call zsubmesh_copy_from_mesh(os%sphere, zpsi(:,idim,iorb), os%zorb(:,idim, iorb))
1249 end do
1250 end do
1251 safe_deallocate_a(zpsi)
1252
1253 safe_allocate(os%phase(1:os%sphere%np, st%d%kpt%start:st%d%kpt%end))
1254 safe_allocate(os%eorb_submesh(1:os%sphere%np, 1:os%ndim, 1:os%norbs, st%d%kpt%start:st%d%kpt%end))
1255 end if
1256 os%use_submesh = .true. ! We are now on a submesh
1257 os%allocated_on_mesh = .false.
1258 this%max_np = max(this%max_np, os%sphere%np)
1259 end do
1260
1261 this%basis%use_submesh = .true.
1262
1263 ! If we use GPUs, we need to transfert the orbitals on the device
1264 if (accel_is_enabled() .and. st%d%dim == 1) then
1265 do ios = 1, this%norbsets
1266 os => this%orbsets(ios)
1267
1268 os%ldorbs = max(accel_padded_size(os%sphere%np), 1)
1269 os%ldorbs_eorb = max(accel_padded_size(os%sphere%np), 1)
1270 if (states_are_real(st)) then
1271 call accel_create_buffer(os%dbuff_orb, accel_mem_read_only, type_float, os%ldorbs*os%norbs)
1272 else
1273 call accel_create_buffer(os%zbuff_orb, accel_mem_read_only, type_cmplx, os%ldorbs*os%norbs)
1274 safe_allocate(os%buff_eorb(st%d%kpt%start:st%d%kpt%end))
1275
1276 do ik= st%d%kpt%start, st%d%kpt%end
1277 call accel_create_buffer(os%buff_eorb(ik), accel_mem_read_only, type_cmplx, os%ldorbs_eorb*os%norbs)
1278 end do
1279 end if
1280
1281 call accel_create_buffer(os%sphere%buff_map, accel_mem_read_only, type_integer, max(os%sphere%np, 1))
1282 call accel_write_buffer(os%sphere%buff_map, os%sphere%np, os%sphere%map)
1283
1284 do iorb = 1, os%norbs
1285 if(states_are_complex(st)) then
1286 call accel_write_buffer(os%zbuff_orb, os%sphere%np, os%zorb(:, 1, iorb), &
1287 offset = (iorb - 1)*os%ldorbs)
1288 else
1289 call accel_write_buffer(os%dbuff_orb, os%sphere%np, os%dorb(:, 1, iorb), &
1290 offset = (iorb - 1)*os%ldorbs)
1291 end if
1292 end do
1293 end do
1294 end if
1295
1296
1297 message(1) = "Debug: Loading DFT+U basis from states done."
1298 call messages_info(1, debug_only=.true.)
1299
1300 pop_sub(lda_u_loadbasis)
1301 end subroutine lda_u_loadbasis
1302
1304 subroutine build_symmetrization_map(this, ions, gr)
1305 type(lda_u_t), intent(inout) :: this
1306 type(ions_t), intent(in) :: ions
1307 type(grid_t), intent(in) :: gr
1308
1309 integer :: nsym, iop, ios, iatom, iatom_sym, ios_sym
1310
1311 push_sub(build_symmetrization_map)
1312
1313 nsym = ions%symm%nops
1314 safe_allocate(this%inv_map_symm(1:this%norbsets, 1:nsym))
1315 this%inv_map_symm = -1
1316
1317 this%nsym = nsym
1318
1319 do ios = 1, this%norbsets
1320 iatom = this%orbsets(ios)%iatom
1321 do iop = 1, nsym
1322 iatom_sym = ions%inv_map_symm_atoms(iatom, iop)
1323
1324 do ios_sym = 1, this%norbsets
1325 if (this%orbsets(ios_sym)%iatom == iatom_sym .and. this%orbsets(ios_sym)%norbs == this%orbsets(ios)%norbs &
1326 .and. this%orbsets(ios_sym)%nn == this%orbsets(ios)%nn .and. this%orbsets(ios_sym)%ll == this%orbsets(ios)%ll &
1327 .and. is_close(this%orbsets(ios_sym)%jj, this%orbsets(ios)%jj)) then
1328 this%inv_map_symm(ios, iop) = ios_sym
1329 exit
1330 end if
1331 end do
1332 assert(this%inv_map_symm(ios, iop) > 0)
1333 end do
1334 end do
1335
1336 safe_allocate(this%symm_weight(1:this%maxnorbs, 1:this%maxnorbs, 1:this%nsym, 1:this%norbsets))
1337 this%symm_weight = m_zero
1338
1339 do ios = 1, this%norbsets
1340 ! s-orbitals
1341 if (this%orbsets(ios)%norbs == 1) then
1342 this%symm_weight(1,1, 1:this%nsym, ios) = m_one
1343 cycle
1344 end if
1345
1346 ! Not implemented yet
1347 if (this%orbsets(ios)%ndim > 1) cycle
1348
1349 call orbitals_get_symm_weight(this%orbsets(ios), ions%space, ions%latt, gr, ions%symm, this%symm_weight(:,:,:,ios))
1350 end do
1351
1353 end subroutine build_symmetrization_map
1354
1356 subroutine orbitals_get_symm_weight(os, space, latt, gr, symm, weight)
1357 type(orbitalset_t), intent(in) :: os
1358 type(space_t), intent(in) :: space
1359 type(lattice_vectors_t), intent(in) :: latt
1360 type(grid_t), intent(in) :: gr
1361 type(symmetries_t), intent(in) :: symm
1362 real(real64), contiguous, intent(inout) :: weight(:,:,:)
1363
1364 integer :: im, imp, iop, mm
1365 real(real64), allocatable :: orb(:,:), orb_sym(:), ylm(:)
1366 type(submesh_t) :: sphere
1367 real(real64) :: rc, norm, origin(space%dim)
1368
1369 push_sub(orbitals_get_symm_weight)
1370
1371 assert(os%ndim == 1)
1372
1373 safe_allocate(orb_sym(1:gr%np))
1374 safe_allocate(orb(1:gr%np, 1:os%norbs))
1375
1376 assert(2*os%ll+1 == os%norbs)
1377
1378 ! We generate an artificial submesh to compute the symmetries on it
1379 ! The radius is such that we fit in 20 points
1380 rc = (50.0_real64 * m_three/m_four/m_pi*product(gr%spacing))**m_third
1381 origin = m_zero
1382 call submesh_init(sphere, space, gr, latt, origin, rc)
1383
1384 safe_allocate(ylm(1:sphere%np))
1385
1386 ! We then compute the spherical harmonics in this submesh
1387 do im = 1, os%norbs
1388 mm = im-1-os%ll
1389 call loct_ylm(sphere%np, sphere%rel_x(1,1), sphere%r(1), os%ll, mm, ylm(1))
1390 orb(:,im) = m_zero
1391 call submesh_add_to_mesh(sphere, ylm, orb(:,im))
1392 norm = dmf_nrm2(gr, orb(:,im))
1393 call lalg_scal(gr%np, m_one / norm, orb(:,im))
1394 end do
1395 safe_deallocate_a(ylm)
1396
1397 ! Then we put them on the grid, rotate them
1398 do im = 1, os%norbs
1399 do iop = 1, symm%nops
1400 call dgrid_symmetrize_single(gr, iop, orb(:,im), orb_sym)
1401
1402 do imp = 1, os%norbs
1403 weight(im, imp, iop) = dmf_dotp(gr, orb(:,imp), orb_sym, reduce=.false.)
1404 end do
1405 end do
1406 end do
1407
1408 call gr%allreduce(weight)
1409
1410 safe_deallocate_a(orb)
1411 safe_deallocate_a(orb_sym)
1412
1414 end subroutine orbitals_get_symm_weight
1415
1416#include "dft_u_noncollinear_inc.F90"
1417
1418#include "undef.F90"
1419#include "real.F90"
1420#include "lda_u_inc.F90"
1421
1422#include "undef.F90"
1423#include "complex.F90"
1424#include "lda_u_inc.F90"
1425end module lda_u_oct_m
scales a vector by a constant
Definition: lalg_basic.F90:147
Prints out to iunit a message in the form: ["InputVariable" = value] where "InputVariable" is given b...
Definition: messages.F90:158
subroutine, public accel_detach_buffer(this)
Clear a buffer handle without freeing device memory.
Definition: accel.F90:1036
pure logical function, public accel_is_enabled()
Definition: accel.F90:391
integer, parameter, public accel_mem_read_only
Definition: accel.F90:162
This module implements batches of mesh functions.
Definition: batch.F90:112
This module implements common operations on batches of mesh functions.
Definition: batch_ops.F90:95
Module implementing boundary conditions in Octopus.
Definition: boundaries.F90:101
type(debug_t), save, public debug
Definition: debug.F90:133
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
subroutine, public distributed_end(this)
subroutine, public distributed_init(this, total, comm, tag, scalapack_compat)
Distribute N instances across M processes of communicator comm
subroutine, public distributed_init_serial(this, total)
Serial initialization of a distributed instance. The calling process is assigned all total instances,...
integer, parameter, public spinors
integer, parameter, public spin_polarized
real(real64), parameter, public m_zero
Definition: global.F90:173
real(real64), parameter, public m_four
Definition: global.F90:177
real(real64), parameter, public m_third
Definition: global.F90:180
real(real64), parameter, public m_pi
some mathematical constants
Definition: global.F90:171
complex(real64), parameter, public m_z0
Definition: global.F90:183
real(real64), parameter, public m_epsilon
Definition: global.F90:189
real(real64), parameter, public m_one
Definition: global.F90:174
real(real64), parameter, public m_three
Definition: global.F90:176
This module implements the underlying real-space grid.
Definition: grid.F90:96
subroutine, public dgrid_symmetrize_single(gr, iop, field, symm_field)
Definition: grid.F90:713
subroutine dupdate_occ_matrices(this, namespace, mesh, st, lda_u_energy, aug_overlap, phase)
This routine computes the values of the occupation matrices.
Definition: lda_u.F90:2121
subroutine zupdate_occ_matrices(this, namespace, mesh, st, lda_u_energy, aug_overlap, phase)
This routine computes the values of the occupation matrices.
Definition: lda_u.F90:4353
integer, parameter, public dft_u_amf
Definition: lda_u.F90:193
subroutine, public zlda_u_commute_r(this, mesh, space, d, namespace, psib, gpsib)
This routine computes [r,V_lda+u] .
Definition: lda_u.F90:5586
subroutine zlda_u_allocate(this, st)
Definition: lda_u.F90:6202
subroutine, public lda_u_get_effectiveu(this, Ueff)
Definition: lda_u.F90:1035
subroutine compute_complex_coulomb_integrals(this, gr, st, psolver, namespace, space)
Definition: lda_u.F90:1510
subroutine, public dlda_u_force(this, namespace, space, mesh, st, iq, psib, grad_psib, force, der, vnl, aug_overlap, phase)
Definition: lda_u.F90:3511
subroutine, public lda_u_set_effectiveu(this, Ueff)
Definition: lda_u.F90:1019
subroutine, public zlda_u_apply_overlap(aug_overlap, mesh, std, psib, spsib)
Apply the ultrasoft/PAW generalized overlap S = 1 + sum_ij |beta_i> q_ij <beta_j| to an (already phas...
Definition: lda_u.F90:4113
subroutine build_symmetrization_map(this, ions, gr)
Builds a mapping between the orbital sets based on symmetries.
Definition: lda_u.F90:1377
subroutine dcompute_acbno_u_kanamori_restricted(this, kanamori)
This routine computes the Kanamori U, Up, and J.
Definition: lda_u.F90:3100
subroutine, public lda_u_init(this, namespace, space, level, gr, ions, st, mc, kpoints)
Definition: lda_u.F90:270
subroutine, public dlda_u_get_occupations(this, occ)
Definition: lda_u.F90:3860
subroutine, public dlda_u_rvu(this, mesh, space, d, namespace, psib, gpsib)
This routine computes .
Definition: lda_u.F90:3693
subroutine orbitals_get_symm_weight(os, space, latt, gr, symm, weight)
Computes the weight of each rotated orbitals in the basis of the same localized subspace.
Definition: lda_u.F90:1429
subroutine, public lda_u_accel_rebuild(this, kpt)
Rebuild DFT+U accelerator buffers after intrinsic assignment.
Definition: lda_u.F90:758
subroutine, public lda_u_update_occ_matrices(this, namespace, mesh, st, phase, energy, aug_overlap)
Definition: lda_u.F90:915
subroutine, public zcompute_dftu_energy(this, energy, st)
This routine computes the value of the double counting term in the DFT+U energy.
Definition: lda_u.F90:4772
integer, parameter, public dft_u_empirical
Definition: lda_u.F90:188
subroutine zcompute_acbno_u_kanamori_restricted(this, kanamori)
This routine computes the Kanamori U, Up, and J.
Definition: lda_u.F90:5332
subroutine dcompute_acbno_u_kanamori(this, kanamori)
This routine computes the Kanamori U, Up, and J.
Definition: lda_u.F90:3001
subroutine, public zlda_u_add_plus_u_ket(this, d, mesh, psib, kpsib, aug_overlap)
Add the bare +U ket chi = sum_m |phi_m> sum_mp V_mmp <phi_mp|psi> to kpsib.
Definition: lda_u.F90:4252
subroutine, public dlda_u_add_plus_u_ket(this, d, mesh, psib, kpsib, aug_overlap)
Add the bare +U ket chi = sum_m |phi_m> sum_mp V_mmp <phi_mp|psi> to kpsib.
Definition: lda_u.F90:2020
subroutine, public zlda_u_commute_r_single(this, mesh, space, d, namespace, ist, ik, psi, gpsi, has_phase)
Definition: lda_u.F90:5535
subroutine, public lda_u_freeze_occ(this)
Definition: lda_u.F90:1005
integer, parameter, public dft_u_mix
Definition: lda_u.F90:193
subroutine, public lda_u_rebind_after_copy(this, ions)
Rebind non-owning pointers after intrinsic assignment of lda_u_t.
Definition: lda_u.F90:713
subroutine, public lda_u_freeze_u(this)
Definition: lda_u.F90:1012
subroutine, public zlda_u_rvu(this, mesh, space, d, namespace, psib, gpsib)
This routine computes .
Definition: lda_u.F90:5955
subroutine dlda_u_allocate(this, st)
Definition: lda_u.F90:3919
subroutine, public compute_acbno_u_kanamori(this, st, kanamori)
Definition: lda_u.F90:982
subroutine, public zlda_u_update_potential(this, st)
This routine computes the potential that, once multiplied by the projector Pmm' and summed over m and...
Definition: lda_u.F90:4846
subroutine lda_u_init_coulomb_integrals(this, namespace, space, gr, st, psolver)
Definition: lda_u.F90:606
subroutine, public lda_u_write_info(this, iunit, namespace)
Definition: lda_u.F90:1087
subroutine, public dlda_u_commute_r(this, mesh, space, d, namespace, psib, gpsib)
This routine computes [r,V_lda+u] .
Definition: lda_u.F90:3354
subroutine dlda_u_normalize_orbitals_uspp(this, mesh, aug_overlap)
S-normalize the localized Hubbard orbitals for ultrasoft/PAW.
Definition: lda_u.F90:1913
subroutine, public dlda_u_apply(this, d, mesh, psib, hpsib, aug_overlap)
Apply the +U nonlocal potential to psib and adds the result to hpsib.
Definition: lda_u.F90:2086
subroutine, public dlda_u_apply_overlap(aug_overlap, mesh, std, psib, spsib)
Apply the ultrasoft/PAW generalized overlap S = 1 + sum_ij |beta_i> q_ij <beta_j| to an (already phas...
Definition: lda_u.F90:1881
subroutine dcompute_coulomb_integrals(this, namespace, space, gr, psolver)
Definition: lda_u.F90:3175
subroutine, public dlda_u_set_occupations(this, occ)
Definition: lda_u.F90:3803
subroutine, public lda_u_get_effectivev(this, Veff)
Definition: lda_u.F90:1069
subroutine lda_u_loadbasis(this, namespace, space, st, mesh, mc, ierr)
Definition: lda_u.F90:1120
subroutine, public dlda_u_commute_r_single(this, mesh, space, d, namespace, ist, ik, psi, gpsi, has_phase)
Definition: lda_u.F90:3303
subroutine, public lda_u_build_phase_correction(this, space, std, boundaries, namespace, kpoints, vec_pot, vec_pot_var)
Build the phase correction to the global phase for all orbitals.
Definition: lda_u.F90:942
subroutine, public lda_u_end(this)
Definition: lda_u.F90:667
subroutine, public lda_u_set_effectivev(this, Veff)
Definition: lda_u.F90:1051
integer, parameter, public dft_u_acbn0
Definition: lda_u.F90:188
subroutine, public lda_u_update_basis(this, space, gr, ions, st, psolver, namespace, kpoints, has_phase, aug_overlap)
Definition: lda_u.F90:801
subroutine zcompute_acbno_u_kanamori(this, kanamori)
This routine computes the Kanamori U, Up, and J.
Definition: lda_u.F90:5233
subroutine zcompute_coulomb_integrals(this, namespace, space, gr, psolver)
Definition: lda_u.F90:5407
subroutine, public zlda_u_get_occupations(this, occ)
Definition: lda_u.F90:6143
subroutine zlda_u_normalize_orbitals_uspp(this, mesh, aug_overlap)
S-normalize the localized Hubbard orbitals for ultrasoft/PAW.
Definition: lda_u.F90:4145
subroutine, public zlda_u_apply(this, d, mesh, psib, hpsib, aug_overlap)
Apply the +U nonlocal potential to psib and adds the result to hpsib.
Definition: lda_u.F90:4318
subroutine, public dcompute_dftu_energy(this, energy, st)
This routine computes the value of the double counting term in the DFT+U energy.
Definition: lda_u.F90:2540
subroutine, public dlda_u_update_potential(this, st)
This routine computes the potential that, once multiplied by the projector Pmm' and summed over m and...
Definition: lda_u.F90:2614
subroutine, public zlda_u_set_occupations(this, occ)
Definition: lda_u.F90:6086
subroutine, public zlda_u_force(this, namespace, space, mesh, st, iq, psib, grad_psib, force, der, vnl, aug_overlap, phase)
Definition: lda_u.F90:5773
System information (time, memory, sysname)
Definition: loct.F90:94
subroutine, public dloewdin_orthogonalize(basis, kpt, namespace)
Definition: loewdin.F90:191
subroutine, public zloewdin_info(basis, kpt, namespace)
Definition: loewdin.F90:755
subroutine, public zloewdin_orthogonalize(basis, kpt, namespace)
Definition: loewdin.F90:535
subroutine, public dloewdin_info(basis, kpt, namespace)
Definition: loewdin.F90:411
This module is intended to contain "only mathematical" functions and procedures.
Definition: math.F90:94
This module defines various routines, operating on mesh functions.
subroutine, public zmf_fix_phase(mesh, ff)
Fix the phase of complex function.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:97
subroutine, public messages_print_with_emphasis(msg, iunit, namespace)
Definition: messages.F90:878
subroutine, public messages_not_implemented(feature, namespace)
Definition: messages.F90:1048
character(len=512), private msg
Definition: messages.F90:143
subroutine, public messages_warning(no_lines, all_nodes, namespace)
Definition: messages.F90:501
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:138
subroutine, public messages_fatal(no_lines, only_root_writes, namespace)
Definition: messages.F90:386
subroutine, public messages_experimental(name, namespace)
Definition: messages.F90:1020
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
Definition: messages.F90:570
type(mpi_grp_t), public mpi_world
Definition: mpi.F90:317
This module handles the communicators for the various parallelization strategies.
Definition: multicomm.F90:124
subroutine, public orbitalbasis_end(this)
subroutine, public zorbitalbasis_build(this, namespace, ions, mesh, kpt, ndim, skip_s_orb, use_all_orb, verbose)
This routine is an interface for constructing the orbital basis.
subroutine, public dorbitalbasis_build(this, namespace, ions, mesh, kpt, ndim, skip_s_orb, use_all_orb, verbose)
This routine is an interface for constructing the orbital basis.
subroutine, public dorbitalbasis_build_empty(this, mesh, ndim, norbsets, map_os, verbose)
This routine constructd an empty orbital basis.
subroutine, public zorbitalbasis_build_empty(this, mesh, ndim, norbsets, map_os, verbose)
This routine constructd an empty orbital basis.
subroutine, public orbitalbasis_init(this, namespace, periodic_dim)
subroutine, public orbitalset_update_phase_shift(os, dim, kpt, kpoints, spin_polarized, vec_pot, vec_pot_var, kpt_max)
Build the phase shift for the intersite interaction.
Definition: orbitalset.F90:358
subroutine, public dorbitalset_transfer_to_device(os, kpt, use_mesh)
Allocate and transfer the orbitals to the device.
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:262
subroutine, public zorbitalset_transfer_to_device(os, kpt, use_mesh)
Allocate and transfer the orbitals to the device.
integer, parameter, public sm_poisson_psolver
integer, parameter, public sm_poisson_isf
subroutine, public zorbitalset_get_center_of_mass(os, space, mesh, latt)
integer, parameter, public sm_poisson_direct
subroutine, public dorbitalset_get_center_of_mass(os, space, mesh, latt)
subroutine, public orbitalset_init_intersite(this, namespace, space, grp, ind, ions, der, psolver, os, nos, maxnorbs, rcut, kpt, has_phase, sm_poisson, basis_from_states, combine_j_orbitals)
integer, parameter, public sm_poisson_fft
integer function, public parse_block(namespace, name, blk, check_varinfo_)
Definition: parser.F90:600
/* To use the profiling module, call profiling_in and profiling_out with the label of the region as a...
Definition: profiling.F90:122
integer, parameter, public restart_gs
Definition: restart.F90:133
integer, parameter, public restart_proj
Definition: restart.F90:133
integer, parameter, public restart_type_load
Definition: restart.F90:161
pure logical function, public states_are_complex(st)
pure logical function, public states_are_real(st)
This module handles spin dimensions of the states and the k-point distribution.
subroutine, public zsubmesh_copy_from_mesh(this, phi, sphi, conjugate)
Definition: submesh.F90:1847
subroutine, public dsubmesh_copy_from_mesh(this, phi, sphi, conjugate)
Definition: submesh.F90:1246
subroutine, public submesh_init(this, space, mesh, latt, center, rc)
Definition: submesh.F90:209
type(type_t), parameter, public type_cmplx
Definition: types.F90:114
type(type_t), parameter, public type_integer
Definition: types.F90:115
type(type_t), parameter, public type_float
Definition: types.F90:113
This module defines the unit system, used for input and output.
type(unit_system_t), public units_inp
the units systems for reading and writing
This class contains information about the boundary conditions.
Definition: boundaries.F90:136
Distribution of N instances over mpi_grpsize processes, for the local rank mpi_grprank....
Description of the grid, containing information on derivatives, stencil, and symmetries.
Definition: grid.F90:148
Class to describe DFT+U parameters.
Definition: lda_u.F90:201
Describes mesh distribution to nodes.
Definition: mesh.F90:165
Stores all communicators and groups.
Definition: multicomm.F90:185
A container for the phase.
Definition: phase.F90:158
class for organizing spins and k-points
The states_elec_t class contains all electronic wave functions.
A submesh is a type of mesh, used for the projectors in the pseudopotentials It contains points on a ...
Definition: submesh.F90:154
int true(void)