|
CP2K 2.4 (Revision 12889)
|
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. |
Utility functions for the perturbation calculations.
| 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
| p_env | the environment to check |
| qs_env | the qs environment this p_env lives in |
| error | variable to control error logging, stopping,... see module cp_error_handling |
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)
| p_env | the environment to initialize |
| qs_env | the qs_environment for the system |
| kpp | 1_env: the environment that builds the second order perturbation kernel. |
| orthogonal_orbitals | if the orbitals are orthogonal |
| error | variable to control error logging, stopping,... see module cp_error_handling |
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)
| p_env | the p_env to inform of the changes |
| grid_changed | true if the grids have changed and have to be rebuilt |
| s_struct_changed | true if the structure of the s matrix has changed |
| error | variable to control error logging, stopping,... see module cp_error_handling |
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.
| p_env | the perturbation environment to set |
| psi | 0: the value of psi0, if not given defaults to the qs_env mos |
| Hrho_psi | 0d: is given, then the partial result Hrho_psi0d is stored in that vector |
| error | variable to control error logging, stopping,... see module cp_error_handling |
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.
| p_env | perturbation calculation environment |
| qs_env | the qs_env that is perturbed by this p_env |
| v | the matrix to operate on |
| res | the result |
| error | error handling object (optional) |
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.
| p_env | perturbation calculation environment |
| qs_env | the qs_env that is perturbed by this p_env |
| spin | the spin to calculate (1 or 2 normally) |
| v | the matrix to operate on |
| res | the result |
| error | error handling object (optional) |
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
| p_env | the perturbation environment |
| qs_env | the qs_env that is perturbed by this p_env |
| p | 1: direction in which evaluate the second derivative |
| res | place where to store the result |
| v | values of the coeffs of the correcting orbitals |
| alpha | scale factor of the result (defaults to 1.0) |
| beta | scale factor of the old values (defaults to 0.0) |
| error | variable to control error logging, stopping,... see module cp_error_handling |
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
| p_env | the perturbation environment |
| qs_env | the qs_env that is perturbed by this p_env |
| res | place where to store the result |
| v | values of the coeffs of the correcting orbitals |
| alpha | scale factor of the result (defaults to 1.0) |
| beta | scale factor of the old values (defaults to 0.0) |
| error | variable to control error logging, stopping,... see module cp_error_handling |
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
| p_env | the perturbation environment |
| qs_env | the qs_env that is perturbed by this p_env |
| v | matrix to orthogonalize |
| n_cols | the number of columns of C to multiply (defaults to size(v,2)) |
| error | variable to control error logging, stopping,... see module cp_error_handling |
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
| p_env | the perturbation environment |
| qs_env | the qs_env that is perturbed by this p_env |
| v | matrix to orthogonalize |
| n_cols | the number of columns of C to multiply (defaults to size(v,2)) |
| error | variable to control error logging, stopping,... see module cp_error_handling |
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:| 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().
| INTEGER,save,private qs_p_env_methods::last_p_env_id = 0 |
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.
1.7.3