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

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.

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

unused(*args)

Classes

Timer([message])

Simple class to time code execution