Skip to content

examples

Small programmatic examples for molecular mechanics and DFT workflows.

import mlx_atomistic.examples

def bonded_chain_example()

Return a four-particle bonded chain with bond, angle, and torsion terms.

def butane_like_torsion_example()

Return a four-atom butane-like torsion system.

def charged_dimer_example()

Return a two-particle charged system with direct Coulomb interactions.

def ionic_cluster_example()

Return a small typed ionic cluster.

def lj_liquid_example(*, particles: int = 32, density: float = 0.8, temperature: float = 1.0, seed: int = 7)

Return an LJ liquid starting point.

Parameters

NameTypeDefaultDescription
particlesint32
densityfloat0.8
temperaturefloat1.0
seedint7
def mixed_lj_fluid_example(*, particles: int = 32, density: float = 0.8, temperature: float = 1.0, seed: int = 7)

Return a typed mixed LJ fluid.

Parameters

NameTypeDefaultDescription
particlesint32
densityfloat0.8
temperaturefloat1.0
seedint7
def periodic_cell_example() -> Cell

Return the default reduced-unit demonstration cell.

Returns

  • Cell
def toy_closed_shell_dft_example()

Return a compact two-electron closed-shell Gaussian-well DFT toy system.

def toy_one_electron_dft_example()

Return a compact one-electron Gaussian-well DFT toy system.

def toy_periodic_cluster_dft_example()

Return a small periodic three-center Gaussian DFT toy system.

def toy_two_center_dft_example()

Return a two-center closed-shell Gaussian DFT toy system.

def water_like_constrained_example()

Return a small constrained water-like molecular mechanics system.