Octopus
elec_matrix_elements.F90
Go to the documentation of this file.
1!! Copyright (C) 2023 F. Troisi
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
22 use batch_oct_m
24 use debug_oct_m
28 use global_oct_m
29 use grid_oct_m
32 use ions_oct_m
33 use, intrinsic :: iso_fortran_env
36 use lda_u_oct_m
38 use mesh_oct_m
42 use mpi_oct_m
45 use phase_oct_m
52 use space_oct_m
57 use xc_oct_m
58
59 implicit none
60
61 private
62
63 public :: elec_momentum_me, &
65 dipole_me, &
71
72 interface dipole_me
73 procedure :: delec_dipole_me, zelec_dipole_me
74 end interface dipole_me
75
76 interface ks_multipoles_1d
77 procedure :: delec_ks_multipoles_1d_me, zelec_ks_multipoles_1d_me
78 end interface ks_multipoles_1d
79
80 interface ks_multipoles_2d
81 procedure :: delec_ks_multipoles_2d_me, zelec_ks_multipoles_2d_me
82 end interface ks_multipoles_2d
83
84 interface ks_multipoles_3d
85 procedure :: delec_ks_multipoles_3d_me, zelec_ks_multipoles_3d_me
86 end interface ks_multipoles_3d
87
88 interface one_body_me
89 procedure :: delec_one_body_me, zelec_one_body_me
90 end interface one_body_me
91
92 interface two_body_me
93 procedure :: delec_two_body_me, zelec_two_body_me
94 end interface two_body_me
95
96contains
97
98 ! -----------------------------------------------------------------------------
99 subroutine elec_momentum_me(gr, st, space, kpoints, momentum)
100 type(grid_t), intent(in) :: gr
101 type(states_elec_t), intent(in) :: st
102 type(space_t), intent(in) :: space
103 type(kpoints_t), intent(in) :: kpoints
104 real(real64), intent(out) :: momentum(:,:,:)
105
106 push_sub(elec_momentum_me)
107
108 if (states_are_real(st)) then
109 call delec_momentum_me(gr, st, space, kpoints, momentum)
110 else
111 call zelec_momentum_me(gr, st, space, kpoints, momentum)
112 end if
113
115 end subroutine elec_momentum_me
116
117 ! -----------------------------------------------------------------------------
118 subroutine elec_angular_momentum_me(gr, st, space, ll, l2)
119 type(grid_t), intent(in) :: gr
120 type(states_elec_t), intent(in) :: st
121 type(space_t), intent(in) :: space
122 real(real64), contiguous, intent(out) :: ll(:, :, :)
123 real(real64), contiguous, optional, intent(out) :: l2(:, :)
124
126
127 if (states_are_real(st)) then
128 call delec_angular_momentum_me(gr, st, space, ll, l2)
129 else
130 call zelec_angular_momentum_me(gr, st, space, ll, l2)
131 end if
132
134 end subroutine elec_angular_momentum_me
135
136#include "undef.F90"
137#include "complex.F90"
138#include "elec_matrix_elements_inc.F90"
139
140#include "undef.F90"
141#include "real.F90"
142#include "elec_matrix_elements_inc.F90"
143
145
146!! Local Variables:
147!! mode: f90
148!! coding: utf-8
149!! End:
This module implements batches of mesh functions.
Definition: batch.F90:133
Module implementing boundary conditions in Octopus.
Definition: boundaries.F90:122
This module calculates the derivatives (gradients, Laplacians, etc.) of a function.
subroutine, public elec_angular_momentum_me(gr, st, space, ll, l2)
subroutine delec_momentum_me(gr, st, space, kpoints, momentum)
The routine calculates the expectation value of the momentum operator.
subroutine, public elec_momentum_me(gr, st, space, kpoints, momentum)
subroutine zelec_momentum_me(gr, st, space, kpoints, momentum)
The routine calculates the expectation value of the momentum operator.
subroutine zelec_angular_momentum_me(gr, st, space, ll, l2)
It calculates the expectation value of the angular momentum of the states. If l2 is passed,...
subroutine delec_angular_momentum_me(gr, st, space, ll, l2)
It calculates the expectation value of the angular momentum of the states. If l2 is passed,...
This module implements the underlying real-space grid.
Definition: grid.F90:117
A module to handle KS potential, without the external potential.
This module defines functions over batches of mesh functions.
Definition: mesh_batch.F90:116
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:118
This module contains some common usage patterns of MPI routines.
Definition: mpi_lib.F90:115
pure logical function, public states_are_real(st)
This module handles spin dimensions of the states and the k-point distribution.