Libcint#

Integral Driver: Libcint#

libcint-based integral implementations.

Drivers#

Driver: Libcint#

Base class for a libcint-based integral implementation Calculation and modification of multipole integrals.

class dxtb._src.integral.driver.libcint.driver.BaseIntDriverLibcint(*args, **kwargs)[source]#

Bases: LibcintImplementation, IntDriver

Implementation of libcint-based integral driver.

setup(positions, **kwargs)[source]#

Run the libcint-specific driver setup.

Return type:

None

Parameters:

positions (Tensor) – Cartesian coordinates of all atoms (shape: (..., nat, 3)).

Parameters:

positions (Tensor)

family: Literal['libcint']#

Label for integral implementation family.

ihelp: IndexHelper#

Helper class for indexing.

numbers: Tensor#

Atomic numbers of the atoms in the system.

par: ParamModule#

Representation of parametrization of xTB method.

class dxtb._src.integral.driver.libcint.driver.IntDriverLibcint(*args, **kwargs)[source]#

Bases: BaseIntDriverLibcint

Implementation of libcint-based integral driver.

family: Literal['libcint']#

Label for integral implementation family.

ihelp: IndexHelper#

Helper class for indexing.

numbers: Tensor#

Atomic numbers of the atoms in the system.

par: ParamModule#

Representation of parametrization of xTB method.

Implementations#

Implementation: Overlap#

Overlap implementation based on libcint.

class dxtb._src.integral.driver.libcint.overlap.OverlapLibcint(device=None, dtype=None, uplo='l', cutoff=50.0)[source]#

Bases: OverlapIntegral, IntegralLibcint

Overlap integral from atomic orbitals.

Use the build() method to calculate the overlap integral. The returned matrix uses a custom autograd function to calculate the backward pass with the analytical gradient. For the full gradient, i.e., a matrix of shape (..., norb, norb, 3), the get_gradient() method should be used.

Parameters:
build(driver, **_)[source]#

Calculation of overlap integral using libcint.

Return type:

Tensor

Returns:

driver – The integral driver for the calculation.

Return type:

IntDriverLibcint

Returns:

Overlap integral matrix of shape (..., norb, norb).

Return type:

Tensor

Parameters:
get_gradient(driver, **_)[source]#

Overlap gradient calculation using libcint.

Return type:

Tensor

Parameters:

driver (IntDriverLibcint) – The integral driver for the calculation.

Returns:

Overlap gradient of shape (..., norb, norb, 3).

Return type:

Tensor

Parameters:
cutoff: Tensor | float | int | None#

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

family: Literal['libcint']#

Label for integral implementation family.

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).

Implementation: Multipole Base#

Template for calculation and modification of multipole integrals.

class dxtb._src.integral.driver.libcint.multipole.MultipoleLibcint(device=None, dtype=None, uplo='l', cutoff=50.0)[source]#

Bases: IntegralLibcint

Base class for multipole integrals calculated with libcint.

Parameters:
multipole(driver, intstring)[source]#

Calculation of multipole integral. The integral is normalized, using the diagonal of the overlap integral.

Return type:

Tensor

Parameters:
  • driver (IntDriver) – The integral driver for the calculation.

  • intstring (str) – String for libcint integral engine.

Returns:

Normalized multipole integral.

Return type:

Tensor

Parameters:
cutoff: Tensor | float | int | None#

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

family: Literal['libcint']#

Label for integral implementation family.

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).

Implementation: Dipole#

Dipole integral implementation based on libcint.

class dxtb._src.integral.driver.libcint.dipole.DipoleLibcint(device=None, dtype=None, uplo='l', cutoff=50.0)[source]#

Bases: DipoleIntegral, MultipoleLibcint

Dipole integral from atomic orbitals.

Parameters:
build(driver)[source]#

Calculation of dipole integral using libcint.

Return type:

Tensor

Parameters:

driver (IntDriverLibcint) – The integral driver for the calculation.

Returns:

Dipole integral.

Return type:

Tensor

Parameters:

driver (IntDriverLibcint)

get_gradient(driver)[source]#

Calculation of dipole gradient using libcint.

Return type:

Tensor

Parameters:

driver (IntDriverLibcint) – The integral driver for the calculation.

Returns:

Dipole gradient.

Return type:

Tensor

Parameters:

driver (IntDriverLibcint)

cutoff: Tensor | float | int | None#

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

family: Literal['libcint']#

Label for integral implementation family.

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).

Implementation: Quadrupole#

Quadrupole integral implementation based on libcint.

class dxtb._src.integral.driver.libcint.quadrupole.QuadrupoleLibcint(device=None, dtype=None, uplo='l', cutoff=50.0)[source]#

Bases: QuadrupoleIntegral, MultipoleLibcint

Quadrupole integral from atomic orbitals.

Parameters:
build(driver)[source]#

Calculation of quadrupole integral using libcint.

Return type:

Tensor

Parameters:

driver (IntDriverLibcint) – The integral driver for the calculation.

Returns:

Quadrupole integral.

Return type:

Tensor

Parameters:

driver (IntDriverLibcint)

get_gradient(driver, **kwargs)[source]#

Calculation of quadrupole gradient using libcint.

Return type:

Tensor

Parameters:

driver (IntDriverLibcint) – The integral driver for the calculation.

Returns:

Quadrupole gradient.

Return type:

Tensor

Parameters:
  • driver (IntDriver)

  • kwargs (Any)

cutoff: Tensor | float | int | None#

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

family: Literal['libcint']#

Label for integral implementation family.

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).