# SCF input documentation

Initialize parameters of self-consistent field iteration (SCF).

Used to initialize class `qimpy.electrons.SCF`

.

## YAML template:

n-iterations: 50 # Number of self-consistent field iterations / cycles. energy-threshold: 1e-08 # Energy convergence threshold in Hartrees. residual-threshold: 1e-07 # Residual-norm convergence threshold. n-consecutive: 2 # Number of consecutive iterations each threshold must be satisfied. n-history: 10 # History size for Pulay mixing. mix-fraction: 0.5 # Fraction of new variable mixed into current variable. mix-fraction-mag: 1.5 # Different mix_fraction for magnetization components. q-kerker: 0.8 # Characteristic wavevector for Kerker mixing. q-metric: 0.8 # Characteristic wavevector controlling Pulay metric. q-kappa: null # Long-range cutoff wavevector for grand-canonical SCF. n-eig-steps: 2 # Number of inner eigenvalue iterations for each SCF cycle. eig-threshold: 1e-08 # Convergence threshold on eigenvalues in Hartrees. mix-density: yes # Whether to mix density or potential.

## Parameters:

### n-iterations

*Type:* int, *Default:* 50

Number of self-consistent field iterations / cycles.

### energy-threshold

*Type:* float, *Default:* 1e-08

Energy convergence threshold in Hartrees. Stop when energy difference between consecutive iterations falls below this threshold.

### residual-threshold

*Type:* float, *Default:* 1e-07

Residual-norm convergence threshold. Stop when the norm of the residual i.e. difference in mixed variable (density / potential) between consecutive iterations falls below this threshold.

### n-consecutive

*Type:* int, *Default:* 2

Number of consecutive iterations each threshold must be satisfied.

### n-history

*Type:* int, *Default:* 10

History size for Pulay mixing. This sets the number of previous residuals and variables to use in the Pulay mixing algorithm. Larger history could improve convergence, while requiring more memory.

### mix-fraction

*Type:* float, *Default:* 0.5

Fraction of new variable mixed into current variable. Lower values (< 0.5) can improve stability, while higher values (0.5 - 1) attempt more aggressive convergence.

### mix-fraction-mag

*Type:* float, *Default:* 1.5

Different mix_fraction for magnetization components. More aggressive fractions (> 1) are typically required to converge the magnetization degrees of freedom, because they tend to contribute less to the overall energy of the system (compared to the overall electron density / potential).

### q-kerker

*Type:* float, *Default:* 0.8

Characteristic wavevector for Kerker mixing.

### q-metric

*Type:* float, *Default:* 0.8

Characteristic wavevector controlling Pulay metric.

### q-kappa

*Type:* float or null, *Default:* null

Long-range cutoff wavevector for grand-canonical SCF. If unspecified, set based on Debye screening length.

### n-eig-steps

*Type:* int, *Default:* 2

Number of inner eigenvalue iterations for each SCF cycle.

### eig-threshold

*Type:* float, *Default:* 1e-08

Convergence threshold on eigenvalues in Hartrees. Stop when the maximum change in any eigenvalue between SCF cycles falls below this threshold.

### mix-density

*Type:* bool, *Default:* yes

Whether to mix density or potential. Mix density if yes, and potential if no.