(git:5e7fe52)
Loading...
Searching...
No Matches
skala_gpw_functional Module Reference

Experimental CP2K-native GPW real-space-grid path for SKALA TorchScript models. More...

Functions/Subroutines

logical function, public xc_section_uses_native_skala_grid (xc_section)
 Return true if the GAUXC subsection requests the CP2K-native GPW grid path.
integer function, public skala_gapw_representation (xc_section)
 Return the pseudopotential GAPW representation selected for an active model.
logical function, public xc_section_uses_native_skala_evaluator (xc_section)
 Return true when SKALA must be evaluated by the CP2K-native grid machinery.
logical function, public native_skala_gapw_composite_reference (xc_section)
 Return true if native SKALA should use the full GAPW ORB density on one common grid.
logical function, public native_skala_gapw_atom_composite_requested (xc_section)
 Return true when the explicit atom-centered composite reference is requested.
logical function, public native_skala_uses_atom_composite_grid (xc_section)
 Return true when native Skala uses atom-centered grids.
logical function, public native_skala_gapw_composite_direct_ao (xc_section)
 Return true if the GAPW composite reference uses direct full-ORB collocation.
logical function, public xc_section_uses_gauxc_model (xc_section)
 Return true if the GAUXC subsection requests a model evaluation.
integer function, public native_skala_gapw_density_partition (xc_section)
 Return the hard/soft GAPW one-center density partition for native SKALA.
subroutine, public ensure_native_skala_grid_scope (xc_section)
 Enforce the currently implemented native SKALA GPW input scope.
subroutine, public skala_gpw_eval (vxc_rho, vxc_tau, exc, rho_r, rho_g, tau, xc_section, weights, pw_pool, particle_set, cell, compute_virial, virial_xc, just_energy, atom_force)
 Evaluate SKALA energy and first derivatives on a CP2K GPW grid.
subroutine, public skala_gpw_weight_derivative (weight_deriv_r, rho_r, rho_g, tau, xc_section, weights, pw_pool, particle_set, cell)
 Evaluate the derivative of native SKALA XC energy with respect to CP2K's external real-space integration-weight multiplier.
subroutine, public skala_gapw_atom_vxc_of_r (xc_section, grid_atom, group, atom_coord, rho, drho, tau, weights, lsd, nspins, na, nr, exc, vxc, vxg, vtau, energy_only, atom_force, atom_virial)
 Evaluate SKALA on a GAPW one-center atomic grid.
subroutine, public skala_gapw_atom_composite_energy (xc_section, group, density, grad, kin, grid_coords, grid_weights, atomic_grid_weights, atomic_grid_sizes, atomic_coords, exc, density_grad_out, grad_grad_out, kin_grad_out, grid_coord_grad_out, grid_weight_grad_out, atomic_grid_weight_grad_out, atom_coord_grad_out)
 Evaluate a rank-local set of complete atom blocks and sum their SKALA energies.
subroutine, public build_vxc_from_feature_grads (vxc_rho, vxc_tau, rho_r, pw_pool, density_grad, grad_grad, kin_grad, xc_deriv_method_id, global_grid_layout)
 Fill CP2K VXC real-space arrays from Torch feature gradients.
type(section_vals_type) function, pointer, public get_gauxc_section (xc_section)
 Return the first GAUXC functional subsection, if present.

Variables

integer, parameter, public skala_gapw_density_partition_hard_minus_soft = 1
integer, parameter, public skala_gapw_density_partition_hard_only = 2
integer, parameter, public skala_gapw_density_partition_soft_only = 3
integer, parameter, public skala_gapw_density_partition_none = 4
type(skala_torch_model_type), save cached_model

Detailed Description

Experimental CP2K-native GPW real-space-grid path for SKALA TorchScript models.

Function/Subroutine Documentation

◆ xc_section_uses_native_skala_grid()

logical function, public skala_gpw_functional::xc_section_uses_native_skala_grid ( type(section_vals_type), intent(in), pointer xc_section)

