105#include "./base/base_uses.f90"
111 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'rpa_gw_static_cohsex'
138 gw_corr_lev_occ, gw_corr_lev_virt, Eigenval, mo_coeff, unit_nr, &
139 qs_env, mp2_env, eigenval_dg, eigenval_cn, u_qp_all)
142 TYPE(
cp_fm_type),
DIMENSION(:),
INTENT(IN) :: fm_mat_s_gw, fm_mat_s_gw_work
143 INTEGER,
INTENT(IN) :: dimen_ri, nmo
144 INTEGER,
DIMENSION(:),
INTENT(IN) :: homo, gw_corr_lev_occ, gw_corr_lev_virt
145 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: eigenval
146 TYPE(
cp_fm_type),
DIMENSION(:),
INTENT(IN) :: mo_coeff
147 INTEGER,
INTENT(IN) :: unit_nr
150 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(OUT), &
151 OPTIONAL :: eigenval_dg, eigenval_cn
152 REAL(kind=
dp),
DIMENSION(:, :, :),
INTENT(OUT), &
155 CHARACTER(LEN=*),
PARAMETER :: routinen =
'static_cohsex_qp_energies'
157 CHARACTER(LEN=10) :: spin_label
158 CHARACTER(LEN=3) :: occ_vir
159 CHARACTER(LEN=40) :: cohsex_label
160 INTEGER :: handle, ispin, m, n, n_mo_win, no, &
161 nspins, nv, p, win_start
163 REAL(kind=
dp) :: shift_occ, shift_virt
164 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: e_can, e_diag, e_qp, scale_vec
165 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:, :) :: h_qp, sigma_c, sigma_x, &
166 sigma_x_minus_vxc, u_qp, vxc
168 TYPE(
cp_fm_type) :: fm_b_re, fm_sigma, fm_wb_re, fm_work
171 CALL timeset(routinen, handle)
173 nspins =
SIZE(fm_mat_s_gw)
180 IF (qp_update)
CALL cite_reference(
tyagi2024)
181 IF (mp2_env%ri_g0w0%cohsex_scale_occ /= 1.0_dp .OR. mp2_env%ri_g0w0%cohsex_scale_virt /= 1.0_dp)
THEN
199 no = gw_corr_lev_occ(ispin)
200 nv = gw_corr_lev_virt(ispin)
202 win_start = homo(ispin) - no + 1
209 CALL parallel_gemm(transa=
"N", transb=
"N", m=dimen_ri, n=n_mo_win*nmo, k=dimen_ri, &
210 alpha=1.0_dp, matrix_a=fm_mat_q, matrix_b=fm_mat_s_gw(ispin), &
211 beta=0.0_dp, matrix_c=fm_mat_s_gw_work(ispin))
212 ALLOCATE (scale_vec(n_mo_win*nmo))
215 IF (p <= homo(ispin))
THEN
216 scale_vec((m - 1)*nmo + p) = -0.5_dp
218 scale_vec((m - 1)*nmo + p) = 0.5_dp
223 DEALLOCATE (scale_vec)
233 NULLIFY (fm_struct_b_re)
234 CALL cp_fm_struct_create(fm_struct_b_re, template_fmstruct=fm_mat_s_gw(ispin)%matrix_struct, &
235 nrow_global=nmo*dimen_ri, ncol_global=n_mo_win)
236 CALL cp_fm_create(fm_b_re, fm_struct_b_re, name=
"static_cohsex_B_reordered", set_zero=.true.)
237 CALL cp_fm_create(fm_wb_re, fm_struct_b_re, name=
"static_cohsex_WB_reordered", set_zero=.true.)
239 CALL cp_fm_permute(fm_b_re, fm_mat_s_gw(ispin), 1.0_dp, 1, nmo, dimen_ri, 1, [4, 1, 3, 2])
240 CALL cp_fm_permute(fm_wb_re, fm_mat_s_gw_work(ispin), 1.0_dp, 1, nmo, dimen_ri, 1, [4, 1, 3, 2])
242 NULLIFY (fm_struct_win)
243 CALL cp_fm_struct_create(fm_struct_win, template_fmstruct=fm_mat_s_gw(ispin)%matrix_struct, &
244 nrow_global=n_mo_win, ncol_global=n_mo_win)
248 ALLOCATE (sigma_c(n_mo_win, n_mo_win), sigma_x(n_mo_win, n_mo_win))
255 CALL parallel_gemm(transa=
"T", transb=
"N", m=n_mo_win, n=n_mo_win, k=nmo*dimen_ri, &
256 alpha=1.0_dp, matrix_a=fm_wb_re, matrix_b=fm_b_re, &
257 beta=0.0_dp, matrix_c=fm_sigma)
264 sigma_x(:, :) = 0.0_dp
265 IF (mp2_env%ri_g0w0%do_ri_Sigma_x)
THEN
266 CALL parallel_gemm(transa=
"T", transb=
"N", m=n_mo_win, n=n_mo_win, k=homo(ispin)*dimen_ri, &
267 alpha=-1.0_dp, matrix_a=fm_b_re, matrix_b=fm_b_re, &
268 beta=0.0_dp, matrix_c=fm_sigma)
284 ALLOCATE (vxc(n_mo_win, n_mo_win), sigma_x_minus_vxc(n_mo_win, n_mo_win))
285 CALL ao_to_mo_window(mp2_env%ri_g0w0%matrix_vxc(ispin)%matrix, mo_coeff(ispin), &
286 win_start, n_mo_win, vxc)
287 CALL ao_to_mo_window(mp2_env%ri_g0w0%matrix_sigma_x_minus_vxc(ispin)%matrix, mo_coeff(ispin), &
288 win_start, n_mo_win, sigma_x_minus_vxc)
289 sigma_x(:, :) = sigma_x(:, :) + sigma_x_minus_vxc(:, :) + vxc(:, :)
299 ALLOCATE (h_qp(n_mo_win, n_mo_win))
301 h_qp(1:no, 1:no) = sigma_x(1:no, 1:no) - vxc(1:no, 1:no) + &
302 mp2_env%ri_g0w0%cohsex_scale_occ*sigma_c(1:no, 1:no)
303 h_qp(no + 1:, no + 1:) = sigma_x(no + 1:, no + 1:) - vxc(no + 1:, no + 1:) + &
304 mp2_env%ri_g0w0%cohsex_scale_virt*sigma_c(no + 1:, no + 1:)
305 h_qp(:, :) = 0.5_dp*(h_qp(:, :) + transpose(h_qp(:, :)))
307 h_qp(n, n) = h_qp(n, n) + eigenval(win_start + n - 1, ispin)
310 ALLOCATE (e_diag(n_mo_win))
312 e_diag(n) = h_qp(n, n)
316 IF (
PRESENT(eigenval_dg))
THEN
318 IF (n < win_start)
THEN
319 eigenval_dg(n, ispin) = eigenval(n, ispin) + e_diag(1) - eigenval(win_start, ispin)
320 ELSE IF (n >= win_start + n_mo_win)
THEN
321 eigenval_dg(n, ispin) = eigenval(n, ispin) + e_diag(n_mo_win) - &
322 eigenval(win_start + n_mo_win - 1, ispin)
324 eigenval_dg(n, ispin) = e_diag(n - win_start + 1)
334 ALLOCATE (e_can(n_mo_win))
336 IF (para_env%is_source())
THEN
337 IF (no > 0)
CALL diamat_all(h_qp(1:no, 1:no), e_can(1:no))
338 IF (nv > 0)
CALL diamat_all(h_qp(no + 1:, no + 1:), e_can(no + 1:))
340 CALL para_env%bcast(h_qp, para_env%source)
341 CALL para_env%bcast(e_can, para_env%source)
350 ALLOCATE (e_qp(nmo), u_qp(nmo, nmo))
351 shift_occ = e_can(1) - eigenval(win_start, ispin)
352 shift_virt = e_can(n_mo_win) - eigenval(win_start + n_mo_win - 1, ispin)
354 IF (n < win_start)
THEN
355 e_qp(n) = eigenval(n, ispin) + shift_occ
356 ELSE IF (n >= win_start + n_mo_win)
THEN
357 e_qp(n) = eigenval(n, ispin) + shift_virt
359 e_qp(n) = e_can(n - win_start + 1)
366 u_qp(win_start:win_start + n_mo_win - 1, win_start:win_start + n_mo_win - 1) = h_qp(:, :)
369 IF (
PRESENT(eigenval_cn)) eigenval_cn(:, ispin) = e_qp(:)
370 IF (
PRESENT(u_qp_all)) u_qp_all(:, :, ispin) = u_qp(:, :)
378 IF (unit_nr > 0)
THEN
380 IF (nspins == 2 .AND. ispin == 1) spin_label =
"Alpha "
381 IF (nspins == 2 .AND. ispin == 2) spin_label =
"Beta "
382 WRITE (unit_nr,
"(/,T3,A)") repeat(
"-", 77)
384 cohsex_label = trim(adjustl(trim(spin_label)//
" static COHSEX"))
385 WRITE (unit_nr,
"(T3,A)") trim(cohsex_label)//
" quasiparticle energies"
386 WRITE (unit_nr,
"(T3,A,F6.3,A,F6.3)")
"COHSEX_SCALE_OCC =", mp2_env%ri_g0w0%cohsex_scale_occ, &
387 ", COHSEX_SCALE_VIRT =", mp2_env%ri_g0w0%cohsex_scale_virt
388 WRITE (unit_nr,
"(T3,A)") repeat(
"-", 77)
390 WRITE (unit_nr,
"(T3,A)")
"DG: diagonal of H^QP, CN: canonical, eigenvalues of the "// &
391 "occ-occ and virt-virt blocks"
392 WRITE (unit_nr,
"(/,T3,A,T16,A,T27,A,T38,A,T49,A,T60,A,T71,A)")
"MO",
"e_n^DFT",
"Sigma^c_nn", &
393 "Sigma^x_nn",
"v^xc_nn",
"e_n^DG",
"e_n^CN"
394 WRITE (unit_nr,
"(T3,A,T16,A,T27,A,T38,A,T49,A,T60,A,T71,A)")
"",
"(eV)",
"(eV)",
"(eV)", &
395 "(eV)",
"(eV)",
"(eV)"
397 WRITE (unit_nr,
"(T3,A)")
"DG: diagonal of H^QP"
398 WRITE (unit_nr,
"(/,T3,A,T16,A,T27,A,T38,A,T49,A,T60,A)")
"MO",
"e_n^DFT",
"Sigma^c_nn", &
399 "Sigma^x_nn",
"v^xc_nn",
"e_n^DG"
400 WRITE (unit_nr,
"(T3,A,T16,A,T27,A,T38,A,T49,A,T60,A)")
"",
"(eV)",
"(eV)",
"(eV)", &
410 WRITE (unit_nr,
"(T3,I5,A,A3,A,6F11.3)") win_start + n - 1,
" (", occ_vir,
")", &
411 eigenval(win_start + n - 1, ispin)*
evolt, sigma_c(n, n)*
evolt, sigma_x(n, n)*
evolt, &
414 WRITE (unit_nr,
"(T3,I5,A,A3,A,5F11.3)") win_start + n - 1,
" (", occ_vir,
")", &
415 eigenval(win_start + n - 1, ispin)*
evolt, sigma_c(n, n)*
evolt, sigma_x(n, n)*
evolt, &
419 IF (no > 0 .AND. nv > 0)
THEN
420 WRITE (unit_nr,
"(/,T3,A,T66,F15.3)") trim(cohsex_label)//
" HOMO, diagonal (eV)", &
421 maxval(e_diag(1:no))*
evolt
422 WRITE (unit_nr,
"(T3,A,T66,F15.3)") trim(cohsex_label)//
" LUMO, diagonal (eV)", &
423 minval(e_diag(no + 1:))*
evolt
424 WRITE (unit_nr,
"(T3,A,T66,F15.3)") trim(cohsex_label)//
" HOMO-LUMO gap, diagonal (eV)", &
425 (minval(e_diag(no + 1:)) - maxval(e_diag(1:no)))*
evolt
427 WRITE (unit_nr,
"(T3,A,T66,F15.3)") trim(cohsex_label)//
" HOMO, canonical (eV)", &
428 maxval(e_can(1:no))*
evolt
429 WRITE (unit_nr,
"(T3,A,T66,F15.3)") trim(cohsex_label)//
" LUMO, canonical (eV)", &
430 minval(e_can(no + 1:))*
evolt
431 WRITE (unit_nr,
"(T3,A,T66,F15.3)") trim(cohsex_label)//
" HOMO-LUMO gap, canonical (eV)", &
432 (minval(e_can(no + 1:)) - maxval(e_can(1:no)))*
evolt
435 WRITE (unit_nr,
"(T3,A)") repeat(
"-", 77)
442 CALL print_static_cohsex_mos(qs_env, mo_coeff(ispin), u_qp, e_qp, homo(ispin), nspins, ispin)
443 DEALLOCATE (e_can, e_qp, u_qp)
446 DEALLOCATE (sigma_c, sigma_x, sigma_x_minus_vxc, vxc, h_qp, e_diag)
452 CALL dbcsr_release_p(mp2_env%ri_g0w0%matrix_sigma_x_minus_vxc(ispin)%matrix)
454 DEALLOCATE (mp2_env%ri_g0w0%matrix_vxc, mp2_env%ri_g0w0%matrix_sigma_x_minus_vxc)
456 CALL timestop(handle)
469 SUBROUTINE ao_to_mo_window(matrix_ao, mo_coeff, win_start, n_mo_win, mat_mo)
472 INTEGER,
INTENT(IN) :: win_start, n_mo_win
473 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(OUT) :: mat_mo
475 CHARACTER(LEN=*),
PARAMETER :: routinen =
'ao_to_mo_window'
477 INTEGER :: handle, nao
481 CALL timeset(routinen, handle)
487 nrow_global=nao, ncol_global=nao)
496 nrow_global=nao, ncol_global=n_mo_win)
499 CALL parallel_gemm(transa=
"N", transb=
"N", m=nao, n=n_mo_win, k=nao, alpha=1.0_dp, &
500 matrix_a=fm_ao, matrix_b=mo_coeff, beta=0.0_dp, matrix_c=fm_ao_mo, &
501 b_first_col=win_start)
507 nrow_global=n_mo_win, ncol_global=n_mo_win)
510 CALL parallel_gemm(transa=
"T", transb=
"N", m=n_mo_win, n=n_mo_win, k=nao, alpha=1.0_dp, &
511 matrix_a=mo_coeff, matrix_b=fm_ao_mo, beta=0.0_dp, matrix_c=fm_mo_mo, &
512 a_first_col=win_start)
518 CALL timestop(handle)
520 END SUBROUTINE ao_to_mo_window
532 SUBROUTINE print_static_cohsex_mos(qs_env, mo_coeff, u_qp, e_qp, homo, nspins, ispin)
535 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: u_qp
536 REAL(kind=
dp),
DIMENSION(:),
INTENT(IN) :: e_qp
537 INTEGER,
INTENT(IN) :: homo, nspins, ispin
539 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_static_cohsex_mos'
541 CHARACTER(LEN=default_path_length) :: fname, title
542 INTEGER :: first_mo, handle, ivector, last_mo, nao, &
543 nelectron, nhomo, nlumo, nmo, unit_nr
544 INTEGER,
DIMENSION(:),
POINTER :: stride
545 LOGICAL :: print_coeff, print_cubes, &
546 print_energies, print_mo, print_occ
547 REAL(kind=
dp) :: maxocc
560 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
564 CALL timeset(routinen, handle)
574 (print_energies .OR. print_occ .OR. print_coeff)
577 IF (print_mo .OR. print_cubes)
THEN
586 IF (nspins == 1)
THEN
591 nelectron = nint(maxocc*real(homo, kind=
dp))
592 CALL allocate_mo_set(qp_mo_set, nao=nao, nmo=nmo, nelectron=nelectron, &
593 n_el_f=real(nelectron, kind=
dp), maxocc=maxocc, &
594 flexible_electron_count=0.0_dp)
595 CALL init_mo_set(qp_mo_set, fm_struct=fm_qp_mo%matrix_struct, name=
"static_cohsex")
596 qp_mo_set%eigenvalues(:) = e_qp(:)
599 CALL get_qs_env(qs_env, particle_set=particle_set, qs_kind_set=qs_kind_set)
600 IF (nspins == 1)
THEN
602 4, 0, final_mos=.true.)
603 ELSE IF (ispin == 1)
THEN
605 4, 0, final_mos=.true., spin=
"ALPHA")
608 4, 0, final_mos=.true., spin=
"BETA")
614 IF (print_cubes)
THEN
618 IF (nhomo == -1) nhomo = homo
619 IF (nlumo == -1) nlumo = nmo - homo
620 first_mo = max(1, homo - nhomo + 1)
621 last_mo = min(nmo, homo + nlumo)
623 CALL get_qs_env(qs_env, atomic_kind_set=atomic_kind_set, qs_kind_set=qs_kind_set, &
624 cell=cell, dft_control=dft_control, particle_set=particle_set, &
625 pw_env=pw_env, subsys=subsys)
627 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
628 CALL auxbas_pw_pool%create_pw(wf_r)
629 CALL auxbas_pw_pool%create_pw(wf_g)
631 DO ivector = first_mo, last_mo
633 qs_kind_set, cell, dft_control, particle_set, pw_env)
634 WRITE (fname,
'(A,I5.5,A,I1)')
"static_cohsex_WFN_", ivector,
"_", ispin
636 extension=
".cube", middle_name=trim(fname), &
637 file_position=
"REWIND", log_filename=.false.)
638 WRITE (title, *)
"static COHSEX WAVEFUNCTION ", ivector,
" spin ", ispin, &
639 " i.e. HOMO ", ivector - homo
640 CALL cp_pw_to_cube(wf_r, unit_nr, title, particles, stride=stride)
644 CALL auxbas_pw_pool%give_back_pw(wf_r)
645 CALL auxbas_pw_pool%give_back_pw(wf_g)
651 CALL timestop(handle)
653 END SUBROUTINE print_static_cohsex_mos
664 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: u_qp
674 nrow_global=nmo, ncol_global=nmo)
679 CALL parallel_gemm(transa=
"N", transb=
"N", m=nao, n=nmo, k=nmo, alpha=1.0_dp, &
680 matrix_a=mo_coeff, matrix_b=fm_u, beta=0.0_dp, matrix_c=fm_qp_mo)
696 INTEGER,
INTENT(IN) :: dimen_ri, n_outer, n_inner
697 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: u_outer, u_inner
699 CHARACTER(LEN=*),
PARAMETER :: routinen =
'rotate_bse_slab'
703 CALL timeset(routinen, handle)
706 CALL rotate_one_index(fm_slab, dimen_ri, n_outer, n_inner, u_inner, [3, 1, 2, 4], [3, 2, 1, 4], &
709 CALL rotate_one_index(fm_slab, dimen_ri, n_inner, n_outer, u_outer, [4, 1, 2, 3], [3, 2, 4, 1], &
712 CALL timestop(handle)
727 SUBROUTINE rotate_one_index(fm_slab, dimen_RI, n_spect, n_rot, u_rot, reord_to, reord_back, &
730 INTEGER,
INTENT(IN) :: dimen_ri, n_spect, n_rot
731 REAL(kind=
dp),
DIMENSION(:, :),
INTENT(IN) :: u_rot
732 INTEGER,
DIMENSION(4) :: reord_to, reord_back
733 INTEGER,
INTENT(IN) :: n_inner
736 TYPE(
cp_fm_type) :: fm_slab_out, fm_t, fm_t_rot, fm_u
740 nrow_global=n_spect*dimen_ri, ncol_global=n_rot)
741 CALL cp_fm_create(fm_t, fm_struct, name=
"static_cohsex_slab_reordered", set_zero=.true.)
742 CALL cp_fm_create(fm_t_rot, fm_struct, name=
"static_cohsex_slab_rotated", set_zero=.true.)
744 CALL cp_fm_permute(fm_t, fm_slab, 1.0_dp, 1, n_inner, dimen_ri, n_rot, reord_to)
748 nrow_global=n_rot, ncol_global=n_rot)
749 CALL cp_fm_create(fm_u, fm_struct, name=
"static_cohsex_U")
752 CALL parallel_gemm(transa=
"N", transb=
"N", m=n_spect*dimen_ri, n=n_rot, k=n_rot, alpha=1.0_dp, &
753 matrix_a=fm_t, matrix_b=fm_u, beta=0.0_dp, matrix_c=fm_t_rot)
757 CALL cp_fm_create(fm_slab_out, fm_slab%matrix_struct, name=
"static_cohsex_slab_back", set_zero=.true.)
758 CALL cp_fm_permute(fm_slab_out, fm_t_rot, 1.0_dp, dimen_ri, n_rot, 1, n_inner, reord_back)
763 END SUBROUTINE rotate_one_index
Define the atomic kind types and their sub types.
collects all references to literature in CP2K as new algorithms / method are included from literature...
integer, save, public tyagi2024
integer, save, public hedin1965
integer, save, public hybertsen1986
integer, save, public tyagi2026
Handles all functions related to the CELL.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_release_p(matrix)
...
DBCSR operations in CP2K.
subroutine, public copy_dbcsr_to_fm(matrix, fm, plan, check_plan)
Copy a DBCSR matrix to a BLACS matrix.
Basic linear algebra operations for full matrices.
subroutine, public cp_fm_add_on_diag(matrix, alpha, n_active)
Adds a scalar to the diagonal of a distributed real full matrix.
subroutine, public cp_fm_column_scale(matrixa, scaling)
scales column i of matrix a with scaling(i)
various cholesky decomposition related routines
subroutine, public cp_fm_cholesky_invert(matrix, n, info_out, work)
Replace the upper Cholesky factor by the upper triangle of the inverse. When work is provided,...
subroutine, public cp_fm_cholesky_decompose(matrix, n, info_out)
used to replace a symmetric positive def. matrix M with its cholesky decomposition U: M = U^T * U,...
Redistribution of full matrices and distributed arrays.
subroutine, public cp_fm_permute(fm_out, fm_in, beta, nrow_secidx_in, ncol_secidx_in, nrow_secidx_out, ncol_secidx_out, reordering, row_offset, col_offset, first_index, last_index)
Add a permuted or restricted four-index tensor stored as a full matrix.
represent the structure of a full matrix
subroutine, public cp_fm_struct_create(fmstruct, para_env, context, nrow_global, ncol_global, nrow_block, ncol_block, descriptor, first_p_pos, local_leading_dimension, template_fmstruct, square_blocks, force_block)
allocates and initializes a full matrix structure
subroutine, public cp_fm_struct_release(fmstruct)
releases a full matrix structure
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_submatrix(fm, new_values, start_row, start_col, n_rows, n_cols, alpha, beta, transpose)
sets a submatrix of a full matrix fm(start_row:start_row+n_rows,start_col:start_col+n_cols) = alpha*o...
subroutine, public cp_fm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
creates a new full matrix with the given structure
subroutine, public cp_fm_get_submatrix(fm, target_m, start_row, start_col, n_rows, n_cols, transpose)
gets a submatrix of a full matrix op(target_m)(1:n_rows,1:n_cols) =fm(start_row:start_row+n_rows,...
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,...
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, zeff, stride, max_file_size_mb, zero_tails, silent, mpi_io)
...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_path_length
Collection of simple mathematical functions and subroutines.
subroutine, public diamat_all(a, eigval, dac)
Diagonalize the symmetric n by n matrix a using the LAPACK library. Only the upper triangle of matrix...
Interface to the message passing library MPI.
Types needed for MP2 calculations.
basic linear algebra operations for full matrixes
represent a simple array based list of the given type
Define the data structure for the particle information.
Definition of physical constants:
real(kind=dp), parameter, public evolt
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)
maps a given wavefunction on the grid
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, mimic, 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_pp, sab_xtb_nonbond, sab_almo, sab_kp, sab_kp_nosym, sab_cneo, 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, matrix_vhxc, 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, xcint_weights, 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, rhoz_cneo_set, ecoul_1c, rho0_s_rs, rho0_s_gs, rhoz_cneo_s_rs, rhoz_cneo_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, harris_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, eeq, rhs, do_rixs, tb_tblite)
Get the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
Definition and initialisation of the mo data type.
subroutine, public write_mo_set_to_output_unit(mo_set, qs_kind_set, particle_set, dft_section, before, kpoint, final_mos, spin, solver_method, rtp, cpart, sim_step, umo_set, qs_env, para_env_inter_kp)
Write MO information to output file (eigenvalues, occupation numbers, coefficients).
Definition and initialisation of the mo data type.
subroutine, public init_mo_set(mo_set, fm_pool, fm_ref, fm_struct, name, counter, complex_coeff)
initializes an allocated mo_set. eigenvalues, mo_coeff, occupation_numbers are valid only after this ...
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.
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)
...
Static Coulomb-hole screened-exchange (COHSEX) quasiparticle energies and MOs in the O(N^4) (RI_RPAGW...
subroutine, public static_cohsex_qp_energies(fm_mat_q, fm_mat_s_gw, fm_mat_s_gw_work, dimen_ri, nmo, homo, gw_corr_lev_occ, gw_corr_lev_virt, eigenval, mo_coeff, unit_nr, qs_env, mp2_env, eigenval_dg, eigenval_cn, u_qp_all)
Compute and print the diagonal (ϵ^DG) static COHSEX quasiparticle energies; with COHSEX QP_UPDATE als...
subroutine, public get_static_cohsex_mo_coeff(mo_coeff, u_qp, fm_qp_mo)
Canonical static COHSEX MO coefficients C^QP_μn = Σ_m C_μm U_mn.
subroutine, public rotate_bse_slab(fm_slab, dimen_ri, n_outer, n_inner, u_outer, u_inner)
Rotate an RI 3-center slab to the canonical static COHSEX MOs.
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
keeps the information about the structure of a full matrix
type of a logger, at the moment it contains just a print level starting at which level it should be l...
stores all the informations relevant to an mpi environment
represent a list of objects
contained for different pw related things
Manages a pool of grids (to be used for example as tmp objects), but can also be used to instantiate ...
Provides all information about a quickstep kind.