-
Notifications
You must be signed in to change notification settings - Fork 1
/
qs_mom_types.F
161 lines (140 loc) · 7.98 KB
/
qs_mom_types.F
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
!--------------------------------------------------------------------------------------------------!
! CP2K: A general program to perform molecular dynamics simulations !
! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
! !
! SPDX-License-Identifier: GPL-2.0-or-later !
!--------------------------------------------------------------------------------------------------!
! **************************************************************************************************
!> \brief manage control variables for the maximum overlap method
! **************************************************************************************************
MODULE qs_mom_types
USE bibliography, ONLY: Barca2018,&
Gilbert2008
USE input_constants, ONLY: momproj_norm,&
momproj_sum,&
momtype_imom,&
momtype_mom
USE input_keyword_types, ONLY: keyword_create,&
keyword_release,&
keyword_type
USE input_section_types, ONLY: section_add_keyword,&
section_create,&
section_type
USE input_val_types, ONLY: integer_t
USE string_utilities, ONLY: s2a
#include "./base/base_uses.f90"
IMPLICIT NONE
PRIVATE
CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_mom_types'
PUBLIC :: create_mom_section
CONTAINS
! **************************************************************************************************
!> \brief Create CP2K input section for variable occupancy using the Maximum
!> Overlap Method. Only with diagonalization methods, i.e. not with OT
!> \param section section to create
!> \date 20.06.2013
!> \par History
!> 06.2013 created [MattW]
!> 01.2016 (DE)OCC_ALPHA and (DE)OCC_BETA keywords accept a list of
!> molecular orbitals. Added two extra keywords: START_ITER
!> and PROJ_FORMULA [Sergey Chulkov]
!> \author MattW
!> \version 1.0
! **************************************************************************************************
SUBROUTINE create_mom_section(section)
TYPE(section_type), POINTER :: section
TYPE(keyword_type), POINTER :: keyword
CPASSERT(.NOT. ASSOCIATED(section))
CALL section_create(section, __LOCATION__, &
name="MOM", &
description="Define type and parameters for the maximum overlap method (MOM) "// &
"to determine orbital occupancies. "// &
"The MOM procedures activated by this section are only active for diagonalization "// &
"methods, i.e. not with minimization methods based on OT. "// &
"Incompatible with core-level excitation spectra (XAS).", &
n_keywords=8, n_subsections=0, repeats=.FALSE., &
citations=(/Gilbert2008, Barca2018/))
NULLIFY (keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="_SECTION_PARAMETERS_", &
description="Controls the activation of the MOM procedure", &
usage="MOM ON", &
default_l_val=.FALSE., &
lone_keyword_l_val=.TRUE.)
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="MOM_TYPE", &
description="Revision of the maximum overlap method to be used", &
usage="MOM_TYPE mom", default_i_val=momtype_mom, &
enum_c_vals=s2a("MOM", "IMOM"), &
enum_desc=s2a( &
"Originally proposed MOM protocol which uses molecular orbitals"// &
" from the previous SCF cycle as reference", &
"Initial-MOM which uses molecular orbitals of the initial guess as reference"), &
enum_i_vals=(/momtype_mom, momtype_imom/))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="START_ITER", &
description="SCF iteration cycle to start the MOM procedure. "// &
"Could be used for ground state calculations only "// &
"in order to stabilise oscillating SCF iterations", &
repeats=.FALSE., &
n_var=1, &
type_of_var=integer_t, &
default_i_val=0, &
usage="START_ITER 2")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="DEOCC_ALPHA", &
description="Alpha orbitals to be deoccupied", &
repeats=.FALSE., &
n_var=-1, &
type_of_var=integer_t, &
default_i_val=0, &
usage="DEOCC_ALPHA 10 11 ...")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="DEOCC_BETA", &
description="Beta orbitals to be deoccupied", &
repeats=.FALSE., &
n_var=-1, &
type_of_var=integer_t, &
default_i_val=0, &
usage="DEOCC_BETA 10 11 ...")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="OCC_ALPHA", &
description="Alpha orbitals to be occupied", &
repeats=.FALSE., &
n_var=-1, &
type_of_var=integer_t, &
default_i_val=0, &
usage="OCC_ALPHA 12 15 ...")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, &
name="OCC_BETA", &
description="Beta orbitals to be occupied", &
repeats=.FALSE., &
n_var=-1, &
type_of_var=integer_t, &
default_i_val=0, &
usage="OCC_BETA 12 15 ...")
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
CALL keyword_create(keyword, __LOCATION__, name="PROJ_FORMULA", &
description="Projection formula to be used", &
usage="PROJ_FORMULA norm", default_i_val=momproj_norm, &
enum_c_vals=s2a("NORM", "SUM"), &
enum_desc=s2a( &
"The one which ignores the phase of molecular orbitals: proj_j = \sqrt(\sum_i overlap(i, j)^2)", &
"The one proposed in the original paper: proj_j = |\sum_i overlap(i, j)|"), &
enum_i_vals=(/momproj_norm, momproj_sum/))
CALL section_add_keyword(section, keyword)
CALL keyword_release(keyword)
END SUBROUTINE create_mom_section
END MODULE qs_mom_types