Return true if the GAUXC subsection requests the CP2K-native GPW grid path.

Parameters
xc_section...
Returns
...

Definition at line 115 of file skala_gpw_functional.F.

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

◆ skala_gapw_representation()

integer function, public skala_gpw_functional::skala_gapw_representation ( type(section_vals_type), intent(in), pointer xc_section)

Return the pseudopotential GAPW representation selected for an active model.

Parameters
xc_section...
Returns
...

Definition at line 134 of file skala_gpw_functional.F.

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

◆ xc_section_uses_native_skala_evaluator()

logical function, public skala_gpw_functional::xc_section_uses_native_skala_evaluator ( type(section_vals_type), intent(in), pointer xc_section)

Return true when SKALA must be evaluated by the CP2K-native grid machinery.

Parameters
xc_section...
Returns
...

Definition at line 163 of file skala_gpw_functional.F.

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

◆ native_skala_gapw_composite_reference()

logical function, public skala_gpw_functional::native_skala_gapw_composite_reference ( type(section_vals_type), intent(in), pointer xc_section)

Return true if native SKALA should use the full GAPW ORB density on one common grid.

Parameters
xc_section...
Returns
...

Definition at line 178 of file skala_gpw_functional.F.

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

◆ native_skala_gapw_atom_composite_requested()

logical function, public skala_gpw_functional::native_skala_gapw_atom_composite_requested ( type(section_vals_type), intent(in), pointer xc_section)

Return true when the explicit atom-centered composite reference is requested.

Parameters
xc_section...
Returns
...

Definition at line 202 of file skala_gpw_functional.F.

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

◆ native_skala_uses_atom_composite_grid()

logical function, public skala_gpw_functional::native_skala_uses_atom_composite_grid ( type(section_vals_type), intent(in), pointer xc_section)

Return true when native Skala uses atom-centered grids.

Parameters
xc_section...
Returns
...

Definition at line 227 of file skala_gpw_functional.F.

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

◆ native_skala_gapw_composite_direct_ao()

logical function, public skala_gpw_functional::native_skala_gapw_composite_direct_ao ( type(section_vals_type), intent(in), pointer xc_section)

Return true if the GAPW composite reference uses direct full-ORB collocation.

Parameters
xc_section...
Returns
...

Definition at line 257 of file skala_gpw_functional.F.

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

◆ xc_section_uses_gauxc_model()

logical function, public skala_gpw_functional::xc_section_uses_gauxc_model ( type(section_vals_type), intent(in), pointer xc_section)

Return true if the GAUXC subsection requests a model evaluation.

Parameters
xc_section...
Returns
...

Definition at line 278 of file skala_gpw_functional.F.

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

◆ native_skala_gapw_density_partition()

integer function, public skala_gpw_functional::native_skala_gapw_density_partition ( type(section_vals_type), intent(in), pointer xc_section)

Return the hard/soft GAPW one-center density partition for native SKALA.

Parameters
xc_section...
Returns
...

Definition at line 305 of file skala_gpw_functional.F.

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

◆ ensure_native_skala_grid_scope()

subroutine, public skala_gpw_functional::ensure_native_skala_grid_scope ( type(section_vals_type), intent(in), pointer xc_section)

Enforce the currently implemented native SKALA GPW input scope.

Parameters
xc_section...

Definition at line 335 of file skala_gpw_functional.F.

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

◆ skala_gpw_eval()

subroutine, public skala_gpw_functional::skala_gpw_eval ( type(pw_r3d_rs_type), dimension(:), pointer vxc_rho,
type(pw_r3d_rs_type), dimension(:), pointer vxc_tau,
real(kind=dp), intent(out) exc,
type(pw_r3d_rs_type), dimension(:), pointer rho_r,
type(pw_c1d_gs_type), dimension(:), pointer rho_g,
type(pw_r3d_rs_type), dimension(:), pointer tau,
type(section_vals_type), pointer xc_section,
type(pw_r3d_rs_type), pointer weights,
type(pw_pool_type), pointer pw_pool,
type(particle_type), dimension(:), pointer particle_set,
type(cell_type), pointer cell,
logical, intent(in) compute_virial,
real(kind=dp), dimension(3, 3), intent(out) virial_xc,
logical, intent(in), optional just_energy,
real(kind=dp), dimension(:, :), intent(out), optional atom_force )

