3.7.2. horton.meanfield.builtin – Built-in energy terms

class horton.meanfield.builtin.RBeckeHartree(lmax, label='hartree_becke')

Bases: horton.meanfield.builtin.BeckeHartree

Hartree term with numerical Becke-Poisson solver for restricted wavefunctions.

add_dot(cache, grid, *args)

Add a dot product with the kernel to the output arguments.

Parameters:
  • cache (Cache) – Used to share intermediate results between the compute and add_pot methods. This cache will also contain pre-computed functions evaluate on the grid. See RGridGroup and UGridGroup for more details.
  • grid (IntGrid) – A numerical integration grid.
  • args (list of [np.ndarray, shape=(npoint, npot), dtype=float]) – The result of this method is added to these output arguments. They are a list of dot arrays. (Only one array for the alpha density in case of restricted. Two arrays, one for alpha and one for beta electrons, in case of unrestricted.) To each array dot data will be added, e.g. the dot product of the density kernel with a change in density, the dot product of the gradient kernel with a change in gradient, etc.
add_pot(cache, grid, pots_alpha)

Add the potential to the output arguments.

Parameters:
  • cache (Cache) – Used to share intermediate results between the compute and add_pot methods. This cache will also contain pre-computed functions evaluate on the grid. See RGridGroup and UGridGroup for more details.
  • grid (IntGrid) – A numerical integration grid.
  • args (list of [np.ndarray, shape=(npoint, npot), dtype=float]) –

    A list of potential arrays. (Only one array for the alpha density in case of restricted. Two arrays, one for alpha and one for beta electrons, in case of unrestricted.) Each array contains potential data, e.g. derivatives of a density functional toward:

    • column 0: the density
    • columns 1,2,3: gradient (x, y, z)
    • column 4: Laplacian
    • column 5: kinetic energy density

    Later columns may not be present if the functional does not need them. They could be present when other terms in the effective Hamiltonian need them.

compute_energy(cache, grid)

Compute the expectation value using numerical integration.

Parameters:
  • cache (Cache) – Used to share intermediate results between the compute and add_pot methods. This cache will also contain pre-computed functions evaluate on the grid. See RGridGroup and UGridGroup for more details.
  • grid (IntGrid) – A numerical integration grid.
df_level = 0
class horton.meanfield.builtin.UBeckeHartree(lmax, label='hartree_becke')

Bases: horton.meanfield.builtin.BeckeHartree

Hartree term with numerical Becke-Poisson solver for unrestricted wavefunctions.

add_dot(cache, grid, *args)

Add a dot product with the kernel to the output arguments.

Parameters:
  • cache (Cache) – Used to share intermediate results between the compute and add_pot methods. This cache will also contain pre-computed functions evaluate on the grid. See RGridGroup and UGridGroup for more details.
  • grid (IntGrid) – A numerical integration grid.
  • args (list of [np.ndarray, shape=(npoint, npot), dtype=float]) – The result of this method is added to these output arguments. They are a list of dot arrays. (Only one array for the alpha density in case of restricted. Two arrays, one for alpha and one for beta electrons, in case of unrestricted.) To each array dot data will be added, e.g. the dot product of the density kernel with a change in density, the dot product of the gradient kernel with a change in gradient, etc.
add_pot(cache, grid, pots_alpha, pots_beta)

Add the potential to the output arguments.

Parameters:
  • cache (Cache) – Used to share intermediate results between the compute and add_pot methods. This cache will also contain pre-computed functions evaluate on the grid. See RGridGroup and UGridGroup for more details.
  • grid (IntGrid) – A numerical integration grid.
  • args (list of [np.ndarray, shape=(npoint, npot), dtype=float]) –

    A list of potential arrays. (Only one array for the alpha density in case of restricted. Two arrays, one for alpha and one for beta electrons, in case of unrestricted.) Each array contains potential data, e.g. derivatives of a density functional toward:

    • column 0: the density
    • columns 1,2,3: gradient (x, y, z)
    • column 4: Laplacian
    • column 5: kinetic energy density

    Later columns may not be present if the functional does not need them. They could be present when other terms in the effective Hamiltonian need them.

compute_energy(cache, grid)

Compute the expectation value using numerical integration.

Parameters:
  • cache (Cache) – Used to share intermediate results between the compute and add_pot methods. This cache will also contain pre-computed functions evaluate on the grid. See RGridGroup and UGridGroup for more details.
  • grid (IntGrid) – A numerical integration grid.
df_level = 0
class horton.meanfield.builtin.RDiracExchange(label='x_dirac', coeff=None)

Bases: horton.meanfield.builtin.DiracExchange

Initialize a DiracExchange instance.

