fold¶
- fold(eri, *, validate=True)[source]¶
Folds an electronic integrals tensor.
This utility method combines
fold_s4_to_s8(),fold_s1_to_s8()andfold_s1_to_s4()and attempts to fold the provided tensor as much as possible given these folding methods. AnyValueErrorraised by the methods above is caught. When this happens, this utility will try the next folding method.- Parameters:
eri (Tensor | ndarray | SparseArray) – a 4-, 2- or 1-dimensional array storing electronic integrals.
validate (bool) – when set to
False, the requirements oferiare not validated.
- Returns:
Either an instance of
S8Integrals,S4IntegralsorS1Integrals(in this order) depending on the first successful folding method.- Raises:
NotImplementedError – if
eriis of an unsupported dimension.- Return type: