sisl.mixing.DIISMixer

class sisl.mixing.DIISMixer(weight=0.1, history=2, metric=None)

Bases: sisl.mixing.History, sisl.mixing.LinearMixer, sisl.mixing.Metric

DIIS mixer

Methods

append(*args[, variable])

Add variables to the history

clear([index, variables])

Clear variables to the history

coefficients()

Calculate coefficients of the Lagrangian

inner(a, b)

Perform the inner product between a and b

mix(coeff)

Calculate a new variable \(f'\) using history and input coefficients

solve_lagrange()

Calculate the coefficients according to Pulay's method, return everything + Lagrange multiplier

history

Number of elements in the history

history_max

Maximum number of elements stored in the history for each variable

variables

Number of different variables that can be contained

weight

Weight used for the linear mixing

__call__(f, df)[source]

Call self as a function.

__init__(weight=0.1, history=2, metric=None)[source]
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

Parameters
  • index (int or array_like of int) – which indices of the history we should clear

  • variables (int or array_like of int) – specify which variables should be cleared

coefficients()[source]

Calculate coefficients of the Lagrangian

property history

Number of elements in the history

property history_max

Maximum number of elements stored in the history for each variable

inner(a, b)

Perform the inner product between a and b

Parameters
mix(coeff)[source]

Calculate a new variable \(f'\) using history and input coefficients

Parameters

coeff (numpy.ndarray) – coefficients used for extrapolation

solve_lagrange()[source]

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