101#include "./base/base_uses.f90"
107 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'gw_tensor_large_cell_Gamma_static_cohsex'
124 CHARACTER(LEN=*),
PARAMETER :: routinen =
'gw_calc_tensor_large_cell_Gamma_static_cohsex'
127 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: fm_sigma_c_gamma, fm_sigma_x_gamma, &
130 CALL timeset(routinen, handle)
136 IF (bs_env%cohsex_scale_occ /= 1.0_dp .OR. bs_env%cohsex_scale_virt /= 1.0_dp)
THEN
140 IF (bs_env%Sigma_c_freq_zero_exists)
THEN
143 CALL read_sigma_c_freq_zero(bs_env, fm_sigma_c_gamma)
154 CALL get_w_mic_freq_zero(bs_env, qs_env, bs_env%mat_chi_Gamma_tau, fm_w_mic_freq_zero)
158 CALL get_sigma_c(bs_env, qs_env, fm_w_mic_freq_zero, fm_sigma_c_gamma)
171 CALL timestop(handle)
186 SUBROUTINE get_w_mic_freq_zero(bs_env, qs_env, mat_chi_Gamma_tau, fm_W_MIC_freq_zero)
189 TYPE(
dbcsr_p_type),
DIMENSION(:),
POINTER :: mat_chi_gamma_tau
190 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: fm_w_mic_freq_zero
192 CHARACTER(LEN=*),
PARAMETER :: routinen =
'get_W_MIC_freq_zero'
194 INTEGER :: handle, i_t, ikp, ikp_batch, ikp_in_batch
196 TYPE(
cp_cfm_type) :: cfm_m_inv_v_sqrt_ikp, cfm_v_sqrt_ikp
197 TYPE(
cp_cfm_type),
ALLOCATABLE,
DIMENSION(:) :: cfm_v_kp
199 CALL timeset(routinen, handle)
202 CALL dbcsr_set(bs_env%mat_RI_RI%matrix, 0.0_dp)
203 DO i_t = 1, bs_env%num_time_freq_points
204 CALL dbcsr_add(bs_env%mat_RI_RI%matrix, mat_chi_gamma_tau(i_t)%matrix, 1.0_dp, &
205 bs_env%time_frequency_grid%time_weights_at_zero_frequency(i_t))
210 ALLOCATE (fm_w_mic_freq_zero(1))
211 CALL cp_fm_create(fm_w_mic_freq_zero(1), bs_env%fm_RI_RI%matrix_struct)
214 DO ikp_batch = 1, bs_env%num_chi_eps_W_batches
221 DO ikp_in_batch = 1, bs_env%nkp_chi_eps_W_batch
223 ikp = (ikp_batch - 1)*bs_env%nkp_chi_eps_W_batch + ikp_in_batch
225 IF (ikp > bs_env%nkp_chi_eps_W_orig_plus_extra) cycle
228 cfm_v_sqrt_ikp, cfm_m_inv_v_sqrt_ikp, ikp)
230 CALL bs_env%para_env%sync()
236 cfm_m_inv_v_sqrt_ikp, cfm_v_sqrt_ikp)
242 DEALLOCATE (cfm_v_kp)
244 IF (bs_env%unit_nr > 0)
THEN
245 WRITE (bs_env%unit_nr,
'(T2,A,I10,A,I3,A,F10.1,A)') &
246 'Computed W(iω=0,k) for k-point batch', &
247 ikp_batch,
' /', bs_env%num_chi_eps_W_batches, &
253 IF (bs_env%approx_kp_extrapol)
THEN
263 IF (bs_env%unit_nr > 0)
WRITE (bs_env%unit_nr,
'(A)')
' '
265 CALL timestop(handle)
267 END SUBROUTINE get_w_mic_freq_zero
280 SUBROUTINE get_sigma_c(bs_env, qs_env, fm_W_MIC_freq_zero, fm_Sigma_c_Gamma)
283 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: fm_w_mic_freq_zero, fm_sigma_c_gamma
285 CHARACTER(LEN=*),
PARAMETER :: routinen =
'get_Sigma_c'
287 INTEGER :: handle, ispin
289 TYPE(
dbcsr_p_type),
DIMENSION(:, :),
POINTER :: mat_sigma_neg, mat_sigma_pos
290 TYPE(dbt_type) :: t_2c_gocc, t_2c_gvir, t_2c_sigma_neg, &
291 t_2c_sigma_pos, t_2c_w, t_3c_x_w
293 CALL timeset(routinen, handle)
296 t_2c_sigma_pos, t_3c_x_w, mat_sigma_neg, mat_sigma_pos)
298 ALLOCATE (fm_sigma_c_gamma(bs_env%n_spin))
299 DO ispin = 1, bs_env%n_spin
305 t_2c_gocc, t_2c_gvir, t_2c_w, t_2c_sigma_neg, &
306 t_2c_sigma_pos, t_3c_x_w, mat_sigma_neg(1, ispin)%matrix, &
307 mat_sigma_pos(1, ispin)%matrix, count_skipped=.false.)
310 CALL cp_fm_create(fm_sigma_c_gamma(ispin), bs_env%fm_s_Gamma%matrix_struct)
311 CALL copy_dbcsr_to_fm(mat_sigma_neg(1, ispin)%matrix, fm_sigma_c_gamma(ispin))
318 CALL fm_write(fm_sigma_c_gamma(ispin), ispin, bs_env%Sigma_c_freq_zero_name, qs_env)
320 IF (bs_env%unit_nr > 0)
THEN
321 WRITE (bs_env%unit_nr,
'(T2,A,T55,A,F10.1,A)') &
322 'Computed Σ^c(k=0),',
' Execution time',
m_walltime() - t1,
' s'
327 IF (bs_env%unit_nr > 0)
WRITE (bs_env%unit_nr,
'(A)')
' '
332 t_3c_x_w, fm_w_mic_freq_zero, mat_sigma_neg, mat_sigma_pos)
336 CALL timestop(handle)
338 END SUBROUTINE get_sigma_c
345 SUBROUTINE read_sigma_c_freq_zero(bs_env, fm_Sigma_c_Gamma)
347 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: fm_sigma_c_gamma
349 CHARACTER(LEN=*),
PARAMETER :: routinen =
'read_Sigma_c_freq_zero'
351 INTEGER :: handle, ispin
354 CALL timeset(routinen, handle)
356 ALLOCATE (fm_sigma_c_gamma(bs_env%n_spin))
357 DO ispin = 1, bs_env%n_spin
359 CALL cp_fm_create(fm_sigma_c_gamma(ispin), bs_env%fm_s_Gamma%matrix_struct)
360 CALL fm_read(fm_sigma_c_gamma(ispin), bs_env, bs_env%Sigma_c_freq_zero_name, ispin)
361 IF (bs_env%unit_nr > 0)
THEN
362 WRITE (bs_env%unit_nr,
'(T2,A,T55,A,F10.1,A)') &
363 'Read Σ^c(k=0) from file,',
' Execution time',
m_walltime() - t1,
' s'
367 IF (bs_env%unit_nr > 0)
WRITE (bs_env%unit_nr,
'(A)')
' '
369 CALL timestop(handle)
371 END SUBROUTINE read_sigma_c_freq_zero
384 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: fm_sigma_x_gamma, fm_sigma_c_gamma
386 CHARACTER(LEN=*),
PARAMETER :: routinen =
'compute_QP_energies'
388 INTEGER :: handle, ikp, ispin
389 TYPE(
cp_cfm_type) :: cfm_ks_ikp, cfm_mos_ikp, cfm_s_ikp, &
391 TYPE(
cp_fm_type) :: fm_sigma_c_ikp_mo, fm_sigma_x_ikp_mo, &
394 CALL timeset(routinen, handle)
396 CALL cp_cfm_create(cfm_mos_ikp, bs_env%fm_s_Gamma%matrix_struct)
397 CALL cp_cfm_create(cfm_work_ikp, bs_env%fm_s_Gamma%matrix_struct)
400 CALL cp_fm_create(fm_v_xc_ikp_mo, bs_env%fm_s_Gamma%matrix_struct)
401 CALL cp_fm_create(fm_sigma_x_ikp_mo, bs_env%fm_s_Gamma%matrix_struct)
402 CALL cp_fm_create(fm_sigma_c_ikp_mo, bs_env%fm_s_Gamma%matrix_struct)
404 DO ispin = 1, bs_env%n_spin
406 DO ikp = 1, bs_env%nkp_bs_and_DOS
410 ikp, qs_env, bs_env%kpoints_DOS,
"ORB")
414 ikp, qs_env, bs_env%kpoints_DOS,
"ORB")
418 bs_env%eigenval_scf(:, ikp, ispin), cfm_work_ikp)
424 ikp, qs_env, bs_env%kpoints_DOS,
"ORB")
430 ikp, qs_env, bs_env%kpoints_DOS,
"ORB")
436 ikp, qs_env, bs_env%kpoints_DOS,
"ORB")
441 CALL diagonalize_and_print(bs_env, qs_env, fm_sigma_x_ikp_mo, fm_v_xc_ikp_mo, &
442 fm_sigma_c_ikp_mo, ikp, ispin)
460 CALL timestop(handle)
476 SUBROUTINE diagonalize_and_print(bs_env, qs_env, fm_Sigma_x_ikp_mo, fm_V_xc_ikp_mo, &
477 fm_Sigma_c_ikp_mo, ikp, ispin)
481 TYPE(
cp_fm_type) :: fm_sigma_x_ikp_mo, fm_v_xc_ikp_mo, &
483 INTEGER :: ikp, ispin
485 CHARACTER(LEN=*),
PARAMETER :: routinen =
'diagonalize_and_print'
487 CHARACTER(len=3) :: occ_vir
488 CHARACTER(len=default_string_length) :: fname
489 INTEGER :: handle, i_col, i_row, ikp_for_print, &
490 iunit, j_col, j_row, m, n_mo, &
491 ncol_local, nrow_local
492 INTEGER,
DIMENSION(:),
POINTER :: col_indices, row_indices
493 LOGICAL :: is_bandstruc_kpoint, print_dos_kpoints, &
496 REAL(kind=
dp),
ALLOCATABLE,
DIMENSION(:) :: diag_sigma_c, diag_sigma_x, diag_sp, &
498 TYPE(
cp_fm_type) :: fm_sp_mat, sp_eigvec, sp_eigvec_ao
500 CALL timeset(routinen, handle)
506 CALL cp_fm_create(fm_sp_mat, bs_env%fm_s_Gamma%matrix_struct)
508 ALLOCATE (sp_eigval(n_mo))
509 sp_eigval(:) = 0.0_dp
517 CALL cp_fm_get_info(fm_sp_mat, nrow_local=nrow_local, ncol_local=ncol_local, &
518 row_indices=row_indices, col_indices=col_indices)
524 DO i_col = 1, ncol_local
525 DO i_row = 1, nrow_local
526 j_col = col_indices(i_col)
527 j_row = row_indices(i_row)
528 IF (j_row <= bs_env%n_occ(ispin) .AND. j_col <= bs_env%n_occ(ispin))
THEN
529 val = fm_sigma_x_ikp_mo%local_data(i_row, i_col) &
530 - fm_v_xc_ikp_mo%local_data(i_row, i_col) &
531 + bs_env%cohsex_scale_occ*fm_sigma_c_ikp_mo%local_data(i_row, i_col)
532 ELSE IF (j_row > bs_env%n_occ(ispin) .AND. j_col > bs_env%n_occ(ispin))
THEN
533 val = fm_sigma_x_ikp_mo%local_data(i_row, i_col) &
534 - fm_v_xc_ikp_mo%local_data(i_row, i_col) &
535 + bs_env%cohsex_scale_virt*fm_sigma_c_ikp_mo%local_data(i_row, i_col)
539 IF (j_row == j_col) val = val + bs_env%eigenval_scf(j_row, ikp, ispin)
540 fm_sp_mat%local_data(i_row, i_col) = val
546 ALLOCATE (diag_sp(n_mo), diag_sigma_c(n_mo), diag_sigma_x(n_mo), diag_v_xc(n_mo))
554 CALL cp_fm_create(sp_eigvec, bs_env%fm_s_Gamma%matrix_struct)
555 CALL cp_fm_create(sp_eigvec_ao, bs_env%fm_s_Gamma%matrix_struct)
556 CALL cp_fm_syevx(matrix=fm_sp_mat, eigenvectors=sp_eigvec, eigenvalues=sp_eigval)
557 IF (ikp == bs_env%nkp_bs_and_DOS)
THEN
558 CALL fm_write_formatted(sp_eigvec, 0,
"Singlepole_Eigenvector_Gamma", qs_env)
562 CALL parallel_gemm(transa=
"N", transb=
"N", m=n_mo, n=n_mo, k=n_mo, alpha=1.0_dp, &
563 matrix_a=bs_env%fm_mo_coeff_Gamma(ispin), matrix_b=sp_eigvec, &
564 beta=0.0_dp, matrix_c=sp_eigvec_ao)
567 sp_eigval(:) = diag_sp(:)
570 bs_env%eigenval_GW(:, ikp, ispin) = sp_eigval(:)
571 IF (
ALLOCATED(bs_env%eigenval_G0W0))
THEN
572 bs_env%eigenval_G0W0(:, ikp, ispin) = sp_eigval(:)
575 bs_env%eigenval_HF(m, ikp, ispin) = bs_env%eigenval_scf(m, ikp, ispin) + &
576 diag_sigma_x(m) - diag_v_xc(m)
581 print_dos_kpoints = (bs_env%nkp_only_bs <= 0)
582 is_bandstruc_kpoint = (ikp > bs_env%nkp_only_DOS)
583 print_ikp = print_dos_kpoints .OR. is_bandstruc_kpoint
586 IF (bs_env%para_env%is_source() .AND. print_ikp)
THEN
588 IF (print_dos_kpoints)
THEN
591 ikp_for_print = ikp - bs_env%nkp_only_DOS
594 fname =
"Quasiparticle_energies_singlepole"
595 IF (ikp_for_print == 1 .AND. ispin == 1)
THEN
596 CALL open_file(trim(fname), unit_number=iunit, file_status=
"REPLACE", file_action=
"WRITE")
598 CALL open_file(trim(fname), unit_number=iunit, file_status=
"OLD", file_action=
"WRITE", &
599 file_position=
"APPEND")
602 WRITE (iunit,
"(A)")
" "
603 WRITE (iunit,
"(A10,I7,A25,3F10.4)")
"kpoint: ", ikp_for_print,
"coordinate: ", &
604 bs_env%kpoints_DOS%xkp(:, ikp)
605 WRITE (iunit,
"(A)")
" "
607 WRITE (iunit,
"(A5,A24,2A17,A16,A18,A18)")
"n",
"ϵ_nk^DFT (eV)",
"Σ^c_nk (eV)", &
608 "Σ^x_nk (eV)",
"v_nk^xc (eV)",
"ϵ_nk^DG (eV)",
"ϵ_nk^CN (eV)"
610 WRITE (iunit,
"(A5,A24,2A17,A16,A18)")
"n",
"ϵ_nk^DFT (eV)",
"Σ^c_nk (eV)", &
611 "Σ^x_nk (eV)",
"v_nk^xc (eV)",
"ϵ_nk^DG (eV)"
613 WRITE (iunit,
"(A)")
" "
616 IF (m <= bs_env%n_occ(ispin)) occ_vir =
'occ'
617 IF (m > bs_env%n_occ(ispin)) occ_vir =
'vir'
619 WRITE (iunit,
"(I5,3A,4F16.3,F17.3,F17.3)") m,
' (', occ_vir,
') ', &
620 bs_env%eigenval_scf(m, ikp, ispin)*
evolt, &
621 diag_sigma_c(m)*
evolt, &
622 diag_sigma_x(m)*
evolt, &
623 diag_v_xc(m)*
evolt, &
627 WRITE (iunit,
"(I5,3A,4F16.3,F17.3)") m,
' (', occ_vir,
') ', &
628 bs_env%eigenval_scf(m, ikp, ispin)*
evolt, &
629 diag_sigma_c(m)*
evolt, &
630 diag_sigma_x(m)*
evolt, &
631 diag_v_xc(m)*
evolt, &
636 WRITE (iunit,
"(A)")
" "
645 CALL print_static_cohsex_mos(bs_env, qs_env, sp_eigvec_ao, sp_eigval, ispin)
652 DEALLOCATE (sp_eigval, diag_sp, diag_sigma_c, diag_sigma_x, diag_v_xc)
654 CALL timestop(handle)
656 END SUBROUTINE diagonalize_and_print
667 SUBROUTINE print_static_cohsex_mos(bs_env, qs_env, fm_qp_mo_ao, qp_eigval, ispin)
671 REAL(kind=
dp),
DIMENSION(:) :: qp_eigval
674 CHARACTER(LEN=*),
PARAMETER :: routinen =
'print_static_cohsex_mos'
676 CHARACTER(LEN=5) :: spin_label
677 CHARACTER(LEN=default_path_length) :: fname, title
678 INTEGER :: first_mo, handle, ivector, last_mo, &
679 n_mo, nelectron, nhomo, nlumo, unit_nr
680 INTEGER,
DIMENSION(:),
POINTER :: stride
681 LOGICAL :: print_coeff, print_cubes, &
682 print_energies, print_mo, print_occ
683 REAL(kind=
dp) :: maxocc
695 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
699 CALL timeset(routinen, handle)
715 IF (print_mo .AND. (print_energies .OR. print_occ .OR. print_coeff))
THEN
718 IF (bs_env%n_spin == 1)
THEN
723 nelectron = nint(maxocc*real(bs_env%n_occ(ispin), kind=
dp))
725 CALL allocate_mo_set(qp_mo_set, nao=n_mo, nmo=n_mo, nelectron=nelectron, &
726 n_el_f=real(nelectron, kind=
dp), maxocc=maxocc, &
727 flexible_electron_count=0.0_dp)
728 CALL init_mo_set(qp_mo_set, fm_struct=fm_qp_mo_ao%matrix_struct, name=
"static_cohsex")
729 qp_mo_set%eigenvalues(:) = qp_eigval(:)
732 CALL get_qs_env(qs_env, particle_set=particle_set, qs_kind_set=qs_kind_set)
734 IF (bs_env%n_spin == 1)
THEN
736 4, 0, final_mos=.true.)
744 4, 0, final_mos=.true., spin=trim(spin_label))
755 IF (print_cubes)
THEN
760 IF (nhomo == -1) nhomo = bs_env%n_occ(ispin)
761 IF (nlumo == -1) nlumo = n_mo - bs_env%n_occ(ispin)
762 first_mo = max(1, bs_env%n_occ(ispin) - nhomo + 1)
763 last_mo = min(n_mo, bs_env%n_occ(ispin) + nlumo)
766 atomic_kind_set=atomic_kind_set, &
767 qs_kind_set=qs_kind_set, &
769 dft_control=dft_control, &
770 particle_set=particle_set, &
775 CALL pw_env_get(pw_env, auxbas_pw_pool=auxbas_pw_pool)
776 CALL auxbas_pw_pool%create_pw(wf_r)
777 CALL auxbas_pw_pool%create_pw(wf_g)
779 DO ivector = first_mo, last_mo
781 qs_kind_set, cell, dft_control, particle_set, pw_env)
783 WRITE (fname,
'(A,I5.5,A,I1)')
"static_cohsex_WFN_", ivector,
"_", ispin
785 extension=
".cube", middle_name=trim(fname), &
786 file_position=
"REWIND", log_filename=.false.)
787 WRITE (title, *)
"static COHSEX WAVEFUNCTION ", ivector,
" spin ", ispin, &
788 " i.e. HOMO ", ivector - bs_env%n_occ(ispin)
789 CALL cp_pw_to_cube(wf_r, unit_nr, title, particles, stride=stride)
793 CALL auxbas_pw_pool%give_back_pw(wf_r)
794 CALL auxbas_pw_pool%give_back_pw(wf_g)
797 CALL timestop(handle)
799 END SUBROUTINE print_static_cohsex_mos
808 SUBROUTINE fm_write_formatted(fm, matrix_index, matrix_name, qs_env)
810 INTEGER :: matrix_index
811 CHARACTER(LEN=*) :: matrix_name
814 CHARACTER(LEN=*),
PARAMETER :: key =
'PROPERTIES%BANDSTRUCTURE%GW%PRINT%RESTART', &
815 routinen =
'fm_write_formatted'
817 CHARACTER(LEN=default_string_length) :: filename
818 INTEGER :: handle, unit_nr
822 CALL timeset(routinen, handle)
830 IF (matrix_index < 10)
THEN
831 WRITE (filename,
'(3A,I1)')
"RESTART_", matrix_name,
"_0", matrix_index
832 ELSE IF (matrix_index < 100)
THEN
833 WRITE (filename,
'(3A,I2)')
"RESTART_", matrix_name,
"_", matrix_index
835 cpabort(
'Please implement more than 99 time/frequency points.')
839 file_form=
"FORMATTED", middle_name=trim(filename), &
840 file_position=
"REWIND", file_action=
"WRITE")
843 IF (unit_nr > 0)
THEN
848 CALL timestop(handle)
850 END SUBROUTINE fm_write_formatted
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.
used for collecting diagonalization schemes available for cp_cfm_type
subroutine, public cp_cfm_geeig(amatrix, bmatrix, eigenvectors, eigenvalues, work, lowest_subset)
General Eigenvalue Problem AX = BXE Single option version: Cholesky decomposition of B.
Represents a complex full matrix distributed on many processors.
subroutine, public cp_cfm_release(matrix)
Releases a full matrix.
subroutine, public cp_cfm_create(matrix, matrix_struct, name, nrow, ncol, set_zero)
Creates a new full matrix with the given structure.
subroutine, public cp_cfm_to_fm(msource, mtargetr, mtargeti)
Copy real and imaginary parts of a complex full matrix into separate real-value full matrices.
Defines control structures, which contain the parameters and the settings for the DFT-based calculati...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
DBCSR operations in CP2K.
subroutine, public copy_dbcsr_to_fm(matrix, fm, plan, check_plan)
Copy a DBCSR matrix to a BLACS matrix.
Utility routines to open and close files.
subroutine, public open_file(file_name, unit_number, file_status, file_form, file_action, file_position, file_pad, file_access, debug)
Opens a file and returns its logical unit number.
subroutine, public close_file(unit_number, file_status)
Closes an open file given by its logical unit number.
Basic linear algebra operations for full matrices.
subroutine, public cp_fm_transpose(matrix, matrixt)
transposes a matrix matrixt = matrix ^ T
subroutine, public cp_fm_scale_and_add(alpha, matrix_a, beta, matrix_b)
calc A <- alpha*A + beta*B optimized for alpha == 1.0 (just add beta*B) and beta == 0....
used for collecting some of the diagonalization schemes available for cp_fm_type. cp_fm_power also mo...
subroutine, public cp_fm_syevx(matrix, eigenvectors, eigenvalues, neig, work_syevx)
compute eigenvalues and optionally eigenvectors of a real symmetric matrix using scalapack....
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_get_diag(matrix, diag, n_active)
returns the diagonal elements of a fm
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, nrow, ncol, set_zero)
creates a new full matrix with the given structure
subroutine, public cp_fm_write_formatted(fm, unit, header, value_format)
Write out a full matrix in plain text.
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, 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, zeff, stride, max_file_size_mb, zero_tails, silent, mpi_io)
...
This is the start of a dbt_api, all publically needed functions are exported here....
Coulomb matrices and screened interactions for imaginary-time GW.
subroutine, public fm_write(fm, matrix_index, matrix_name, qs_env, matrix)
Write a GW restart matrix when requested by the print key.
subroutine, public compute_minvvsqrt_vsqrt(bs_env, qs_env, cfm_v_kp, cfm_v_sqrt_ikp, cfm_m_inv_v_sqrt_ikp, ikp)
...
subroutine, public compute_fm_w_mic_freq_j_from_chi(bs_env, qs_env, fm_w_mic_freq_j, j_w, ikp, cfm_m_inv_v_sqrt_ikp, cfm_v_sqrt_ikp)
W_PQ^MIC(iω_j) from χ_PQ(iω_j,k=0) in bs_envfm_chi_Gamma_freq.
subroutine, public fm_read(fm, bs_env, mat_name, idx)
...
subroutine, public compute_v_k_by_lattice_sum(bs_env, qs_env, cfm_v_kp, ikp_batch)
...
subroutine, public apply_extrapol_factor(bs_env, fm_w_mic_time)
...
Static COHSEX band structure in the tensor-based large-cell Gamma GW code: COHSEX DIAGONAL (diagonal ...
subroutine, public gw_calc_tensor_large_cell_gamma_static_cohsex(qs_env, bs_env)
Perform static COHSEX band structure calculation.
Routines from paper [Graml2024].
subroutine, public compute_sigma_c_occ_vir(bs_env, qs_env, tau, ispin, fm_w, t_2c_gocc, t_2c_gvir, t_2c_w, t_2c_sigma_neg, t_2c_sigma_pos, t_3c_x_w, mat_sigma_neg, mat_sigma_pos, count_skipped)
...
subroutine, public get_mat_chi_gamma_tau(bs_env, qs_env, mat_chi_gamma_tau)
...
subroutine, public get_sigma_x(bs_env, qs_env, fm_sigma_x_gamma)
...
subroutine, public create_mat_for_sigma_c(bs_env, t_2c_gocc, t_2c_gvir, t_2c_w, t_2c_sigma_neg_tau, t_2c_sigma_pos_tau, t_3c_x_w, mat_sigma_neg_tau, mat_sigma_pos_tau)
...
subroutine, public compute_qp_energies(bs_env, qs_env, fm_sigma_x_gamma, fm_sigma_c_gamma_time)
...
subroutine, public delete_unnecessary_files(bs_env)
...
subroutine, public destroy_mat_sigma_c(t_2c_gocc, t_2c_gvir, t_2c_w, t_2c_sigma_neg_tau, t_2c_sigma_pos_tau, t_3c_x_w, fm_w_mic_time, mat_sigma_neg_tau, mat_sigma_pos_tau)
...
subroutine, public print_skipping(bs_env)
...
Full-matrix operations not provided by the CP2K FM packages.
subroutine, public cfm_contract_aba(matrix_a, matrix_b, matrix_c, workspace)
Computes A^H B A for complex full matrices.
subroutine, public de_init_bs_env(qs_env, bs_env)
Releases the memory-heavy GW intermediates that cannot be freed in bs_env_release,...
Defines the basic variable types.
integer, parameter, public dp
integer, parameter, public default_string_length
integer, parameter, public default_path_length
Machine interface based on Fortran 2003 and POSIX.
real(kind=dp) function, public m_walltime()
returns time from a real-time clock, protected against rolling early/easily
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
subroutine, public cfm_ikp_from_fm_gamma(cfm_ikp, fm_gamma, ikp, qs_env, kpoints, basis_type)
Reconstruct a k-point operator from a real Gamma matrix using one MIC phase.
subroutine, public get_all_vbm_cbm_bandgaps(bs_env)
...
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)
...
Provides all information about an atomic kind.
Type defining parameters related to the simulation cell.
Represent a complex full matrix.
type of a logger, at the moment it contains just a print level starting at which level it should be l...
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.