72#include "./base/base_uses.f90"
79 CHARACTER(len=*),
PARAMETER,
PRIVATE :: moduleN =
'qs_dcdr'
93 CHARACTER(LEN=*),
PARAMETER :: routinen =
'prepare_per_atom'
95 INTEGER :: handle, i, ispin, j, natom
101 CALL timeset(routinen, handle)
103 NULLIFY (sab_all, qs_kind_set, particle_set)
106 qs_kind_set=qs_kind_set, &
107 particle_set=particle_set)
109 natom =
SIZE(particle_set)
110 IF (dcdr_env%distributed_origin) dcdr_env%ref_point(:) = particle_set(dcdr_env%lambda)%r(:)
112 dcdr_env%delta_basis_function = 0._dp
113 dcdr_env%delta_basis_function(:, dcdr_env%lambda) = 1._dp
129 CALL dbcsr_set(dcdr_env%matrix_nosym_temp(i)%matrix, 0._dp)
130 CALL dbcsr_desymmetrize(dcdr_env%matrix_s(1 + i)%matrix, dcdr_env%matrix_s1(1 + i)%matrix)
131 CALL dbcsr_desymmetrize(dcdr_env%matrix_s(1 + i)%matrix, dcdr_env%matrix_nosym_temp(i)%matrix)
134 sab_all, dcdr_env%lambda, direction_or=.true.)
136 sab_all, dcdr_env%lambda, direction_or=.false.)
138 CALL dbcsr_add(dcdr_env%matrix_s1(1 + i)%matrix, dcdr_env%matrix_nosym_temp(i)%matrix, -1._dp, +1._dp)
139 CALL dbcsr_set(dcdr_env%matrix_nosym_temp(i)%matrix, 0._dp)
142 CALL dbcsr_set(dcdr_env%matrix_nosym_temp(i)%matrix, 0._dp)
143 CALL dbcsr_desymmetrize(dcdr_env%matrix_t(1 + i)%matrix, dcdr_env%matrix_t1(1 + i)%matrix)
144 CALL dbcsr_desymmetrize(dcdr_env%matrix_t(1 + i)%matrix, dcdr_env%matrix_nosym_temp(i)%matrix)
147 sab_all, dcdr_env%lambda, direction_or=.true.)
149 sab_all, dcdr_env%lambda, direction_or=.false.)
151 CALL dbcsr_add(dcdr_env%matrix_t1(1 + i)%matrix, dcdr_env%matrix_nosym_temp(i)%matrix, -1._dp, +1._dp)
152 CALL dbcsr_set(dcdr_env%matrix_nosym_temp(i)%matrix, 0._dp)
156 DO ispin = 1, dcdr_env%nspins
158 CALL dbcsr_set(dcdr_env%matrix_ppnl_1(i)%matrix, 0.0_dp)
159 CALL dbcsr_set(dcdr_env%matrix_hc(i)%matrix, 0.0_dp)
160 CALL dbcsr_set(dcdr_env%matrix_vhxc_perturbed_basis(ispin, i)%matrix, 0.0_dp)
161 CALL dbcsr_set(dcdr_env%matrix_vhxc_perturbed_basis(ispin, i + 3)%matrix, 0.0_dp)
162 CALL dbcsr_set(dcdr_env%matrix_d_vhxc_dR(i, ispin)%matrix, 0.0_dp)
163 CALL dbcsr_set(dcdr_env%matrix_core_charge_1(i)%matrix, 0.0_dp)
175 CALL dbcsr_set(dcdr_env%matrix_difdip(i, j)%matrix, 0._dp)
179 CALL dipole_deriv_ao(qs_env, dcdr_env%matrix_difdip, dcdr_env%delta_basis_function, 1, dcdr_env%ref_point)
181 CALL timestop(handle)
198 CHARACTER(LEN=*),
PARAMETER :: routinen =
'dcdr_build_op_dR'
199 REAL(kind=
dp),
PARAMETER :: one = 1.0_dp, zero = 0.0_dp
201 INTEGER :: handle, ispin, nao, nmo
205 CALL timeset(routinen, handle)
212 ALLOCATE (opdr_sym(1)%matrix)
213 CALL dbcsr_copy(opdr_sym(1)%matrix, dcdr_env%matrix_s1(1)%matrix)
214 CALL dbcsr_set(opdr_sym(1)%matrix, 0.0_dp)
216 DO ispin = 1, dcdr_env%nspins
217 nmo = dcdr_env%nmo(ispin)
221 CALL dbcsr_add(opdr_sym(1)%matrix, dcdr_env%matrix_core_charge_1(dcdr_env%beta)%matrix, zero, one)
222 CALL dbcsr_add(opdr_sym(1)%matrix, dcdr_env%matrix_d_vhxc_dR(dcdr_env%beta, ispin)%matrix, one, one)
223 CALL dbcsr_add(opdr_sym(1)%matrix, dcdr_env%matrix_vhxc_perturbed_basis(ispin, dcdr_env%beta)%matrix, one, one)
226 CALL dbcsr_add(opdr_sym(1)%matrix, dcdr_env%matrix_hc(dcdr_env%beta)%matrix, one, one)
227 CALL dbcsr_add(opdr_sym(1)%matrix, dcdr_env%matrix_ppnl_1(dcdr_env%beta)%matrix, one, one)
228 CALL dbcsr_add(opdr_sym(1)%matrix, dcdr_env%matrix_apply_op_constant(ispin)%matrix, one, one)
231 CALL dbcsr_add(dcdr_env%hamiltonian1(1)%matrix, dcdr_env%matrix_t1(dcdr_env%beta + 1)%matrix, one, one)
234 dcdr_env%op_dR(ispin), ncol=nmo)
238 CALL cp_fm_create(buf, dcdr_env%likemos_fm_struct(ispin)%struct)
240 -1.0_dp, dcdr_env%mo_coeff(ispin), dcdr_env%chc(ispin), &
244 nmo, alpha=1.0_dp, beta=1.0_dp)
250 IF (dcdr_env%z_matrix_method)
THEN
251 CALL cp_fm_to_fm(dcdr_env%op_dR(ispin), dcdr_env%matrix_m_alpha(dcdr_env%beta, ispin))
258 CALL timestop(handle)
274 CHARACTER(LEN=*),
PARAMETER :: routinen =
'dcdr_response_dR'
276 INTEGER :: handle, ispin, output_unit
277 LOGICAL :: should_stop
278 TYPE(
cp_fm_type),
ALLOCATABLE,
DIMENSION(:) :: h1_psi0, psi0_order, psi1
285 CALL timeset(routinen, handle)
286 NULLIFY (linres_control, lr_section, logger)
289 linres_control=linres_control, &
296 extension=
".linresLog")
297 IF (output_unit > 0)
THEN
298 WRITE (unit=output_unit, fmt=
"(T10,A,/)") &
299 "*** Self consistent optimization of the response wavefunction ***"
303 ALLOCATE (psi0_order(dcdr_env%nspins))
304 ALLOCATE (psi1(dcdr_env%nspins))
305 ALLOCATE (h1_psi0(dcdr_env%nspins))
307 DO ispin = 1, dcdr_env%nspins
308 CALL cp_fm_create(psi1(ispin), dcdr_env%likemos_fm_struct(ispin)%struct)
309 CALL cp_fm_create(h1_psi0(ispin), dcdr_env%likemos_fm_struct(ispin)%struct)
310 CALL get_mo_set(mo_set=mos(ispin), mo_coeff=mo_coeff)
311 psi0_order(ispin) = mo_coeff
315 IF (linres_control%linres_restart)
THEN
316 CALL dcdr_read_restart(qs_env, lr_section, psi1, dcdr_env%lambda, dcdr_env%beta,
"dCdR")
318 DO ispin = 1, dcdr_env%nspins
323 IF (output_unit > 0)
THEN
324 WRITE (output_unit,
"(T10,A,I4,A)") &
325 "Response to the perturbation operator referring to atom ", dcdr_env%lambda, &
326 " displaced in "//achar(dcdr_env%beta + 119)
328 DO ispin = 1, dcdr_env%nspins
330 CALL cp_fm_to_fm(dcdr_env%op_dR(ispin), h1_psi0(ispin))
333 linres_control%lr_triplet = .false.
334 linres_control%do_kernel = .true.
335 linres_control%converged = .false.
342 CALL linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, &
343 output_unit, should_stop)
344 DO ispin = 1, dcdr_env%nspins
349 IF (linres_control%linres_restart)
THEN
350 CALL dcdr_write_restart(qs_env, lr_section, psi1, dcdr_env%lambda, dcdr_env%beta,
"dCdR")
354 DO ispin = 1, dcdr_env%nspins
358 DEALLOCATE (psi1, h1_psi0, psi0_order)
360 "PRINT%PROGRAM_RUN_INFO")
362 CALL timestop(handle)
379 CHARACTER(LEN=*),
PARAMETER :: routinen =
'apt_dR'
381 INTEGER :: alpha, handle, ikind, ispin, nao, nmo
383 REAL(
dp) :: apt_basis_derivative, &
384 apt_coeff_derivative, charge, f_spin, &
386 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: apt_el, apt_nuc
387 TYPE(
cp_fm_type) :: overlap1_mo, tmp_fm_like_mos
388 TYPE(
cp_fm_type),
DIMENSION(:, :),
POINTER :: dberry_psi0, psi1_dberry
392 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
394 apt_basis_derivative = 0._dp
395 apt_coeff_derivative = 0._dp
397 CALL timeset(routinen, handle)
399 NULLIFY (qs_kind_set, particle_set)
401 qs_kind_set=qs_kind_set, &
402 particle_set=particle_set)
405 apt_el => dcdr_env%apt_el_dcdr
406 apt_nuc => dcdr_env%apt_nuc_dcdr
408 f_spin = 2._dp/dcdr_env%nspins
410 DO ispin = 1, dcdr_env%nspins
412 CALL cp_fm_create(tmp_fm_like_mos, dcdr_env%likemos_fm_struct(ispin)%struct)
413 CALL cp_fm_create(overlap1_mo, dcdr_env%momo_fm_struct(ispin)%struct)
414 nmo = dcdr_env%nmo(ispin)
415 mo_coeff => dcdr_env%mo_coeff(ispin)
419 tmp_fm_like_mos, ncol=nmo)
421 1.0_dp, mo_coeff, tmp_fm_like_mos, &
428 -0.5_dp, mo_coeff, overlap1_mo, &
429 -1.0_dp, dcdr_env%dCR_prime(ispin))
433 IF (.NOT. dcdr_env%z_matrix_method)
THEN
437 CALL dbcsr_desymmetrize(dcdr_env%matrix_s1(1)%matrix, dcdr_env%matrix_nosym_temp(1)%matrix)
438 CALL dbcsr_desymmetrize(dcdr_env%moments(alpha)%matrix, dcdr_env%matrix_nosym_temp(2)%matrix)
439 CALL dbcsr_add(dcdr_env%matrix_nosym_temp(1)%matrix, dcdr_env%matrix_nosym_temp(2)%matrix, &
440 -dcdr_env%ref_point(alpha), 1._dp)
443 tmp_fm_like_mos, ncol=nmo)
444 CALL cp_fm_trace(mo_coeff, tmp_fm_like_mos, apt_coeff_derivative)
446 apt_coeff_derivative = (-2._dp)*f_spin*apt_coeff_derivative
447 apt_el(dcdr_env%beta, alpha, dcdr_env%lambda) &
448 = apt_el(dcdr_env%beta, alpha, dcdr_env%lambda) + apt_coeff_derivative
450 CALL get_qs_env(qs_env=qs_env, polar_env=polar_env)
451 CALL get_polar_env(polar_env=polar_env, psi1_dberry=psi1_dberry, &
452 dberry_psi0=dberry_psi0)
458 dcdr_env%dCR_prime(ispin), &
461 CALL cp_fm_trace(dcdr_env%matrix_m_alpha(dcdr_env%beta, ispin), &
462 psi1_dberry(alpha, ispin), &
465 apt_coeff_derivative = temp1 - temp2
471 apt_coeff_derivative = (-2._dp)*f_spin*apt_coeff_derivative
472 apt_el(dcdr_env%beta, alpha, dcdr_env%lambda) &
473 = apt_el(dcdr_env%beta, alpha, dcdr_env%lambda) + apt_coeff_derivative
482 tmp_fm_like_mos, ncol=nmo)
483 CALL cp_fm_trace(mo_coeff, tmp_fm_like_mos, apt_basis_derivative)
486 apt_basis_derivative = -f_spin*apt_basis_derivative
487 apt_el(dcdr_env%beta, alpha, dcdr_env%lambda) = &
488 apt_el(dcdr_env%beta, alpha, dcdr_env%lambda) + apt_basis_derivative
496 CALL get_atomic_kind(particle_set(dcdr_env%lambda)%atomic_kind, kind_number=ikind)
497 CALL get_qs_kind(qs_kind_set(ikind), core_charge=charge, ghost=ghost)
498 IF (.NOT. ghost)
THEN
499 apt_nuc(dcdr_env%beta, dcdr_env%beta, dcdr_env%lambda) = &
500 apt_nuc(dcdr_env%beta, dcdr_env%beta, dcdr_env%lambda) + charge
507 CALL timestop(handle)
522 CHARACTER(LEN=*),
PARAMETER :: routinen =
'apt_dR_localization'
524 INTEGER :: alpha, handle, i, icenter, ikind, ispin, &
525 map_atom, map_molecule, &
526 max_nbr_center, nao, natom, nmo, &
528 INTEGER,
ALLOCATABLE,
DIMENSION(:) :: mapping_atom_molecule
529 INTEGER,
ALLOCATABLE,
DIMENSION(:, :) :: mapping_wannier_atom
531 REAL(
dp) :: apt_basis_derivative, &
532 apt_coeff_derivative, charge, f_spin, &
533 smallest_r, this_factor, tmp_aptcontr, &
535 REAL(
dp),
ALLOCATABLE,
DIMENSION(:) :: diagonal_elements, diagonal_elements2
536 REAL(
dp),
DIMENSION(3) :: distance, r_shifted
537 REAL(
dp),
DIMENSION(:, :, :),
POINTER :: apt_el, apt_nuc
538 REAL(
dp),
DIMENSION(:, :, :, :),
POINTER :: apt_center, apt_subset
541 TYPE(
cp_fm_type),
DIMENSION(:, :),
POINTER :: dberry_psi0, psi1_dberry
542 TYPE(
cp_fm_type),
POINTER :: mo_coeff, overlap1_mo, tmp_fm, &
543 tmp_fm_like_mos, tmp_fm_momo, &
548 TYPE(
qs_kind_type),
DIMENSION(:),
POINTER :: qs_kind_set
550 CALL timeset(routinen, handle)
552 NULLIFY (qs_kind_set, particle_set, molecule_set, cell)
555 qs_kind_set=qs_kind_set, &
556 particle_set=particle_set, &
557 molecule_set=molecule_set, &
560 nsubset =
SIZE(molecule_set)
561 natom =
SIZE(particle_set)
562 apt_el => dcdr_env%apt_el_dcdr
563 apt_nuc => dcdr_env%apt_nuc_dcdr
564 apt_subset => dcdr_env%apt_el_dcdr_per_subset
565 apt_center => dcdr_env%apt_el_dcdr_per_center
568 IF (dcdr_env%nspins == 1)
THEN
569 max_nbr_center = dcdr_env%nbr_center(1)
571 max_nbr_center = max(dcdr_env%nbr_center(1), dcdr_env%nbr_center(2))
573 ALLOCATE (mapping_wannier_atom(max_nbr_center, dcdr_env%nspins))
574 ALLOCATE (mapping_atom_molecule(natom))
575 centers_set => dcdr_env%centers_set
577 DO ispin = 1, dcdr_env%nspins
578 DO icenter = 1, dcdr_env%nbr_center(ispin)
584 smallest_r = huge(0._dp)
586 distance =
pbc(r_shifted, particle_set(i)%r(1:3), cell)
587 tmp_r = sum(distance**2)
588 IF (tmp_r < smallest_r)
THEN
589 mapping_wannier_atom(icenter, ispin) = i
597 IF (dcdr_env%lambda == 1 .AND. dcdr_env%beta == 1)
THEN
598 DO icenter = 1, dcdr_env%nbr_center(ispin)
599 map_atom = mapping_wannier_atom(icenter, ispin)
600 map_molecule = mapping_atom_molecule(map_atom)
606 f_spin = 2._dp/dcdr_env%nspins
608 DO ispin = 1, dcdr_env%nspins
611 ALLOCATE (tmp_fm_like_mos)
612 ALLOCATE (overlap1_mo)
613 CALL cp_fm_create(tmp_fm_like_mos, dcdr_env%likemos_fm_struct(ispin)%struct)
614 CALL cp_fm_create(overlap1_mo, dcdr_env%momo_fm_struct(ispin)%struct)
615 nmo = dcdr_env%nmo(ispin)
616 mo_coeff => dcdr_env%mo_coeff(ispin)
620 tmp_fm_like_mos, ncol=nmo)
622 1.0_dp, mo_coeff, tmp_fm_like_mos, &
629 -0.5_dp, mo_coeff, overlap1_mo, &
630 -1.0_dp, dcdr_env%dCR_prime(ispin))
633 ALLOCATE (diagonal_elements(nmo))
634 ALLOCATE (diagonal_elements2(nmo))
638 ALLOCATE (tmp_fm_momo)
639 ALLOCATE (tmp_fm_momo2)
640 CALL cp_fm_create(tmp_fm, dcdr_env%likemos_fm_struct(ispin)%struct)
641 CALL cp_fm_create(tmp_fm_momo, dcdr_env%momo_fm_struct(ispin)%struct)
642 CALL cp_fm_create(tmp_fm_momo2, dcdr_env%momo_fm_struct(ispin)%struct)
645 this_factor = -2._dp*f_spin
647 IF (.NOT. dcdr_env%z_matrix_method)
THEN
649 DO icenter = 1, dcdr_env%nbr_center(ispin)
650 CALL dbcsr_set(dcdr_env%moments(alpha)%matrix, 0.0_dp)
652 ref_point=centers_set(ispin)%array(1:3, icenter))
654 mo_coeff=dcdr_env%dCR_prime(ispin), work=tmp_fm, nmo=nmo, &
660 1.0_dp, mo_coeff, tmp_fm_like_mos, &
665 CALL get_qs_env(qs_env=qs_env, polar_env=polar_env)
666 CALL get_polar_env(polar_env=polar_env, psi1_dberry=psi1_dberry, &
667 dberry_psi0=dberry_psi0)
670 1.0_dp, dcdr_env%dCR_prime(ispin), dberry_psi0(alpha, ispin), &
675 1.0_dp, dcdr_env%matrix_m_alpha(dcdr_env%beta, ispin), &
676 psi1_dberry(alpha, ispin), 0.0_dp, tmp_fm_momo2)
679 diagonal_elements(:) = diagonal_elements(:) - diagonal_elements2(:)
682 DO icenter = 1, dcdr_env%nbr_center(ispin)
683 map_atom = mapping_wannier_atom(icenter, ispin)
684 map_molecule = mapping_atom_molecule(map_atom)
685 tmp_aptcontr = this_factor*diagonal_elements(icenter)
687 apt_subset(dcdr_env%beta, alpha, dcdr_env%lambda, map_molecule) &
688 = apt_subset(dcdr_env%beta, alpha, dcdr_env%lambda, map_molecule) + tmp_aptcontr
690 apt_center(dcdr_env%beta, alpha, dcdr_env%lambda, icenter) &
691 = apt_center(dcdr_env%beta, alpha, dcdr_env%lambda, icenter) + tmp_aptcontr
694 apt_coeff_derivative = this_factor*sum(diagonal_elements)
695 apt_el(dcdr_env%beta, alpha, dcdr_env%lambda) &
696 = apt_el(dcdr_env%beta, alpha, dcdr_env%lambda) + apt_coeff_derivative
703 this_factor = -f_spin
705 DO icenter = 1, dcdr_env%nbr_center(ispin)
707 CALL dbcsr_set(dcdr_env%matrix_difdip(1, dcdr_env%beta)%matrix, 0._dp)
708 CALL dbcsr_set(dcdr_env%matrix_difdip(2, dcdr_env%beta)%matrix, 0._dp)
709 CALL dbcsr_set(dcdr_env%matrix_difdip(3, dcdr_env%beta)%matrix, 0._dp)
710 CALL dipole_deriv_ao(qs_env, dcdr_env%matrix_difdip, dcdr_env%delta_basis_function, &
711 1, centers_set(ispin)%array(1:3, icenter))
713 mo_coeff=mo_coeff, work=tmp_fm, nmo=nmo, &
719 1.0_dp, mo_coeff, tmp_fm_like_mos, &
723 DO icenter = 1, dcdr_env%nbr_center(ispin)
724 map_atom = mapping_wannier_atom(icenter, ispin)
725 map_molecule = mapping_atom_molecule(map_atom)
726 tmp_aptcontr = this_factor*diagonal_elements(icenter)
728 apt_subset(dcdr_env%beta, alpha, dcdr_env%lambda, map_molecule) &
729 = apt_subset(dcdr_env%beta, alpha, dcdr_env%lambda, map_molecule) + tmp_aptcontr
731 apt_center(dcdr_env%beta, alpha, dcdr_env%lambda, icenter) &
732 = apt_center(dcdr_env%beta, alpha, dcdr_env%lambda, icenter) + tmp_aptcontr
736 apt_basis_derivative = this_factor*sum(diagonal_elements)
738 apt_el(dcdr_env%beta, alpha, dcdr_env%lambda) &
739 = apt_el(dcdr_env%beta, alpha, dcdr_env%lambda) + apt_basis_derivative
742 DEALLOCATE (diagonal_elements)
743 DEALLOCATE (diagonal_elements2)
749 DEALLOCATE (overlap1_mo)
751 DEALLOCATE (tmp_fm_like_mos)
752 DEALLOCATE (tmp_fm_momo)
753 DEALLOCATE (tmp_fm_momo2)
757 CALL get_atomic_kind(particle_set(dcdr_env%lambda)%atomic_kind, kind_number=ikind)
758 CALL get_qs_kind(qs_kind_set(ikind), core_charge=charge, ghost=ghost)
759 IF (.NOT. ghost)
THEN
760 apt_nuc(dcdr_env%beta, dcdr_env%beta, dcdr_env%lambda) = &
761 apt_nuc(dcdr_env%beta, dcdr_env%beta, dcdr_env%lambda) + charge
763 map_molecule = mapping_atom_molecule(dcdr_env%lambda)
764 apt_subset(dcdr_env%beta, dcdr_env%beta, dcdr_env%lambda, map_molecule) &
765 = apt_subset(dcdr_env%beta, dcdr_env%beta, dcdr_env%lambda, map_molecule) + charge
770 CALL timestop(handle)
Define the atomic kind types and their sub types.
subroutine, public get_atomic_kind(atomic_kind, fist_potential, element_symbol, name, mass, kind_number, natom, atom_list, rcov, rvdw, z, qeff, apol, cpol, mm_radius, shell, shell_active, damping)
Get attributes of an atomic kind.
Handles all functions related to the CELL.
various utilities that regard array of different kinds: output, allocation,... maybe it is not a good...
subroutine, public dbcsr_desymmetrize(matrix_a, matrix_b)
...
subroutine, public dbcsr_copy(matrix_b, matrix_a, name, keep_sparsity, keep_imaginary)
...
subroutine, public dbcsr_set(matrix, alpha)
...
subroutine, public dbcsr_add(matrix_a, matrix_b, alpha_scalar, beta_scalar)
...
DBCSR operations in CP2K.
subroutine, public cp_dbcsr_sm_fm_multiply(matrix, fm_in, fm_out, ncol, alpha, beta)
multiply a dbcsr with a fm matrix
basic linear algebra operations for full matrices
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....
subroutine, public cp_fm_scale(alpha, matrix_a)
scales a matrix matrix_a = alpha * matrix_b
represent a full matrix distributed on many processors
subroutine, public cp_fm_get_diag(matrix, diag)
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, 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 ...
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,...
Defines the basic variable types.
integer, parameter, public dp
Define the data structure for the molecule information.
subroutine, public molecule_of_atom(molecule_set, atom_to_mol)
finds for each atom the molecule it belongs to
basic linear algebra operations for full matrixes
Define the data structure for the particle information.
Calculate the derivatives of the MO coefficients wrt nuclear coordinates.
subroutine, public core_dr(qs_env, dcdr_env)
Core Hamiltonian contributions to the operator (the pseudopotentials)
subroutine, public apply_op_constant_term(qs_env, dcdr_env, overlap1)
Build the perturbed density matrix correction depending on the overlap derivative.
subroutine, public hr_mult_by_delta_1d(matrix, qs_kind_set, basis_type, sab_nl, lambda, direction_or)
Enforce that one of the basis functions in < a | O | b > is centered on atom lambda.
subroutine, public vhxc_r_perturbed_basis_functions(qs_env, dcdr_env)
The derivatives of the basis functions over which the HXC potential is integrated,...
subroutine, public d_vhxc_dr(qs_env, dcdr_env)
The derivatives of the basis functions going into the HXC potential wrt nuclear positions.
subroutine, public d_core_charge_density_dr(qs_env, dcdr_env)
Calculate the derivative of the Hartree term due to the core charge density.
Calculate the derivatives of the MO coefficients wrt nuclear coordinates.
subroutine, public multiply_localization(ao_matrix, mo_coeff, work, nmo, icenter, res)
Multiply (ao_matrix @ mo_coeff) and store the column icenter in res.
subroutine, public dcdr_read_restart(qs_env, linres_section, vec, lambda, beta, tag)
Copied from linres_read_restart.
subroutine, public shift_wannier_into_cell(r, cell, r_shifted)
...
subroutine, public dcdr_write_restart(qs_env, linres_section, vec, lambda, beta, tag)
Copied from linres_write_restart.
Calculate the derivatives of the MO coefficients wrt nuclear coordinates.
subroutine, public prepare_per_atom(dcdr_env, qs_env)
Prepare the environment for a choice of lambda.
subroutine, public apt_dr_localization(qs_env, dcdr_env)
Calculate atomic polar tensor using the localized dipole operator.
subroutine, public apt_dr(qs_env, dcdr_env)
Calculate atomic polar tensor.
subroutine, public dcdr_response_dr(dcdr_env, p_env, qs_env)
Get the dC/dR by solving the Sternheimer equation, using the op_dR matrix.
subroutine, public dcdr_build_op_dr(dcdr_env, qs_env)
Build the operator for the position perturbation.
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_pp, 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, 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)
Get the QUICKSTEP environment.
Define the quickstep kind type and their sub types.
subroutine, public get_qs_kind(qs_kind, basis_set, basis_type, ncgf, nsgf, all_potential, tnadd_potential, gth_potential, sgp_potential, upf_potential, se_parameter, dftb_parameter, xtb_parameter, dftb3_param, zatom, zeff, elec_conf, mao, lmax_dftb, alpha_core_charge, ccore_charge, core_charge, core_charge_radius, paw_proj_set, paw_atom, hard_radius, hard0_radius, max_rad_local, covalent_radius, vdw_radius, gpw_type_forced, harmonics, max_iso_not0, max_s_harm, grid_atom, ngrid_ang, ngrid_rad, lmax_rho0, dft_plus_u_atom, l_of_dft_plus_u, n_of_dft_plus_u, u_minus_j, u_of_dft_plus_u, j_of_dft_plus_u, alpha_of_dft_plus_u, beta_of_dft_plus_u, j0_of_dft_plus_u, occupation_of_dft_plus_u, dispersion, bs_occupation, magnetization, no_optimize, addel, laddel, naddel, orbitals, max_scf, eps_scf, smear, u_ramping, u_minus_j_target, eps_u_ramping, init_u_ramping_each_scf, reltmat, ghost, floating, name, element_symbol, pao_basis_size, pao_model_file, pao_potentials, pao_descriptors, nelec)
Get attributes of an atomic kind.
localize wavefunctions linear response scf
subroutine, public linres_solver(p_env, qs_env, psi1, h1_psi0, psi0_order, iounit, should_stop)
scf loop to optimize the first order wavefunctions (psi1) given a perturbation as an operator applied...
Type definitiona for linear response calculations.
subroutine, public get_polar_env(polar_env, do_raman, do_periodic, dberry_psi0, polar, psi1_dberry, run_stopped)
...
Definition and initialisation of the mo data type.
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.
Calculates the moment integrals <a|r^m|b> and <a|r x d/dr|b>
subroutine, public build_local_moment_matrix(qs_env, moments, nmoments, ref_point, ref_points, basis_type)
...
subroutine, public dipole_deriv_ao(qs_env, difdip, deltar, order, rcc)
...
Define the neighbor list data types and the corresponding functionality.
basis types for the calculation of the perturbation of density theory.
Type defining parameters related to the simulation cell.
represent a pointer to a 2d array
type of a logger, at the moment it contains just a print level starting at which level it should be l...
Provides all information about a quickstep kind.
General settings for linear response calculations.
Represent a qs system that is perturbed. Can calculate the linear operator and the rhs of the system ...