Skip to content

dft.xc

Exchange-correlation functionals for the spin-unpolarized DFT prototype.

import mlx_atomistic.dft.xc

class DiracExchange
def __init__(name: str = 'dirac-exchange')

Unpolarized Dirac LDA exchange.

Parameters

NameTypeDefaultDescription
namestr'dirac-exchange'

Methods

def evaluate(density: mx.array, grid: RealSpaceGrid | None = None, *, density_floor: float = 1e-12) -> XCResult

Evaluate the Dirac LDA exchange energy density, potential, and total energy.

Parameters

NameTypeDefaultDescription
densitymx.arrayElectron density rho sampled on the grid.
gridRealSpaceGrid | NoneNoneReal-space grid providing the integration weight dv; None uses unit weight. Defaults to None.
density_floorfloat1e-12Lower clamp applied to the density for numerical stability. Defaults to 1e-12.

Returns

  • XCResult — An XCResult with the energy density, potential, and total energy.
class ExchangeCorrelationFunctional(Protocol)

Protocol for local exchange-correlation functionals.

Methods

def evaluate(density: mx.array, grid: RealSpaceGrid | None = None, *, density_floor: float = 1e-12) -> XCResult

Evaluate energy density, total energy, and potential for ρ.

Parameters

NameTypeDefaultDescription
densitymx.array
gridRealSpaceGrid | NoneNone
density_floorfloat1e-12

Returns

  • XCResult
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

NameTypeDefaultDescription
namestr'lda-correlation-pz81'
afloat0.0311
bfloat-0.048
cfloat0.002
dfloat-0.0116
gammafloat-0.1423
beta1float1.0529
beta2float0.3334

Methods

def evaluate(density: mx.array, grid: RealSpaceGrid | None = None, *, density_floor: float = 1e-12) -> XCResult

Evaluate the PZ81 LDA correlation energy density, potential, and total energy.

Parameters

NameTypeDefaultDescription
densitymx.arrayElectron density rho sampled on the grid.
gridRealSpaceGrid | NoneNoneReal-space grid providing the integration weight dv; None uses unit weight. Defaults to None.
density_floorfloat1e-12Lower clamp applied to the density for numerical stability. Defaults to 1e-12.

Returns

  • XCResult — An XCResult with the energy density, potential, and total energy.
class LDAExchangeCorrelation
def __init__(exchange: ExchangeCorrelationFunctional = DiracExchange(), correlation: ExchangeCorrelationFunctional = LDACorrelationPZ81(), name: str = 'lda-xc-pz81')

Combined Dirac exchange plus PZ81 LDA correlation.

Parameters

NameTypeDefaultDescription
exchangeExchangeCorrelationFunctionalDiracExchange()
correlationExchangeCorrelationFunctionalLDACorrelationPZ81()
namestr'lda-xc-pz81'

Methods

def evaluate(density: mx.array, grid: RealSpaceGrid | None = None, *, density_floor: float = 1e-12) -> XCResult

Evaluate the combined LDA exchange-correlation (Dirac + PZ81).

Parameters

NameTypeDefaultDescription
densitymx.arrayElectron density rho sampled on the grid.
gridRealSpaceGrid | NoneNoneReal-space grid providing the integration weight dv; None uses unit weight. Defaults to None.
density_floorfloat1e-12Lower clamp applied to the density for numerical stability. Defaults to 1e-12.

Returns

  • XCResult — An XCResult with the energy density, potential, and total energy.
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

NameTypeDefaultDescription
namestr
energy_densitymx.array
potentialmx.array
total_energymx.array