quemb.shared.helperΒΆ

Functions

add_docstring(doc)

Add a docstring to a function as decorator.

add_init_docstring(obj)

Add a sensible docstring to the __init__ method of an attrs class

clean_overlap(M[, epsilon])

We assume that M is a (not necessarily square) overlap matrix between ortho-normal vectors.

copy_docstring(f)

Copy docstring from another function as decorator.

delete_multiple_files(*args)

ensure(condition[, message])

This function can be used instead of assert, if the test should be always executed.

gauss_sum(n)

Return the sum \(\sum_{i=1}^n i\)

get_calling_function_name()

Do stack inspection shenanigan to obtain the name of the calling function

get_flexible_n_eri(p_max, q_max, r_max, s_max)

Return the number of unique ERIs but allowing different number of orbitals.

jitclass([cls_or_spec, spec])

Decorator to make a class jit-able.

n_eri(n)

n_symmetric(n)

The number if symmetry-equivalent pairs i <= j, for i <= n and j <= n

ncore_(z)

njit([f])

Type-safe jit wrapper that caches the compiled function

ravel_C(a, b, n_cols)

Flatten the index a, b assuming row-mayor/C indexing

ravel_Fortran(a, b, n_rows)

Flatten the index a, b assuming column-mayor/Fortran indexing

ravel_eri_idx(a, b, c, d)

Return compound index given four indices using Yoshimine sort and assuming 8-fold permutational symmetry

ravel_symmetric(a, b)

Flatten the index a, b assuming symmetry.

symmetric_different_size(m, n)

Return the number of unique elements in a symmetric matrix of different row and column length

union_of_seqs(*seqs)

Merge multiple sequences into a single OrderedSet.

unravel_eri_idx(i)

Invert ravel_eri_idx()

unravel_symmetric(i)

unused(*args)

Classes

Timer([message])

Simple class to time code execution