tightbinder.optimize.loss_init#
- loss_init(model, kpoints, energy, penalization=None, map=None)[source]#
Routine to generate the loss function (least squares) in terms of the parameters of a given model, evaluated over a specific k path and compared with some bands, typically from DFT, to fit the model bands to
- Parameters:
model (
SlaterKoster) – SlaterKoster model. Must implement the method solve() to evaluate the model.kpoints (
ndarray) – Array of shape (nk, 3) with the kpoints.energy (
ndarray) – Matrix (n, nk) with the energy bands we want to adjust.penalization (
ndarray) – Matrix (n, nk) to penalize specific terms in the loss.
- Return type:
- Returns:
Loss function to optimize.