(git:b279b6b)
qs_ot_scf.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 basic functionality for using ot in the scf routines.
10 !> \par History
11 !> 01.2003 : Joost VandeVondele : adapted for LSD
12 !> \author Joost VandeVondele (25.08.2002)
13 ! **************************************************************************************************
14 MODULE qs_ot_scf
15  USE cp_array_utils, ONLY: cp_1d_r_p_type
18  USE cp_fm_types, ONLY: cp_fm_type
20  cp_logger_type
23  USE dbcsr_api, ONLY: &
24  dbcsr_copy, dbcsr_dot, dbcsr_get_diag, dbcsr_get_info, dbcsr_init_p, dbcsr_multiply, &
25  dbcsr_p_type, dbcsr_release, dbcsr_scale_by_vector, dbcsr_set, dbcsr_set_diag, dbcsr_type, &
26  dbcsr_type_no_symmetry
29  section_vals_type
30  USE kinds, ONLY: dp
31  USE qs_mo_occupation, ONLY: set_mo_occupation
32  USE qs_mo_types, ONLY: get_mo_set,&
34  mo_set_type
35  USE qs_ot, ONLY: qs_ot_get_orbitals,&
38  USE qs_ot_minimizer, ONLY: ot_mini
39  USE qs_ot_types, ONLY: ot_readwrite_input,&
42  qs_ot_init,&
44  qs_ot_type
45  USE scf_control_types, ONLY: smear_type
46 #include "./base/base_uses.f90"
47 
48  IMPLICIT NONE
49 
50  PRIVATE
51 
52  CHARACTER(len=*), PARAMETER, PRIVATE :: moduleN = 'qs_ot_scf'
53  ! *** Public subroutines ***
54 
55  PUBLIC :: ot_scf_init
56  PUBLIC :: ot_scf_mini
57  PUBLIC :: ot_scf_destroy
58  PUBLIC :: ot_scf_read_input
59 
60 CONTAINS
61 
62 ! **************************************************************************************************
63 !> \brief ...
64 !> \param qs_ot_env ...
65 !> \param scf_section ...
66 ! **************************************************************************************************
67  SUBROUTINE ot_scf_read_input(qs_ot_env, scf_section)
68  TYPE(qs_ot_type), DIMENSION(:), POINTER :: qs_ot_env
69  TYPE(section_vals_type), POINTER :: scf_section
70 
71  CHARACTER(len=*), PARAMETER :: routinen = 'ot_scf_read_input'
72 
73  INTEGER :: handle, ispin, nspin, output_unit
74  LOGICAL :: explicit
75  TYPE(cp_logger_type), POINTER :: logger
76  TYPE(section_vals_type), POINTER :: ot_section
77 
78  CALL timeset(routinen, handle)
79 
80  logger => cp_get_default_logger()
81  output_unit = cp_print_key_unit_nr(logger, scf_section, "PRINT%PROGRAM_RUN_INFO", &
82  extension=".log")
83 
84  ! decide default settings
85  CALL qs_ot_settings_init(qs_ot_env(1)%settings)
86 
87  ! use ot input new style
88  ot_section => section_vals_get_subs_vals(scf_section, "OT")
89  CALL section_vals_get(ot_section, explicit=explicit)
90 
91  CALL ot_readwrite_input(qs_ot_env(1)%settings, ot_section, output_unit)
92 
93  CALL cp_print_key_finished_output(output_unit, logger, scf_section, &
94  "PRINT%PROGRAM_RUN_INFO")
95 
96  ! copy the ot settings type so it is identical
97  nspin = SIZE(qs_ot_env)
98  DO ispin = 2, nspin
99  qs_ot_env(ispin)%settings = qs_ot_env(1)%settings
100  END DO
101 
102  CALL timestop(handle)
103 
104  END SUBROUTINE ot_scf_read_input
105 ! **************************************************************************************************
106  !
107  ! performs the actual minimisation, needs only limited info
108  ! updated for restricted calculations
109  ! matrix_dedc is the derivative of the energy with respect to the orbitals (except for a factor 2*fi)
110  ! a null pointer for matrix_s implies that matrix_s is the unit matrix
111  !
112  !
113 ! **************************************************************************************************
114 !> \brief ...
115 !> \param mo_array ...
116 !> \param matrix_dedc ...
117 !> \param smear ...
118 !> \param matrix_s ...
119 !> \param energy ...
120 !> \param energy_only ...
121 !> \param delta ...
122 !> \param qs_ot_env ...
123 ! **************************************************************************************************
124  SUBROUTINE ot_scf_mini(mo_array, matrix_dedc, smear, matrix_s, energy, &
125  energy_only, delta, qs_ot_env)
126 
127  TYPE(mo_set_type), DIMENSION(:), INTENT(INOUT) :: mo_array
128  TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_dedc
129  TYPE(smear_type), POINTER :: smear
130  TYPE(dbcsr_type), POINTER :: matrix_s
131  REAL(kind=dp) :: energy
132  LOGICAL, INTENT(INOUT) :: energy_only
133  REAL(kind=dp) :: delta
134  TYPE(qs_ot_type), DIMENSION(:), POINTER :: qs_ot_env
135 
136  CHARACTER(len=*), PARAMETER :: routinen = 'ot_scf_mini'
137 
138  INTEGER :: handle, ispin, k, n, nspin
139  REAL(kind=dp) :: ener_nondiag, trace
140  TYPE(cp_1d_r_p_type), ALLOCATABLE, DIMENSION(:) :: expectation_values, occupation_numbers, &
141  scaling_factor
142  TYPE(cp_logger_type), POINTER :: logger
143  TYPE(dbcsr_p_type), DIMENSION(:), POINTER :: matrix_dedc_scaled
144  TYPE(dbcsr_type), POINTER :: mo_coeff
145 
146  CALL timeset(routinen, handle)
147 
148  NULLIFY (logger)
149  logger => cp_get_default_logger()
150 
151  nspin = SIZE(mo_array)
152 
153  ALLOCATE (occupation_numbers(nspin))
154  ALLOCATE (scaling_factor(nspin))
155 
156  IF (qs_ot_env(1)%settings%do_ener) THEN
157  ALLOCATE (expectation_values(nspin))
158  END IF
159 
160  DO ispin = 1, nspin
161  CALL get_mo_set(mo_set=mo_array(ispin), occupation_numbers=occupation_numbers(ispin)%array)
162  ALLOCATE (scaling_factor(ispin)%array(SIZE(occupation_numbers(ispin)%array)))
163  scaling_factor(ispin)%array = 2.0_dp*occupation_numbers(ispin)%array
164  IF (qs_ot_env(1)%settings%do_ener) THEN
165  ALLOCATE (expectation_values(ispin)%array(SIZE(occupation_numbers(ispin)%array)))
166  END IF
167  END DO
168 
169  ! optimizing orbital energies somehow implies non-equivalent orbitals
170  IF (qs_ot_env(1)%settings%do_ener) THEN
171  cpassert(qs_ot_env(1)%settings%do_rotation)
172  END IF
173  ! add_nondiag_energy requires do_ener
174  IF (qs_ot_env(1)%settings%add_nondiag_energy) THEN
175  cpassert(qs_ot_env(1)%settings%do_ener)
176  END IF
177 
178  ! get a rotational force
179  IF (.NOT. energy_only) THEN
180  IF (qs_ot_env(1)%settings%do_rotation) THEN
181  DO ispin = 1, SIZE(qs_ot_env)
182  CALL get_mo_set(mo_set=mo_array(ispin), mo_coeff_b=mo_coeff)
183  CALL dbcsr_get_info(mo_coeff, nfullrows_total=n, nfullcols_total=k)
184  CALL dbcsr_multiply('T', 'N', 1.0_dp, mo_coeff, matrix_dedc(ispin)%matrix, &
185  0.0_dp, qs_ot_env(ispin)%rot_mat_chc)
186  CALL dbcsr_copy(qs_ot_env(ispin)%matrix_buf1, qs_ot_env(ispin)%rot_mat_chc)
187 
188  CALL dbcsr_scale_by_vector(qs_ot_env(ispin)%matrix_buf1, alpha=scaling_factor(ispin)%array, side='right')
189  ! create the derivative of the energy wrt to rot_mat_u
190  CALL dbcsr_multiply('N', 'N', 1.0_dp, qs_ot_env(ispin)%rot_mat_u, qs_ot_env(ispin)%matrix_buf1, &
191  0.0_dp, qs_ot_env(ispin)%rot_mat_dedu)
192  END DO
193 
194  ! here we construct the derivative of the free energy with respect to the evals
195  ! (note that this requires the diagonal elements of chc)
196  ! the mo occupations should in principle remain unaltered
197  IF (qs_ot_env(1)%settings%do_ener) THEN
198  DO ispin = 1, SIZE(mo_array)
199  CALL dbcsr_get_diag(qs_ot_env(ispin)%rot_mat_chc, expectation_values(ispin)%array)
200  qs_ot_env(ispin)%ener_gx = expectation_values(ispin)%array
201  CALL set_mo_occupation(mo_set=mo_array(ispin), &
202  smear=smear, eval_deriv=qs_ot_env(ispin)%ener_gx)
203  END DO
204  END IF
205 
206  ! chc only needs to be stored in u independent form if we require add_nondiag_energy,
207  ! which will use it in non-selfconsistent form for e.g. the linesearch
208  ! transform C^T H C -> U C^T H C U ^ T
209  IF (qs_ot_env(1)%settings%add_nondiag_energy) THEN
210  DO ispin = 1, SIZE(qs_ot_env)
211  CALL dbcsr_get_info(qs_ot_env(ispin)%rot_mat_u, nfullcols_total=k)
212  CALL dbcsr_multiply('N', 'N', 1.0_dp, qs_ot_env(ispin)%rot_mat_u, qs_ot_env(ispin)%rot_mat_chc, &
213  0.0_dp, qs_ot_env(ispin)%matrix_buf1)
214  CALL dbcsr_multiply('N', 'T', 1.0_dp, qs_ot_env(ispin)%matrix_buf1, qs_ot_env(ispin)%rot_mat_u, &
215  0.0_dp, qs_ot_env(ispin)%rot_mat_chc)
216  END DO
217  END IF
218  END IF
219  END IF
220 
221  ! evaluate non-diagonal energy contribution
222  ener_nondiag = 0.0_dp
223  IF (qs_ot_env(1)%settings%add_nondiag_energy) THEN
224  DO ispin = 1, SIZE(qs_ot_env)
225  ! transform \tilde H to the current basis of C (assuming non-selfconsistent H)
226  CALL dbcsr_get_info(qs_ot_env(ispin)%rot_mat_u, nfullcols_total=k)
227  CALL dbcsr_multiply('T', 'N', 1.0_dp, qs_ot_env(ispin)%rot_mat_u, qs_ot_env(ispin)%rot_mat_chc, &
228  0.0_dp, qs_ot_env(ispin)%matrix_buf1)
229  CALL dbcsr_multiply('N', 'N', 1.0_dp, qs_ot_env(ispin)%matrix_buf1, qs_ot_env(ispin)%rot_mat_u, &
230  0.0_dp, qs_ot_env(ispin)%matrix_buf2)
231 
232  ! subtract the current ener_x from the diagonal
233  CALL dbcsr_get_diag(qs_ot_env(ispin)%matrix_buf2, expectation_values(ispin)%array)
234  expectation_values(ispin)%array = expectation_values(ispin)%array - qs_ot_env(ispin)%ener_x
235  CALL dbcsr_set_diag(qs_ot_env(ispin)%matrix_buf2, expectation_values(ispin)%array)
236 
237  ! get nondiag energy trace (D^T D)
238  CALL dbcsr_dot(qs_ot_env(ispin)%matrix_buf2, qs_ot_env(ispin)%matrix_buf2, trace)
239  ener_nondiag = ener_nondiag + 0.5_dp*qs_ot_env(1)%settings%nondiag_energy_strength*trace
240 
241  ! get gradient (again ignoring dependencies of H)
242  IF (.NOT. energy_only) THEN
243  ! first for the ener_x (-2*(diag(C^T H C)-ener_x))
244  qs_ot_env(ispin)%ener_gx = qs_ot_env(ispin)%ener_gx - &
245  qs_ot_env(1)%settings%nondiag_energy_strength*expectation_values(ispin)%array
246 
247  ! next for the rot_mat_u derivative (2 * k * \tilde H U D)
248  CALL dbcsr_multiply('N', 'N', 1.0_dp, qs_ot_env(ispin)%rot_mat_chc, qs_ot_env(ispin)%rot_mat_u, &
249  0.0_dp, qs_ot_env(ispin)%matrix_buf1)
250  CALL dbcsr_multiply('N', 'N', 2.0_dp*qs_ot_env(1)%settings%nondiag_energy_strength, &
251  qs_ot_env(ispin)%matrix_buf1, qs_ot_env(ispin)%matrix_buf2, &
252  1.0_dp, qs_ot_env(ispin)%rot_mat_dedu)
253  END IF
254  END DO
255  END IF
256 
257  ! this is kind of a hack so far (costly memory wise), we locally recreate the scaled matrix_hc, and
258  ! use it in the following, eventually, as occupations numbers get more integrated, it should become possible
259  ! to remove this.
260  ALLOCATE (matrix_dedc_scaled(SIZE(matrix_dedc)))
261  DO ispin = 1, SIZE(matrix_dedc)
262  ALLOCATE (matrix_dedc_scaled(ispin)%matrix)
263  CALL dbcsr_copy(matrix_dedc_scaled(ispin)%matrix, matrix_dedc(ispin)%matrix)
264 
265  ! as a preconditioner, one might want to scale only with a constant, not with f(i)
266  ! for the convergence criterion, maybe take it back out
267  IF (qs_ot_env(1)%settings%occupation_preconditioner) THEN
268  scaling_factor(ispin)%array = 2.0_dp
269  END IF
270  CALL dbcsr_scale_by_vector(matrix_dedc_scaled(ispin)%matrix, alpha=scaling_factor(ispin)%array, side='right')
271  END DO
272 
273  ! notice we use qs_ot_env(1) for driving all output and the minimization in case of LSD
274  qs_ot_env(1)%etotal = energy + ener_nondiag
275 
276  CALL ot_mini(qs_ot_env, matrix_dedc_scaled)
277 
278  delta = qs_ot_env(1)%delta
279  energy_only = qs_ot_env(1)%energy_only
280 
281  ! generate the orbitals using the new matrix_x
282  DO ispin = 1, SIZE(qs_ot_env)
283  CALL get_mo_set(mo_set=mo_array(ispin), mo_coeff_b=mo_coeff)
284  CALL dbcsr_get_info(mo_coeff, nfullrows_total=n, nfullcols_total=k)
285  SELECT CASE (qs_ot_env(1)%settings%ot_algorithm)
286  CASE ("TOD")
287  IF (ASSOCIATED(matrix_s)) THEN
288  CALL dbcsr_multiply('N', 'N', 1.0_dp, matrix_s, qs_ot_env(ispin)%matrix_x, &
289  0.0_dp, qs_ot_env(ispin)%matrix_sx)
290  ELSE
291  CALL dbcsr_copy(qs_ot_env(ispin)%matrix_sx, qs_ot_env(ispin)%matrix_x)
292  END IF
293  CALL qs_ot_get_p(qs_ot_env(ispin)%matrix_x, qs_ot_env(ispin)%matrix_sx, qs_ot_env(ispin))
294  CALL qs_ot_get_orbitals(mo_coeff, qs_ot_env(ispin)%matrix_x, qs_ot_env(ispin))
295  CASE ("REF")
296  CALL qs_ot_get_orbitals_ref(mo_coeff, matrix_s, qs_ot_env(ispin)%matrix_x, &
297  qs_ot_env(ispin)%matrix_sx, qs_ot_env(ispin)%matrix_gx_old, &
298  qs_ot_env(ispin)%matrix_dx, qs_ot_env(ispin), qs_ot_env(1))
299  CASE DEFAULT
300  cpabort("Algorithm not yet implemented")
301  END SELECT
302  END DO
303 
304  IF (qs_ot_env(1)%restricted) THEN
305  CALL mo_set_restrict(mo_array, convert_dbcsr=.true.)
306  END IF
307  !
308  ! obtain the new set of OT eigenvalues and set the occupations accordingly
309  !
310  IF (qs_ot_env(1)%settings%do_ener) THEN
311  DO ispin = 1, SIZE(mo_array)
312  mo_array(ispin)%eigenvalues = qs_ot_env(ispin)%ener_x
313  CALL set_mo_occupation(mo_set=mo_array(ispin), &
314  smear=smear)
315  END DO
316  END IF
317 
318  ! cleanup
319  DO ispin = 1, SIZE(scaling_factor)
320  DEALLOCATE (scaling_factor(ispin)%array)
321  END DO
322  DEALLOCATE (scaling_factor)
323  IF (qs_ot_env(1)%settings%do_ener) THEN
324  DO ispin = 1, SIZE(expectation_values)
325  DEALLOCATE (expectation_values(ispin)%array)
326  END DO
327  DEALLOCATE (expectation_values)
328  END IF
329  DEALLOCATE (occupation_numbers)
330  DO ispin = 1, SIZE(matrix_dedc_scaled)
331  CALL dbcsr_release(matrix_dedc_scaled(ispin)%matrix)
332  DEALLOCATE (matrix_dedc_scaled(ispin)%matrix)
333  END DO
334  DEALLOCATE (matrix_dedc_scaled)
335 
336  CALL timestop(handle)
337 
338  END SUBROUTINE ot_scf_mini
339  !
340  ! initialises qs_ot_env so that mo_coeff is the current point
341  ! and that the mimizization can be started.
342  !
343 ! **************************************************************************************************
344 !> \brief ...
345 !> \param mo_array ...
346 !> \param matrix_s ...
347 !> \param qs_ot_env ...
348 !> \param matrix_ks ...
349 !> \param broyden_adaptive_sigma ...
350 ! **************************************************************************************************
351  SUBROUTINE ot_scf_init(mo_array, matrix_s, qs_ot_env, matrix_ks, broyden_adaptive_sigma)
352 
353  TYPE(mo_set_type), DIMENSION(:), INTENT(IN) :: mo_array
354  TYPE(dbcsr_type), POINTER :: matrix_s
355  TYPE(qs_ot_type), DIMENSION(:), POINTER :: qs_ot_env
356  TYPE(dbcsr_type), POINTER :: matrix_ks
357  REAL(kind=dp) :: broyden_adaptive_sigma
358 
359  CHARACTER(len=*), PARAMETER :: routinen = 'ot_scf_init'
360 
361  INTEGER :: handle, ispin, k, n, nspin
362  LOGICAL :: is_equal
363  TYPE(cp_fm_type), POINTER :: mo_coeff_fm
364  TYPE(dbcsr_type), POINTER :: mo_coeff
365 
366  CALL timeset(routinen, handle)
367 
368  DO ispin = 1, SIZE(mo_array)
369  IF (.NOT. ASSOCIATED(mo_array(ispin)%mo_coeff_b)) THEN
370  cpabort("Shouldn't get there")
371  ! we do ot then copy fm to dbcsr
372  ! allocate that somewhere else ! fm -> dbcsr
373  CALL dbcsr_init_p(mo_array(ispin)%mo_coeff_b)
374  CALL cp_dbcsr_m_by_n_from_row_template(mo_array(ispin)%mo_coeff_b, template=matrix_ks, &
375  n=mo_array(ispin)%nmo, &
376  sym=dbcsr_type_no_symmetry)
377  END IF
378  END DO
379 
380  ! *** set a history for broyden
381  DO ispin = 1, SIZE(qs_ot_env)
382  qs_ot_env(ispin)%broyden_adaptive_sigma = broyden_adaptive_sigma
383  END DO
384 
385  ! **** SCP
386  ! **** SCP
387  ! adapted for work with the restricted keyword
388  nspin = SIZE(qs_ot_env)
389 
390  DO ispin = 1, nspin
391 
392  NULLIFY (mo_coeff)
393  CALL get_mo_set(mo_set=mo_array(ispin), mo_coeff_b=mo_coeff, mo_coeff=mo_coeff_fm)
394  CALL copy_fm_to_dbcsr(mo_coeff_fm, mo_coeff) !fm -> dbcsr
395 
396  CALL dbcsr_get_info(mo_coeff, nfullrows_total=n, nfullcols_total=k)
397 
398  ! allocate
399  CALL qs_ot_allocate(qs_ot_env(ispin), matrix_ks, mo_coeff_fm%matrix_struct)
400 
401  ! set c0,sc0
402  CALL dbcsr_copy(qs_ot_env(ispin)%matrix_c0, mo_coeff)
403  IF (ASSOCIATED(matrix_s)) THEN
404  CALL dbcsr_multiply('N', 'N', 1.0_dp, matrix_s, qs_ot_env(ispin)%matrix_c0, &
405  0.0_dp, qs_ot_env(ispin)%matrix_sc0)
406  ELSE
407  CALL dbcsr_copy(qs_ot_env(ispin)%matrix_sc0, qs_ot_env(ispin)%matrix_c0)
408  END IF
409 
410  ! init
411  CALL qs_ot_init(qs_ot_env(ispin))
412 
413  ! set x
414  CALL dbcsr_set(qs_ot_env(ispin)%matrix_x, 0.0_dp)
415  CALL dbcsr_set(qs_ot_env(ispin)%matrix_sx, 0.0_dp)
416 
417  IF (qs_ot_env(ispin)%settings%do_rotation) THEN
418  CALL dbcsr_set(qs_ot_env(ispin)%rot_mat_x, 0.0_dp)
419  END IF
420 
421  IF (qs_ot_env(ispin)%settings%do_ener) THEN
422  is_equal = SIZE(qs_ot_env(ispin)%ener_x) == SIZE(mo_array(ispin)%eigenvalues)
423  cpassert(is_equal)
424  qs_ot_env(ispin)%ener_x = mo_array(ispin)%eigenvalues
425  END IF
426 
427  SELECT CASE (qs_ot_env(1)%settings%ot_algorithm)
428  CASE ("TOD")
429  ! get c
430  CALL qs_ot_get_p(qs_ot_env(ispin)%matrix_x, qs_ot_env(ispin)%matrix_sx, qs_ot_env(ispin))
431  CASE ("REF")
432  CALL dbcsr_copy(qs_ot_env(ispin)%matrix_x, qs_ot_env(ispin)%matrix_c0)
433  CALL dbcsr_copy(qs_ot_env(ispin)%matrix_sx, qs_ot_env(ispin)%matrix_sc0)
434  CASE DEFAULT
435  cpabort("Algorithm not yet implemented")
436  END SELECT
437 
438  END DO
439  CALL timestop(handle)
440  END SUBROUTINE ot_scf_init
441 
442 ! **************************************************************************************************
443 !> \brief ...
444 !> \param qs_ot_env ...
445 ! **************************************************************************************************
446  SUBROUTINE ot_scf_destroy(qs_ot_env)
447 
448  TYPE(qs_ot_type) :: qs_ot_env
449 
450  CALL qs_ot_destroy(qs_ot_env)
451 
452  END SUBROUTINE ot_scf_destroy
453 
454 END MODULE qs_ot_scf
455 
various utilities that regard array of different kinds: output, allocation,... maybe it is not a good...
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_m_by_n_from_row_template(matrix, template, n, sym, data_type)
Utility function to create dbcsr matrix, m x n matrix (n arbitrary) with the same processor grid and ...
subroutine, public copy_fm_to_dbcsr(fm, matrix, keep_sparsity)
Copy a BLACS matrix to a dbcsr matrix.
represent a full matrix distributed on many processors
Definition: cp_fm_types.F:15
various routines to log and control the output. The idea is that decisions about where to log should ...
type(cp_logger_type) function, pointer, public cp_get_default_logger()
returns the default logger
routines to handle the output, The idea is to remove the decision of wheter to output and what to out...
integer function, public cp_print_key_unit_nr(logger, basis_section, print_key_path, extension, middle_name, local, log_filename, ignore_should_output, file_form, file_position, file_action, file_status, do_backup, on_file, is_new_file, mpi_io, fout)
...
subroutine, public cp_print_key_finished_output(unit_nr, logger, basis_section, print_key_path, local, ignore_should_output, on_file, mpi_io)
should be called after you finish working with a unit obtained with cp_print_key_unit_nr,...
objects that represent the structure of input sections and the data contained in an input section
recursive type(section_vals_type) function, pointer, public section_vals_get_subs_vals(section_vals, subsection_name, i_rep_section, can_return_null)
returns the values of the requested subsection
subroutine, public section_vals_get(section_vals, ref_count, n_repetition, n_subs_vals_rep, section, explicit)
returns various attributes about the section_vals
Defines the basic variable types.
Definition: kinds.F:23
integer, parameter, public dp
Definition: kinds.F:34
Set occupation of molecular orbitals.
Definition and initialisation of the mo data type.
Definition: qs_mo_types.F:22
subroutine, public mo_set_restrict(mo_array, convert_dbcsr)
make the beta orbitals explicitly equal to the alpha orbitals effectively copying the orbital data
Definition: qs_mo_types.F:315
subroutine, public get_mo_set(mo_set, maxocc, homo, lfomo, nao, nelectron, n_el_f, nmo, eigenvalues, occupation_numbers, mo_coeff, mo_coeff_b, uniform_occupation, kTS, mu, flexible_electron_count)
Get the components of a MO set data structure.
Definition: qs_mo_types.F:397
orbital transformations
subroutine, public ot_mini(qs_ot_env, matrix_hc)
...
basic functionality for using ot in the scf routines.
Definition: qs_ot_scf.F:14
subroutine, public ot_scf_read_input(qs_ot_env, scf_section)
...
Definition: qs_ot_scf.F:68
subroutine, public ot_scf_init(mo_array, matrix_s, qs_ot_env, matrix_ks, broyden_adaptive_sigma)
...
Definition: qs_ot_scf.F:352
subroutine, public ot_scf_mini(mo_array, matrix_dedc, smear, matrix_s, energy, energy_only, delta, qs_ot_env)
...
Definition: qs_ot_scf.F:126
subroutine, public ot_scf_destroy(qs_ot_env)
...
Definition: qs_ot_scf.F:447
orbital transformations
Definition: qs_ot_types.F:15
subroutine, public qs_ot_init(qs_ot_env)
...
Definition: qs_ot_types.F:254
subroutine, public qs_ot_allocate(qs_ot_env, matrix_s, fm_struct_ref, ortho_k)
...
Definition: qs_ot_types.F:303
subroutine, public qs_ot_settings_init(settings)
sets default values for the settings type
Definition: qs_ot_types.F:215
subroutine, public qs_ot_destroy(qs_ot_env)
...
Definition: qs_ot_types.F:636
subroutine, public ot_readwrite_input(settings, ot_section, output_unit)
...
Definition: qs_ot_types.F:733
orbital transformations
Definition: qs_ot.F:15
subroutine, public qs_ot_get_p(matrix_x, matrix_sx, qs_ot_env)
...
Definition: qs_ot.F:752
subroutine, public qs_ot_get_orbitals(matrix_c, matrix_x, qs_ot_env)
...
Definition: qs_ot.F:1018
subroutine, public qs_ot_get_orbitals_ref(matrix_c, matrix_s, matrix_x, matrix_sx, matrix_gx_old, matrix_dx, qs_ot_env, qs_ot_env1)
...
Definition: qs_ot.F:515
parameters that control an scf iteration