triqs.dos.dos.DOSFromFunction

class triqs.dos.dos.DOSFromFunction(function, x_min, x_max, n_pts=100, name='')[source]

Bases: DOS

DOS constructed by sampling a callable \(\rho(\epsilon)\).

Evaluates function on an equispaced 1D mesh of n_pts points between x_min and x_max and stores the result as a DOS. The mesh can be re-sampled at runtime to refine precision – HilbertTransform.__call__() exploits this via its n_points_integral and test_convergence arguments.

Parameters:
functioncallable

Function \(\epsilon \mapsto \rho(\epsilon)\). The return value must be convertible to a 1D numpy array.

x_minfloat

Lower bound of the mesh (domain of function).

x_maxfloat

Upper bound of the mesh.

n_ptsint, optional

Number of points in the mesh. Default 100.

namestr, optional

Name of the DOS. Default ''.

Attributes

function

(callable) The callable supplied at construction.

x_min

(float) Lower mesh bound.

x_max

(float) Upper mesh bound.