(git:e7e05ae)
qs_mom_types.F
Go to the documentation of this file.
1 !--------------------------------------------------------------------------------------------------!
2 ! CP2K: A general program to perform molecular dynamics simulations !
3 ! Copyright 2000-2024 CP2K developers group <https://cp2k.org> !
4 ! !
5 ! SPDX-License-Identifier: GPL-2.0-or-later !
6 !--------------------------------------------------------------------------------------------------!
7 
8 ! **************************************************************************************************
9 !> \brief manage control variables for the maximum overlap method
10 ! **************************************************************************************************
12  USE bibliography, ONLY: barca2018,&
14  USE input_constants, ONLY: momproj_norm,&
15  momproj_sum,&
16  momtype_imom,&
20  keyword_type
23  section_type
24  USE input_val_types, ONLY: integer_t
25  USE string_utilities, ONLY: s2a
26 #include "./base/base_uses.f90"
27 
28  IMPLICIT NONE
29 
30  PRIVATE
31 
32  CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_mom_types'
33 
34  PUBLIC :: create_mom_section
35 
36 CONTAINS
37 
38 ! **************************************************************************************************
39 !> \brief Create CP2K input section for variable occupancy using the Maximum
40 !> Overlap Method. Only with diagonalization methods, i.e. not with OT
41 !> \param section section to create
42 !> \date 20.06.2013
43 !> \par History
44 !> 06.2013 created [MattW]
45 !> 01.2016 (DE)OCC_ALPHA and (DE)OCC_BETA keywords accept a list of
46 !> molecular orbitals. Added two extra keywords: START_ITER
47 !> and PROJ_FORMULA [Sergey Chulkov]
48 !> \author MattW
49 !> \version 1.0
50 ! **************************************************************************************************
51  SUBROUTINE create_mom_section(section)
52  TYPE(section_type), POINTER :: section
53 
54  TYPE(keyword_type), POINTER :: keyword
55 
56  cpassert(.NOT. ASSOCIATED(section))
57 
58  CALL section_create(section, __location__, &
59  name="MOM", &
60  description="Define type and parameters for the maximum overlap method (MOM) "// &
61  "to determine orbital occupancies. "// &
62  "The MOM procedures activated by this section are only active for diagonalization "// &
63  "methods, i.e. not with minimization methods based on OT. "// &
64  "Incompatible with core-level excitation spectra (XAS).", &
65  n_keywords=8, n_subsections=0, repeats=.false., &
66  citations=(/gilbert2008, barca2018/))
67 
68  NULLIFY (keyword)
69 
70  CALL keyword_create(keyword, __location__, &
71  name="_SECTION_PARAMETERS_", &
72  description="Controls the activation of the MOM procedure", &
73  usage="MOM ON", &
74  default_l_val=.false., &
75  lone_keyword_l_val=.true.)
76  CALL section_add_keyword(section, keyword)
77  CALL keyword_release(keyword)
78 
79  CALL keyword_create(keyword, __location__, name="MOM_TYPE", &
80  description="Revision of the maximum overlap method to be used", &
81  usage="MOM_TYPE mom", default_i_val=momtype_mom, &
82  enum_c_vals=s2a("MOM", "IMOM"), &
83  enum_desc=s2a( &
84  "Originally proposed MOM protocol which uses molecular orbitals"// &
85  " from the previous SCF cycle as reference", &
86  "Initial-MOM which uses molecular orbitals of the initial guess as reference"), &
87  enum_i_vals=(/momtype_mom, momtype_imom/))
88  CALL section_add_keyword(section, keyword)
89  CALL keyword_release(keyword)
90 
91  CALL keyword_create(keyword, __location__, &
92  name="START_ITER", &
93  description="SCF iteration cycle to start the MOM procedure. "// &
94  "Could be used for ground state calculations only "// &
95  "in order to stabilise oscillating SCF iterations", &
96  repeats=.false., &
97  n_var=1, &
98  type_of_var=integer_t, &
99  default_i_val=0, &
100  usage="START_ITER 2")
101  CALL section_add_keyword(section, keyword)
102  CALL keyword_release(keyword)
103 
104  CALL keyword_create(keyword, __location__, &
105  name="DEOCC_ALPHA", &
106  description="Alpha orbitals to be deoccupied", &
107  repeats=.false., &
108  n_var=-1, &
109  type_of_var=integer_t, &
110  default_i_val=0, &
111  usage="DEOCC_ALPHA 10 11 ...")
112  CALL section_add_keyword(section, keyword)
113  CALL keyword_release(keyword)
114 
115  CALL keyword_create(keyword, __location__, &
116  name="DEOCC_BETA", &
117  description="Beta orbitals to be deoccupied", &
118  repeats=.false., &
119  n_var=-1, &
120  type_of_var=integer_t, &
121  default_i_val=0, &
122  usage="DEOCC_BETA 10 11 ...")
123  CALL section_add_keyword(section, keyword)
124  CALL keyword_release(keyword)
125 
126  CALL keyword_create(keyword, __location__, &
127  name="OCC_ALPHA", &
128  description="Alpha orbitals to be occupied", &
129  repeats=.false., &
130  n_var=-1, &
131  type_of_var=integer_t, &
132  default_i_val=0, &
133  usage="OCC_ALPHA 12 15 ...")
134  CALL section_add_keyword(section, keyword)
135  CALL keyword_release(keyword)
136 
137  CALL keyword_create(keyword, __location__, &
138  name="OCC_BETA", &
139  description="Beta orbitals to be occupied", &
140  repeats=.false., &
141  n_var=-1, &
142  type_of_var=integer_t, &
143  default_i_val=0, &
144  usage="OCC_BETA 12 15 ...")
145  CALL section_add_keyword(section, keyword)
146  CALL keyword_release(keyword)
147 
148  CALL keyword_create(keyword, __location__, name="PROJ_FORMULA", &
149  description="Projection formula to be used", &
150  usage="PROJ_FORMULA norm", default_i_val=momproj_norm, &
151  enum_c_vals=s2a("NORM", "SUM"), &
152  enum_desc=s2a( &
153  "The one which ignores the phase of molecular orbitals: proj_j = \sqrt(\sum_i overlap(i, j)^2)", &
154  "The one proposed in the original paper: proj_j = |\sum_i overlap(i, j)|"), &
155  enum_i_vals=(/momproj_norm, momproj_sum/))
156  CALL section_add_keyword(section, keyword)
157  CALL keyword_release(keyword)
158 
159  END SUBROUTINE create_mom_section
160 
161 END MODULE qs_mom_types
collects all references to literature in CP2K as new algorithms / method are included from literature...
Definition: bibliography.F:28
integer, save, public barca2018
Definition: bibliography.F:43
integer, save, public gilbert2008
Definition: bibliography.F:43
collects all constants needed in input so that they can be used without circular dependencies
integer, parameter, public momproj_norm
integer, parameter, public momtype_mom
integer, parameter, public momproj_sum
integer, parameter, public momtype_imom
represents keywords in an input
subroutine, public keyword_release(keyword)
releases the given keyword (see doc/ReferenceCounting.html)
subroutine, public keyword_create(keyword, location, name, description, usage, type_of_var, n_var, repeats, variants, default_val, default_l_val, default_r_val, default_lc_val, default_c_val, default_i_val, default_l_vals, default_r_vals, default_c_vals, default_i_vals, lone_keyword_val, lone_keyword_l_val, lone_keyword_r_val, lone_keyword_c_val, lone_keyword_i_val, lone_keyword_l_vals, lone_keyword_r_vals, lone_keyword_c_vals, lone_keyword_i_vals, enum_c_vals, enum_i_vals, enum, enum_strict, enum_desc, unit_str, citations, deprecation_notice, removed)
creates a keyword object
objects that represent the structure of input sections and the data contained in an input section
subroutine, public section_create(section, location, name, description, n_keywords, n_subsections, repeats, citations)
creates a list of keywords
subroutine, public section_add_keyword(section, keyword)
adds a keyword to the given section
a wrapper for basic fortran types.
integer, parameter, public integer_t
manage control variables for the maximum overlap method
Definition: qs_mom_types.F:11
subroutine, public create_mom_section(section)
Create CP2K input section for variable occupancy using the Maximum Overlap Method....
Definition: qs_mom_types.F:52
Utilities for string manipulations.