Skip to content

Integrals and GTO basis (low level)¤

The analytic integral matrices (Obara-Saika / McMurchie-Davidson, all jit/vmap/grad-friendly) and the GTO basis container they act on. Most users never call these directly.

dftax.integrals.overlap_matrix(basis: BasisData, plan: tuple | None = None) -> Float[Array, 'nao nao'] ¤

Overlap matrix S_μν = ⟨χ_μ|χ_ν⟩.

Differentiable with respect to basis.centers.

Parameters:

Name Type Description Default
basis BasisData

the orbital basis, from :func:~dftax.energy.gto.extract_basis_data.

required
plan tuple | None

the shell-pair plan from :func:~dftax.integrals.eri3c_bucketed.plan_pairs; needed only when basis is traced, as under jit with the basis as an argument.

None

Returns:

Type Description
Float[Array, 'nao nao']

(nao, nao) array, spherical when the basis is.

dftax.integrals.kinetic_matrix(basis: BasisData, plan: tuple | None = None) -> Float[Array, 'nao nao'] ¤

Kinetic energy matrix T_μν = -½ ⟨χ_μ|∇²|χ_ν⟩.

Differentiable with respect to basis.centers.

Parameters:

Name Type Description Default
basis BasisData

the orbital basis, from :func:~dftax.energy.gto.extract_basis_data.

required
plan tuple | None

the shell-pair plan from :func:~dftax.integrals.eri3c_bucketed.plan_pairs; needed only when basis is traced, as under jit with the basis as an argument.

None

Returns:

Type Description
Float[Array, 'nao nao']

(nao, nao) array, spherical when the basis is.

dftax.integrals.nuclear_attraction_matrix(basis: BasisData, atom_coords: Float[Array, 'n_atoms 3'], atom_charges: Float[Array, n_atoms], plan: tuple | None = None) -> Float[Array, 'nao nao'] ¤

Nuclear attraction matrix V_μν = -Σ_A Z_A ∫ χ_μ(r) χ_ν(r) / |r - R_A| dr.

Differentiable with respect to basis.centers and atom_coords.

Parameters:

Name Type Description Default
basis BasisData

the orbital basis, from :func:~dftax.energy.gto.extract_basis_data.

required
atom_coords Float[Array, 'n_atoms 3']

nuclear coordinates (Bohr), (natom, 3).

required
atom_charges Float[Array, n_atoms]

nuclear charges, (natom,).

required
plan tuple | None

the shell-pair plan from :func:~dftax.integrals.eri3c_bucketed.plan_pairs; needed only when basis is traced, as under jit with the basis as an argument.

None

Returns:

Type Description
Float[Array, 'nao nao']

(nao, nao) array.

dftax.integrals.nuclear_repulsion ¤

__cached__ module-attribute ¤

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.

__file__ module-attribute ¤

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.

__name__ module-attribute ¤

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.

__package__ module-attribute ¤

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.

nuclear_repulsion(coords: Float[Array, 'n_atoms 3'], charges: Float[Array, n_atoms]) -> Shaped[Array, ''] ¤

Compute nuclear repulsion energy.

Parameters:

Name Type Description Default
coords Float[Array, 'n_atoms 3']

Nuclear positions in Bohr, shape (n_atoms, 3).

required
charges Float[Array, n_atoms]

Nuclear charges, shape (n_atoms,).

required

Returns:

Type Description
Shaped[Array, '']

Nuclear repulsion energy in Hartree (scalar).

dftax.integrals.eri2c_matrix(aux_basis: BasisData, omega: float | None = None, plan: tuple | None = None) -> Float[Array, 'n_aux n_aux'] ¤

2-center electron repulsion integrals (P|Q), the density-fitting metric.

Differentiable with respect to aux_basis.centers.

Parameters:

Name Type Description Default
aux_basis BasisData

the auxiliary basis.

required
omega float | None

None for the Coulomb operator; a float for the long-range operator erf(ω r₁₂)/r₁₂.

None
plan tuple | None

the shell-pair plan from :func:~dftax.integrals.eri3c_bucketed.plan_pairs; needed only when aux_basis is traced, as under jit with the basis as an argument.

None

Returns:

Type Description
Float[Array, 'n_aux n_aux']

(naux, naux) array.

