(git:3add494)
optimize_embedding_potential Module Reference

Functions/Subroutines

subroutine, public understand_spin_states (force_env, ref_subsys_number, change_spin, open_shell_embed, all_nspins)
 Find out whether we need to swap alpha- and beta- spind densities in the second subsystem. More...
 
subroutine, public init_embed_pot (qs_env, embed_pot, add_const_pot, Fermi_Amaldi, const_pot, open_shell_embed, spin_embed_pot, pot_diff, Coulomb_guess, grid_opt)
 ... More...
 
subroutine, public prepare_embed_opt (qs_env, opt_embed, opt_embed_section)
 Creates and allocates objects for optimization of embedding potential. More...
 
subroutine, public find_aux_dimen (qs_env, dimen_aux)
 Find the dimension of the auxiliary basis for the expansion of the embedding potential. More...
 
subroutine, public given_embed_pot (qs_env)
 Read the external embedding potential, not to be optimized. More...
 
subroutine, public read_embed_pot (qs_env, embed_pot, spin_embed_pot, section, opt_embed)
 ... More...
 
subroutine, public release_opt_embed (opt_embed)
 Deallocate stuff for optimizing embedding potential. More...
 
subroutine, public coulomb_guess (v_rspace, rhs, mapping_section, qs_env, nforce_eval, iforce_eval, eta)
 Calculates subsystem Coulomb potential from the RESP charges of the total system. More...
 
subroutine, public make_subsys_embed_pot (qs_env, embed_pot, embed_pot_subsys, spin_embed_pot, spin_embed_pot_subsys, open_shell_embed, change_spin_sign)
 Creates a subsystem embedding potential. More...
 
subroutine, public calculate_embed_pot_grad (qs_env, diff_rho_r, diff_rho_spin, opt_embed)
 Calculates the derivative of the embedding potential wrt to the expansion coefficients. More...
 
subroutine, public opt_embed_step (diff_rho_r, diff_rho_spin, opt_embed, embed_pot, spin_embed_pot, rho_r_ref, qs_env)
 Takes maximization step in embedding potential optimization. More...
 
subroutine, public step_control (opt_embed)
 Controls the step, changes the trust radius if needed in maximization of the V_emb. More...
 
real(kind=dp) function, public max_dens_diff (diff_rho_r)
 ... More...
 
subroutine, public print_rho_diff (diff_rho_r, i_iter, qs_env, final_one)
 Prints a cube for the (rho_A + rho_B - rho_ref) to be minimized in embedding. More...
 
subroutine, public print_rho_spin_diff (spin_diff_rho_r, i_iter, qs_env, final_one)
 Prints a cube for the (spin_rho_A + spin_rho_B - spin_rho_ref) to be minimized in embedding. More...
 
subroutine, public print_embed_restart (qs_env, dimen_aux, embed_pot_coef, embed_pot, i_iter, embed_pot_spin, open_shell_embed, grid_opt, final_one)
 Print embedding potential as a cube and as a binary (for restarting) More...
 
subroutine, public print_pot_simple_grid (qs_env, embed_pot, embed_pot_spin, i_iter, open_shell_embed, final_one, qs_env_cluster)
 Prints a volumetric file: X Y Z value for interfacing with external programs. More...
 
subroutine, public print_emb_opt_info (output_unit, step_num, opt_embed)
 ... More...
 
subroutine, public get_prev_density (opt_embed, force_env, subsys_num)
 ... More...
 
subroutine, public get_max_subsys_diff (opt_embed, force_env, subsys_num)
 ... More...
 
subroutine, public conv_check_embed (opt_embed, diff_rho_r, diff_rho_spin, output_unit)
 ... More...
 

Function/Subroutine Documentation

◆ understand_spin_states()

subroutine, public optimize_embedding_potential::understand_spin_states ( type(force_env_type), pointer  force_env,
integer  ref_subsys_number,
logical  change_spin,
logical  open_shell_embed,
integer, dimension(:), allocatable  all_nspins 
)

Find out whether we need to swap alpha- and beta- spind densities in the second subsystem.

It's only needed because by default alpha-spins go first in a subsystem.

By swapping we impose the constraint:

rho_1(alpha) + rho_2(alpha) = rho_total(alpha)

rho_1(beta) + rho_2(beta) = rho_total(beta)

Parameters
force_env...
ref_subsys_number...
change_spin...
open_shell_embed...
all_nspins...
Returns
...
Author
Vladimir Rybkin

Definition at line 127 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_embed_pot()

subroutine, public optimize_embedding_potential::init_embed_pot ( type(qs_environment_type), pointer  qs_env,
type(pw_r3d_rs_type), pointer  embed_pot,
logical  add_const_pot,
logical  Fermi_Amaldi,
type(pw_r3d_rs_type), pointer  const_pot,
logical  open_shell_embed,
type(pw_r3d_rs_type), pointer  spin_embed_pot,
type(pw_r3d_rs_type), pointer  pot_diff,
logical  Coulomb_guess,
logical  grid_opt 
)

