dft.mixing
Density mixers for the DFT SCF loop.
import mlx_atomistic.dft.mixing
Classes
Section titled “Classes”LinearMixer
Section titled “LinearMixer”class LinearMixer def __init__(beta: float = 0.35, name: str = 'linear')Simple linear density mixing.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
beta | float | 0.35 | |
name | str | 'linear' |
Methods
metadata
Section titled “metadata”def metadata() -> dict[str, float | int | str]Return JSON-safe mixer metadata.
Returns
dict[str, float | int | str]
def mix(current: mx.array, target: mx.array) -> mx.arrayReturn a mixed density.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
current | mx.array | ||
target | mx.array |
Returns
mx.array
def reset() -> NoneReset mixer state.
Returns
None
PulayDIISMixer
Section titled “PulayDIISMixer”class PulayDIISMixer def __init__(beta: float = 0.35, history_size: int = 6, regularization: float = 1e-10, name: str = 'pulay-diis')Pulay DIIS mixer for density residuals.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
beta | float | 0.35 | |
history_size | int | 6 | |
regularization | float | 1e-10 | |
name | str | 'pulay-diis' |
Methods
metadata
Section titled “metadata”def metadata() -> dict[str, float | int | str | Sequence[float]]Return JSON-safe mixer metadata.
Returns
dict[str, float | int | str | Sequence[float]]
def mix(current: mx.array, target: mx.array) -> mx.arrayReturn a DIIS-mixed density, falling back to linear mixing early on.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
current | mx.array | ||
target | mx.array |
Returns
mx.array
def reset() -> NoneClear DIIS history.
Returns
None