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
29 use global_oct_m
30 use grid_oct_m
33 use ions_oct_m
34 use, intrinsic :: iso_fortran_env
37 use lda_u_oct_m
39 use mesh_oct_m
43 use mpi_oct_m
46 use phase_oct_m
53 use space_oct_m
58 use xc_cam_oct_m
59 use xc_oct_m
60
61 implicit none
62
63 private
64
65 public :: elec_momentum_me, &
67 dipole_me, &
73
74 interface dipole_me
75 procedure :: delec_dipole_me, zelec_dipole_me
76 end interface dipole_me
77
78 interface ks_multipoles_1d
79 procedure :: delec_ks_multipoles_1d_me, zelec_ks_multipoles_1d_me
80 end interface ks_multipoles_1d
81
82 interface ks_multipoles_2d
83 procedure :: delec_ks_multipoles_2d_me, zelec_ks_multipoles_2d_me
84 end interface ks_multipoles_2d
85
86 interface ks_multipoles_3d
87 procedure :: delec_ks_multipoles_3d_me, zelec_ks_multipoles_3d_me
88 end interface ks_multipoles_3d
89
90 interface one_body_me
91 procedure :: delec_one_body_me, zelec_one_body_me
92 end interface one_body_me
93
94 interface two_body_me
95 procedure :: delec_two_body_me, zelec_two_body_me
96 end interface two_body_me
97
98contains
99
100 ! -----------------------------------------------------------------------------
101 subroutine elec_momentum_me(gr, st, space, kpoints, momentum)
102 type(grid_t), intent(in) :: gr
103 type(states_elec_t), intent(in) :: st
104 type(space_t), intent(in) :: space
105 type(kpoints_t), intent(in) :: kpoints
106 real(real64), intent(out) :: momentum(:,:,:)
107
108 push_sub(elec_momentum_me)
109
110 if (states_are_real(st)) then
111 call delec_momentum_me(gr, st, space, kpoints, momentum)
112 else
113 call zelec_momentum_me(gr, st, space, kpoints, momentum)
114 end if
115
116 pop_sub(elec_momentum_me)
117 end subroutine elec_momentum_me
118
119 ! -----------------------------------------------------------------------------
120 subroutine elec_angular_momentum_me(gr, st, space, ll, l2)
121 type(grid_t), intent(in) :: gr
122 type(states_elec_t), intent(in) :: st
123 type(space_t), intent(in) :: space
124 real(real64), contiguous, intent(out) :: ll(:, :, :)
125 real(real64), contiguous, optional, intent(out) :: l2(:, :)
126
128
129 if (states_are_real(st)) then
130 call delec_angular_momentum_me(gr, st, space, ll, l2)
131 else
132 call zelec_angular_momentum_me(gr, st, space, ll, l2)
133 end if
134
136 end subroutine elec_angular_momentum_me
137
138#include "undef.F90"
139#include "complex.F90"
140#include "elec_matrix_elements_inc.F90"
141
142#include "undef.F90"
143#include "real.F90"
144#include "elec_matrix_elements_inc.F90"
145
147
148!! Local Variables:
149!! mode: f90
150!! coding: utf-8
151!! 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.
Definition: xc.F90:114