Integral Drivers#

Integrals: Base Classes#

Base class for integral classes and their actual implementations.

class dxtb._src.integral.base.BaseIntegral(device=None, dtype=None, uplo='l', cutoff=50.0)[source]#

Bases: IntegralABC, TensorLike

Base class for integral implementations.

All integral calculations are executed by its child classes.

Parameters:
checks(driver)[source]#

Check if the driver is setup.

Return type:

None

Parameters:

driver (IntDriver) – Integral driver for the calculation.

Parameters:

driver (IntDriver)

clear()[source]#

Clear the integral matrix and gradient.

Return type:

None

normalize(norm=None, **_)[source]#

Normalize the integral (changes self.matrix).

Return type:

None

Parameters:

norm (Tensor | None, optional) – Overlap norm to normalize the integral.

Parameters:
normalize_gradient(norm=None)[source]#

Normalize the gradient (changes self.gradient).

Return type:

None

Parameters:

norm (Tensor) – Overlap norm to normalize the integral.

Parameters:

norm (Tensor | None)

to(device=None, dtype=None)[source]#

Returns a copy of the integral on the specified device “device”. This is essentially a wrapper around the to() method of the TensorLike class, but explicitly also moves the integral matrix.

Return type:

Self

Parameters:

device (torch.device | None) – Device to which all associated tensors should be moved.

Returns:

A copy of the integral placed on the specified device.

Return type:

Self

Parameters:
to_pt(path=None)[source]#

Save the integral matrix to a file.

Return type:

None

Parameters:

path (PathLike | None) – Path to the file where the integral matrix should be saved. If None, the matrix is saved to the default location.

Parameters:

path (str | Path | None)

cutoff: Tensor | float | int | None#

Real-space cutoff for integral calculation in Bohr. Defaults to constants.defaults.INTCUTOFF.

family: str | None#

Family of the integral implementation (PyTorch or libcint).

property matrix: Tensor#

Matrix of the integral.

property requires_grad: bool#

Check if any field of the integral class is requires gradient.

Returns:

Flag for gradient requirement.

Return type:

bool

uplo: Literal['n', 'u', 'l']#

Whether the matrix of unique shell pairs should be create as a triangular matrix (l: lower, u: upper) or full matrix (n). Defaults to l (lower triangular matrix).