quemb.molbe.eri_sparse_DF.SemiSparse3DTensor

class quemb.molbe.eri_sparse_DF.SemiSparse3DTensor(unique_dense_data, keys, shape, AO_reachable_by_MO_with_offsets, AO_reachable_by_MO)

Specialised datastructure for immutable and semi-sparse 3-indexed tensors.

For a tensor, \(T_{ijk}\), to be stored in this datastructure we assume

  • sparsity along the \(i, j\) indices, i.e. \(T_{ijk} = 0\) for many \(i, j\)

  • dense storage along the \(k\) index

It can be used for example to store the partially contracted 3-center, 2-electron integrals \((\mu i | P)\), with AO \(\mu\), localised MO \(i\), and auxiliary basis indices \(P\). Semi-sparsely, because it is assumed that there are many exchange pairs \(\mu, i\) which are zero, while the integral along the auxiliary basis \(P\) is stored densely as numpy array.

2-fold permutational symmetry for the \(\mu, i\) pairs is not assumed.

Note that this class is immutable which enables to store the non-zero data in a dense manner, which has some performance benefits.

Attributes

class_type = jitclass.SemiSparse3DTensor#7fbbc4c016d0<_keys:array(int64, 1d, C),dense_data:array(float64, 2d, C),shape:UniTuple(int64 x 3),AO_reachable_by_MO_with_offsets:ListType[ListType[UniTuple(int64 x 2)]],AO_reachable_by_MO:ListType[array(int64, 1d, C)],naux:int64>
shape: tuple[int, int, int]

number of AOs, number of MOs, number of auxiliary functions.

naux: int

number of auxiliary functions

AO_reachable_by_MO: list[ndarray[tuple[int], dtype[NewType(AOIdx, NewType(OrbitalIdx, integer))]]]

For a given MO index i the self.AO_reachable_by_MO[i] returns all mu that are assumed unrelevant for \((\mu i | r s)\) after screening. Note that \((p i | P )\) might still be non-zero.

AO_reachable_by_MO_with_offsets: list[list[tuple[int, NewType(AOIdx, NewType(OrbitalIdx, integer))]]]

The following datastructures also return the offset to index the dense_data directly and enables very fast loops without having to compute the offset.

for offset, mu in self.AO_reachable_by_MO[i]:
    self.dense_data[offset] == self[mu, i]  # True
dense_data: ndarray[tuple[int, ...], dtype[float64]]

Methods

__init__(unique_dense_data, keys, shape, ...)

to_dense()

Convert to dense 3D tensor