utilities

Module: luescher_nd.database.utilities

Utility functions for database submodule

get_continuum_extrapolation(df, n_poly_max=4, delta_x=1.25e-13, include_statistics=True, odd_poly=False)[source]

Takes a data frame read in by read tables and runs a continuum extrapolation for the spectrum.

The continuum extrapolation is executed by a even polynomial fit up to order n_poly_max

Arguments
df: pd.DataFrame

DataFrame returend by read_table.

n_poly_max: int = 4

Maximal order of the polynomial used for the spectrum extrapolation. The fitter runs fits from 1 to n_poly_max even polynomials and picks the best one defined by the maximum of the logGBF.

delta_x:float=1.0e-8

Approximate error for the x-values.

include_statistics: bool = True

Includes fit statistics like chi2/dof or logGBF.

odd_poly: bool = False

Allow fits of odd polynomials.

Return type

DataFrame

get_degeneracy(n1d, ndim=3)[source]

Computes n@n from lattice vectors in [-n1d//2, n1d//2) and counts degeneracy.

Vectors are gegenerate if there is no permutation such that abs(v1) == abs(v2) but still v1@v1 == v2@v2.

The dictionary contains equivalency classes for each v@v value.

Arguments
n1d: int

Number of lattice sides in on dimension.

ndim: int = 3

Number of dimensions.

Return type

Dict[int, List[Tuple[int, int, int]]]

get_degeneracy_list(n1d, ndim=3)[source]

Computes n@n from lattice vectors in [-n1d//2, n1d//2) and counts degeneracy.

Vectors are gegenerate if there is no permutation such that abs(v1) == abs(v2) but still v1@v1 == v2@v2.

The returned list returns the n**2 values which are degenerate.

Arguments
n1d: int

Number of lattice sides in on dimension.

ndim: int = 3

Number of dimensions.

Return type

List[int]

get_ere(df, zeta='spherical')[source]

Converts data frame of box levels to effective range expansion.

Return type

Series

read_table(database, zeta=None, filter_poles=False, round_digits=2, filter_by_nstates=False, filter_degeneracy=False, drop_comment=True)[source]

Reads database and returns data frame with table plus additional columns.

The database must contain an Energy table. Drops all entries which are at or close to divergencies of the zeta function.

Argumennts:
database: str

The sqlite database file.

zeta: Optional[str] = None

Zeta function to use to convert spectrum to phase shifts. Valid options are ‘spherical’, ‘dispersion’ or ‘cartesian’. Defaults to not converting (if None).

filter_poles: bool = False

Automatically filter out states which are close to zeta poles.

round_digits: int = 2

How close an x-value has to be to an integer in order to be dropped.

filter_by_nstates: bool = False

Automatically filter out states which are degenerate.

drop_comment: bool = True

Drops the comment column.

Return type

DataFrame