Skip to content

visualization

Lightweight visualization helpers for notebooks.

import mlx_atomistic.visualization

def atoms_to_xyz_block(symbols: Sequence[str], positions: Sequence[Sequence[float]]) -> str

Convert atom symbols and Cartesian coordinates to an XYZ string.

Parameters

NameTypeDefaultDescription
symbolsSequence[str]
positionsSequence[Sequence[float]]

Returns

  • str
def view_atoms_3d(symbols: Sequence[str], positions: Sequence[Sequence[float]], *, width: int = 640, height: int = 420)

Create a py3Dmol viewer for simple atomistic structures.

Parameters

NameTypeDefaultDescription
symbolsSequence[str]
positionsSequence[Sequence[float]]
widthint640
heightint420