PulayMixer¶
Included in QATK.Calculators.DFT, QATK.Calculators.SemiEmpirical, QATK.Calculators.Parameters
- class PulayMixer(noncollinear_mixing=None, restart_strategy=None)¶
Class for representing a Pulay mixer.
- Parameters:
noncollinear_mixing (bool) – A special routine is used for the noncollinear mixing if this flag is used. Default:
Falserestart_strategy (
NoRestart|AdaptiveHistoryRestart) – The restart strategy for the SCF loop. Default:None
- historyStorage()¶
- Returns:
The flag indicating how the history is stored.
- Return type:
Duplicated|Distributed
- nlinfo()¶
- Returns:
The nlinfo.
- Return type:
dict
- noncollinearMixing()¶
- Returns:
True if the non-collinear restart mixing algorithm should be used.
- Return type:
bool
- restartStrategy()¶
- Returns:
The restart strategy.
- Return type:
NoRestart|AdaptiveHistoryRestart
- uniqueString()¶
Return a unique string representing the state of the object.
Usage Examples¶
Set up a Pulay mixer with automatic memory distribution
# Iteration control parameters with automatic Pulay mixer
mixer=PulayMixer()
iteration_control_parameters=IterationControlParameters(algorithm=mixer)
Set up a Pulay mixer that uses the non-collinear restart mixing algorithm (and thus non-distributed history storage)
# Iteration control parameters with Pulay mixer (non-collinear mixing)
mixer=PulayMixer(noncollinear_mixing=True)
iteration_control_parameters=IterationControlParameters(algorithm=mixer)
Notes¶
PulayMixer implements the Pulay-Kerker method [1].
In the Pulay mixing scheme the best guess for the next input is given by,
where \(h_i^\mathrm{in}\) is the input value and \(h_i^\mathrm{out}\) is the output value of the mixing_variable at iteration \(i\). Currently there is support for using HamiltonianVariable for mixing. The parameter \(\eta\) is the damping_factor and \(n^\mathrm{hist}\) the number_of_history_steps used for finding the input value for the next iteration. The variables \(\alpha_i\) are obtained by minimizing the residual error of the mixing_variable assuming a linear relation between the residual errors of different iteration numbers.
The PulayMixer is available in both a memory-distributed and a non-memory-distributed version. The non-distributed version has a slight performance advantage, but in cases where the SCF history uses a considerable amount of memory, the distributed version can be used to avoid being memory limited.
In the default case, memory distribution is activated if the stored history would use more than 50 MB. However, memory distribution cannot be used when either a preconditioner or non-collinear mixing is used. In those cases, memory distribution will be disabled by default.