sisl.mixing.AdaptivePulayMixer
- class sisl.mixing.AdaptivePulayMixer(weight=(0.03, 0.5), history=2, metric=None)
Bases:
sisl.mixing.AdaptiveDIISMixer
Methods
adjust_weight
(lagrange[, offset, spread])Adjust the weight according to the Lagrange multiplier.
append
(*args[, variable])Add variables to the history
clear
([index, variables])Clear variables to the history
Calculate coefficients and adjust weights according to a Lagrange multiplier
inner
(a, b)Perform the inner product between a and b
mix
(coeff)Calculate a new variable \(f'\) using history and input coefficients
Calculate the coefficients according to Pulay's method, return everything + Lagrange multiplier
Number of elements in the history
Maximum number of elements stored in the history for each variable
Number of different variables that can be contained
Weight used for the linear mixing
- __call__(f, df)
Call self as a function.
- __init__(weight=(0.03, 0.5), history=2, metric=None)
- adjust_weight(lagrange, offset=13, spread=7)
Adjust the weight according to the Lagrange multiplier.
Once close to convergence the Lagrange multiplier will be close to 0, otherwise it will go towards infinity. We here adjust using the Fermi-function to hit the minimum/maximum weight with a suitable spread
- append(*args, variable=None)
Add variables to the history
- Parameters
*args (tuple of object) – each variable will be added to the history of the mixer
variable (int or listlike of int) – specify which variables the history should be added to, note:
len(args) == len(variable)
- clear(index=None, variables=None)
Clear variables to the history
- coefficients()
Calculate coefficients and adjust weights according to a Lagrange multiplier
- property history
Number of elements in the history
- property history_max
Maximum number of elements stored in the history for each variable
- mix(coeff)
Calculate a new variable \(f'\) using history and input coefficients
- Parameters
coeff (numpy.ndarray) – coefficients used for extrapolation
- solve_lagrange()
Calculate the coefficients according to Pulay’s method, return everything + Lagrange multiplier
- property variables
Number of different variables that can be contained
- property weight
Weight used for the linear mixing