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), intent(in) :: rho(:,:)
73 real(real64), 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), 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 (mpi_world%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), 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
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 lmm(1,ia) = lmm(1,ia)+md(sphere%map(is),1)*cosqr - md(sphere%map(is),2)*sinqr
244 lmm(2,ia) = lmm(2,ia)+md(sphere%map(is),1)*sinqr + md(sphere%map(is),2)*cosqr
245 end do
246 lmm(1,ia) = lmm(1,ia)*mesh%volume_element
247 lmm(2,ia) = lmm(2,ia)*mesh%volume_element
248 lmm(3,ia) = dsm_integrate_frommesh(mesh, sphere, md(1:mesh%np,3), reduce = .false.)
249 else
250 assert(.not. boundaries%spiral)
251 end if
252
253 safe_deallocate_a(phase_spiral)
254 else
255 do idir = 1, max(mesh%box%dim, 3)
256 lmm(idir, ia) = dsm_integrate_frommesh(mesh, sphere, md(1:mesh%np,idir), reduce = .false.)
257 end do
258 end if
259
260 call submesh_end(sphere)
261 end do
262
263 call mesh%allreduce(lmm)
264
265 safe_deallocate_a(md)
266
268 end subroutine magnetic_local_moments
269
270 ! ---------------------------------------------------------
281 subroutine magnetic_orbital_moments(gr, st, phase, ep, ions, rho, rr, lom)
282 type(grid_t), intent(in) :: gr
283 type(states_elec_t), intent(in) :: st
284 type(phase_t), intent(in) :: phase
285 type(epot_t), intent(in) :: ep
286 type(ions_t), intent(in) :: ions
287 real(real64), intent(in) :: rho(:,:)
288 real(real64), intent(in) :: rr
289 real(real64), intent(out) :: lom(3, ions%natoms)
290
291 integer :: ia, idir, is, map_ip, ibatch, idim, ist, ib, ik
292 type(submesh_t) :: sphere
293 type(wfs_elec_t) :: epsib
294 type(wfs_elec_t), allocatable :: gpsib(:)
295
296 complex(real64), allocatable :: psi(:,:), gf(:,:,:), gf_nl(:,:,:)
297 complex(real64) :: acc(3), acc_nl(3)
298 real(real64) :: x1, x2, x3, factor
301
302 assert(st%d%ispin == spinors)
303 assert(ions%space%dim == 3)
304 assert(.not. gr%use_curvilinear)
305
306 lom = m_zero
307
308 safe_allocate(psi(1:gr%np_part, 1:st%d%dim))
309 safe_allocate(gf(1:gr%np, 1:st%d%dim, 1:gr%der%dim))
310 safe_allocate(gf_nl(1:gr%np, 1:st%d%dim, 1:gr%der%dim))
311 safe_allocate_type_array(wfs_elec_t, gpsib, (1:gr%der%dim))
312
313 do ik = st%d%kpt%start, st%d%kpt%end
314 do ib = st%group%block_start, st%group%block_end
315 ! copy st%group%psib(ib, ik) to epsib and set the phase
316 call phase%copy_and_set_phase(gr, st%d%kpt, st%group%psib(ib, ik), epsib)
317
318 ! this now takes non-orthogonal axis into account
319 call zderivatives_batch_grad(gr%der, epsib, gpsib, set_bc=.false.)
320
321 do ibatch = 1, epsib%nst
322 ist = st%group%psib(ib, ik)%ist(ibatch)
323 factor = st%kweights(ik)*st%occ(ist, ik)
324 if (abs(factor) < m_epsilon) cycle
325
326 ! Note: this is not efficient at all, but we do not have ready-to-use batch functions for this yet
327 ! The regeneration of many submeshes is also very inefficient
328 call batch_get_state(epsib, ibatch, gr%np, psi)
329 call batch_get_state(gpsib(1), ibatch, gr%np, gf(:,:,1))
330 call batch_get_state(gpsib(2), ibatch, gr%np, gf(:,:,2))
331 call batch_get_state(gpsib(3), ibatch, gr%np, gf(:,:,3))
332
333 ! TODO: precompute \psi^* (-i\nabla) \psi as Im[\psi^* (\nabla) \psi]
334
335 do ia = 1, ions%natoms
336 call submesh_init(sphere, ions%space, gr, ions%latt, ions%pos(:, ia), rr)
337
338 gf_nl = m_zero
339 call zprojector_commute_r(ep%proj(ia), gr, gr%der%boundaries, st%d%dim, 1, ik, psi, gf_nl(:, :, 1))
340 call zprojector_commute_r(ep%proj(ia), gr, gr%der%boundaries, st%d%dim, 2, ik, psi, gf_nl(:, :, 2))
341 call zprojector_commute_r(ep%proj(ia), gr, gr%der%boundaries, st%d%dim, 3, ik, psi, gf_nl(:, :, 3))
342
343 acc = m_zero
344 acc_nl = m_zero
345 do idim = 1, st%d%dim
346 do is = 1, sphere%np
347 map_ip = sphere%map(is)
348 x1 = sphere%rel_x(1, is)
349 x2 = sphere%rel_x(2, is)
350 x3 = sphere%rel_x(3, is)
351
352 acc(1) = acc(1) + conjg(psi(map_ip, idim)) * (x2 * gf(map_ip, idim, 3) - x3 * gf(map_ip, idim, 2))
353 acc(2) = acc(2) + conjg(psi(map_ip, idim)) * (x3 * gf(map_ip, idim, 1) - x1 * gf(map_ip, idim, 3))
354 acc(3) = acc(3) + conjg(psi(map_ip, idim)) * (x1 * gf(map_ip, idim, 2) - x2 * gf(map_ip, idim, 1))
355
356 acc_nl(:) = acc_nl(:) + conjg(psi(map_ip, idim)) * gf_nl(map_ip, idim, :)
357 end do
358 end do
359 call submesh_end(sphere)
360
361 ! The -i is absorbed in the imaginary part
362 lom(:, ia) = lom(:, ia) + factor * gr%volume_element * (aimag(acc) + dcross_product(ions%pos(:, ia), aimag(acc_nl)))
363 end do
364 end do
365
366 do idir = 1, gr%der%dim
367 call gpsib(idir)%end()
368 end do
369
370 call epsib%end()
371 end do
372 end do
373
374 call gr%allreduce(lom)
375 if (st%parallel_in_states .or. st%d%kpt%parallel) then
376 call comm_allreduce(st%st_kpt_mpi_grp, lom)
377 end if
378
379 safe_deallocate_a(psi)
380 safe_deallocate_a(gf)
381 safe_deallocate_a(gf_nl)
382 safe_deallocate_a(gpsib)
383
385 end subroutine magnetic_orbital_moments
386
387
388 ! ---------------------------------------------------------
389 subroutine magnetic_total_magnetization(mesh, st, qq, trans_mag)
390 class(mesh_t), intent(in) :: mesh
391 type(states_elec_t), intent(in) :: st
392 real(real64), intent(in) :: qq(:)
393 complex(real64), intent(out) :: trans_mag(6)
394
395 integer :: ip
396 complex(real64), allocatable :: tmp(:,:)
397 real(real64), allocatable :: md(:, :)
398 complex(real64) :: expqr
399
401
402 call profiling_in("TOTAL_MAGNETIZATION")
403
404 safe_allocate(tmp(1:mesh%np, 1:6))
405 safe_allocate(md(1:mesh%np, 1:max(mesh%box%dim, 3)))
406
407 call magnetic_density(mesh, st%d, st%rho, md)
408 do ip = 1, mesh%np
409 expqr = exp(-m_zi*sum(mesh%x(1:mesh%box%dim, ip)*qq(1:mesh%box%dim)))
410 tmp(ip,1) = expqr*md(ip,1)
411 tmp(ip,2) = expqr*md(ip,2)
412 tmp(ip,3) = expqr*md(ip,3)
413 tmp(ip,4) = conjg(expqr)*md(ip,1)
414 tmp(ip,5) = conjg(expqr)*md(ip,2)
415 tmp(ip,6) = conjg(expqr)*md(ip,3)
416 end do
417
418 trans_mag = zmf_integrate(mesh, 6, tmp)
419
420 safe_deallocate_a(md)
421 safe_deallocate_a(tmp)
422
423 call profiling_out("TOTAL_MAGNETIZATION")
424
426 end subroutine magnetic_total_magnetization
427
428 ! ---------------------------------------------------------
432 subroutine magnetic_induced(namespace, gr, st, psolver, kpoints, a_ind, b_ind)
433 type(namespace_t), intent(in) :: namespace
434 type(grid_t), intent(in) :: gr
435 type(states_elec_t), intent(inout) :: st
436 type(poisson_t), intent(in) :: psolver
437 type(kpoints_t), intent(in) :: kpoints
438 real(real64), contiguous, intent(out) :: a_ind(:, :)
439 real(real64), contiguous, intent(out) :: b_ind(:, :)
440
442
443 integer :: idir
444 real(real64), allocatable :: jj(:, :, :)
445
446 push_sub(magnetic_induced)
447
448 ! If the states are real, we should never have reached here, but
449 ! just in case we return zero.
450 if (states_are_real(st)) then
451 a_ind = m_zero
452 b_ind = m_zero
453 pop_sub(magnetic_induced)
454 return
455 end if
456
457 safe_allocate(jj(1:gr%np_part, 1:gr%der%dim, 1:st%d%nspin))
458 call states_elec_calc_quantities(gr, st, kpoints, .false., paramagnetic_current = jj)
459
460 !We sum the current for up and down, valid for collinear and noncollinear spins
461 if (st%d%nspin > 1) then
462 do idir = 1, gr%der%dim
463 jj(:, idir, 1) = jj(:, idir, 1) + jj(:, idir, 2)
464 end do
465 end if
466
467 a_ind = m_zero
468 do idir = 1, gr%der%dim
469 call dpoisson_solve(psolver, namespace, a_ind(:, idir), jj(:, idir, 1))
470 end do
471 ! This minus sign is introduced here because the current that has been used
472 ! before is the "number-current density", and not the "charge-current density",
473 ! and therefore there is a minus sign missing (electrons are negative charges...)
474 call lalg_scal(gr%np, gr%der%dim, -m_one / p_c, a_ind)
475
476 call dderivatives_curl(gr%der, a_ind, b_ind)
477
478 safe_deallocate_a(jj)
479 pop_sub(magnetic_induced)
480 end subroutine magnetic_induced
481
482 subroutine write_total_xc_torque(iunit, mesh, vxc, st)
483 integer, intent(in) :: iunit
484 class(mesh_t), intent(in) :: mesh
485 real(real64), intent(in) :: vxc(:,:)
486 type(states_elec_t), intent(in) :: st
487
488 real(real64), allocatable :: torque(:,:)
489 real(real64) :: tt(3)
490
491 push_sub(write_total_xc_torque)
492
493 safe_allocate(torque(1:mesh%np, 1:3))
494
495 call calc_xc_torque(mesh, vxc, st, torque)
496
497 tt = dmf_integrate(mesh, 3, torque)
498
499 if (st%system_grp%is_root()) then
500 write(iunit, '(a)') 'Total xc torque:'
501 write(iunit, '(1x,3(a,es10.3,3x))') 'Tx = ', tt(1),'Ty = ', tt(2),'Tz = ', tt(3)
502 end if
503
504 safe_deallocate_a(torque)
505
506 pop_sub(write_total_xc_torque)
507 end subroutine write_total_xc_torque
508
509 ! ---------------------------------------------------------
510 subroutine calc_xc_torque(mesh, vxc, st, torque)
511 class(mesh_t), intent(in) :: mesh
512 real(real64), intent(in) :: vxc(:,:)
513 type(states_elec_t), intent(in) :: st
514 real(real64), intent(out) :: torque(:,:)
515
516 real(real64) :: mag(3), bxc(3)
517 integer :: ip
518
519 push_sub(calc_xc_torque)
520
521 assert(st%d%ispin == spinors)
522
523 do ip = 1, mesh%np
524 mag(1) = m_two * st%rho(ip, 3)
525 mag(2) = -m_two * st%rho(ip, 4)
526 mag(3) = st%rho(ip, 1) - st%rho(ip, 2)
527 bxc(1) = -m_two * vxc(ip, 3)
528 bxc(2) = m_two * vxc(ip, 4)
529 bxc(3) = -(vxc(ip, 1) - vxc(ip, 2))
530 torque(ip, 1) = mag(2) * bxc(3) - mag(3) * bxc(2)
531 torque(ip, 2) = mag(3) * bxc(1) - mag(1) * bxc(3)
532 torque(ip, 3) = mag(1) * bxc(2) - mag(2) * bxc(1)
533 end do
534
535 pop_sub(calc_xc_torque)
536 end subroutine calc_xc_torque
537
538
539
540end module magnetic_oct_m
541
542!! Local Variables:
543!! mode: f90
544!! coding: utf-8
545!! End:
scales a vector by a constant
Definition: lalg_basic.F90:159
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:377
subroutine, public calc_xc_torque(mesh, vxc, st, torque)
Definition: magnetic.F90:606
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:485
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:578
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:528
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
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
type(mpi_grp_t), public mpi_world
Definition: mpi.F90:272
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:867
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
subroutine, public zprojector_commute_r(pj, mesh, bnd, dim, idir, ik, psi, cpsi)
This function calculates |cpsi> += [x, V_nl] |psi>
Definition: projector.F90:1674
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:1136
subroutine, public submesh_end(this)
Definition: submesh.F90:677
subroutine, public submesh_init(this, space, mesh, latt, center, rc)
Definition: submesh.F90:226
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:187
A container for the phase.
Definition: phase.F90:180
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:174
batches of electronic states
Definition: wfs_elec.F90:141