...

Parameters
qs_env...
embed_pot...
add_const_pot...
Fermi_Amaldi...
const_pot...
open_shell_embed...
spin_embed_pot...
pot_diff...
Coulomb_guess...
grid_opt...

Definition at line 204 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepare_embed_opt()

subroutine, public optimize_embedding_potential::prepare_embed_opt ( type(qs_environment_type), pointer  qs_env,
type(opt_embed_pot_type)  opt_embed,
type(section_vals_type), pointer  opt_embed_section 
)

Creates and allocates objects for optimization of embedding potential.

Parameters
qs_env...
opt_embed...
opt_embed_section...
Author
Vladimir Rybkin

Definition at line 290 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ find_aux_dimen()

subroutine, public optimize_embedding_potential::find_aux_dimen ( type(qs_environment_type), pointer  qs_env,
integer  dimen_aux 
)

Find the dimension of the auxiliary basis for the expansion of the embedding potential.

Parameters
qs_env...
dimen_aux...

Definition at line 543 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ given_embed_pot()

subroutine, public optimize_embedding_potential::given_embed_pot ( type(qs_environment_type), pointer  qs_env)

Read the external embedding potential, not to be optimized.

Parameters
qs_env...

Definition at line 609 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_embed_pot()

subroutine, public optimize_embedding_potential::read_embed_pot ( type(qs_environment_type), pointer  qs_env,
type(pw_r3d_rs_type), pointer  embed_pot,
type(pw_r3d_rs_type), pointer  spin_embed_pot,
type(section_vals_type), pointer  section,
type(opt_embed_pot_type)  opt_embed 
)

...

Parameters
qs_env...
embed_pot...
spin_embed_pot...
section...
opt_embed...

Definition at line 662 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ release_opt_embed()

subroutine, public optimize_embedding_potential::release_opt_embed ( type(opt_embed_pot_type)  opt_embed)

Deallocate stuff for optimizing embedding potential.

Parameters
opt_embed...

Definition at line 855 of file optimize_embedding_potential.F.

Here is the caller graph for this function:

◆ coulomb_guess()

subroutine, public optimize_embedding_potential::coulomb_guess ( type(pw_r3d_rs_type)  v_rspace,
real(kind=dp), dimension(:), pointer  rhs,
type(section_vals_type), pointer  mapping_section,
type(qs_environment_type), pointer  qs_env,
integer  nforce_eval,
integer  iforce_eval,
real(kind=dp)  eta 
)

Calculates subsystem Coulomb potential from the RESP charges of the total system.

Parameters
v_rspace...
rhs...
mapping_section...
qs_env...
nforce_eval...
iforce_eval...
eta...

Definition at line 932 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_subsys_embed_pot()

subroutine, public optimize_embedding_potential::make_subsys_embed_pot ( type(qs_environment_type), pointer  qs_env,
type(pw_r3d_rs_type), intent(in)  embed_pot,
type(pw_r3d_rs_type), pointer  embed_pot_subsys,
type(pw_r3d_rs_type), intent(in), pointer  spin_embed_pot,
type(pw_r3d_rs_type), pointer  spin_embed_pot_subsys,
logical  open_shell_embed,
logical  change_spin_sign 
)

Creates a subsystem embedding potential.

Parameters
qs_env...
embed_pot...
embed_pot_subsys...
spin_embed_pot...
spin_embed_pot_subsys...
open_shell_embed...
change_spin_sign...
Author
Vladimir Rybkin

Definition at line 1021 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ calculate_embed_pot_grad()

subroutine, public optimize_embedding_potential::calculate_embed_pot_grad ( type(qs_environment_type), pointer  qs_env,
type(pw_r3d_rs_type), intent(in)  diff_rho_r,
type(pw_r3d_rs_type), intent(in)  diff_rho_spin,
type(opt_embed_pot_type)  opt_embed 
)

Calculates the derivative of the embedding potential wrt to the expansion coefficients.

Parameters
qs_env...
diff_rho_r...
diff_rho_spin...
opt_embed...
Author
Vladimir Rybkin

Definition at line 1071 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ opt_embed_step()

subroutine, public optimize_embedding_potential::opt_embed_step ( type(pw_r3d_rs_type), intent(inout)  diff_rho_r,
type(pw_r3d_rs_type), intent(inout)  diff_rho_spin,
type(opt_embed_pot_type)  opt_embed,
type(pw_r3d_rs_type), intent(inout)  embed_pot,
type(pw_r3d_rs_type), intent(in), pointer  spin_embed_pot,
type(pw_r3d_rs_type), dimension(:), pointer  rho_r_ref,
type(qs_environment_type), pointer  qs_env 
)

Takes maximization step in embedding potential optimization.

