3.7.3. horton.meanfield.cext – C++ extensions

class horton.meanfield.cext.RLibXCWrapper

Bases: horton.meanfield.cext.LibXCWrapper

compute_gga_exc(self, ndarray rho, ndarray sigma, ndarray zk)

Compute the GGA energy density.

Parameters:
  • rho (np.ndarray, shape=(npoint,)) – The total electron density.
  • sigma (np.ndarray, shape=(npoint,)) – The reduced density gradient norm.
  • zk (np.ndarray, shape=(npoint,), output) – The energy density.
compute_gga_fxc(self, ndarray rho, ndarray sigma, ndarray v2rho2, ndarray v2rhosigma, ndarray v2sigma2)

Compute the GGA hardness kernel.

Parameters:
  • rho (np.ndarray, shape=(npoint,)) – The total electron density.
  • sigma (np.ndarray, shape=(npoint,)) – The reduced density gradient norm.
  • v2rho2 (np.ndarray, shape=(npoint,)) – The second derivative of the energy w.r.t. density (twice).
  • v2rhosigma (np.ndarray, shape=(npoint,)) – The second derivative of the energy w.r.t. density (once) and sigma (once).
  • v2sigma2 (np.ndarray, shape=(npoint,)) – The second derivative of the energy w.r.t. sigma (twice).
compute_gga_vxc(self, ndarray rho, ndarray sigma, ndarray vrho, ndarray vsigma)

Compute the GGA functional derivatives.

For every input x, a functional derivative is computed, vx, stored in an array with the same shape.

Parameters:
  • rho (np.ndarray, shape=(npoint,)) – The total electron density.
  • sigma (np.ndarray, shape=(npoint,)) – The reduced density gradient norm.
  • vrho (np.ndarray, shape=(npoint,), output) – The LDA part of the potential.
  • vsigma (np.ndarray, shape=(npoint,), output) – The GGA part of the potential, i.e. derivatives of the density w.r.t. the reduced gradient norm.
compute_lda_exc(self, ndarray rho, ndarray zk)

Compute the LDA energy density.

Parameters:
  • rho (np.ndarray, shape=(npoint,)) – The total electron density.
  • zk (np.ndarray, shape=(npoint,), output) – The energy density.
compute_lda_fxc(self, ndarray rho, ndarray v2rho2)

Compute the LDA hardness kernel.

Parameters:
  • rho (np.ndarray, shape=(npoint,)) – The total electron density.
  • v2rho2 (np.ndarray, shape=(npoint,), output) – The (diagonal) LDA kernel.
compute_lda_vxc(self, ndarray rho, ndarray vrho)

Compute the LDA potential.

Parameters:
  • rho (np.ndarray, shape=(npoint,)) – The total electron density.
  • vrho (np.ndarray, shape=(npoint,), output) – The LDA potential.
compute_mgga_exc(self, ndarray rho, ndarray sigma, ndarray lapl, ndarray tau, ndarray zk)

Compute the MGGA energy density.

Parameters:
  • rho (np.ndarray, shape=(npoint,)) – The total electron density.
  • sigma (np.ndarray, shape=(npoint,)) – The reduced density gradient norm.
  • lapl (np.ndarray, shape=(npoint,)) – The laplacian of the density.
  • tau (np.ndarray, shape=(npoint,)) – The kinetic energy density.
  • zk (np.ndarray, shape=(npoint,), output) – The energy density.
compute_mgga_vxc(self, ndarray rho, ndarray sigma, ndarray lapl, ndarray tau, ndarray vrho, ndarray vsigma, ndarray vlapl, ndarray vtau)

Compute the MGGA functional derivatives.

For every input x, a functional derivative is computed, vx, stored in an array with the same shape.

Parameters:
  • rho (np.ndarray, shape=(npoint,)) – The total electron density.
  • sigma (np.ndarray, shape=(npoint,)) – The reduced density gradient norm.
  • lapl (np.ndarray, shape=(npoint,)) – The laplacian of the density.
  • tau (np.ndarray, shape=(npoint,)) – The kinetic energy density.
  • vrho (np.ndarray, shape=(npoint,)) – The derivative of the energy w.r.t. the electron density.
  • vsigma (np.ndarray, shape=(npoint,)) – The derivative of the energy w.r.t. the reduced density gradient norm.
  • vlapl (np.ndarray, shape=(npoint,)) – The derivative of the energy w.r.t. the laplacian of the density.
  • vtau (np.ndarray, shape=(npoint,)) – The derivative of the energy w.r.t. the kinetic energy density.
