Octopus
hamiltonian_abst.F90
Go to the documentation of this file.
1!! Copyright (C) 2019 N. Tancogne-Dejean, M. Oliveira
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 st program; if not, write to the Free Software
15!! Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16!! 02110-1301, USA.
17!!
18#include "global.h"
19
23
25 use batch_oct_m
26 use global_oct_m
27 use mesh_oct_m
29
30 implicit none
31
32 private
33
34 public :: &
36
38 type, abstract :: hamiltonian_abst_t
40 real(real64) :: spectral_middle_point
41 real(real64) :: spectral_half_span
42
43 contains
44 procedure(is_hermitian), deferred :: is_hermitian
45 procedure(hamiltonian_update_span), deferred :: update_span
46 procedure(dhamiltonian_apply), deferred :: dapply
47 procedure(zhamiltonian_apply), deferred :: zapply
48 end type hamiltonian_abst_t
49
50 abstract interface
51 logical function is_hermitian(hm)
52 import
53 class(hamiltonian_abst_t), intent(in) :: hm
54 end function is_hermitian
55
56 subroutine hamiltonian_update_span(hm, delta, emin, namespace)
57 import
58 class(hamiltonian_abst_t), intent(inout) :: hm
59 real(real64), intent(in) :: delta(:)
60 real(real64), intent(in) :: emin
61 type(namespace_t), intent(in) :: namespace
62 end subroutine hamiltonian_update_span
63
64 subroutine dhamiltonian_apply(hm, namespace, mesh, psib, hpsib, terms, set_bc)
65 import
66 class(hamiltonian_abst_t), intent(in) :: hm
67 type(namespace_t), intent(in) :: namespace
68 class(mesh_t), intent(in) :: mesh
69 class(batch_t), target, intent(inout) :: psib
70 class(batch_t), target, intent(inout) :: hpsib
71 integer, optional, intent(in) :: terms
72 logical, optional, intent(in) :: set_bc
73 end subroutine dhamiltonian_apply
74
75 subroutine zhamiltonian_apply(hm, namespace, mesh, psib, hpsib, terms, set_bc)
76 import
77 class(hamiltonian_abst_t), intent(in) :: hm
78 type(namespace_t), intent(in) :: namespace
79 class(mesh_t), intent(in) :: mesh
80 class(batch_t), target, intent(inout) :: psib
81 class(batch_t), target, intent(inout) :: hpsib
82 integer, optional, intent(in) :: terms
83 logical, optional, intent(in) :: set_bc
84 end subroutine zhamiltonian_apply
85 end interface
86
88
89
90!! Local Variables:
91!! mode: f90
92!! coding: utf-8
93!! End:
This module implements batches of mesh functions.
Definition: batch.F90:135
This module defines an abstract class for Hamiltonians.
This module defines the meshes, which are used in Octopus.
Definition: mesh.F90:120
The abstract Hamiltonian class defines a skeleton for specific implementations.