dft.xc
Exchange-correlation functionals for the spin-unpolarized DFT prototype.
import mlx_atomistic.dft.xc
Classes
Section titled “Classes”DiracExchange
Section titled “DiracExchange”class DiracExchange def __init__(name: str = 'dirac-exchange')Unpolarized Dirac LDA exchange.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | 'dirac-exchange' |
Methods
evaluate
Section titled “evaluate”def evaluate(density: mx.array, grid: RealSpaceGrid | None = None, *, density_floor: float = 1e-12) -> XCResultEvaluate the Dirac LDA exchange energy density, potential, and total energy.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
density | mx.array | Electron density rho sampled on the grid. | |
grid | RealSpaceGrid | None | None | Real-space grid providing the integration weight dv; None uses unit weight. Defaults to None. |
density_floor | float | 1e-12 | Lower clamp applied to the density for numerical stability. Defaults to 1e-12. |
Returns
XCResult— AnXCResultwith the energy density, potential, and total energy.
ExchangeCorrelationFunctional
Section titled “ExchangeCorrelationFunctional”class ExchangeCorrelationFunctional(Protocol)Protocol for local exchange-correlation functionals.
Methods
evaluate
Section titled “evaluate”def evaluate(density: mx.array, grid: RealSpaceGrid | None = None, *, density_floor: float = 1e-12) -> XCResultEvaluate energy density, total energy, and potential for ρ.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
density | mx.array | ||
grid | RealSpaceGrid | None | None | |
density_floor | float | 1e-12 |
Returns
XCResult
LDACorrelationPZ81
Section titled “LDACorrelationPZ81”class LDACorrelationPZ81 def __init__(name: str = 'lda-correlation-pz81', a: float = 0.0311, b: float = -0.048, c: float = 0.002, d: float = -0.0116, gamma: float = -0.1423, beta1: float = 1.0529, beta2: float = 0.3334)Perdew-Zunger 1981 unpolarized LDA correlation parameterization.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | 'lda-correlation-pz81' | |
a | float | 0.0311 | |
b | float | -0.048 | |
c | float | 0.002 | |
d | float | -0.0116 | |
gamma | float | -0.1423 | |
beta1 | float | 1.0529 | |
beta2 | float | 0.3334 |
Methods
evaluate
Section titled “evaluate”def evaluate(density: mx.array, grid: RealSpaceGrid | None = None, *, density_floor: float = 1e-12) -> XCResultEvaluate the PZ81 LDA correlation energy density, potential, and total energy.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
density | mx.array | Electron density rho sampled on the grid. | |
grid | RealSpaceGrid | None | None | Real-space grid providing the integration weight dv; None uses unit weight. Defaults to None. |
density_floor | float | 1e-12 | Lower clamp applied to the density for numerical stability. Defaults to 1e-12. |
Returns
XCResult— AnXCResultwith the energy density, potential, and total energy.
LDAExchangeCorrelation
Section titled “LDAExchangeCorrelation”class LDAExchangeCorrelation def __init__(exchange: ExchangeCorrelationFunctional = DiracExchange(), correlation: ExchangeCorrelationFunctional = LDACorrelationPZ81(), name: str = 'lda-xc-pz81')Combined Dirac exchange plus PZ81 LDA correlation.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
exchange | ExchangeCorrelationFunctional | DiracExchange() | |
correlation | ExchangeCorrelationFunctional | LDACorrelationPZ81() | |
name | str | 'lda-xc-pz81' |
Methods
evaluate
Section titled “evaluate”def evaluate(density: mx.array, grid: RealSpaceGrid | None = None, *, density_floor: float = 1e-12) -> XCResultEvaluate the combined LDA exchange-correlation (Dirac + PZ81).
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
density | mx.array | Electron density rho sampled on the grid. | |
grid | RealSpaceGrid | None | None | Real-space grid providing the integration weight dv; None uses unit weight. Defaults to None. |
density_floor | float | 1e-12 | Lower clamp applied to the density for numerical stability. Defaults to 1e-12. |
Returns
XCResult— AnXCResultwith the energy density, potential, and total energy.
XCResult
Section titled “XCResult”class XCResult def __init__(name: str, energy_density: mx.array, potential: mx.array, total_energy: mx.array)Exchange-correlation energy density, total energy, and potential.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | ||
energy_density | mx.array | ||
potential | mx.array | ||
total_energy | mx.array |