dftax.integrals.eri3c_matrix(basis: BasisData, aux_basis: BasisData, omega: float | None = None, plan: tuple | None = None) -> Float[Array, 'nao nao n_aux'] ¤

3-center electron repulsion integrals (μν|P).

Differentiable with respect to basis.centers and aux_basis.centers.

Parameters:

Name Type Description Default
basis BasisData

the orbital basis, from :func:~dftax.energy.gto.extract_basis_data.

required
aux_basis BasisData

the auxiliary basis.

required
omega float | None

None for the Coulomb operator 1/r₁₂; a float for the long-range operator erf(ω r₁₂)/r₁₂.

None
plan tuple | None

the shell-class plan from :func:~dftax.integrals.eri3c_bucketed.plan_eri3c; needed only when the bases are traced, as under jit with the bases as arguments.

None

Returns:

Type Description
Float[Array, 'nao nao n_aux']

(nao, nao, naux) array.

dftax.integrals.multipole.dipole_matrices(basis: BasisData, origin=(0.0, 0.0, 0.0)) -> Float[Array, '3 nao nao'] ¤

Dipole integral matrices ⟨μ|(r-origin)|ν⟩ for the x, y, z components.

Differentiable w.r.t. basis.centers and origin. Returns shape (3, nao, nao) in the same AO ordering as :func:~dftax.integrals.overlap_matrix (spherical if basis.cart2sph is set).

dftax.energy.gto.BasisData ¤

A Gaussian basis set placed on a molecule, as the integral and grid functions take it.

Attributes:

Name Type Description
centers

center of each cartesian AO (Bohr), (nao_cart, 3).

exponents

primitive exponents, zero-padded, (nao_cart, max_prim).

coefficients

normalized contraction coefficients, zero-padded, (nao_cart, max_prim).

angular

cartesian powers (lx, ly, lz) of each AO, (nao_cart, 3).

cart2sph

cartesian-to-spherical transformation, (nao_cart, nao_sph), or None for a cartesian basis.

max_l

largest angular momentum in the basis.

__abstractclassvars__ class-attribute ¤

Build an immutable unordered collection of unique elements.

__abstractmethods__ class-attribute ¤

Build an immutable unordered collection of unique elements.

__abstractvars__ class-attribute ¤

Build an immutable unordered collection of unique elements.

__annotations__ class-attribute ¤

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

__dataclass_fields__ class-attribute ¤

dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)

__dataclass_params__ class-attribute ¤
__doc__ class-attribute ¤

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.

__firstlineno__ class-attribute ¤

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer iteral.

int('0b100', base=0) 4

__match_args__ class-attribute ¤

Built-in immutable sequence.

If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.

If the argument is a tuple, the return value is the same object.

__module__ class-attribute ¤

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to 'utf-8'. errors defaults to 'strict'.

__static_attributes__ class-attribute ¤

Built-in immutable sequence.

If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.

If the argument is a tuple, the return value is the same object.

max_l class-attribute ¤

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer iteral.

int('0b100', base=0) 4

__init__(centers: Float[Array, 'nao_cart 3'], exponents: Float[Array, 'nao_cart max_prim'], coefficients: Float[Array, 'nao_cart max_prim'], angular: Int[Array, 'nao_cart 3'], cart2sph: Float[Array, 'nao_cart nao_sph'] | None, max_l: int = 4) -> None ¤

Initialize self. See help(type(self)) for accurate signature.

dftax.energy.gto.extract_basis_data(mol: object) -> BasisData ¤

The :class:BasisData of a PySCF molecule.

Parameters:

Name Type Description Default
mol object

a built PySCF gto.Mole.

required

Returns:

Name Type Description
Its BasisData

class:BasisData, spherical when mol.cart is false.

Raises:

Type Description
NotImplementedError

mol has effective core potentials, which dftax does not support.

dftax.energy.gto.eval_gto(basis: BasisData, r: Float[Array, 3]) -> Float[Array, nao] ¤

Values of the contracted basis functions at one point.

Differentiable, and works under jit and vmap.

Parameters:

Name Type Description Default
basis BasisData

the basis, from :func:extract_basis_data.

required
r Float[Array, 3]

the point (Bohr), (3,).

required

Returns:

Type Description
Float[Array, nao]

(nao,) array, in the order of PySCF's eval_ao.