qrunch.chemistry.integral_builders

Module with integral builders.

Classes

IntegralBuilderSubCreator

Two-body electron repulsion integral builder sub-creator.

class DoubleFactorizedIntegralBuilder

Bases: TwoBodyElectronRepulsionIntegralBuilderProtocol

Build integrals using Double Factorized integrals.

__init__(*, repulsion_integral_builder: TwoBodyElectronRepulsionIntegralBuilderProtocol | None = None, tolerance: float = 1e-10) None

Initialize the Double Factorized integral builder.

Parameters:
  • repulsion_integral_builder (TwoBodyElectronRepulsionIntegralBuilderProtocol | None) – The object that can build the initial two electron repulsion integrals, that can be double factorized.

  • tolerance (float) – Minimum eigenvalue threshold for inclusion.

Return type:

None

calculate_integrals(molecular_orbitals: RestrictedMolecularOrbitals | UnrestrictedMolecularOrbitals, molecular_configuration: MolecularConfiguration) RestrictedDoubleFactorizedIntegrals | UnrestrictedTwoBodyElectronRepulsionIntegralsProtocol

Compute Double Factorized integrals for a given molecule.

The tensor is decomposed into lower-rank objects. In this process, we perform two eigenvalue decompositions. The first one provides a set of eigenvalues g_elements and eigenvectors in the form of v_matrices. The second eigenvalue decomposition return sets of eigenvalues and eigenvector matrices for each v_matrix, which we name l_elements and u_matrices. The z_matrices are also generated from the l_elements and g_elements and are useful when reconstructing the tensor or calling individual coefficients.

Not implemented for unrestricted orbitals.

Parameters:
Return type:

RestrictedDoubleFactorizedIntegrals | UnrestrictedTwoBodyElectronRepulsionIntegralsProtocol

class GridLevel

Bases: Enum

Defines grid resolution levels for numerical integration in PySCF.

The value of the enum is used to select the number of radial grid shells and the number of angular (spherical) points per shell.

LEVEL0 through LEVEL9 goes from fast to accurate. LEVEL9 is the default.

LEVEL0 = (2, 14)

2 radial shells and 14 angular points per shell.

LEVEL1 = (4, 14)

4 radial shells and 14 angular points per shell.

LEVEL2 = (4, 26)

4 radial shells and 26 angular points per shell.

LEVEL3 = (6, 26)

6 radial shells and 26 angular points per shell.

LEVEL4 = (6, 38)

6 radial shells and 38 angular points per shell.

LEVEL5 = (8, 38)

8 radial shells and 38 angular points per shell.

LEVEL6 = (8, 50)

8 radial shells and 50 angular points per shell.

LEVEL7 = (10, 50)

10 radial shells and 50 angular points per shell.

LEVEL8 = (10, 74)

10 radial shells and 74 angular points per shell.

LEVEL9 = (12, 74)

12 radial shells and 74 angular points per shell.

class ResolutionOfTheIdentityIntegralBuilder

Bases: TwoBodyElectronRepulsionIntegralBuilderProtocol

Build integrals using Resolution of the Identity (RI) integrals.

__init__(*, aux_basis: BasisSet | None = None) None

Initialize the Resolution of the Identity (RI) integral builder.

Parameters:

aux_basis (BasisSet | None) – The auxiliary density-fitting RI basis set. Defaults to the Weigend-Coulomb-fit basis.

Return type:

None

calculate_integrals(molecular_orbitals: RestrictedMolecularOrbitals | UnrestrictedMolecularOrbitals, molecular_configuration: MolecularConfiguration) RestrictedResolutionOfTheIdentityIntegrals | UnrestrictedResolutionOfTheIdentityIntegrals

Calculate the Resolution of the Identity (RI) two-electron repulsion integrals (ERI) in the MO basis.

Parameters:
Return type:

RestrictedResolutionOfTheIdentityIntegrals | UnrestrictedResolutionOfTheIdentityIntegrals

class TensorHyperContractionIntegralsBuilder

Bases: TwoBodyElectronRepulsionIntegralBuilderProtocol

Build integrals using Tensor Hyper Contraction (THC) approximation.

__init__(*, use_ri: bool = True, use_grid_point_pruning: bool = True, pseudoinverse_tolerance: float = 1e-08, grid_level: GridLevel = GridLevel.LEVEL9, maximum_memory_in_gb: float = 10.0, aux_basis: BasisSet | None = None) None

Initialize the Tensor Hyper Contraction (THC) integral builder.

Parameters:
  • use_ri (bool) – If True, use the 3 index RI tensor (via Cholesky decomposition) to compute THC matrices. Otherwise, use the conventional 4 index integrals.

  • use_grid_point_pruning (bool) – Use grid point pruning.

  • pseudoinverse_tolerance (float) – The tolerance acts as a cutoff threshold constructing the pseudoinverse.

  • grid_level (GridLevel) – The numerical grid level.

  • maximum_memory_in_gb (float) – The maximum memory in GB.

  • aux_basis (BasisSet | None) – The auxiliary density-fitting RI basis set. Defaults to the Weigend-Coulomb-fit basis.

Return type:

None

calculate_integrals(molecular_orbitals: RestrictedMolecularOrbitals | UnrestrictedMolecularOrbitals, molecular_configuration: MolecularConfiguration) RestrictedTensorHyperContractionIntegrals | UnrestrictedTensorHyperContractionIntegrals

Compute tensor hyper-contraction (THC) integrals for a given molecule.

Parameters:
Return type:

RestrictedTensorHyperContractionIntegrals | UnrestrictedTensorHyperContractionIntegrals

class TwoBodyElectronRepulsionIntegralBuilder

Bases: TwoBodyElectronRepulsionIntegralBuilderProtocol

Build integrals by performing the full 4-index four-center AO to MO transformation.

__init__() None

Initialize the two-body electron repulsion integral builder.

Return type:

None

calculate_integrals(molecular_orbitals: RestrictedMolecularOrbitals | UnrestrictedMolecularOrbitals, molecular_configuration: MolecularConfiguration) RestrictedTwoBodyElectronRepulsionIntegrals | UnrestrictedTwoBodyElectronRepulsionIntegrals

Calculate the 4-center two-electron repulsion integrals (ERI) in the MO basis.

Parameters:
Return type:

RestrictedTwoBodyElectronRepulsionIntegrals | UnrestrictedTwoBodyElectronRepulsionIntegrals

class TwoBodyElectronRepulsionIntegralBuilderProtocol

Bases: Protocol

Protocol for classes that build restricted two-body electron repulsion integrals.

__init__(*args, **kwargs)
calculate_integrals(molecular_orbitals: RestrictedMolecularOrbitals | UnrestrictedMolecularOrbitals, molecular_configuration: MolecularConfiguration) RestrictedTwoBodyElectronRepulsionIntegralsProtocol | UnrestrictedTwoBodyElectronRepulsionIntegralsProtocol

Calculate the two-body electron repulsion integrals for a given molecule.

Parameters:
Return type:

RestrictedTwoBodyElectronRepulsionIntegralsProtocol | UnrestrictedTwoBodyElectronRepulsionIntegralsProtocol

Modules

double_factorized_integral_builder

Module for Double Factorized Integral builders.

integral_builder_protocols

Integral builder protocols.

resolution_of_the_identity_integral_builder

Resolution of the identity integral builders.

standard_integral_builder

Standard four center two-electron repulsion integral builders.

tensor_hyper_contraction_integral_builder

Module for Tensor Hyper Contraction integral builders.