dft.grids
Real- and reciprocal-space grids for toy plane-wave DFT.
import mlx_atomistic.dft.grids
Classes
Section titled “Classes”RealSpaceGrid
Section titled “RealSpaceGrid”class RealSpaceGrid def __init__(shape: Sequence[int], cell: Cell | Sequence[float])Uniform orthorhombic real-space grid in atomic units.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
shape | Sequence[int] | ||
cell | Cell | Sequence[float] |
Properties
dvfloat— Volume represented by one grid point.lengthsmx.array— Cell lengths in atomic units.ndimint— Number of grid dimensions.sizeint— Total number of grid points.spacingmx.array— Grid spacing in atomic units.volumefloat— Cell volume in bohr cubed.
Methods
coordinates
Section titled “coordinates”def coordinates() -> mx.arrayReturn cell-centered Cartesian grid coordinates with shape (*shape, 3).
Returns
mx.array
ReciprocalGrid
Section titled “ReciprocalGrid”class ReciprocalGrid def __init__(real_grid: RealSpaceGrid, vectors: mx.array, g2: mx.array, zero_mask: mx.array)Reciprocal-space vectors matching a RealSpaceGrid FFT layout.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
real_grid | RealSpaceGrid | ||
vectors | mx.array | ||
g2 | mx.array | ||
zero_mask | mx.array |
Methods
from_real_space
Section titled “from_real_space”def from_real_space(grid: RealSpaceGrid) -> ReciprocalGridBuild reciprocal vectors in NumPy FFT frequency order.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
grid | RealSpaceGrid |
Returns
ReciprocalGrid