Octopus
magnetic.F90
Go to the documentation of this file.
1!! Copyright (C) 2002-2006 M. Marques, A. Castro, A. Rubio, G. Bertsch
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 magnetic_oct_m
24 use comm_oct_m
25 use debug_oct_m
28 use epot_oct_m
29 use global_oct_m
31 use grid_oct_m
32 use ions_oct_m
34 use math_oct_m
36 use mesh_oct_m
38 use mpi_oct_m
40 use phase_oct_m
49 use unit_oct_m
52
53 implicit none
54
55 private
56 public :: &
65
66contains
67
68 ! ---------------------------------------------------------
69 subroutine magnetic_density(mesh, std, rho, md)
70 class(mesh_t), intent(in) :: mesh
71 type(states_elec_dim_t), intent(in) :: std
72 real(real64), contiguous, intent(in) :: rho(:,:)
73 real(real64), contiguous, intent(out) :: md(:,:)
74
75 integer :: ip
76
77 push_sub(magnetic_density)
78
79 select case (std%ispin)
80 case (unpolarized)
81 md = m_zero
82
83 case (spin_polarized)
84 md = m_zero
85 !$omp parallel do
86 do ip = 1, mesh%np
87 md(ip, 3) = rho(ip, 1) - rho(ip, 2)
88 end do
89 !$omp end parallel do
90
91 case (spinors)
92 !$omp parallel do
93 do ip = 1, mesh%np
94 md(ip, 1) = m_two*rho(ip, 3)
95 md(ip, 2) = -m_two*rho(ip, 4)
96 md(ip, 3) = rho(ip, 1) - rho(ip, 2)
97 end do
98 !$omp end parallel do
99 end select
100
101 pop_sub(magnetic_density)
102 end subroutine magnetic_density
103
104
105 ! ---------------------------------------------------------
106 subroutine magnetic_moment(mesh, st, rho, mm)
107 class(mesh_t), intent(in) :: mesh
108 type(states_elec_t), intent(in) :: st
109 real(real64), contiguous, intent(in) :: rho(:,:)
110 real(real64), intent(out) :: mm(3)
111
112 real(real64), allocatable :: md(:,:)
113
114 push_sub(states_elec_magnetic_moment)
115
116 safe_allocate(md(1:mesh%np, 1:3))
117 call magnetic_density(mesh, st%d, rho, md)
118
119 mm = dmf_integrate(mesh, 3, md)
120
121 safe_deallocate_a(md)
122
123 pop_sub(states_elec_magnetic_moment)
124 end subroutine magnetic_moment
125
126
127 ! ---------------------------------------------------------
129 subroutine compute_and_write_magnetic_moments(gr, st, phase, ep, ions, lmm_r, calc_orb_moments, iunit, namespace)
130 type(grid_t), intent(in) :: gr
131 type(states_elec_t), intent(in) :: st
132 type(phase_t), intent(in) :: phase
133 type(epot_t), intent(in) :: ep
134 type(ions_t), intent(in) :: ions
135 real(real64), intent(in) :: lmm_r
136 logical, optional, intent(in) :: calc_orb_moments
137 integer, optional, intent(in) :: iunit
138 type(namespace_t), optional, intent(in) :: namespace
139
140 integer :: ia
141 real(real64) :: mm(max(gr%box%dim, 3))
142 real(real64), allocatable :: lmm(:,:)
143
145
146 call magnetic_moment(gr, st, st%rho, mm)
147 safe_allocate(lmm(1:max(gr%box%dim, 3), 1:ions%natoms))
148 call magnetic_local_moments(gr, st, ions, gr%der%boundaries, st%rho, lmm_r, lmm)
149
150 message(1) = 'Total Spin Magnetic Moment:'
151 call messages_info(1, iunit=iunit, namespace=namespace)
152 if (st%d%ispin == spin_polarized) then ! collinear spin
153 write(message(1), '(a,f10.6)') ' mz = ', mm(3)
154 call messages_info(1, iunit=iunit, namespace=namespace)
155 else if (st%d%ispin == spinors) then ! non-collinear
156 write(message(1), '(1x,3(a,f10.6,3x))') 'mx = ', mm(1),'my = ', mm(2),'mz = ', mm(3)
157 call messages_info(1, iunit=iunit, namespace=namespace)
158 end if
159
160 write(message(1), '(a,a,a,f7.3,a)') 'Local Spin Magnetic Moments (sphere radius [', &
161 trim(units_abbrev(units_out%length)),'] = ', units_from_atomic(units_out%length, lmm_r), '):'
162 call messages_info(1, iunit=iunit, namespace=namespace)
163 if (st%d%ispin == spin_polarized) then ! collinear spin
164 write(message(1),'(a,6x,14x,a)') ' Ion','mz'
165 call messages_info(1, iunit=iunit, namespace=namespace)
166 do ia = 1, ions%natoms
167 write(message(1),'(i4,a10,f15.6)') ia, trim(ions%atom(ia)%species%get_label()), lmm(3, ia)
168 call messages_info(1, iunit=iunit, namespace=namespace)
169 end do
170 else if (st%d%ispin == spinors) then ! non-collinear
171 write(message(1),'(a,8x,13x,a,13x,a,13x,a)') ' Ion','mx','my','mz'
172 call messages_info(1, iunit=iunit, namespace=namespace)
173 do ia = 1, ions%natoms
174 write(message(1),'(i4,a10,9f15.6)') ia, trim(ions%atom(ia)%species%get_label()), lmm(:, ia)
175 call messages_info(1, iunit=iunit, namespace=namespace)
176 end do
177 end if
178
179 if (optional_default(calc_orb_moments, .false.)) then
180 assert(st%d%ispin == spinors)
181
182 if (st%system_grp%is_root()) write(iunit, '(1x)')
183
184 call magnetic_orbital_moments(gr, st, phase, ep, ions, st%rho, lmm_r, lmm)
185
186 write(message(1), '(a,a,a,f7.3,a)') 'Local Orbital Moments (sphere radius [', &
187 trim(units_abbrev(units_out%length)),'] = ', units_from_atomic(units_out%length, lmm_r), '):'
188 call messages_info(1, iunit=iunit, namespace=namespace)
189 write(message(1),'(a,8x,13x,a,13x,a,13x,a)') ' Ion','Lx','Ly','Lz'
190 call messages_info(1, iunit=iunit, namespace=namespace)
191 do ia = 1, ions%natoms
192 write(message(1),'(i4,a10,9f15.6)') ia, trim(ions%atom(ia)%species%get_label()), lmm(:, ia)
193 call messages_info(1, iunit=iunit, namespace=namespace)
194 end do
195 end if
196
197
198 safe_deallocate_a(lmm)
199
202
203 ! ---------------------------------------------------------
204 subroutine magnetic_local_moments(mesh, st, ions, boundaries, rho, rr, lmm)
205 class(mesh_t), intent(in) :: mesh
206 type(states_elec_t), intent(in) :: st
207 type(ions_t), intent(in) :: ions
208 type(boundaries_t), intent(in) :: boundaries
209 real(real64), contiguous, intent(in) :: rho(:,:)
210 real(real64), intent(in) :: rr
211 real(real64), intent(out) :: lmm(max(mesh%box%dim, 3), ions%natoms)
212
213 integer :: ia, idir, is
214 real(real64), allocatable :: md(:, :)
215 type(submesh_t) :: sphere
216 real(real64) :: cosqr, sinqr, ww
217 complex(real64), allocatable :: phase_spiral(:)
218
219 push_sub(magnetic_local_moments)
220
221 safe_allocate(md(1:mesh%np, 1:max(mesh%box%dim, 3)))
222
223 call magnetic_density(mesh, st%d, rho, md)
224 lmm = m_zero
225 do ia = 1, ions%natoms
226 call submesh_init(sphere, ions%space, mesh, ions%latt, ions%pos(:, ia), rr)
227
228 if (boundaries%spiral) then
229 safe_allocate(phase_spiral(1:sphere%np))
230 do is = 1, sphere%np
231 phase_spiral(is) = exp(+m_zi*sum((sphere%rel_x(:,is) + sphere%center - mesh%x(:, sphere%map(is))) &
232 *boundaries%spiral_q(1:mesh%box%dim)))
233 end do
234
235 if (mesh%box%dim>= 3) then
236 lmm(1,ia) = m_zero
237 lmm(2,ia) = m_zero
238
239 do is = 1, sphere%np
240 !There is a factor of 1/2 in phase_spiral
241 cosqr = real(phase_spiral(is), real64)
242 sinqr = aimag(phase_spiral(is))
243 ! meshes with per-point volume elements carry the weight per point
244 ww = mesh%volume_element
245 if (mesh%use_vol_pp) ww = mesh%vol_pp(sphere%map(is))
246 lmm(1,ia) = lmm(1,ia)+(md(sphere%map(is),1)*cosqr - md(sphere%map(is),2)*sinqr)*ww
247 lmm(2,ia) = lmm(2,ia)+(md(sphere%map(is),1)*sinqr + md(sphere%map(is),2)*cosqr)*ww
248 end do
249 lmm(3,ia) = dsm_integrate_frommesh(mesh, sphere, md(1:mesh%np,3), reduce = .false.)
250 else
251 assert(.not. boundaries%spiral)
252 end if
253
254 safe_deallocate_a(phase_spiral)
255 else
256 do idir = 1, max(mesh%box%dim, 3)
257 lmm(idir, ia) = dsm_integrate_frommesh(mesh, sphere, md(1:mesh%np,idir), reduce = .false.)
258 end do
259 end if
260
261 call submesh_end(sphere)
262 end do
263
264 call mesh%allreduce(lmm)
265
266 safe_deallocate_a(md)
267
269 end subroutine magnetic_local_moments
270
271 ! ---------------------------------------------------------
282 subroutine magnetic_orbital_moments(gr, st, phase, ep, ions, rho, rr, lom)
283 type(grid_t), intent(in) :: gr
284 type(states_elec_t), intent(in) :: st
285 type(phase_t), intent(in) :: phase
286 type(epot_t), intent(in) :: ep
287 type(ions_t), intent(in) :: ions
288 real(real64), contiguous, intent(in) :: rho(:,:)
289 real(real64), intent(in) :: rr
290 real(real64), intent(out) :: lom(3, ions%natoms)
291
292 integer :: ia, idir, is, map_ip, ibatch, idim, ist, ib, ik
293 type(submesh_t) :: sphere
294 type(wfs_elec_t) :: epsib
295 type(wfs_elec_t), allocatable :: gpsib(:)
296
297 complex(real64), allocatable :: psi(:,:), gf(:,:,:), gf_nl(:,:,:)
298 complex(real64) :: acc(3), acc_nl(3)
299 real(real64) :: x1, x2, x3, factor
300
302
303 assert(st%d%ispin == spinors)
304 assert(ions%space%dim == 3)
305 if (gr%use_vol_pp) then
306 call messages_not_implemented("Orbital magnetic moments with per-point volume elements")
307 end if
308
309 lom = m_zero
310
311 safe_allocate(psi(1:gr%np_part, 1:st%d%dim))
312 safe_allocate(gf(1:gr%np, 1:st%d%dim, 1:gr%der%dim))
313 safe_allocate(gf_nl(1:gr%np, 1:st%d%dim, 1:gr%der%dim))
314 safe_allocate_type_array(wfs_elec_t, gpsib, (1:gr%der%dim))
315
316 do ik = st%d%kpt%start, st%d%kpt%end
317 do ib = st%group%block_start, st%group%block_end
318 ! copy st%group%psib(ib, ik) to epsib and set the phase
319 call phase%copy_and_set_phase(gr, st%d%kpt, st%group%psib(ib, ik), epsib)
320
321 ! this now takes non-orthogonal axis into account
322 call zderivatives_batch_grad(gr%der, epsib, gpsib, set_bc=.false.)
323
324 do ibatch = 1, epsib%nst
325 ist = st%group%psib(ib, ik)%ist(ibatch)
326 factor = st%kweights(ik)*st%occ(ist, ik)
327 if (abs(factor) < m_epsilon) cycle
328
329 ! Note: this is not efficient at all, but we do not have ready-to-use batch functions for this yet
330 ! The regeneration of many submeshes is also very inefficient
331 call batch_get_state(epsib, ibatch, gr%np, psi)
332 call batch_get_state(gpsib(1), ibatch, gr%np, gf(:,:,1))
333 call batch_get_state(gpsib(2), ibatch, gr%np, gf(:,:,2))
334 call batch_get_state(gpsib(3), ibatch, gr%np, gf(:,:,3))
335
336 ! TODO: precompute \psi^* (-i\nabla) \psi as Im[\psi^* (\nabla) \psi]
337
338 do ia = 1, ions%natoms
339 call submesh_init(sphere, ions%space, gr, ions%latt, ions%pos(:, ia), rr)
340
341 gf_nl = m_zero
342 call zprojector_commute_r(ep%proj(ia), gr, gr%der%boundaries, st%d%dim, 1, ik, psi, gf_nl(:, :, 1))
343 call zprojector_commute_r(ep%proj(ia), gr, gr%der%boundaries, st%d%dim, 2, ik, psi, gf_nl(:, :, 2))
344 call zprojector_commute_r(ep%proj(ia), gr, gr%der%boundaries, st%d%dim, 3, ik, psi, gf_nl(:, :, 3))
345
346 acc = m_zero
347 acc_nl = m_zero
348 do idim = 1, st%d%dim
349 do is = 1, sphere%np
350 map_ip = sphere%map(is)
351 x1 = sphere%rel_x(1, is)
352 x2 = sphere%rel_x(2, is)
353 x3 = sphere%rel_x(3, is)
354
355 acc(1) = acc(1) + conjg(psi(map_ip, idim)) * (x2 * gf(map_ip, idim, 3) - x3 * gf(map_ip, idim, 2))
356 acc(2) = acc(2) + conjg(psi(map_ip, idim)) * (x3 * gf(map_ip, idim, 1) - x1 * gf(map_ip, idim, 3))
357 acc(3) = acc(3) + conjg(psi(map_ip, idim)) * (x1 * gf(map_ip, idim, 2) - x2 * gf(map_ip, idim, 1))
358
359 acc_nl(:) = acc_nl(:) + conjg(psi(map_ip, idim)) * gf_nl(map_ip, idim, :)
360 end do
361 end do
362 call submesh_end(sphere)
363
364 ! The -i is absorbed in the imaginary part
365 lom(:, ia) = lom(:, ia) + factor * gr%volume_element * (aimag(acc) + dcross_product(ions%pos(:, ia), aimag(acc_nl)))
366 end do
367 end do
368
369 do idir = 1, gr%der%dim
370 call gpsib(idir)%end()
371 end do
372
373 call epsib%end()
374 end do
375 end do
376
377 call gr%allreduce(lom)
378 if (st%parallel_in_states .or. st%d%kpt%parallel) then
379 call comm_allreduce(st%st_kpt_mpi_grp, lom)
380 end if
381
382 safe_deallocate_a(psi)
383 safe_deallocate_a(gf)
384 safe_deallocate_a(gf_nl)
385 safe_deallocate_a(gpsib)
386
388 end subroutine magnetic_orbital_moments
389
390
391 ! ---------------------------------------------------------
392 subroutine magnetic_total_magnetization(mesh, st, qq, trans_mag)
393 class(mesh_t), intent(in) :: mesh
394 type(states_elec_t), intent(in) :: st
395 real(real64), contiguous, intent(in) :: qq(:)
396 complex(real64), intent(out) :: trans_mag(6)
397
398 integer :: ip
399 complex(real64), allocatable :: tmp(:,:)
400 real(real64), allocatable :: md(:, :)
401 complex(real64) :: expqr
402
404
405 call profiling_in("TOTAL_MAGNETIZATION")
406
407 safe_allocate(tmp(1:mesh%np, 1:6))
408 safe_allocate(md(1:mesh%np, 1:max(mesh%box%dim, 3)))
409
410 call magnetic_density(mesh, st%d, st%rho, md)
411 do ip = 1, mesh%np
412 expqr = exp(-m_zi*sum(mesh%x(1:mesh%box%dim, ip)*qq(1:mesh%box%dim)))
413 tmp(ip,1) = expqr*md(ip,1)
414 tmp(ip,2) = expqr*md(ip,2)
415 tmp(ip,3) = expqr*md(ip,3)
416 tmp(ip,4) = conjg(expqr)*md(ip,1)
417 tmp(ip,5) = conjg(expqr)*md(ip,2)
418 tmp(ip,6) = conjg(expqr)*md(ip,3)
419 end do
420
421 trans_mag = zmf_integrate(mesh, 6, tmp)
422
423 safe_deallocate_a(md)
424 safe_deallocate_a(tmp)
425
426 call profiling_out("TOTAL_MAGNETIZATION")
427
429 end subroutine magnetic_total_magnetization
430
431 ! ---------------------------------------------------------
435 subroutine magnetic_induced(namespace, gr, st, psolver, kpoints, a_ind, b_ind)
436 type(namespace_t), intent(in) :: namespace
437 type(grid_t), intent(in) :: gr
438 type(states_elec_t), intent(inout) :: st
439 type(poisson_t), intent(in) :: psolver
440 type(kpoints_t), intent(in) :: kpoints
441 real(real64), contiguous, intent(out) :: a_ind(:, :)
442 real(real64), contiguous, intent(out) :: b_ind(:, :)
443
445
446 integer :: idir
447 real(real64), allocatable :: jj(:, :, :)
448
449 push_sub(magnetic_induced)
450
451 ! If the states are real, we should never have reached here, but
452 ! just in case we return zero.
453 if (states_are_real(st)) then
454 a_ind = m_zero
455 b_ind = m_zero
456 pop_sub(magnetic_induced)
457 return
458 end if
459
460 safe_allocate(jj(1:gr%np_part, 1:gr%der%dim, 1:st%d%nspin))
461 call states_elec_calc_quantities(gr, st, kpoints, .false., paramagnetic_current = jj)
462
463 !We sum the current for up and down, valid for collinear and noncollinear spins
464 if (st%d%nspin > 1) then
465 do idir = 1, gr%der%dim
466 jj(:, idir, 1) = jj(:, idir, 1) + jj(:, idir, 2)
467 end do
468 end if
469
470 a_ind = m_zero
471 do idir = 1, gr%der%dim
472 call dpoisson_solve(psolver, namespace, a_ind(:, idir), jj(:, idir, 1))
473 end do
474 ! This minus sign is introduced here because the current that has been used
475 ! before is the "number-current density", and not the "charge-current density",
476 ! and therefore there is a minus sign missing (electrons are negative charges...)
477 call lalg_scal(gr%np, gr%der%dim, -m_one / p_c, a_ind)
478
479 call dderivatives_curl(gr%der, a_ind, b_ind)
480
481 safe_deallocate_a(jj)
482 pop_sub(magnetic_induced)
483 end subroutine magnetic_induced
484
485 subroutine write_total_xc_torque(iunit, mesh, vxc, st)
486 integer, intent(in) :: iunit
487 class(mesh_t), intent(in) :: mesh
488 real(real64), contiguous, intent(in) :: vxc(:,:)
489 type(states_elec_t), intent(in) :: st
490
491 real(real64), allocatable :: torque(:,:)
492 real(real64) :: tt(3)
493
494 push_sub(write_total_xc_torque)
495
496 safe_allocate(torque(1:mesh%np, 1:3))
497
498 call calc_xc_torque(mesh, vxc, st, torque)
499
500 tt = dmf_integrate(mesh, 3, torque)
501
502 if (st%system_grp%is_root()) then
503 write(iunit, '(a)') 'Total xc torque:'
504 write(iunit, '(1x,3(a,es10.3,3x))') 'Tx = ', tt(1),'Ty = ', tt(2),'Tz = ', tt(3)
505 end if
506
507 safe_deallocate_a(torque)
508
509 pop_sub(write_total_xc_torque)
510 end subroutine write_total_xc_torque
511
512 ! ---------------------------------------------------------
513 subroutine calc_xc_torque(mesh, vxc, st, torque)
514 class(mesh_t), intent(in) :: mesh
515 real(real64), contiguous, intent(in) :: vxc(:,:)
516 type(states_elec_t), intent(in) :: st
517 real(real64), contiguous, intent(out) :: torque(:,:)
518
519 real(real64) :: mag(3), bxc(3)
520 integer :: ip
521
522 push_sub(calc_xc_torque)
523
524 assert(st%d%ispin == spinors)
525
526 do ip = 1, mesh%np
527 mag(1) = m_two * st%rho(ip, 3)
528 mag(2) = -m_two * st%rho(ip, 4)
529 mag(3) = st%rho(ip, 1) - st%rho(ip, 2)
530 bxc(1) = -m_two * vxc(ip, 3)
531 bxc(2) = m_two * vxc(ip, 4)
532 bxc(3) = -(vxc(ip, 1) - vxc(ip, 2))
533 torque(ip, 1) = mag(2) * bxc(3) - mag(3) * bxc(2)
534 torque(ip, 2) = mag(3) * bxc(1) - mag(1) * bxc(3)
535 torque(ip, 3) = mag(1) * bxc(2) - mag(2) * bxc(1)
536 end do
537
538 pop_sub(calc_xc_torque)
539 end subroutine calc_xc_torque
540
541
542
543end module magnetic_oct_m
544
545!! Local Variables:
546!! mode: f90
547!! coding: utf-8
548!! End:
scales a vector by a constant
Definition: lalg_basic.F90:170
double exp(double __x) __attribute__((__nothrow__
This module implements common operations on batches of mesh functions.
Definition: batch_ops.F90:118
Module implementing boundary conditions in Octopus.
Definition: boundaries.F90:124
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
subroutine, public dderivatives_curl(der, ff, op_ff, ghost_update, set_bc)
apply the curl operator to a vector of mesh functions
subroutine, public zderivatives_batch_grad(der, ffb, opffb, ghost_update, set_bc, to_cartesian, factor)
apply the gradient to a batch of mesh functions
integer, parameter, public unpolarized
Parameters...
integer, parameter, public spinors
integer, parameter, public spin_polarized
real(real64), parameter, public m_two
Definition: global.F90:202
real(real64), parameter, public m_zero
Definition: global.F90:200
complex(real64), parameter, public m_zi
Definition: global.F90:214
real(real64), parameter, public m_epsilon
Definition: global.F90:216
real(real64), parameter, public p_c
Electron gyromagnetic ratio, see Phys. Rev. Lett. 130, 071801 (2023)
Definition: global.F90:242
real(real64), parameter, public m_one
Definition: global.F90:201
This module implements the underlying real-space grid.
Definition: grid.F90:119
subroutine, public magnetic_local_moments(mesh, st, ions, boundaries, rho, rr, lmm)
Definition: magnetic.F90:300
subroutine magnetic_orbital_moments(gr, st, phase, ep, ions, rho, rr, lom)
@bief Computes orbital moments around the atoms in the GIPAW gauge
Definition: magnetic.F90:378
subroutine, public calc_xc_torque(mesh, vxc, st, torque)
Definition: magnetic.F90:609
subroutine, public magnetic_moment(mesh, st, rho, mm)
Definition: magnetic.F90:202
subroutine, public magnetic_total_magnetization(mesh, st, qq, trans_mag)
Definition: magnetic.F90:488
subroutine, public compute_and_write_magnetic_moments(gr, st, phase, ep, ions, lmm_r, calc_orb_moments, iunit, namespace)
Computes and prints the global and local magnetic moments.
Definition: magnetic.F90:225
subroutine, public write_total_xc_torque(iunit, mesh, vxc, st)
Definition: magnetic.F90:581
subroutine, public magnetic_density(mesh, std, rho, md)
Definition: magnetic.F90:165
subroutine, public magnetic_induced(namespace, gr, st, psolver, kpoints, a_ind, b_ind)
This subroutine receives as input a current, and produces as an output the vector potential that it i...
Definition: magnetic.F90:531
This module is intended to contain "only mathematical" functions and procedures.
Definition: math.F90:117
pure real(real64) function, dimension(1:3), public dcross_product(a, b)
Definition: math.F90:1909
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:1068
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
Definition: messages.F90:162
subroutine, public messages_info(no_lines, iunit, debug_only, stress, all_nodes, namespace)
Definition: messages.F90:594
subroutine, public dpoisson_solve(this, namespace, pot, rho, all_nodes, kernel, reset)
Calculates the Poisson equation. Given the density returns the corresponding potential.
Definition: poisson.F90:916
subroutine, public profiling_out(label)
Increment out counter and sum up difference between entry and exit time.
Definition: profiling.F90:668
subroutine, public profiling_in(label, exclude)
Increment in counter and save entry time.
Definition: profiling.F90:600
subroutine, public zprojector_commute_r(pj, mesh, bnd, dim, idir, ik, psi, cpsi)
This function calculates |cpsi> += [x, V_nl] |psi>
Definition: projector.F90:1749
pure logical function, public states_are_real(st)
This module handles spin dimensions of the states and the k-point distribution.
subroutine, public states_elec_calc_quantities(gr, st, kpoints, nlcc, kinetic_energy_density, paramagnetic_current, density_gradient, density_laplacian, gi_kinetic_energy_density, st_end)
calculated selected quantities
real(real64) function, public dsm_integrate_frommesh(mesh, sm, ff, reduce)
Definition: submesh.F90:1176
subroutine, public submesh_end(this)
Definition: submesh.F90:716
subroutine, public submesh_init(this, space, mesh, latt, center, rc)
Definition: submesh.F90:232
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
Definition: unit.F90:134
character(len=20) pure function, public units_abbrev(this)
Definition: unit.F90:225
This module defines the unit system, used for input and output.
type(unit_system_t), public units_out
This class contains information about the boundary conditions.
Definition: boundaries.F90:159
Description of the grid, containing information on derivatives, stencil, and symmetries.
Definition: grid.F90:171
Describes mesh distribution to nodes.
Definition: mesh.F90:188
A container for the phase.
Definition: phase.F90:181
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:177
batches of electronic states
Definition: wfs_elec.F90:143