sisl.mixing.LinearMixer

class sisl.mixing.LinearMixer(weight: float | int = 0.2, history: int | History = 0)

Bases: BaseHistoryWeightMixer

Linear mixing

The linear mixing is solely defined using a weight, and the resulting functional may then be calculated via:

\[\mathbf f^{i+1} = \mathbf f^i + w \delta \mathbf f^i\]
Parameters:
  • weight (float, optional) – mixing weight

  • history (TypeArgHistory)

Methods

set_history(history)

Replace the current history in the mixer with a new one

set_weight(weight)

Set a new weight for this mixer

history

History object tracked by this mixer

weight

This mixers mixing weight, the weight is the fractional contribution of the derivative

__call__(f: T, df: T, append: bool = True) T[source]

Calculate a new variable \(\mathbf f'\) using input and output of the functional

Parameters:
  • f (object) – input variable for the functional

  • df (object) – derivative of the functional

  • append (bool, optional) – whether to append to the history

Return type:

T

__init__(weight: float | int = 0.2, history: int | History = 0)
Parameters:
property history: History

History object tracked by this mixer

set_history(history: int | History) None

Replace the current history in the mixer with a new one

Parameters:

history (int | History) – if an int a new History object will be created with that number of history elements Otherwise the object will be directly attached to the mixer.

Return type:

None

set_weight(weight: float | int)

Set a new weight for this mixer

Parameters:

weight (float) – the new weight for this mixer, it must be bigger than 0

property weight: float | int

This mixers mixing weight, the weight is the fractional contribution of the derivative