Parameters:
  • label (str) – A label for this observable.
  • coeff (float) – The coefficient Cx in front of the Dirac exchange energy. It defaults to the uniform electron gas value, i.e. \(C_x = \frac{3}{4} \left(\frac{3}{\pi}\right)^{1/3}\).
add_dot(cache, grid, *args)

Add a dot product with the kernel to the output arguments.

Parameters:
  • cache (Cache) – Used to share intermediate results between the compute and add_pot methods. This cache will also contain pre-computed functions evaluate on the grid. See RGridGroup and UGridGroup for more details.
  • grid (IntGrid) – A numerical integration grid.
  • args (list of [np.ndarray, shape=(npoint, npot), dtype=float]) – The result of this method is added to these output arguments. They are a list of dot arrays. (Only one array for the alpha density in case of restricted. Two arrays, one for alpha and one for beta electrons, in case of unrestricted.) To each array dot data will be added, e.g. the dot product of the density kernel with a change in density, the dot product of the gradient kernel with a change in gradient, etc.
add_pot(cache, grid, pots_alpha)

Add the potential to the output arguments.

Parameters:
  • cache (Cache) – Used to share intermediate results between the compute and add_pot methods. This cache will also contain pre-computed functions evaluate on the grid. See RGridGroup and UGridGroup for more details.
  • grid (IntGrid) – A numerical integration grid.
  • args (list of [np.ndarray, shape=(npoint, npot), dtype=float]) –

    A list of potential arrays. (Only one array for the alpha density in case of restricted. Two arrays, one for alpha and one for beta electrons, in case of unrestricted.) Each array contains potential data, e.g. derivatives of a density functional toward:

    • column 0: the density
    • columns 1,2,3: gradient (x, y, z)
    • column 4: Laplacian
    • column 5: kinetic energy density

    Later columns may not be present if the functional does not need them. They could be present when other terms in the effective Hamiltonian need them.

compute_energy(cache, grid)

Compute the expectation value using numerical integration.

Parameters:
  • cache (Cache) – Used to share intermediate results between the compute and add_pot methods. This cache will also contain pre-computed functions evaluate on the grid. See RGridGroup and UGridGroup for more details.
  • grid (IntGrid) – A numerical integration grid.
df_level = 0
class horton.meanfield.builtin.UDiracExchange(label='x_dirac', coeff=None)

Bases: horton.meanfield.builtin.DiracExchange

Initialize a DiracExchange instance.

Parameters:
  • label (str) – A label for this observable.
  • coeff (float) – The coefficient Cx in front of the Dirac exchange energy. It defaults to the uniform electron gas value, i.e. \(C_x = \frac{3}{4} \left(\frac{3}{\pi}\right)^{1/3}\).
add_dot(cache, grid, *args)

Add a dot product with the kernel to the output arguments.

Parameters:
  • cache (Cache) – Used to share intermediate results between the compute and add_pot methods. This cache will also contain pre-computed functions evaluate on the grid. See RGridGroup and UGridGroup for more details.
  • grid (IntGrid) – A numerical integration grid.
  • args (list of [np.ndarray, shape=(npoint, npot), dtype=float]) – The result of this method is added to these output arguments. They are a list of dot arrays. (Only one array for the alpha density in case of restricted. Two arrays, one for alpha and one for beta electrons, in case of unrestricted.) To each array dot data will be added, e.g. the dot product of the density kernel with a change in density, the dot product of the gradient kernel with a change in gradient, etc.
add_pot(cache, grid, pots_alpha, pots_beta)

Add the potential to the output arguments.

Parameters:
  • cache (Cache) – Used to share intermediate results between the compute and add_pot methods. This cache will also contain pre-computed functions evaluate on the grid. See RGridGroup and UGridGroup for more details.
  • grid (IntGrid) – A numerical integration grid.
  • args (list of [np.ndarray, shape=(npoint, npot), dtype=float]) –

    A list of potential arrays. (Only one array for the alpha density in case of restricted. Two arrays, one for alpha and one for beta electrons, in case of unrestricted.) Each array contains potential data, e.g. derivatives of a density functional toward:

    • column 0: the density
    • columns 1,2,3: gradient (x, y, z)
    • column 4: Laplacian
    • column 5: kinetic energy density

    Later columns may not be present if the functional does not need them. They could be present when other terms in the effective Hamiltonian need them.

compute_energy(cache, grid)

Compute the expectation value using numerical integration.

Parameters:
  • cache (Cache) – Used to share intermediate results between the compute and add_pot methods. This cache will also contain pre-computed functions evaluate on the grid. See RGridGroup and UGridGroup for more details.
  • grid (IntGrid) – A numerical integration grid.
df_level = 0