CP2K 2.4 (Revision 12889)
Functions | Variables

qs_p_env_methods Namespace Reference

Utility functions for the perturbation calculations. More...

Functions

subroutine, public p_env_create (p_env, qs_env, kpp1_env, p1_option, psi0d, orthogonal_orbitals, linres_control, error)
 allocates and initializes the perturbation environment (no setup)
subroutine p_env_check_i_alloc (p_env, qs_env, error)
 checks that the intenal storage is allocated, and allocs it if needed
subroutine, public p_env_did_change (p_env, s_struct_changed, grid_changed, error)
 function to advise of changes either in the grids or in the the matrix structure (to update p_env's internal cache)
subroutine, public p_env_psi0_changed (p_env, qs_env, psi0, Hrho_psi0d, error)
 To be called after the value of psi0 has changed. Recalculates the quantities S_psi0 and m_epsilon.
subroutine, public p_op_l1 (p_env, qs_env, v, res, error)
 Evaluates Fv (S_mo)^-1 - Sv(epsilon) and stores it in res.
subroutine, public p_op_l1_spin (p_env, qs_env, spin, v, res, error)
 Evaluates Fv (S_mo)^-1 - Sv(epsilon) and stores it in res for a given spin.
subroutine, public p_op_l2 (p_env, qs_env, p1, res, alpha, beta, error)
 evaluates res = alpha kpp1(v)*psi0 + beta res with kpp1 evaluated with p=qs_envrhorho_ao, p1=p1
subroutine, public p_preortho (p_env, qs_env, v, n_cols, error)
 does a preorthogonalization of the given matrix: v = (I-PS)v
subroutine, public p_postortho (p_env, qs_env, v, n_cols, error)
 does a postorthogonalization on the given matrix vector: v = (I-SP) v
subroutine, public p_op_l2_fawzi (p_env, qs_env, v, res, alpha, beta, error)
 evaluates res = alpha kpp1(v)*psi0 + beta res

Variables

CHARACTER(len=*), parameter,
private 
moduleN = 'qs_p_env_methods'
INTEGER, save, private last_p_env_id = 0
LOGICAL, parameter, private debug_this_module = .FALSE.

Detailed Description

Utility functions for the perturbation calculations.

Note:
  • routines are programmed with spins in mind but are as of now not tested with them
History
22-08-2002, TCH, started development

Function Documentation

subroutine qs_p_env_methods::p_env_check_i_alloc ( TYPE(qs_p_env_type),pointer  p_env,
TYPE(qs_environment_type),pointer  qs_env,
TYPE(cp_error_type),intent(inout)  error 
) [private]

checks that the intenal storage is allocated, and allocs it if needed

Parameters:
p_envthe environment to check
qs_envthe qs environment this p_env lives in
errorvariable to control error logging, stopping,... see module cp_error_handling
Note:
private routine
History
12.2002 created [fawzi]
Author:
Fawzi Mohamed

Definition at line 320 of file qs_p_env_methods.f90.

References string_utilities::compress(), cp_dbcsr_interface::cp_dbcsr_copy(), qs_environment_types::get_qs_env(), qs_rho_methods::qs_rho_rebuild(), and timings::timeset().

Referenced by p_op_l2(), and p_op_l2_fawzi().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public qs_p_env_methods::p_env_create ( TYPE(qs_p_env_type),pointer  p_env,
TYPE(qs_environment_type),pointer  qs_env,
TYPE(qs_kpp1_env_type),optional,pointer  kpp1_env,
TYPE(cp_dbcsr_p_type),dimension(:),optional,pointer  p1_option,
TYPE(cp_fm_p_type),dimension(:),optional,pointer  psi0d,
LOGICAL,intent(in),optional  orthogonal_orbitals,
TYPE(linres_control_type),optional,pointer  linres_control,
TYPE(cp_error_type),intent(inout)  error 
)

allocates and initializes the perturbation environment (no setup)

Parameters:
p_envthe environment to initialize
qs_envthe qs_environment for the system
kpp1_env: the environment that builds the second order perturbation kernel.
orthogonal_orbitalsif the orbitals are orthogonal
errorvariable to control error logging, stopping,... see module cp_error_handling
History
07.2002 created [fawzi]
Author:
Fawzi Mohamed

Definition at line 116 of file qs_p_env_methods.f90.

References qs_rho_atom_methods::allocate_rho_atom_internals(), cp_dbcsr_interface::cp_dbcsr_copy(), cp_fm_vect::cp_fm_vect_copy(), CPPostcondition, error, qs_mo_types::get_mo_set(), qs_environment_types::get_qs_env(), hartree_local_types::hartree_local_create(), hartree_local_methods::init_coulomb_local(), preconditioner_types::init_preconditioner(), qs_rho0_methods::init_rho0(), last_p_env_id, qs_local_rho_types::local_rho_set_create(), qs_matrix_pools::mpools_get(), input_constants::ot_precond_none, and timings::timeset().

Referenced by ep_methods::ep_env_init_low(), qs_linres_module::linres_init(), and qs_tddfpt_utils::tddfpt_init().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public qs_p_env_methods::p_env_did_change ( TYPE(qs_p_env_type),pointer  p_env,
LOGICAL,intent(in),optional  s_struct_changed,
LOGICAL,intent(in),optional  grid_changed,
TYPE(cp_error_type),intent(inout)  error 
)

function to advise of changes either in the grids or in the the matrix structure (to update p_env's internal cache)

Parameters:
p_envthe p_env to inform of the changes
grid_changedtrue if the grids have changed and have to be rebuilt
s_struct_changedtrue if the structure of the s matrix has changed
errorvariable to control error logging, stopping,... see module cp_error_handling
History
12.2002 created [fawzi]
Author:
Fawzi Mohamed

Definition at line 390 of file qs_p_env_methods.f90.

References qs_rho_types::qs_rho_release().

Here is the call graph for this function:

subroutine,public qs_p_env_methods::p_env_psi0_changed ( TYPE(qs_p_env_type),pointer  p_env,
TYPE(qs_environment_type),pointer  qs_env,
TYPE(cp_fm_p_type),dimension(:),optional,pointer  psi0,
TYPE(cp_fm_p_type),dimension(:),intent(inout),optional  Hrho_psi0d,
TYPE(cp_error_type),intent(inout)  error 
)

To be called after the value of psi0 has changed. Recalculates the quantities S_psi0 and m_epsilon.

Parameters:
p_envthe perturbation environment to set
psi0: the value of psi0, if not given defaults to the qs_env mos
Hrho_psi0d: is given, then the partial result Hrho_psi0d is stored in that vector
errorvariable to control error logging, stopping,... see module cp_error_handling
History
07.2002 created [fawzi]
Author:
Fawzi Mohamed

Definition at line 446 of file qs_p_env_methods.f90.

References cp_fm_cholesky::cp_fm_cholesky_decompose(), cp_fm_basic_linalg::cp_fm_gemm(), cp_fm_vect::cp_fm_vect_copy(), cp_output_handling::cp_print_key_finished_output(), CPPostcondition, qs_mo_types::get_mo_set(), qs_environment_types::get_qs_env(), qs_matrix_pools::mpools_get(), qs_ks_methods::qs_ks_did_change(), input_section_types::section_vals_get(), and timings::timeset().

Here is the call graph for this function:

subroutine,public qs_p_env_methods::p_op_l1 ( TYPE(qs_p_env_type),pointer  p_env,
TYPE(qs_environment_type),pointer  qs_env,
TYPE(cp_fm_p_type),dimension(:),intent(in)  v,
TYPE(cp_fm_p_type),dimension(:),intent(inout)  res,
TYPE(cp_error_type),intent(inout)  error 
)

Evaluates Fv (S_mo)^-1 - Sv(epsilon) and stores it in res.

Parameters:
p_envperturbation calculation environment
qs_envthe qs_env that is perturbed by this p_env
vthe matrix to operate on
resthe result
errorerror handling object (optional)
History
10.2002, TCH, extracted single spin calculation
Author:
Thomas Chassaing

Definition at line 680 of file qs_p_env_methods.f90.

References p_op_l1_spin().

Referenced by qs_tddfpt_eigensolver::apply_op().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public qs_p_env_methods::p_op_l1_spin ( TYPE(qs_p_env_type),pointer  p_env,
TYPE(qs_environment_type),pointer  qs_env,
INTEGER,intent(in)  spin,
TYPE(cp_fm_type),pointer  v,
TYPE(cp_fm_type),pointer  res,
TYPE(cp_error_type),intent(inout)  error 
)

Evaluates Fv (S_mo)^-1 - Sv(epsilon) and stores it in res for a given spin.

Parameters:
p_envperturbation calculation environment
qs_envthe qs_env that is perturbed by this p_env
spinthe spin to calculate (1 or 2 normally)
vthe matrix to operate on
resthe result
errorerror handling object (optional)
Note:
Same as p_op_l1 but takes a spin as additional argument.
History
10.2002, TCH, created
Author:
Thomas Chassaing

Definition at line 727 of file qs_p_env_methods.f90.

References qs_environment_types::get_qs_env(), qs_matrix_pools::mpools_get(), and timings::timeset().

Referenced by p_op_l1().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public qs_p_env_methods::p_op_l2 ( TYPE(qs_p_env_type),pointer  p_env,
TYPE(qs_environment_type),pointer  qs_env,
TYPE(cp_dbcsr_p_type),dimension(:),pointer  p1,
TYPE(cp_fm_p_type),dimension(:),intent(inout)  res,
REAL(KIND=dp),intent(in),optional  alpha,
REAL(KIND=dp),intent(in),optional  beta,
TYPE(cp_error_type),intent(inout)  error 
)

evaluates res = alpha kpp1(v)*psi0 + beta res with kpp1 evaluated with p=qs_envrhorho_ao, p1=p1

Parameters:
p_envthe perturbation environment
qs_envthe qs_env that is perturbed by this p_env
p1: direction in which evaluate the second derivative
resplace where to store the result
vvalues of the coeffs of the correcting orbitals
alphascale factor of the result (defaults to 1.0)
betascale factor of the old values (defaults to 0.0)
errorvariable to control error logging, stopping,... see module cp_error_handling
Note:
qs_envrho must be up to date it would be better to pass rho1, not p1
History
02.09.2002 adapted for new qs_p_env_type (TC) 03.2003 extended for p1 not taken from v (TC)
Author:
fawzi

Definition at line 805 of file qs_p_env_methods.f90.

References cp_dbcsr_interface::cp_dbcsr_copy(), qs_environment_types::get_qs_env(), qs_kpp1_env_methods::kpp1_calc_k_p_p1(), p_env_check_i_alloc(), and timings::timeset().

Referenced by p_op_l2_fawzi().

Here is the call graph for this function:

Here is the caller graph for this function:

subroutine,public qs_p_env_methods::p_op_l2_fawzi ( TYPE(qs_p_env_type),pointer  p_env,
TYPE(qs_environment_type),pointer  qs_env,
TYPE(cp_fm_p_type),dimension(:),intent(in)  v,
TYPE(cp_fm_p_type),dimension(:),intent(inout)  res,
REAL(KIND=dp),intent(in),optional  alpha,
REAL(KIND=dp),intent(in),optional  beta,
TYPE(cp_error_type),intent(inout)  error 
)

evaluates res = alpha kpp1(v)*psi0 + beta res

Parameters:
p_envthe perturbation environment
qs_envthe qs_env that is perturbed by this p_env
resplace where to store the result
vvalues of the coeffs of the correcting orbitals
alphascale factor of the result (defaults to 1.0)
betascale factor of the old values (defaults to 0.0)
errorvariable to control error logging, stopping,... see module cp_error_handling
Note:
to be removed
History
02.09.2002 adapted for new qs_p_env_type (TC)
Author:
Fawzi Mohamed

Definition at line 1133 of file qs_p_env_methods.f90.

References debug_this_module, qs_mo_types::get_mo_set(), qs_environment_types::get_qs_env(), p_env_check_i_alloc(), p_op_l2(), and timings::timeset().

Here is the call graph for this function:

subroutine,public qs_p_env_methods::p_postortho ( TYPE(qs_p_env_type),pointer  p_env,
TYPE(qs_environment_type),pointer  qs_env,
TYPE(cp_fm_p_type),dimension(:),intent(inout)  v,
INTEGER,dimension(:),intent(in),optional  n_cols,
TYPE(cp_error_type),intent(inout)  error 
)

does a postorthogonalization on the given matrix vector: v = (I-SP) v

Parameters:
p_envthe perturbation environment
qs_envthe qs_env that is perturbed by this p_env
vmatrix to orthogonalize
n_colsthe number of columns of C to multiply (defaults to size(v,2))
errorvariable to control error logging, stopping,... see module cp_error_handling
History
07.2002 created [fawzi]
Author:
Fawzi Mohamed

Definition at line 1013 of file qs_p_env_methods.f90.

References cp_fm_types::cp_fm_create(), cp_fm_basic_linalg::cp_fm_gemm(), cp_fm_struct::cp_fm_struct_create(), qs_environment_types::get_qs_env(), qs_matrix_pools::mpools_get(), and timings::timeset().

Here is the call graph for this function:

subroutine,public qs_p_env_methods::p_preortho ( TYPE(qs_p_env_type),pointer  p_env,
TYPE(qs_environment_type),pointer  qs_env,
TYPE(cp_fm_p_type),dimension(:),intent(inout)  v,
INTEGER,dimension(:),intent(in),optional  n_cols,
TYPE(cp_error_type),intent(inout)  error 
)

does a preorthogonalization of the given matrix: v = (I-PS)v

Parameters:
p_envthe perturbation environment
qs_envthe qs_env that is perturbed by this p_env
vmatrix to orthogonalize
n_colsthe number of columns of C to multiply (defaults to size(v,2))
errorvariable to control error logging, stopping,... see module cp_error_handling
History
02.09.2002 adapted for new qs_p_env_type (TC)
Author:
Fawzi Mohamed

Definition at line 894 of file qs_p_env_methods.f90.

References cp_fm_types::cp_fm_create(), cp_fm_basic_linalg::cp_fm_gemm(), cp_fm_struct::cp_fm_struct_create(), qs_environment_types::get_qs_env(), qs_matrix_pools::mpools_get(), and timings::timeset().

Here is the call graph for this function:


Variable Documentation

LOGICAL,parameter,private qs_p_env_methods::debug_this_module = .FALSE.

Definition at line 94 of file qs_p_env_methods.f90.

Referenced by p_op_l2_fawzi().

Definition at line 93 of file qs_p_env_methods.f90.

Referenced by p_env_create().

CHARACTER(len=*),parameter,private qs_p_env_methods::moduleN = 'qs_p_env_methods'

Definition at line 92 of file qs_p_env_methods.f90.