37 USE dbcsr_api,
ONLY: &
38 dbcsr_add, dbcsr_binary_read, dbcsr_checksum, dbcsr_copy, dbcsr_copy_into_existing, &
39 dbcsr_create, dbcsr_deallocate_matrix, dbcsr_desymmetrize, dbcsr_distribution_type, &
40 dbcsr_filter, dbcsr_get_info, dbcsr_iterator_blocks_left, dbcsr_iterator_next_block, &
41 dbcsr_iterator_start, dbcsr_iterator_stop, dbcsr_iterator_type, dbcsr_p_type, dbcsr_scale, &
95 #include "../base/base_uses.f90"
108 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'rt_propagation_utils'
123 TYPE(qs_environment_type),
POINTER :: qs_env
125 CHARACTER(LEN=*),
PARAMETER :: routinen =
'calc_S_derivs'
126 REAL(kind=
dp),
PARAMETER :: one = 1.0_dp,
zero = 0.0_dp
128 INTEGER :: col_atom, handle, i, j, m, maxder, n, &
130 INTEGER,
DIMENSION(6, 2) :: c_map_mat
131 LOGICAL :: return_s_derivatives
132 REAL(
dp),
DIMENSION(:),
POINTER :: block_values
133 TYPE(dbcsr_iterator_type) :: iter
134 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: c_mat, s_der, s_derivs
135 TYPE(dbcsr_type),
POINTER :: b_mat, tmp_mat, tmp_mat2
136 TYPE(dft_control_type),
POINTER :: dft_control
137 TYPE(neighbor_list_set_p_type),
DIMENSION(:), &
139 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
140 TYPE(qs_ks_env_type),
POINTER :: ks_env
141 TYPE(rt_prop_type),
POINTER :: rtp
143 CALL timeset(routinen, handle)
145 return_s_derivatives = .true.
147 NULLIFY (particle_set)
150 NULLIFY (dft_control)
155 particle_set=particle_set, &
157 dft_control=dft_control, &
160 CALL get_rtp(rtp=rtp, b_mat=b_mat, c_mat=c_mat, s_der=s_der)
167 CALL dbcsr_create(tmp_mat, template=s_der(1)%matrix, matrix_type=
"N")
169 IF (rtp%iter < 2)
THEN
171 IF (dft_control%qs_control%dftb)
THEN
175 basis_type_a=
"ORB", basis_type_b=
"ORB", sab_nl=sab_orb)
180 CALL dbcsr_create(tmp_mat2, template=s_der(1)%matrix, matrix_type=
"S")
182 CALL dbcsr_copy(tmp_mat2, s_derivs(m + 1)%matrix)
183 CALL dbcsr_desymmetrize(tmp_mat2, s_der(m)%matrix)
184 CALL dbcsr_scale(s_der(m)%matrix, -one)
185 CALL dbcsr_filter(s_der(m)%matrix, rtp%filter_eps)
187 CALL dbcsr_iterator_start(iter, s_der(m)%matrix)
188 DO WHILE (dbcsr_iterator_blocks_left(iter))
189 CALL dbcsr_iterator_next_block(iter, row_atom, col_atom, block_values)
190 IF (row_atom == col_atom) block_values = 0.0_dp
192 CALL dbcsr_iterator_stop(iter)
195 CALL dbcsr_deallocate_matrix(tmp_mat2)
200 CALL dbcsr_set(b_mat,
zero)
202 CALL dbcsr_copy(tmp_mat, s_der(m)%matrix)
203 CALL dbcsr_iterator_start(iter, tmp_mat)
204 DO WHILE (dbcsr_iterator_blocks_left(iter))
205 CALL dbcsr_iterator_next_block(iter, row_atom, col_atom, block_values)
206 IF (row_atom == col_atom) block_values = 0.0_dp
207 block_values = block_values*particle_set(col_atom)%v(m)
209 CALL dbcsr_iterator_stop(iter)
210 CALL dbcsr_add(b_mat, tmp_mat, one, one)
212 CALL dbcsr_filter(b_mat, rtp%filter_eps)
227 CALL dbcsr_set(c_mat(i)%matrix,
zero)
230 CALL dbcsr_copy(tmp_mat, s_der(m + 3)%matrix)
232 IF (c_map_mat(m, j) == 0) cycle
233 CALL dbcsr_add(c_mat(c_map_mat(m, j))%matrix, tmp_mat, one, one)
238 CALL dbcsr_iterator_start(iter, c_mat(m)%matrix)
239 DO WHILE (dbcsr_iterator_blocks_left(iter))
240 CALL dbcsr_iterator_next_block(iter, row_atom, col_atom, block_values)
241 block_values = block_values*particle_set(row_atom)%v(m)
243 CALL dbcsr_iterator_stop(iter)
244 CALL dbcsr_filter(c_mat(m)%matrix, rtp%filter_eps)
247 CALL dbcsr_deallocate_matrix(tmp_mat)
248 CALL timestop(handle)
258 TYPE(qs_environment_type),
POINTER :: qs_env
260 CHARACTER(LEN=default_path_length) :: file_name, project_name
261 INTEGER :: i, id_nr, im, ispin, ncol, nspin, &
262 output_unit, re, unit_nr
263 REAL(kind=
dp) :: alpha, cs_pos
264 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
265 TYPE(cp_fm_type) :: mos_occ
266 TYPE(cp_fm_type),
DIMENSION(:),
POINTER :: mos_old
267 TYPE(cp_logger_type),
POINTER :: logger
268 TYPE(dbcsr_distribution_type) :: dist
269 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: p_rmpv, rho_new, rho_old
270 TYPE(dft_control_type),
POINTER :: dft_control
271 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mo_array
272 TYPE(mp_para_env_type),
POINTER :: para_env
273 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
274 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
275 TYPE(qs_rho_type),
POINTER :: rho_struct
276 TYPE(rt_prop_type),
POINTER :: rtp
277 TYPE(section_vals_type),
POINTER :: dft_section, input
279 NULLIFY (atomic_kind_set, qs_kind_set, mo_array, particle_set, rho_struct, para_env)
282 qs_kind_set=qs_kind_set, &
283 atomic_kind_set=atomic_kind_set, &
284 particle_set=particle_set, &
288 dft_control=dft_control, &
294 IF (logger%para_env%is_source())
THEN
301 nspin =
SIZE(mo_array)
304 SELECT CASE (dft_control%rtp_control%initial_wfn)
307 id_nr=id_nr, multiplicity=dft_control%multiplicity, dft_section=dft_section)
308 CALL set_uniform_occupation_mo_array(mo_array, nspin)
310 IF (dft_control%rtp_control%apply_wfn_mix_init_restart) &
311 CALL wfn_mix(mo_array, particle_set, dft_section, qs_kind_set, para_env, output_unit, &
315 CALL calculate_density_matrix(mo_array(ispin), p_rmpv(ispin)%matrix)
317 IF (rtp%linear_scaling)
THEN
318 CALL get_rtp(rtp=rtp, rho_old=rho_old, rho_new=rho_new)
324 matrix_struct=mo_array(ispin)%mo_coeff%matrix_struct, &
326 CALL cp_fm_to_fm(mo_array(ispin)%mo_coeff, mos_occ)
327 IF (mo_array(ispin)%uniform_occupation)
THEN
328 alpha = 3.0_dp - real(nspin,
dp)
333 alpha=alpha, keep_sparsity=.false.)
338 matrix_v=mo_array(ispin)%mo_coeff, &
341 alpha=alpha, keep_sparsity=.false.)
343 CALL dbcsr_filter(rho_old(re)%matrix, rtp%filter_eps)
344 CALL dbcsr_copy(rho_new(re)%matrix, rho_old(re)%matrix)
345 CALL cp_fm_release(mos_occ)
349 CALL get_rtp(rtp=rtp, mos_old=mos_old)
350 DO i = 1,
SIZE(qs_env%mos)
351 CALL cp_fm_to_fm(mo_array(i)%mo_coeff, mos_old(2*i - 1))
356 IF (rtp%linear_scaling)
THEN
357 CALL get_rtp(rtp=rtp, rho_old=rho_old, rho_new=rho_new)
358 project_name = logger%iter_info%project_name
362 WRITE (file_name,
'(A,I0,A)') trim(project_name)//
"_LS_DM_SPIN_RE", ispin,
"_RESTART.dm"
363 CALL dbcsr_get_info(rho_old(re)%matrix, distribution=dist)
364 CALL dbcsr_binary_read(file_name, distribution=dist, matrix_new=rho_old(re)%matrix)
365 cs_pos = dbcsr_checksum(rho_old(re)%matrix, pos=.true.)
366 IF (unit_nr > 0)
THEN
367 WRITE (unit_nr,
'(T2,A,E20.8)')
"Read restart DM "//trim(file_name)//
" with checksum: ", cs_pos
369 WRITE (file_name,
'(A,I0,A)') trim(project_name)//
"_LS_DM_SPIN_IM", ispin,
"_RESTART.dm"
370 CALL dbcsr_get_info(rho_old(im)%matrix, distribution=dist)
371 CALL dbcsr_binary_read(file_name, distribution=dist, matrix_new=rho_old(im)%matrix)
372 cs_pos = dbcsr_checksum(rho_old(im)%matrix, pos=.true.)
373 IF (unit_nr > 0)
THEN
374 WRITE (unit_nr,
'(T2,A,E20.8)')
"Read restart DM "//trim(file_name)//
" with checksum: ", cs_pos
377 DO i = 1,
SIZE(rho_new)
378 CALL dbcsr_copy(rho_new(i)%matrix, rho_old(i)%matrix)
382 CALL get_rtp(rtp=rtp, mos_old=mos_old)
384 id_nr, dft_control%multiplicity, dft_section)
385 CALL set_uniform_occupation_mo_array(mo_array, nspin)
387 CALL calculate_density_matrix(mo_array(ispin), &
388 p_rmpv(ispin)%matrix)
402 SUBROUTINE set_uniform_occupation_mo_array(mo_array, nspin)
404 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mo_array
408 LOGICAL :: is_uniform
412 DO mo = 1, mo_array(ispin)%nmo
413 IF (mo_array(ispin)%occupation_numbers(mo) /= 0.0 .AND. &
414 mo_array(ispin)%occupation_numbers(mo) /= 1.0 .AND. &
415 mo_array(ispin)%occupation_numbers(mo) /= 2.0) &
418 mo_array(ispin)%uniform_occupation = is_uniform
421 END SUBROUTINE set_uniform_occupation_mo_array
432 TYPE(qs_environment_type),
POINTER :: qs_env
434 CHARACTER(len=*),
PARAMETER :: routinen =
'calc_update_rho'
435 REAL(kind=
dp),
PARAMETER :: one = 1.0_dp,
zero = 0.0_dp
437 INTEGER :: handle, i, im, ncol, re
438 REAL(kind=
dp) :: alpha
439 TYPE(cp_fm_type) :: mos_occ
440 TYPE(cp_fm_type),
DIMENSION(:),
POINTER :: mos_new
441 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: rho_ao, rho_ao_im
442 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mos
443 TYPE(qs_ks_env_type),
POINTER :: ks_env
444 TYPE(qs_rho_type),
POINTER :: rho
445 TYPE(rt_prop_type),
POINTER :: rtp
447 CALL timeset(routinen, handle)
449 NULLIFY (rho, ks_env, mos_new, rtp)
455 CALL get_rtp(rtp=rtp, mos_new=mos_new)
456 CALL qs_rho_get(rho_struct=rho, rho_ao=rho_ao)
457 DO i = 1,
SIZE(mos_new)/2
458 re = 2*i - 1; im = 2*i
459 CALL dbcsr_set(rho_ao(i)%matrix,
zero)
462 matrix_struct=mos(i)%mo_coeff%matrix_struct, &
464 CALL cp_fm_to_fm(mos_new(re), mos_occ)
465 IF (mos(i)%uniform_occupation)
THEN
466 alpha = 3*one - real(
SIZE(mos_new)/2,
dp)
476 matrix_v=mos_new(re), &
483 CALL cp_fm_to_fm(mos_new(im), mos_occ)
484 IF (mos(i)%uniform_occupation)
THEN
485 alpha = 3*one - real(
SIZE(mos_new)/2,
dp)
495 matrix_v=mos_new(im), &
500 CALL cp_fm_release(mos_occ)
504 IF (rtp%track_imag_density)
THEN
505 CALL qs_rho_get(rho_struct=rho, rho_ao_im=rho_ao_im)
512 CALL timestop(handle)
524 TYPE(qs_environment_type),
POINTER :: qs_env
526 CHARACTER(len=*),
PARAMETER :: routinen =
'calc_update_rho_sparse'
527 REAL(kind=
dp),
PARAMETER ::
zero = 0.0_dp
529 INTEGER :: handle, ispin
530 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: rho_ao, rho_ao_im, rho_new
531 TYPE(dft_control_type),
POINTER :: dft_control
532 TYPE(qs_ks_env_type),
POINTER :: ks_env
533 TYPE(qs_rho_type),
POINTER :: rho
534 TYPE(rt_prop_type),
POINTER :: rtp
535 TYPE(rtp_control_type),
POINTER :: rtp_control
537 NULLIFY (rho, ks_env, rtp, dft_control)
538 CALL timeset(routinen, handle)
543 dft_control=dft_control)
544 rtp_control => dft_control%rtp_control
545 CALL get_rtp(rtp=rtp, rho_new=rho_new)
546 CALL qs_rho_get(rho_struct=rho, rho_ao=rho_ao)
547 IF (rtp%track_imag_density)
CALL qs_rho_get(rho_struct=rho, rho_ao_im=rho_ao_im)
548 DO ispin = 1,
SIZE(rho_ao)
549 CALL dbcsr_set(rho_ao(ispin)%matrix,
zero)
550 CALL dbcsr_copy_into_existing(rho_ao(ispin)%matrix, rho_new(ispin*2 - 1)%matrix)
551 IF (rtp%track_imag_density)
THEN
552 CALL dbcsr_copy_into_existing(rho_ao_im(ispin)%matrix, rho_new(ispin*2)%matrix)
559 CALL timestop(handle)
571 TYPE(qs_environment_type),
POINTER :: qs_env
572 TYPE(rt_prop_type),
POINTER :: rtp
573 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: matrix_p_im
574 LOGICAL,
OPTIONAL :: keep_sparsity
576 INTEGER :: i, im, ncol, re
577 LOGICAL :: my_keep_sparsity
578 REAL(kind=
dp) :: alpha
579 TYPE(cp_fm_type),
DIMENSION(:),
POINTER :: mos_new, mos_occ
580 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mos
582 CALL get_rtp(rtp=rtp, mos_new=mos_new)
584 my_keep_sparsity = .false.
585 IF (
PRESENT(keep_sparsity)) my_keep_sparsity = keep_sparsity
587 ALLOCATE (mos_occ(
SIZE(mos)*2))
589 DO i = 1,
SIZE(mos_new)/2
590 re = 2*i - 1; im = 2*i
591 alpha = 3.0_dp - real(
SIZE(matrix_p_im),
dp)
593 matrix_struct=mos(i)%mo_coeff%matrix_struct, &
596 matrix_struct=mos(i)%mo_coeff%matrix_struct, &
598 CALL dbcsr_set(matrix_p_im(i)%matrix, 0.0_dp)
600 CALL cp_fm_to_fm(mos_new(re), mos_occ(re))
602 CALL cp_fm_to_fm(mos_new(im), mos_occ(im))
605 matrix_v=mos_occ(im), &
606 matrix_g=mos_occ(re), &
608 keep_sparsity=my_keep_sparsity, &
609 alpha=2.0_dp*alpha, &
612 CALL cp_fm_release(mos_occ)
622 TYPE(qs_environment_type),
POINTER :: qs_env
623 TYPE(rt_prop_type),
POINTER :: rtp
625 CHARACTER(len=*),
PARAMETER :: routinen =
'write_rtp_mos_to_output_unit'
627 CHARACTER(LEN=10) :: spin
628 CHARACTER(LEN=2*default_string_length) :: name
629 INTEGER :: handle, i, ispin, nao, nelectron, nmo, &
631 LOGICAL :: print_eigvecs, print_mo_info
632 REAL(kind=
dp) :: flexible_electron_count, maxocc, n_el_f
633 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
634 TYPE(cp_fm_type),
DIMENSION(:),
POINTER :: mos_new
635 TYPE(cp_logger_type),
POINTER :: logger
636 TYPE(mo_set_type) :: mo_set_rtp
637 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mos
638 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
639 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
640 TYPE(section_vals_type),
POINTER :: dft_section, input
642 NULLIFY (atomic_kind_set, particle_set, qs_kind_set, input, mos, dft_section)
644 CALL timeset(routinen, handle)
647 atomic_kind_set=atomic_kind_set, &
648 qs_kind_set=qs_kind_set, &
649 particle_set=particle_set, &
659 dft_section,
"PRINT%MO") /= 0) .OR. &
660 (qs_env%sim_step == 1)
662 IF ((.NOT. print_mo_info) .OR. (.NOT. print_eigvecs))
THEN
663 CALL timestop(handle)
667 CALL get_rtp(rtp=rtp, mos_new=mos_new)
669 nspins =
SIZE(mos_new)/2
673 CALL get_mo_set(mo_set=mos(ispin), nao=nao, nmo=nmo, nelectron=nelectron, &
674 n_el_f=n_el_f, maxocc=maxocc, flexible_electron_count=flexible_electron_count)
679 nelectron=nelectron, &
682 flexible_electron_count=flexible_electron_count)
684 WRITE (name, fmt=
"(A,I6)")
"RTP MO SET, SPIN ", ispin
685 CALL init_mo_set(mo_set_rtp, fm_ref=mos_new(2*ispin - 1), name=name)
697 mo_set_rtp%occupation_numbers = mos(ispin)%occupation_numbers
701 CALL cp_fm_to_fm(mos_new(2*ispin - i), mo_set_rtp%mo_coeff)
703 dft_section, 4, 0, rtp=.true., spin=trim(spin), cpart=mod(i, 2), sim_step=qs_env%sim_step)
709 CALL timestop(handle)
721 TYPE(qs_environment_type),
POINTER :: qs_env
722 TYPE(rt_prop_type),
POINTER :: rtp
724 CHARACTER(LEN=*),
PARAMETER :: routinen =
'write_rtp_mo_cubes'
726 CHARACTER(LEN=default_path_length) :: filename, my_pos_cube, title
727 INTEGER :: handle, homo, i, ir, ispin, ivector, &
728 n_rep, nhomo, nlist, nspins, &
729 rt_time_step, unit_nr
730 INTEGER,
DIMENSION(:),
POINTER ::
list, list_index
731 LOGICAL :: append_cube, do_kpoints, mpi_io
732 TYPE(atomic_kind_type),
DIMENSION(:),
POINTER :: atomic_kind_set
733 TYPE(cell_type),
POINTER :: cell
734 TYPE(cp_blacs_env_type),
POINTER :: blacs_env
735 TYPE(cp_fm_type),
DIMENSION(:),
POINTER :: mos_new
736 TYPE(cp_fm_type),
POINTER :: mo_coeff
737 TYPE(cp_logger_type),
POINTER :: logger
738 TYPE(dft_control_type),
POINTER :: dft_control
739 TYPE(mo_set_type),
DIMENSION(:),
POINTER :: mos
740 TYPE(mp_para_env_type),
POINTER :: para_env
741 TYPE(particle_list_type),
POINTER :: particles
742 TYPE(particle_type),
DIMENSION(:),
POINTER :: particle_set
743 TYPE(pw_c1d_gs_type) :: wf_g
744 TYPE(pw_env_type),
POINTER :: pw_env
745 TYPE(pw_pool_p_type),
DIMENSION(:),
POINTER :: pw_pools
746 TYPE(pw_pool_type),
POINTER :: auxbas_pw_pool
747 TYPE(pw_r3d_rs_type) :: density_r, wf_r
748 TYPE(qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
749 TYPE(qs_subsys_type),
POINTER :: subsys
750 TYPE(section_vals_type),
POINTER :: dft_section, input
752 CALL timeset(routinen, handle)
754 NULLIFY (logger, auxbas_pw_pool, pw_pools, pw_env)
757 CALL get_qs_env(qs_env, do_kpoints=do_kpoints, &
762 cpabort(
"K points not handled yet for printing MO_CUBE")
771 CALL timestop(handle)
775 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, &
777 blacs_env=blacs_env, &
778 qs_kind_set=qs_kind_set, &
782 particle_set=particle_set, &
783 dft_control=dft_control)
786 nspins = dft_control%nspins
787 rt_time_step = qs_env%sim_step
790 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool, &
792 CALL auxbas_pw_pool%create_pw(wf_r)
793 CALL auxbas_pw_pool%create_pw(wf_g)
794 CALL auxbas_pw_pool%create_pw(density_r)
795 CALL get_rtp(rtp=rtp, mos_new=mos_new)
802 my_pos_cube =
"REWIND"
803 IF (append_cube)
THEN
804 my_pos_cube =
"APPEND"
813 IF (
ASSOCIATED(
list))
THEN
814 CALL reallocate(list_index, 1, nlist +
SIZE(
list))
816 list_index(i + nlist) =
list(i)
818 nlist = nlist +
SIZE(
list)
823 IF (nhomo == -1) nhomo = homo
824 nlist = homo - max(1, homo - nhomo + 1) + 1
825 ALLOCATE (list_index(nlist))
827 list_index(i) = max(1, homo - nhomo + 1) + i - 1
831 ivector = list_index(i)
833 atomic_kind_set=atomic_kind_set, &
834 qs_kind_set=qs_kind_set, &
836 particle_set=particle_set, &
840 CALL pw_zero(density_r)
841 mo_coeff => mos_new(2*ispin - 1)
843 cell, dft_control, particle_set, pw_env)
845 CALL pw_multiply(density_r, wf_r, wf_r, 1.0_dp)
847 mo_coeff => mos_new(2*ispin)
849 cell, dft_control, particle_set, pw_env)
851 CALL pw_multiply(density_r, wf_r, wf_r, 1.0_dp)
853 WRITE (filename,
'(a4,I5.5,a1,I1.1)')
"WFN_", ivector,
"_", ispin
856 middle_name=trim(filename), file_position=my_pos_cube, log_filename=.false., &
858 WRITE (title, *)
"DENSITY ", ivector,
" spin ", ispin,
" i.e. HOMO - ", ivector - homo
859 CALL cp_pw_to_cube(density_r, unit_nr, title, particles=particles, &
863 IF (
ASSOCIATED(list_index))
DEALLOCATE (list_index)
867 CALL auxbas_pw_pool%give_back_pw(wf_r)
868 CALL auxbas_pw_pool%give_back_pw(wf_g)
869 CALL auxbas_pw_pool%give_back_pw(density_r)
871 CALL timestop(handle)
Define the atomic kind types and their sub types.
Handles all functions related to the CELL.
methods related to the blacs parallel environment
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_plus_fm_fm_t(sparse_matrix, matrix_v, matrix_g, ncol, alpha, keep_sparsity, symmetry_mode)
performs the multiplication sparse_matrix+dense_mat*dens_mat^T if matrix_g is not explicitly given,...
basic linear algebra operations for full matrices
subroutine, public cp_fm_column_scale(matrixa, scaling)
scales column i of matrix a with scaling(i)
represent a full matrix distributed on many processors
subroutine, public cp_fm_get_info(matrix, name, nrow_global, ncol_global, nrow_block, ncol_block, nrow_local, ncol_local, row_indices, col_indices, local_data, context, nrow_locals, ncol_locals, matrix_struct, para_env)
returns all kind of information about the full matrix
subroutine, public cp_fm_set_all(matrix, alpha, beta)
set all elements of a matrix to the same value, and optionally the diagonal to a different one
subroutine, public cp_fm_create(matrix, matrix_struct, name, use_sp)
creates a new full matrix with the given structure
various routines to log and control the output. The idea is that decisions about where to log should ...
recursive integer function, public cp_logger_get_default_unit_nr(logger, local, skip_not_ionode)
asks the default unit number of the given logger. try to use cp_logger_get_unit_nr
integer function, public cp_logger_get_default_io_unit(logger)
returns the unit nr for the ionode (-1 on all other processors) skips as well checks if the procs cal...
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,...
integer, parameter, public cp_p_file
integer function, public cp_print_key_should_output(iteration_info, basis_section, print_key_path, used_print_key, first_time)
returns what should be done with the given property if btest(res,cp_p_store) then the property should...
A wrapper around pw_to_cube() which accepts particle_list_type.
subroutine, public cp_pw_to_cube(pw, unit_nr, title, particles, stride, zero_tails, silent, mpi_io)
...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
An array-based list which grows on demand. When the internal array is full, a new array of twice the ...
Definition of mathematical constants and functions.
real(kind=dp), parameter, public zero
Utility routines for the memory handling.
Interface to the message passing library MPI.
Provides Cartesian and spherical orbital pointers and indices.
integer, dimension(:), allocatable, public ncoset
represent a simple array based list of the given type
Define the data structure for the particle information.
container for various plainwaves related things
subroutine, public pw_env_get(pw_env, pw_pools, cube_info, gridlevel_info, auxbas_pw_pool, auxbas_grid, auxbas_rs_desc, auxbas_rs_grid, rs_descs, rs_grids, xc_pw_pool, vdw_pw_pool, poisson_env, interp_section)
returns the various attributes of the pw env
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Calculate the plane wave density by collocating the primitive Gaussian functions (pgf).
subroutine, public calculate_wavefunction(mo_vectors, ivector, rho, rho_gspace, atomic_kind_set, qs_kind_set, cell, dft_control, particle_set, pw_env, basis_type, external_vector)
maps a given wavefunction on the grid
collects routines that calculate density matrices
Calculation of Overlap and Hamiltonian matrices in DFTB.
subroutine, public build_dftb_overlap(qs_env, nderivative, matrix_s)
...
subroutine, public get_qs_env(qs_env, atomic_kind_set, qs_kind_set, cell, super_cell, cell_ref, use_ref_cell, kpoints, dft_control, mos, sab_orb, sab_all, qmmm, qmmm_periodic, sac_ae, sac_ppl, sac_lri, sap_ppnl, sab_vdw, sab_scp, sap_oce, sab_lrc, sab_se, sab_xtbe, sab_tbe, sab_core, sab_xb, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, particle_set, energy, force, matrix_h, matrix_h_im, matrix_ks, matrix_ks_im, matrix_vxc, run_rtp, rtp, matrix_h_kp, matrix_h_im_kp, matrix_ks_kp, matrix_ks_im_kp, matrix_vxc_kp, kinetic_kp, matrix_s_kp, matrix_w_kp, matrix_s_RI_aux_kp, matrix_s, matrix_s_RI_aux, matrix_w, matrix_p_mp2, matrix_p_mp2_admm, rho, rho_xc, pw_env, ewald_env, ewald_pw, active_space, mpools, input, para_env, blacs_env, scf_control, rel_control, kinetic, qs_charges, vppl, rho_core, rho_nlcc, rho_nlcc_g, ks_env, ks_qmmm_env, wf_history, scf_env, local_particles, local_molecules, distribution_2d, dbcsr_dist, molecule_kind_set, molecule_set, subsys, cp_subsys, oce, local_rho_set, rho_atom_set, task_list, task_list_soft, rho0_atom_set, rho0_mpole, rhoz_set, ecoul_1c, rho0_s_rs, rho0_s_gs, do_kpoints, has_unit_metric, requires_mo_derivs, mo_derivs, mo_loc_history, nkind, natom, nelectron_total, nelectron_spin, efield, neighbor_list_id, linres_control, xas_env, virial, cp_ddapc_env, cp_ddapc_ewald, outer_scf_history, outer_scf_ihistory, x_data, et_coupling, dftb_potential, results, se_taper, se_store_int_env, se_nddo_mpole, se_nonbond_env, admm_env, lri_env, lri_density, exstate_env, ec_env, dispersion_env, gcp_env, vee, rho_external, external_vxc, mask, mp2_env, bs_env, kg_env, WannierCentres, atprop, ls_scf_env, do_transport, transport_env, v_hartree_rspace, s_mstruct_changed, rho_changed, potential_changed, forces_up_to_date, mscfg_env, almo_scf_env, gradient_history, variable_history, embed_pot, spin_embed_pot, polar_env, mos_last_converged, rhs)
Get the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
subroutine, public qs_ks_did_change(ks_env, s_mstruct_changed, rho_changed, potential_changed, full_reset)
tells that some of the things relevant to the ks calculation did change. has to be called when change...
Definition and initialisation of the mo data type.
subroutine, public read_rt_mos_from_restart(mo_array, rt_mos, atomic_kind_set, qs_kind_set, particle_set, para_env, id_nr, multiplicity, dft_section)
...
subroutine, public write_mo_set_to_output_unit(mo_set, atomic_kind_set, qs_kind_set, particle_set, dft_section, before, kpoint, final_mos, spin, solver_method, rtp, cpart, sim_step, umo_set)
Write MO information to output file (eigenvalues, occupation numbers, coefficients)
subroutine, public read_mo_set_from_restart(mo_array, atomic_kind_set, qs_kind_set, particle_set, para_env, id_nr, multiplicity, dft_section, natom_mismatch, cdft, out_unit)
...
Definition and initialisation of the mo data type.
subroutine, public allocate_mo_set(mo_set, nao, nmo, nelectron, n_el_f, maxocc, flexible_electron_count)
Allocates a mo set and partially initializes it (nao,nmo,nelectron, and flexible_electron_count are v...
subroutine, public deallocate_mo_set(mo_set)
Deallocate a wavefunction data structure.
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.
subroutine, public init_mo_set(mo_set, fm_pool, fm_ref, fm_struct, name)
initializes an allocated mo_set. eigenvalues, mo_coeff, occupation_numbers are valid only after this ...
Define the neighbor list data types and the corresponding functionality.
Calculation of overlap matrix, its derivatives and forces.
subroutine, public build_overlap_matrix(ks_env, matrix_s, matrixkp_s, matrix_name, nderivative, basis_type_a, basis_type_b, sab_nl, calculate_forces, matrix_p, matrixkp_p)
Calculation of the overlap matrix over Cartesian Gaussian functions.
methods of the rho structure (defined in qs_rho_types)
subroutine, public qs_rho_update_rho(rho_struct, qs_env, rho_xc_external, local_rho_set, task_list_external, task_list_external_soft, pw_env_external, para_env_external)
updates rho_r and rho_g to the rhorho_ao. if use_kinetic_energy_density also computes tau_r and tau_g...
superstucture that hold various representations of the density and keeps track of which ones are vali...
subroutine, public qs_rho_set(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rho_r, drho_r, rho_g, drho_g, tau_r, tau_g, rho_r_valid, drho_r_valid, rho_g_valid, drho_g_valid, tau_r_valid, tau_g_valid, tot_rho_r, tot_rho_g, rho_r_sccs, soft_valid, complex_rho_ao)
...
subroutine, public qs_rho_get(rho_struct, rho_ao, rho_ao_im, rho_ao_kp, rho_ao_im_kp, rho_r, drho_r, rho_g, drho_g, tau_r, tau_g, rho_r_valid, drho_r_valid, rho_g_valid, drho_g_valid, tau_r_valid, tau_g_valid, tot_rho_r, tot_rho_g, rho_r_sccs, soft_valid, complex_rho_ao)
returns info about the density described by this object. If some representation is not available an e...
Does all kind of post scf calculations for GPW/GAPW.
subroutine, public wfn_mix(mos, particle_set, dft_section, qs_kind_set, para_env, output_unit, unoccupied_orbs, scf_env, matrix_s, marked_states, for_rtp)
writes a new 'mixed' set of mos to restart file, without touching the current MOs
types that represent a quickstep subsys
subroutine, public qs_subsys_get(subsys, atomic_kinds, atomic_kind_set, particles, particle_set, local_particles, molecules, molecule_set, molecule_kinds, molecule_kind_set, local_molecules, para_env, colvar_p, shell_particles, core_particles, gci, multipoles, natom, nparticle, ncore, nshell, nkind, atprop, virial, results, cell, cell_ref, use_ref_cell, energy, force, qs_kind_set, cp_subsys, nelectron_total, nelectron_spin)
...
Types and set_get for real time propagation depending on runtype and diagonalization method different...
subroutine, public get_rtp(rtp, exp_H_old, exp_H_new, H_last_iter, rho_old, rho_next, rho_new, mos, mos_new, mos_old, mos_next, S_inv, S_half, S_minus_half, B_mat, C_mat, propagator_matrix, mixing, mixing_factor, S_der, dt, nsteps, SinvH, SinvH_imag, SinvB, admm_mos)
...
subroutine, public calc_update_rho_sparse(qs_env)
Copies the density matrix back into the qs_envrhorho_ao.
subroutine, public calc_s_derivs(qs_env)
Calculates dS/dR respectily the velocity weighted derivatves only needed for ehrenfest MD.
subroutine, public write_rtp_mos_to_output_unit(qs_env, rtp)
...
subroutine, public write_rtp_mo_cubes(qs_env, rtp)
Write the time dependent amplitude of the MOs in real grid. Very close to qs_scf_post_gpw/qs_scf_post...
subroutine, public calculate_p_imaginary(qs_env, rtp, matrix_p_im, keep_sparsity)
...
subroutine, public calc_update_rho(qs_env)
calculates the density from the complex MOs and passes the density to qs_env.
subroutine, public get_restart_wfn(qs_env)
reads the restart file. At the moment only SCF (means only real)