initialize
Initial configurations and velocities for reduced-unit MD.
import mlx_atomistic.initialize
Functions
Section titled “Functions”fcc_lattice
Section titled “fcc_lattice”def fcc_lattice(n_particles: int, *, density: float = 0.8) -> tuple[mx.array, Cell]Return positions on an FCC lattice and a cubic cell.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
n_particles | int | ||
density | float | 0.8 |
Returns
tuple[mx.array, Cell]
random_velocities
Section titled “random_velocities”def random_velocities(n_particles: int, *, temperature: float = 1.0, masses = None, seed: int | None = None) -> mx.arrayReturn Maxwell-like random velocities in reduced units.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
n_particles | int | ||
temperature | float | 1.0 | |
masses | None | ||
seed | int | None | None |
Returns
mx.array
remove_center_of_mass_velocity
Section titled “remove_center_of_mass_velocity”def remove_center_of_mass_velocity(velocities, masses = None) -> mx.arrayRemove center-of-mass velocity.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
velocities | |||
masses | None |
Returns
mx.array
rescale_temperature
Section titled “rescale_temperature”def rescale_temperature(velocities, masses = None, *, temperature: float = 1.0) -> mx.arrayRescale velocities to a target reduced temperature.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
velocities | |||
masses | None | ||
temperature | float | 1.0 |
Returns
mx.array
simple_cubic_lattice
Section titled “simple_cubic_lattice”def simple_cubic_lattice(n_particles: int, *, density: float = 0.8) -> tuple[mx.array, Cell]Return positions on a simple cubic lattice and a cubic cell.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
n_particles | int | ||
density | float | 0.8 |
Returns
tuple[mx.array, Cell]
thermal_velocities
Section titled “thermal_velocities”def thermal_velocities(n_particles: int, *, temperature: float = 1.0, masses = None, seed: int | None = None) -> mx.arrayReturn random velocities with zero COM velocity and target temperature.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
n_particles | int | ||
temperature | float | 1.0 | |
masses | None | ||
seed | int | None | None |
Returns
mx.array