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