Evaluate SKALA energy and first derivatives on a CP2K GPW grid.

Parameters
vxc_rho...
vxc_tau...
exc...
rho_r...
rho_g...
tau...
xc_section...
weights...
pw_pool...
particle_set...
cell...
compute_virial...
virial_xc...
just_energy...
atom_force...

Definition at line 401 of file skala_gpw_functional.F.

Here is the call graph for this function:

◆ skala_gpw_weight_derivative()

subroutine, public skala_gpw_functional::skala_gpw_weight_derivative ( type(pw_r3d_rs_type), intent(inout) weight_deriv_r,
type(pw_r3d_rs_type), dimension(:), pointer rho_r,
type(pw_c1d_gs_type), dimension(:), pointer rho_g,
type(pw_r3d_rs_type), dimension(:), pointer tau,
type(section_vals_type), pointer xc_section,
type(pw_r3d_rs_type), pointer weights,
type(pw_pool_type), pointer pw_pool,
type(particle_type), dimension(:), pointer particle_set,
type(cell_type), pointer cell )

Evaluate the derivative of native SKALA XC energy with respect to CP2K's external real-space integration-weight multiplier.

Parameters
weight_deriv_r...
rho_r...
rho_g...
tau...
xc_section...
weights...
pw_pool...
particle_set...
cell...

Definition at line 714 of file skala_gpw_functional.F.

Here is the call graph for this function:

◆ skala_gapw_atom_vxc_of_r()

subroutine, public skala_gpw_functional::skala_gapw_atom_vxc_of_r ( type(section_vals_type), pointer xc_section,
type(grid_atom_type), pointer grid_atom,
class(mp_comm_type), intent(in) group,
real(kind=dp), dimension(3), intent(in) atom_coord,
real(kind=dp), dimension(:, :, :), pointer rho,
real(kind=dp), dimension(:, :, :, :), pointer drho,
real(kind=dp), dimension(:, :, :), pointer tau,
real(kind=dp), dimension(:, :), intent(in) weights,
logical, intent(in) lsd,
integer, intent(in) nspins,
integer, intent(in) na,
integer, intent(in) nr,
real(kind=dp), intent(out) exc,
real(kind=dp), dimension(:, :, :), pointer vxc,
real(kind=dp), dimension(:, :, :, :), pointer vxg,
real(kind=dp), dimension(:, :, :), pointer vtau,
logical, intent(in), optional energy_only,
real(kind=dp), dimension(3), intent(out), optional atom_force,
real(kind=dp), dimension(3, 3), intent(out), optional atom_virial )

Evaluate SKALA on a GAPW one-center atomic grid.

Parameters
xc_section...
grid_atom...
group...
atom_coord...
rho...
drho...
tau...
weights...
lsd...
nspins...
na...
nr...
exc...
vxc...
vxg...
vtau...
energy_only...
atom_force...
atom_virial...

Definition at line 891 of file skala_gpw_functional.F.

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

◆ skala_gapw_atom_composite_energy()

