dft.system
Lightweight DFT system model for toy Γ-point calculations.
import mlx_atomistic.dft.system
Classes
Section titled “Classes”DFTSystem
Section titled “DFTSystem”class DFTSystem def __init__(*, cell: Cell | Sequence[float], grid_shape: Sequence[int], electron_count: float | None = None, centers: Sequence[Sequence[float]] | None = None, amplitudes: Sequence[float] | float | None = None, widths: Sequence[float] | float | None = None, charges: Sequence[float] | None = None, pseudopotential: LocalGaussianPseudopotential | LocalPseudopotentialField | None = None, ions: IonCollection | None = None)Minimal spin-unpolarized DFT system with local Gaussian centers.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
cell | Cell | Sequence[float] | ||
grid_shape | Sequence[int] | ||
electron_count | float | None | None | |
centers | Sequence[Sequence[float]] | None | None | |
amplitudes | Sequence[float] | float | None | None | |
widths | Sequence[float] | float | None | None | |
charges | Sequence[float] | None | None | |
pseudopotential | LocalGaussianPseudopotential | LocalPseudopotentialField | None | None | |
ions | IonCollection | None | None |
Properties
center_center_energyfloat— Pairwise center-center Coulomb energy.center_center_forcesnp.ndarray— Pairwise center-center Coulomb forces.center_countint— Number of local pseudopotential centers.centers— Pseudopotential center coordinates.gridRealSpaceGrid— Return the real-space grid for this system.
Methods
cluster
Section titled “cluster”def cluster(*, cell: Cell | Sequence[float] = (10.0, 10.0, 10.0), grid_shape: Sequence[int] = (8, 8, 8), electron_count: float = 4.0, centers: Sequence[Sequence[float]] = ((4.0, 4.0, 5.0), (6.0, 4.0, 5.0), (5.0, 6.0, 5.0)), amplitudes: Sequence[float] | float = (-2.0, -2.0, -1.5), widths: Sequence[float] | float = (0.85, 0.85, 0.95), charges: Sequence[float] | None = None) -> DFTSystemBuild a small multi-center toy DFT system.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
cell | Cell | Sequence[float] | (10.0, 10.0, 10.0) | |
grid_shape | Sequence[int] | (8, 8, 8) | |
electron_count | float | 4.0 | |
centers | Sequence[Sequence[float]] | ((4.0, 4.0, 5.0), (6.0, 4.0, 5.0), (5.0, 6.0, 5.0)) | |
amplitudes | Sequence[float] | float | (-2.0, -2.0, -1.5) | |
widths | Sequence[float] | float | (0.85, 0.85, 0.95) | |
charges | Sequence[float] | None | None |
Returns
DFTSystem
one_center
Section titled “one_center”def one_center(*, cell: Cell | Sequence[float] = (8.0, 8.0, 8.0), grid_shape: Sequence[int] = (8, 8, 8), center: Sequence[float] = (4.0, 4.0, 4.0), electron_count: float = 2.0, amplitude: float = -3.0, width: float = 0.9, charge: float | None = None) -> DFTSystemBuild a one-center toy DFT system.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
cell | Cell | Sequence[float] | (8.0, 8.0, 8.0) | |
grid_shape | Sequence[int] | (8, 8, 8) | |
center | Sequence[float] | (4.0, 4.0, 4.0) | |
electron_count | float | 2.0 | |
amplitude | float | -3.0 | |
width | float | 0.9 | |
charge | float | None | None |
Returns
DFTSystem
two_center
Section titled “two_center”def two_center(*, cell: Cell | Sequence[float] = (8.0, 8.0, 8.0), grid_shape: Sequence[int] = (8, 8, 8), centers: Sequence[Sequence[float]] = ((3.4, 4.0, 4.0), (4.6, 4.0, 4.0)), electron_count: float = 2.0, amplitudes: Sequence[float] | float = (-2.0, -2.0), widths: Sequence[float] | float = (0.8, 0.8), charges: Sequence[float] | None = None) -> DFTSystemBuild a two-center toy DFT system.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
cell | Cell | Sequence[float] | (8.0, 8.0, 8.0) | |
grid_shape | Sequence[int] | (8, 8, 8) | |
centers | Sequence[Sequence[float]] | ((3.4, 4.0, 4.0), (4.6, 4.0, 4.0)) | |
electron_count | float | 2.0 | |
amplitudes | Sequence[float] | float | (-2.0, -2.0) | |
widths | Sequence[float] | float | (0.8, 0.8) | |
charges | Sequence[float] | None | None |
Returns
DFTSystem
with_cell
Section titled “with_cell”def with_cell(cell: Cell | Sequence[float], *, scale_centers: bool = False) -> DFTSystemReturn a copy with a new orthorhombic cell.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
cell | Cell | Sequence[float] | ||
scale_centers | bool | False |
Returns
DFTSystem
with_centers
Section titled “with_centers”def with_centers(centers: Sequence[Sequence[float]]) -> DFTSystemReturn a copy with shifted center coordinates.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
centers | Sequence[Sequence[float]] |
Returns
DFTSystem
Functions
Section titled “Functions”center_center_energy
Section titled “center_center_energy”def center_center_energy(system: DFTSystem) -> floatReturn pairwise center-center Coulomb energy for toy DFT centers.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
system | DFTSystem |
Returns
float
center_center_forces
Section titled “center_center_forces”def center_center_forces(system: DFTSystem) -> np.ndarrayReturn pairwise Coulomb forces between toy DFT centers.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
system | DFTSystem |
Returns
np.ndarray