get_hyb_exx_fraction(self)

Return the amount of Hartree-Fock exchange to be used.

family
key
kind
name
number
refs
class horton.meanfield.cext.ULibXCWrapper

Bases: horton.meanfield.cext.LibXCWrapper

compute_gga_exc(self, ndarray rho, ndarray sigma, ndarray zk)

Compute the GGA energy density.

Parameters:
  • rho (np.ndarray, shape=(npoint, 2)) – The alpha and beta electron density.
  • sigma (np.ndarray, shape=(npoint, 3)) – The reduced density gradient norms (alpha, alpha), (alpha, beta) and (beta, beta).
  • zk (np.ndarray, shape=(npoint,), output) – The energy density.
compute_gga_vxc(self, ndarray rho, ndarray sigma, ndarray vrho, ndarray vsigma)

Compute the GGA functional derivatives.

For every input x, a functional derivative is computed, vx, stored in an array with the same shape.

Parameters:
  • rho (np.ndarray, shape=(npoint, 2)) – The alpha and beta electron density.
  • sigma (np.ndarray, shape=(npoint, 3)) – The reduced density gradient norms (alpha, alpha), (alpha, beta) and (beta, beta).
  • vrho (np.ndarray, shape=(npoint, 2), output) – Derivative of the energy w.r.t. alpha and beta density
  • vsigma (np.ndarray, shape=(npoint, 3), output) – Derivative of the energy w.r.t reduced density gradient norms.
compute_lda_exc(self, ndarray rho, ndarray zk)

Compute the LDA energy density.

Parameters:
  • rho (np.ndarray, shape=(npoint, 2)) – The alpha and beta electron density.
  • zk (np.ndarray, shape=(npoint,), output) – The energy density.
compute_lda_vxc(self, ndarray rho, ndarray vrho)

Compute the LDA potentials (alpha and beta).

Parameters:
  • rho (np.ndarray, shape=(npoint, 2)) – The alpha and beta electron density.
  • vrho (np.ndarray, shape=(npoint, 2), output) – The SLDA potential, i.e. derivative of the energy w.r.t. alpha and beta density.
compute_mgga_exc(self, ndarray rho, ndarray sigma, ndarray lapl, ndarray tau, ndarray zk)

Compute the MGGA energy density.

Parameters:
  • rho (np.ndarray, shape=(npoint, 2)) – The alpha and beta electron density.
  • sigma (np.ndarray, shape=(npoint, 3)) – The reduced density gradient norms (alpha, alpha), (alpha, beta) and (beta, beta).
  • lapl (np.ndarray, shape=(npoint, 2)) – The laplacian of the alpha and beta density.
  • tau (np.ndarray, shape=(npoint, 2)) – The alph and beta kinetic energy density.
  • zk (np.ndarray, shape=(npoint,), output) – The energy density.
compute_mgga_vxc(self, ndarray rho, ndarray sigma, ndarray lapl, ndarray kin, ndarray vrho, ndarray vsigma, ndarray vlapl, ndarray vtau)

Compute the MGGA functional derivatives.

For every input x, a functional derivative is computed, vx, stored in an array with the same shape.

Parameters:
  • rho (np.ndarray, shape=(npoint, 2)) – The alpha and beta electron density.
  • sigma (np.ndarray, shape=(npoint, 3)) – The reduced density gradient norms (alpha, alpha), (alpha, beta) and (beta, beta).
  • lapl (np.ndarray, shape=(npoint, 2)) – The laplacian of the alpha and beta density.
  • tau (np.ndarray, shape=(npoint, 2)) – The alph and beta kinetic energy density.
  • vrho (np.ndarray, shape=(npoint, 2)) – The derivative of the energy w.r.t. the alpha and beta electron density.
  • vsigma (np.ndarray, shape=(npoint, 3)) – The derivative of the energy w.r.t. the reduced density gradient norms.
  • vlapl (np.ndarray, shape=(npoint, 2)) – The derivative of the energy w.r.t. the laplacian of the alpha and beta density.
  • vtau (np.ndarray, shape=(npoint, 2)) – The derivative of the energy w.r.t. the alpha and beta kinetic energy density.
get_hyb_exx_fraction(self)

Return the amount of Hartree-Fock exchange to be used.

family
key
kind
name
number
refs