Octopus
propagator_qoct.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
22 use debug_oct_m
28 use grid_oct_m
29 use global_oct_m
33 use ions_oct_m
34 use lasers_oct_m
38 use parser_oct_m
42 use space_oct_m
44 use xc_oct_m
45
46 implicit none
47
48 private
49
50 public :: &
52
53contains
54
55 ! ---------------------------------------------------------
57 subroutine td_qoct_tddft_propagator(hm, namespace, space, gr, st, tr, time, dt, ions_dyn, ions, ext_partners)
58 type(hamiltonian_elec_t), intent(inout) :: hm
59 type(namespace_t), intent(in) :: namespace
60 type(electron_space_t), intent(in) :: space
61 type(grid_t), intent(inout) :: gr
62 type(states_elec_t), intent(inout) :: st
63 type(propagator_base_t), intent(inout) :: tr
64 real(real64), intent(in) :: time, dt
65 type(ion_dynamics_t), intent(inout) :: ions_dyn
66 type(ions_t), intent(inout) :: ions
67 type(partner_list_t), intent(in) :: ext_partners
68
69 type(gauge_field_t), pointer :: gfield
70
72
73 !TODO: Add gauge field support
74 gfield => list_get_gauge_field(ext_partners)
75 if(associated(gfield)) then
76 assert(gauge_field_is_propagated(gfield) .eqv. .false.)
77 end if
78
79 if ((hm%theory_level /= independent_particles) .and. &
80 (.not. oct_exchange_enabled(hm%oct_exchange))) then
81 call potential_interpolation_interpolate(tr%vksold, 2, time, dt, time-dt/m_two, &
82 hm%vhxc, vtau = hm%vtau)
83 end if
84
85 !move the ions to time 'time - dt/2'
86 call propagation_ops_elec_move_ions(tr%propagation_ops_elec, gr, hm, st, namespace, space, ions_dyn, ions, &
87 ext_partners, time - m_half*dt, m_half*dt, save_pos = .true.)
88
89 call propagation_ops_elec_update_hamiltonian(namespace, space, st, gr, hm, ext_partners, time-dt/m_two)
90
91 call exponential_apply_all(tr%te, namespace, gr, hm, st, dt)
92
93 call density_calc(st, gr, st%rho)
94
95 !restore to time 'time - dt'
96 call propagation_ops_elec_restore_ions(tr%propagation_ops_elec, ions_dyn, ions)
97
99 end subroutine td_qoct_tddft_propagator
100 ! ---------------------------------------------------------
101
102end module propagator_qoct_oct_m
103
104!! Local Variables:
105!! mode: f90
106!! coding: utf-8
107!! End:
This module implements a calculator for the density and defines related functions.
Definition: density.F90:120
subroutine, public density_calc(st, gr, density, istin)
Computes the density from the orbitals in st.
Definition: density.F90:608
subroutine, public exponential_apply_all(te, namespace, mesh, hm, st, deltat, order)
Note that this routine not only computes the exponential, but also an extra term if there is a inhomo...
type(gauge_field_t) function, pointer, public list_get_gauge_field(partners)
logical pure function, public gauge_field_is_propagated(this)
real(real64), parameter, public m_two
Definition: global.F90:189
real(real64), parameter, public m_half
Definition: global.F90:193
This module implements the underlying real-space grid.
Definition: grid.F90:117
integer, parameter, public independent_particles
This module defines classes and functions for interaction partners.
logical function, public oct_exchange_enabled(this)
subroutine, public potential_interpolation_interpolate(potential_interpolation, order, time, dt, t, vhxc, vtau)
subroutine, public propagation_ops_elec_restore_ions(wo, ions_dyn, ions)
subroutine, public propagation_ops_elec_move_ions(wo, gr, hm, st, namespace, space, ions_dyn, ions, ext_partners, time, dt, save_pos)
subroutine, public propagation_ops_elec_update_hamiltonian(namespace, space, st, mesh, hm, ext_partners, time)
subroutine, public td_qoct_tddft_propagator(hm, namespace, space, gr, st, tr, time, dt, ions_dyn, ions, ext_partners)
Propagator specifically designed for the QOCT+TDDFT problem.
Definition: xc.F90:114
int true(void)