Parameters
diff_rho_r...
diff_rho_spin...
opt_embed...
embed_pot...
spin_embed_pot...
rho_r_ref...
qs_env...
Author
Vladimir Rybkin

Definition at line 1466 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ step_control()

subroutine, public optimize_embedding_potential::step_control ( type(opt_embed_pot_type)  opt_embed)

Controls the step, changes the trust radius if needed in maximization of the V_emb.

Parameters
opt_embed...
Author
Vladimir Rybkin

Definition at line 2169 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ max_dens_diff()

real(kind=dp) function, public optimize_embedding_potential::max_dens_diff ( type(pw_r3d_rs_type), intent(in)  diff_rho_r)

...

Parameters
diff_rho_r...
Returns
...

Definition at line 2973 of file optimize_embedding_potential.F.

Here is the caller graph for this function:

◆ print_rho_diff()

subroutine, public optimize_embedding_potential::print_rho_diff ( type(pw_r3d_rs_type), intent(in)  diff_rho_r,
integer, intent(in)  i_iter,
type(qs_environment_type), intent(in), pointer  qs_env,
logical, intent(in)  final_one 
)

Prints a cube for the (rho_A + rho_B - rho_ref) to be minimized in embedding.

Parameters
diff_rho_r...
i_iter...
qs_env...
final_one...
Author
Vladimir Rybkin

Definition at line 3012 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_rho_spin_diff()

subroutine, public optimize_embedding_potential::print_rho_spin_diff ( type(pw_r3d_rs_type), intent(in)  spin_diff_rho_r,
integer, intent(in)  i_iter,
type(qs_environment_type), intent(in), pointer  qs_env,
logical, intent(in)  final_one 
)

Prints a cube for the (spin_rho_A + spin_rho_B - spin_rho_ref) to be minimized in embedding.

Parameters
spin_diff_rho_r...
i_iter...
qs_env...
final_one...
Author
Vladimir Rybkin

Definition at line 3063 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_embed_restart()

subroutine, public optimize_embedding_potential::print_embed_restart ( type(qs_environment_type), pointer  qs_env,
integer  dimen_aux,
type(cp_fm_type), intent(in), pointer  embed_pot_coef,
type(pw_r3d_rs_type), intent(in)  embed_pot,
integer  i_iter,
type(pw_r3d_rs_type), intent(in), pointer  embed_pot_spin,
logical  open_shell_embed,
logical  grid_opt,
logical  final_one 
)

Print embedding potential as a cube and as a binary (for restarting)

Parameters
qs_env...
dimen_aux...
embed_pot_coef...
embed_pot...
i_iter...
embed_pot_spin...
open_shell_embed...
grid_opt...
final_one...

Definition at line 3117 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_pot_simple_grid()

subroutine, public optimize_embedding_potential::print_pot_simple_grid ( type(qs_environment_type), pointer  qs_env,
type(pw_r3d_rs_type), intent(in)  embed_pot,
type(pw_r3d_rs_type), intent(in), pointer  embed_pot_spin,
integer  i_iter,
logical  open_shell_embed,
logical  final_one,
type(qs_environment_type), pointer  qs_env_cluster 
)

Prints a volumetric file: X Y Z value for interfacing with external programs.

Parameters
qs_env...
embed_pot...
embed_pot_spin...
i_iter...
open_shell_embed...
final_one...
qs_env_cluster...

Definition at line 3215 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ print_emb_opt_info()

subroutine, public optimize_embedding_potential::print_emb_opt_info ( integer  output_unit,
integer  step_num,
type(opt_embed_pot_type)  opt_embed 
)

...

Parameters
output_unit...
step_num...
opt_embed...

Definition at line 3382 of file optimize_embedding_potential.F.

Here is the caller graph for this function:

◆ get_prev_density()

subroutine, public optimize_embedding_potential::get_prev_density ( type(opt_embed_pot_type)  opt_embed,
type(force_env_type), pointer  force_env,
integer  subsys_num 
)

...

Parameters
opt_embed...
force_env...
subsys_num...

Definition at line 3415 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_max_subsys_diff()

subroutine, public optimize_embedding_potential::get_max_subsys_diff ( type(opt_embed_pot_type)  opt_embed,
type(force_env_type), pointer  force_env,
integer  subsys_num 
)

...

Parameters
opt_embed...
force_env...
subsys_num...

Definition at line 3445 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ conv_check_embed()

subroutine, public optimize_embedding_potential::conv_check_embed ( type(opt_embed_pot_type)  opt_embed,
type(pw_r3d_rs_type), intent(in)  diff_rho_r,
type(pw_r3d_rs_type), intent(in)  diff_rho_spin,
integer  output_unit 
)

...

Parameters
opt_embed...
diff_rho_r...
diff_rho_spin...
output_unit...

Definition at line 3478 of file optimize_embedding_potential.F.

Here is the call graph for this function:
Here is the caller graph for this function: