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
30 use grid_oct_m
31 use ions_oct_m
33 use math_oct_m
35 use mesh_oct_m
37 use mpi_oct_m
39 use phase_oct_m
48 use unit_oct_m
51
52 implicit none
53
54 private
55 public :: &
64
65contains
66
67 ! ---------------------------------------------------------
68 subroutine magnetic_density(mesh, std, rho, md)
69 class(mesh_t), intent(in) :: mesh
70 type(states_elec_dim_t), intent(in) :: std
71 real(real64), intent(in) :: rho(:,:)
72 real(real64), intent(out) :: md(:,:)
73
74 push_sub(magnetic_density)
75
76 select case (std%ispin)
77 case (unpolarized)
78 md = m_zero
79
80 case (spin_polarized)
81 md = m_zero
82 md(1:mesh%np, 3) = rho(1:mesh%np, 1) - rho(1:mesh%np, 2)
83
84 case (spinors)
85 md(1:mesh%np, 1) = m_two*rho(1:mesh%np, 3)
86 md(1:mesh%np, 2) = -m_two*rho(1:mesh%np, 4)
87 md(1:mesh%np, 3) = rho(1:mesh%np, 1) - rho(1:mesh%np, 2)
88 end select
89
90 pop_sub(magnetic_density)
91 end subroutine magnetic_density
92
93
94 ! ---------------------------------------------------------
95 subroutine magnetic_moment(mesh, st, rho, mm)
96 class(mesh_t), intent(in) :: mesh
97 type(states_elec_t), intent(in) :: st
98 real(real64), intent(in) :: rho(:,:)
99 real(real64), intent(out) :: mm(3)
100
101 real(real64), allocatable :: md(:,:)
102
103 push_sub(states_elec_magnetic_moment)
104
105 safe_allocate(md(1:mesh%np, 1:3))
106 call magnetic_density(mesh, st%d, rho, md)
107
108 mm = dmf_integrate(mesh, 3, md)
109
110 safe_deallocate_a(md)
111
112 pop_sub(states_elec_magnetic_moment)
113 end subroutine magnetic_moment
114
115
116 ! ---------------------------------------------------------
118 subroutine compute_and_write_magnetic_moments(gr, st, phase, ep, ions, lmm_r, calc_orb_moments, iunit, namespace)
119 type(grid_t), intent(in) :: gr
120 type(states_elec_t), intent(in) :: st
121 type(phase_t), intent(in) :: phase
122 type(epot_t), intent(in) :: ep
123 type(ions_t), intent(in) :: ions
124 real(real64), intent(in) :: lmm_r
125 logical, optional, intent(in) :: calc_orb_moments
126 integer, optional, intent(in) :: iunit
127 type(namespace_t), optional, intent(in) :: namespace
128
129 integer :: ia
130 real(real64) :: mm(max(gr%box%dim, 3))
131 real(real64), allocatable :: lmm(:,:)
132
134
135 call magnetic_moment(gr, st, st%rho, mm)
136 safe_allocate(lmm(1:max(gr%box%dim, 3), 1:ions%natoms))
137 call magnetic_local_moments(gr, st, ions, gr%der%boundaries, st%rho, lmm_r, lmm)
138
139 message(1) = 'Total Spin Magnetic Moment:'
140 call messages_info(1, iunit=iunit, namespace=namespace)
141 if (st%d%ispin == spin_polarized) then ! collinear spin
142 write(message(1), '(a,f10.6)') ' mz = ', mm(3)
143 call messages_info(1, iunit=iunit, namespace=namespace)
144 else if (st%d%ispin == spinors) then ! non-collinear
145 write(message(1), '(1x,3(a,f10.6,3x))') 'mx = ', mm(1),'my = ', mm(2),'mz = ', mm(3)
146 call messages_info(1, iunit=iunit, namespace=namespace)
147 end if
148
149 write(message(1), '(a,a,a,f7.3,a)') 'Local Spin Magnetic Moments (sphere radius [', &
150 trim(units_abbrev(units_out%length)),'] = ', units_from_atomic(units_out%length, lmm_r), '):'
151 call messages_info(1, iunit=iunit, namespace=namespace)
152 if (st%d%ispin == spin_polarized) then ! collinear spin
153 write(message(1),'(a,6x,14x,a)') ' Ion','mz'
154 call messages_info(1, iunit=iunit, namespace=namespace)
155 do ia = 1, ions%natoms
156 write(message(1),'(i4,a10,f15.6)') ia, trim(ions%atom(ia)%species%get_label()), lmm(3, ia)
157 call messages_info(1, iunit=iunit, namespace=namespace)
158 end do
159 else if (st%d%ispin == spinors) then ! non-collinear
160 write(message(1),'(a,8x,13x,a,13x,a,13x,a)') ' Ion','mx','my','mz'
161 call messages_info(1, iunit=iunit, namespace=namespace)
162 do ia = 1, ions%natoms
163 write(message(1),'(i4,a10,9f15.6)') ia, trim(ions%atom(ia)%species%get_label()), lmm(:, ia)
164 call messages_info(1, iunit=iunit, namespace=namespace)
165 end do
166 end if
167
168 if (optional_default(calc_orb_moments, .false.)) then
169 assert(st%d%ispin == spinors)
170
171 if (mpi_world%is_root()) write(iunit, '(1x)')
172
173 call magnetic_orbital_moments(gr, st, phase, ep, ions, st%rho, lmm_r, lmm)
174
175 write(message(1), '(a,a,a,f7.3,a)') 'Local Orbital Moments (sphere radius [', &
176 trim(units_abbrev(units_out%length)),'] = ', units_from_atomic(units_out%length, lmm_r), '):'
177 call messages_info(1, iunit=iunit, namespace=namespace)
178 write(message(1),'(a,8x,13x,a,13x,a,13x,a)') ' Ion','Lx','Ly','Lz'
179 call messages_info(1, iunit=iunit, namespace=namespace)
180 do ia = 1, ions%natoms
181 write(message(1),'(i4,a10,9f15.6)') ia, trim(ions%atom(ia)%species%get_label()), lmm(:, ia)
182 call messages_info(1, iunit=iunit, namespace=namespace)
183 end do
184 end if
185
186
187 safe_deallocate_a(lmm)
188
191
192 ! ---------------------------------------------------------
193 subroutine magnetic_local_moments(mesh, st, ions, boundaries, rho, rr, lmm)
194 class(mesh_t), intent(in) :: mesh
195 type(states_elec_t), intent(in) :: st
196 type(ions_t), intent(in) :: ions
197 type(boundaries_t), intent(in) :: boundaries
198 real(real64), intent(in) :: rho(:,:)
199 real(real64), intent(in) :: rr
200 real(real64), intent(out) :: lmm(max(mesh%box%dim, 3), ions%natoms)
201
202 integer :: ia, idir, is
203 real(real64), allocatable :: md(:, :)
204 type(submesh_t) :: sphere
205 real(real64) :: cosqr, sinqr
206 complex(real64), allocatable :: phase_spiral(:)
207
208 push_sub(magnetic_local_moments)
209
210 safe_allocate(md(1:mesh%np, 1:max(mesh%box%dim, 3)))
211
212 call magnetic_density(mesh, st%d, rho, md)
213 lmm = m_zero
214 do ia = 1, ions%natoms
215 call submesh_init(sphere, ions%space, mesh, ions%latt, ions%pos(:, ia), rr)
216
217 if (boundaries%spiral) then
218 safe_allocate(phase_spiral(1:sphere%np))
219 do is = 1, sphere%np
220 phase_spiral(is) = exp(+m_zi*sum((sphere%rel_x(:,is) + sphere%center - mesh%x(:, sphere%map(is))) &
221 *boundaries%spiral_q(1:mesh%box%dim)))
222 end do
223
224 if (mesh%box%dim>= 3) then
225 lmm(1,ia) = m_zero
226 lmm(2,ia) = m_zero
227
228 do is = 1, sphere%np
229 !There is a factor of 1/2 in phase_spiral
230 cosqr = real(phase_spiral(is), real64)
231 sinqr = aimag(phase_spiral(is))
232 lmm(1,ia) = lmm(1,ia)+md(sphere%map(is),1)*cosqr - md(sphere%map(is),2)*sinqr
233 lmm(2,ia) = lmm(2,ia)+md(sphere%map(is),1)*sinqr + md(sphere%map(is),2)*cosqr
234 end do
235 lmm(1,ia) = lmm(1,ia)*mesh%volume_element
236 lmm(2,ia) = lmm(2,ia)*mesh%volume_element
237 lmm(3,ia) = dsm_integrate_frommesh(mesh, sphere, md(1:mesh%np,3), reduce = .false.)
238 else
239 assert(.not. boundaries%spiral)
240 end if
241
242 safe_deallocate_a(phase_spiral)
243 else
244 do idir = 1, max(mesh%box%dim, 3)
245 lmm(idir, ia) = dsm_integrate_frommesh(mesh, sphere, md(1:mesh%np,idir), reduce = .false.)
246 end do
247 end if
248
249 call submesh_end(sphere)
250 end do
251
252 call mesh%allreduce(lmm)
253
254 safe_deallocate_a(md)
255
257 end subroutine magnetic_local_moments
258
259 ! ---------------------------------------------------------
270 subroutine magnetic_orbital_moments(gr, st, phase, ep, ions, rho, rr, lom)
271 type(grid_t), intent(in) :: gr
272 type(states_elec_t), intent(in) :: st
273 type(phase_t), intent(in) :: phase
274 type(epot_t), intent(in) :: ep
275 type(ions_t), intent(in) :: ions
276 real(real64), intent(in) :: rho(:,:)
277 real(real64), intent(in) :: rr
278 real(real64), intent(out) :: lom(3, ions%natoms)
279
280 integer :: ia, idir, is, map_ip, ibatch, idim, ist, ib, ik
281 type(submesh_t) :: sphere
282 type(wfs_elec_t) :: epsib
283 type(wfs_elec_t), allocatable :: gpsib(:)
284
285 complex(real64), allocatable :: psi(:,:), gf(:,:,:), gf_nl(:,:,:)
286 complex(real64) :: acc(3), acc_nl(3)
287 real(real64) :: x1, x2, x3, factor
290
291 assert(st%d%ispin == spinors)
292 assert(ions%space%dim == 3)
293 assert(.not. gr%use_curvilinear)
294
295 lom = m_zero
296
297 safe_allocate(psi(1:gr%np_part, 1:st%d%dim))
298 safe_allocate(gf(1:gr%np, 1:st%d%dim, 1:gr%der%dim))
299 safe_allocate(gf_nl(1:gr%np, 1:st%d%dim, 1:gr%der%dim))
300 safe_allocate_type_array(wfs_elec_t, gpsib, (1:gr%der%dim))
301
302 do ik = st%d%kpt%start, st%d%kpt%end
303 do ib = st%group%block_start, st%group%block_end
304 ! copy st%group%psib(ib, ik) to epsib and set the phase
305 call phase%copy_and_set_phase(gr, st%d%kpt, st%group%psib(ib, ik), epsib)
306
307 ! this now takes non-orthogonal axis into account
308 call zderivatives_batch_grad(gr%der, epsib, gpsib, set_bc=.false.)
309
310 do ibatch = 1, epsib%nst
311 ist = st%group%psib(ib, ik)%ist(ibatch)
312 factor = st%kweights(ik)*st%occ(ist, ik)
313 if (abs(factor) < m_epsilon) cycle
314
315 ! Note: this is not efficient at all, but we do not have ready-to-use batch functions for this yet
316 ! The regeneration of many submeshes is also very inefficient
317 call batch_get_state(epsib, ibatch, gr%np, psi)
318 call batch_get_state(gpsib(1), ibatch, gr%np, gf(:,:,1))
319 call batch_get_state(gpsib(2), ibatch, gr%np, gf(:,:,2))
320 call batch_get_state(gpsib(3), ibatch, gr%np, gf(:,:,3))
321
322 ! TODO: precompute \psi^* (-i\nabla) \psi as Im[\psi^* (\nabla) \psi]
323
324 do ia = 1, ions%natoms
325 call submesh_init(sphere, ions%space, gr, ions%latt, ions%pos(:, ia), rr)
326
327 gf_nl = m_zero
328 call zprojector_commute_r(ep%proj(ia), gr, gr%der%boundaries, st%d%dim, 1, ik, psi, gf_nl(:, :, 1))
329 call zprojector_commute_r(ep%proj(ia), gr, gr%der%boundaries, st%d%dim, 2, ik, psi, gf_nl(:, :, 2))
330 call zprojector_commute_r(ep%proj(ia), gr, gr%der%boundaries, st%d%dim, 3, ik, psi, gf_nl(:, :, 3))
331
332 acc = m_zero
333 acc_nl = m_zero
334 do idim = 1, st%d%dim
335 do is = 1, sphere%np
336 map_ip = sphere%map(is)
337 x1 = sphere%rel_x(1, is)
338 x2 = sphere%rel_x(2, is)
339 x3 = sphere%rel_x(3, is)
340
341 acc(1) = acc(1) + conjg(psi(map_ip, idim)) * (x2 * gf(map_ip, idim, 3) - x3 * gf(map_ip, idim, 2))
342 acc(2) = acc(2) + conjg(psi(map_ip, idim)) * (x3 * gf(map_ip, idim, 1) - x1 * gf(map_ip, idim, 3))
343 acc(3) = acc(3) + conjg(psi(map_ip, idim)) * (x1 * gf(map_ip, idim, 2) - x2 * gf(map_ip, idim, 1))
344
345 acc_nl(:) = acc_nl(:) + conjg(psi(map_ip, idim)) * gf_nl(map_ip, idim, :)
346 end do
347 end do
348 call submesh_end(sphere)
349
350 ! The -i is absorbed in the imaginary part
351 lom(:, ia) = lom(:, ia) + factor * gr%volume_element * (aimag(acc) + dcross_product(ions%pos(:, ia), aimag(acc_nl)))
352 end do
353 end do
354
355 do idir = 1, gr%der%dim
356 call gpsib(idir)%end()
357 end do
358
359 call epsib%end()
360 end do
361 end do
362
363 call gr%allreduce(lom)
364 if (st%parallel_in_states .or. st%d%kpt%parallel) then
365 call comm_allreduce(st%st_kpt_mpi_grp, lom)
366 end if
367
368 safe_deallocate_a(psi)
369 safe_deallocate_a(gf)
370 safe_deallocate_a(gf_nl)
371 safe_deallocate_a(gpsib)
372
374 end subroutine magnetic_orbital_moments
375
376
377 ! ---------------------------------------------------------
378 subroutine magnetic_total_magnetization(mesh, st, qq, trans_mag)
379 class(mesh_t), intent(in) :: mesh
380 type(states_elec_t), intent(in) :: st
381 real(real64), intent(in) :: qq(:)
382 complex(real64), intent(out) :: trans_mag(6)
383
384 integer :: ip
385 complex(real64), allocatable :: tmp(:,:)
386 real(real64), allocatable :: md(:, :)
387 complex(real64) :: expqr
388
390
391 call profiling_in("TOTAL_MAGNETIZATION")
392
393 safe_allocate(tmp(1:mesh%np, 1:6))
394 safe_allocate(md(1:mesh%np, 1:max(mesh%box%dim, 3)))
395
396 call magnetic_density(mesh, st%d, st%rho, md)
397 do ip = 1, mesh%np
398 expqr = exp(-m_zi*sum(mesh%x(1:mesh%box%dim, ip)*qq(1:mesh%box%dim)))
399 tmp(ip,1) = expqr*md(ip,1)
400 tmp(ip,2) = expqr*md(ip,2)
401 tmp(ip,3) = expqr*md(ip,3)
402 tmp(ip,4) = conjg(expqr)*md(ip,1)
403 tmp(ip,5) = conjg(expqr)*md(ip,2)
404 tmp(ip,6) = conjg(expqr)*md(ip,3)
405 end do
406
407 trans_mag = zmf_integrate(mesh, 6, tmp)
408
409 safe_deallocate_a(md)
410 safe_deallocate_a(tmp)
411
412 call profiling_out("TOTAL_MAGNETIZATION")
413
415 end subroutine magnetic_total_magnetization
416
417 ! ---------------------------------------------------------
421 subroutine magnetic_induced(namespace, gr, st, psolver, kpoints, a_ind, b_ind)
422 type(namespace_t), intent(in) :: namespace
423 type(grid_t), intent(in) :: gr
424 type(states_elec_t), intent(inout) :: st
425 type(poisson_t), intent(in) :: psolver
426 type(kpoints_t), intent(in) :: kpoints
427 real(real64), contiguous, intent(out) :: a_ind(:, :)
428 real(real64), contiguous, intent(out) :: b_ind(:, :)
429
431
432 integer :: idir
433 real(real64), allocatable :: jj(:, :, :)
434
435 push_sub(magnetic_induced)
436
437 ! If the states are real, we should never have reached here, but
438 ! just in case we return zero.
439 if (states_are_real(st)) then
440 a_ind = m_zero
441 b_ind = m_zero
442 pop_sub(magnetic_induced)
443 return
444 end if
445
446 safe_allocate(jj(1:gr%np_part, 1:gr%der%dim, 1:st%d%nspin))
447 call states_elec_calc_quantities(gr, st, kpoints, .false., paramagnetic_current = jj)
448
449 !We sum the current for up and down, valid for collinear and noncollinear spins
450 if (st%d%nspin > 1) then
451 do idir = 1, gr%der%dim
452 jj(:, idir, 1) = jj(:, idir, 1) + jj(:, idir, 2)
453 end do
454 end if
455
456 a_ind = m_zero
457 do idir = 1, gr%der%dim
458 call dpoisson_solve(psolver, namespace, a_ind(:, idir), jj(:, idir, 1))
459 end do
460 ! This minus sign is introduced here because the current that has been used
461 ! before is the "number-current density", and not the "charge-current density",
462 ! and therefore there is a minus sign missing (electrons are negative charges...)
463 a_ind(1:gr%np, 1:gr%der%dim) = - a_ind(1:gr%np, 1:gr%der%dim) / p_c
464
465 call dderivatives_curl(gr%der, a_ind, b_ind)
466
467 safe_deallocate_a(jj)
468 pop_sub(magnetic_induced)
469 end subroutine magnetic_induced
470
471 subroutine write_total_xc_torque(iunit, mesh, vxc, st)
472 integer, intent(in) :: iunit
473 class(mesh_t), intent(in) :: mesh
474 real(real64), intent(in) :: vxc(:,:)
475 type(states_elec_t), intent(in) :: st
476
477 real(real64), allocatable :: torque(:,:)
478 real(real64) :: tt(3)
479
480 push_sub(write_total_xc_torque)
481
482 safe_allocate(torque(1:mesh%np, 1:3))
483
484 call calc_xc_torque(mesh, vxc, st, torque)
485
486 tt = dmf_integrate(mesh, 3, torque)
487
488 if (mpi_world%is_root()) then
489 write(iunit, '(a)') 'Total xc torque:'
490 write(iunit, '(1x,3(a,es10.3,3x))') 'Tx = ', tt(1),'Ty = ', tt(2),'Tz = ', tt(3)
491 end if
492
493 safe_deallocate_a(torque)
494
495 pop_sub(write_total_xc_torque)
496 end subroutine write_total_xc_torque
497
498 ! ---------------------------------------------------------
499 subroutine calc_xc_torque(mesh, vxc, st, torque)
500 class(mesh_t), intent(in) :: mesh
501 real(real64), intent(in) :: vxc(:,:)
502 type(states_elec_t), intent(in) :: st
503 real(real64), intent(inout) :: torque(:,:)
504
505 real(real64) :: mag(3), bxc(3)
506 integer :: ip
507
508 push_sub(calc_xc_torque)
509
510 assert(st%d%ispin == spinors)
511
512 do ip = 1, mesh%np
513 mag(1) = m_two * st%rho(ip, 3)
514 mag(2) = -m_two * st%rho(ip, 4)
515 mag(3) = st%rho(ip, 1) - st%rho(ip, 2)
516 bxc(1) = -m_two * vxc(ip, 3)
517 bxc(2) = m_two * vxc(ip, 4)
518 bxc(3) = -(vxc(ip, 1) - vxc(ip, 2))
519 torque(ip, 1) = mag(2) * bxc(3) - mag(3) * bxc(2)
520 torque(ip, 2) = mag(3) * bxc(1) - mag(1) * bxc(3)
521 torque(ip, 3) = mag(1) * bxc(2) - mag(2) * bxc(1)
522 end do
523
524 pop_sub(calc_xc_torque)
525 end subroutine calc_xc_torque
526
527
528
529end module magnetic_oct_m
530
531!! Local Variables:
532!! mode: f90
533!! coding: utf-8
534!! End:
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:193
real(real64), parameter, public m_zero
Definition: global.F90:191
complex(real64), parameter, public m_zi
Definition: global.F90:205
real(real64), parameter, public m_epsilon
Definition: global.F90:207
real(real64), parameter, public p_c
Electron gyromagnetic ratio, see Phys. Rev. Lett. 130, 071801 (2023)
Definition: global.F90:229
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:289
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:366
subroutine, public calc_xc_torque(mesh, vxc, st, torque)
Definition: magnetic.F90:595
subroutine, public magnetic_moment(mesh, st, rho, mm)
Definition: magnetic.F90:191
subroutine, public magnetic_total_magnetization(mesh, st, qq, trans_mag)
Definition: magnetic.F90:474
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:214
subroutine, public write_total_xc_torque(iunit, mesh, vxc, st)
Definition: magnetic.F90:567
subroutine, public magnetic_density(mesh, std, rho, md)
Definition: magnetic.F90:164
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:517
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:1941
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:875
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:1673
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:1203
subroutine, public submesh_end(this)
Definition: submesh.F90:733
subroutine, public submesh_init(this, space, mesh, latt, center, rc)
Definition: submesh.F90:282
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:177
batches of electronic states
Definition: wfs_elec.F90:141