tbplas.ParamFit
- class tbplas.ParamFit(k_points: ndarray, weights: ndarray = None)
Class for fitting on-site energies and hopping parameters to reference band data.
- _k_points
FRACTIONAL coordinates of the k-points corresponding to the band data
- Type:
(num_kpt, 3) float64 array
- _bands_ref
copy of reference band data
- Type:
(num_kpt, num_orb) float64 array
- _weights
weights of each band during fitting process
- Type:
(num_orb,) float64 array
- __init__(k_points: ndarray, weights: ndarray = None) None
- Parameters:
k_points – (num_kpt, 3) float64 array FRACTIONAL coordinates of the k-points
weights – (num_orb,) float64 array weights of each band for fitting
Methods
__init__
(k_points[, weights])calc_bands_fit
(params)Method for calculating fitted band data from given parameters. :param params: parameters to fit :return: (num_kpt, num_orb) float64 array band data of the model built from parameters.
Method for calculating reference band data. :return: (num_kpt, num_orb) float64 array reference band data.
estimate_error
(params)Object function for minimizing the error between reference and fitted band data.
fit
(params0, **kwargs)Fit the parameters to reference band data.
- __init__(k_points: ndarray, weights: ndarray = None) None
- Parameters:
k_points – (num_kpt, 3) float64 array FRACTIONAL coordinates of the k-points
weights – (num_orb,) float64 array weights of each band for fitting
- abstractmethod calc_bands_fit(params: ndarray) ndarray
Method for calculating fitted band data from given parameters. :param params: parameters to fit :return: (num_kpt, num_orb) float64 array
band data of the model built from parameters
- abstractmethod calc_bands_ref() ndarray
Method for calculating reference band data. :return: (num_kpt, num_orb) float64 array
reference band data
- estimate_error(params: ndarray) ndarray
Object function for minimizing the error between reference and fitted band data. :param params: parameters to fit :return: flattened difference between band data
- fit(params0: ndarray, **kwargs) ndarray
Fit the parameters to reference band data. :param params0: initial value of parameters to fit :param kwargs: keyword parameters for the ‘leastsq’ function of scipy :return: the optimal parameters after fitting :raises RuntimeError: if the fitting fails
- __weakref__
list of weak references to the object