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(namespace, gr, st, space, hm, ions, momentum, non_local)
102 type(namespace_t), intent(in) :: namespace
103 type(grid_t), intent(in) :: gr
104 type(states_elec_t), intent(in) :: st
105 type(space_t), intent(in) :: space
106 type(hamiltonian_elec_t), intent(in) :: hm
107 type(ions_t), intent(in) :: ions
108 real(real64), intent(out) :: momentum(:,:,:)
109 logical, optional, intent(in) :: non_local
110
111 push_sub(elec_momentum_me)
112
113 if (states_are_real(st)) then
114 call delec_momentum_me(namespace, gr, st, space, hm, ions, momentum, non_local)
115 else
116 call zelec_momentum_me(namespace, gr, st, space, hm, ions, momentum, non_local)
117 end if
118
119 pop_sub(elec_momentum_me)
120 end subroutine elec_momentum_me
121
122 ! -----------------------------------------------------------------------------
123 subroutine elec_angular_momentum_me(gr, st, space, ll, l2)
124 type(grid_t), intent(in) :: gr
125 type(states_elec_t), intent(in) :: st
126 type(space_t), intent(in) :: space
127 real(real64), contiguous, intent(out) :: ll(:, :, :)
128 real(real64), contiguous, optional, intent(out) :: l2(:, :)
129
131
132 if (states_are_real(st)) then
133 call delec_angular_momentum_me(gr, st, space, ll, l2)
134 else
135 call zelec_angular_momentum_me(gr, st, space, ll, l2)
136 end if
137
139 end subroutine elec_angular_momentum_me
140
141#include "undef.F90"
142#include "complex.F90"
143#include "elec_matrix_elements_inc.F90"
144
145#include "undef.F90"
146#include "real.F90"
147#include "elec_matrix_elements_inc.F90"
148
150
151!! Local Variables:
152!! mode: f90
153!! coding: utf-8
154!! End:
This module implements batches of mesh functions.
Definition: batch.F90:135
Module implementing boundary conditions in Octopus.
Definition: boundaries.F90:124
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(namespace, gr, st, space, hm, ions, momentum, non_local)
The routine calculates the expectation value of the momentum operator.
subroutine zelec_momentum_me(namespace, gr, st, space, hm, ions, momentum, non_local)
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,...
subroutine, public elec_momentum_me(namespace, gr, st, space, hm, ions, momentum, non_local)
This module implements the underlying real-space grid.
Definition: grid.F90:119
A module to handle KS potential, without the external potential.
This module defines functions over batches of mesh functions.
Definition: mesh_batch.F90:118
This module defines various routines, operating on mesh functions.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:120
This module contains some common usage patterns of MPI routines.
Definition: mpi_lib.F90:117
pure logical function, public states_are_real(st)
This module handles spin dimensions of the states and the k-point distribution.
Definition: xc.F90:116