subroutine, public skala_gpw_functional::skala_gapw_atom_composite_energy ( type(section_vals_type), pointer xc_section,
class(mp_comm_type), intent(in) group,
real(kind=dp), dimension(:, :), intent(in), allocatable density,
real(kind=dp), dimension(:, :, :), intent(in), allocatable grad,
real(kind=dp), dimension(:, :), intent(in), allocatable kin,
real(kind=dp), dimension(:, :), intent(in), allocatable grid_coords,
real(kind=dp), dimension(:), intent(in), allocatable grid_weights,
real(kind=dp), dimension(:), intent(in), allocatable atomic_grid_weights,
integer(kind=int_8), dimension(:), intent(in), allocatable atomic_grid_sizes,
real(kind=dp), dimension(:, :), intent(in), allocatable atomic_coords,
real(kind=dp), intent(out) exc,
real(kind=dp), dimension(:, :), intent(out), optional, allocatable density_grad_out,
real(kind=dp), dimension(:, :, :), intent(out), optional, allocatable grad_grad_out,
real(kind=dp), dimension(:, :), intent(out), optional, allocatable kin_grad_out,
real(kind=dp), dimension(:, :), intent(out), optional, allocatable grid_coord_grad_out,
real(kind=dp), dimension(:), intent(out), optional, allocatable grid_weight_grad_out,
real(kind=dp), dimension(:), intent(out), optional, allocatable atomic_grid_weight_grad_out,
real(kind=dp), dimension(:, :), intent(out), optional, allocatable atom_coord_grad_out )

Evaluate a rank-local set of complete atom blocks and sum their SKALA energies.

Parameters
xc_section...
group...
density...
grad...
kin...
grid_coords...
grid_weights...
atomic_grid_weights...
atomic_grid_sizes...
atomic_coords...
exc...
density_grad_out...
grad_grad_out...
kin_grad_out...
grid_coord_grad_out...
grid_weight_grad_out...
atomic_grid_weight_grad_out...
atom_coord_grad_out...

Definition at line 1150 of file skala_gpw_functional.F.

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

◆ build_vxc_from_feature_grads()

subroutine, public skala_gpw_functional::build_vxc_from_feature_grads ( type(pw_r3d_rs_type), dimension(:), pointer vxc_rho,
type(pw_r3d_rs_type), dimension(:), pointer vxc_tau,
type(pw_r3d_rs_type), dimension(:), pointer rho_r,
type(pw_pool_type), pointer pw_pool,
real(kind=dp), dimension(:, :), intent(in) density_grad,
real(kind=dp), dimension(:, :, :), intent(in) grad_grad,
real(kind=dp), dimension(:, :), intent(in) kin_grad,
integer, intent(in) xc_deriv_method_id,
logical, intent(in), optional global_grid_layout )

Fill CP2K VXC real-space arrays from Torch feature gradients.

Parameters
vxc_rho...
vxc_tau...
rho_r...
pw_pool...
density_grad...
grad_grad...
kin_grad...
xc_deriv_method_id...
global_grid_layout...

Definition at line 2713 of file skala_gpw_functional.F.

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

◆ get_gauxc_section()

type(section_vals_type) function, pointer, public skala_gpw_functional::get_gauxc_section ( type(section_vals_type), intent(in), pointer xc_section)

Return the first GAUXC functional subsection, if present.

Parameters
xc_section...
Returns
...

Definition at line 3025 of file skala_gpw_functional.F.

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

Variable Documentation

◆ skala_gapw_density_partition_hard_minus_soft

integer, parameter, public skala_gpw_functional::skala_gapw_density_partition_hard_minus_soft = 1

Definition at line 78 of file skala_gpw_functional.F.

◆ skala_gapw_density_partition_hard_only

integer, parameter, public skala_gpw_functional::skala_gapw_density_partition_hard_only = 2

Definition at line 78 of file skala_gpw_functional.F.

◆ skala_gapw_density_partition_soft_only

integer, parameter, public skala_gpw_functional::skala_gapw_density_partition_soft_only = 3

Definition at line 78 of file skala_gpw_functional.F.

◆ skala_gapw_density_partition_none

integer, parameter, public skala_gpw_functional::skala_gapw_density_partition_none = 4

Definition at line 78 of file skala_gpw_functional.F.

◆ cached_model

type(skala_torch_model_type), save skala_gpw_functional::cached_model

Definition at line 98 of file skala_gpw_functional.F.