atomli
Generated from the public Python surface of Atomli 0.1.4.
Atoms(symbols=None, positions=None, cell=None, pbc=None, charge=0.0, unpaired=0)
Section titled “Atoms(symbols=None, positions=None, cell=None, pbc=None, charge=0.0, unpaired=0)”A collection of atoms. ASE method surface (properties via Python).
center(self, /, vacuum=None, axis=None)
Section titled “center(self, /, vacuum=None, axis=None)”Center atoms (in place). Optional vacuum in angstrom along axes.
vacuum: Vacuum padding in angstrom, or None. axis: Which axes to center; True/False or length-3 sequence.
copy(self, /)
Section titled “copy(self, /)”get_atomic_numbers(self, /)
Section titled “get_atomic_numbers(self, /)”get_calculator(self, /)
Section titled “get_calculator(self, /)”get_cell(self, complete=False)
Section titled “get_cell(self, complete=False)”The cell, as ASE returns it: detached, but geometry-aware.
ASE’s get_cell returns an ase.cell.Cell, not a bare array, and code
relies on it — ase.filters.FrechetCellFilter calls get_cell() and
then asks for .volume. complete=True fills zero vectors with unit
normals, matching ASE.
get_center_of_mass(self, /)
Section titled “get_center_of_mass(self, /)”Center of mass in angstrom, shape (3,).
get_chemical_formula(self, /)
Section titled “get_chemical_formula(self, /)”Hill-system chemical formula string (e.g. "H2O").
get_chemical_symbols(self, /)
Section titled “get_chemical_symbols(self, /)”get_distance(self, /, a0, a1, mic=False)
Section titled “get_distance(self, /, a0, a1, mic=False)”Distance between two atoms in angstrom.
a0: First atom index. a1: Second atom index. mic: Use minimum-image convention when True.
get_forces(self, /, apply_constraint=True, md=False)
Section titled “get_forces(self, /, apply_constraint=True, md=False)”get_initial_charges(self, /)
Section titled “get_initial_charges(self, /)”get_initial_magnetic_moments(self, /)
Section titled “get_initial_magnetic_moments(self, /)”get_kinetic_energy(self, /)
Section titled “get_kinetic_energy(self, /)”get_masses(self, /)
Section titled “get_masses(self, /)”get_momenta(self, /)
Section titled “get_momenta(self, /)”Momenta as mass times ASE velocity units, shape (n, 3).
Numerically identical to ASE Atoms.get_momenta().
get_pbc(self, /)
Section titled “get_pbc(self, /)”get_positions(self, /)
Section titled “get_positions(self, /)”get_potential_energy(self, /, force_consistent=False, apply_constraint=True)
Section titled “get_potential_energy(self, /, force_consistent=False, apply_constraint=True)”get_scaled_positions(self, /, wrap=True)
Section titled “get_scaled_positions(self, /, wrap=True)”Fractional (scaled) positions, shape (n, 3). Needs a cell.
wrap: Wrap into the cell along the periodic directions. ASE defaults to True, so atomli does too: without it a periodic structure silently reports coordinates outside [0, 1).
get_stress(self, /, voigt=True, apply_constraint=True, include_ideal_gas=False)
Section titled “get_stress(self, /, voigt=True, apply_constraint=True, include_ideal_gas=False)”get_tags(self, /)
Section titled “get_tags(self, /)”Integer tags per atom, shape (n,).
get_temperature(self, /)
Section titled “get_temperature(self, /)”get_total_energy(self, /)
Section titled “get_total_energy(self, /)”get_velocities(self, /)
Section titled “get_velocities(self, /)”get_volume(self, /)
Section titled “get_volume(self, /)”Unit-cell volume in angstrom^3.
Matches ASE: with fewer than three lattice vectors the volume is not
defined and this raises ValueError. Returning zero instead would
turn the error into a silent division by zero downstream.
repeat(self, /, rep)
Section titled “repeat(self, /, rep)”set_calculator(self, value=None)
Section titled “set_calculator(self, value=None)”set_cell(self, /, cell, scale_atoms=False, *, pbc=None)
Section titled “set_cell(self, /, cell, scale_atoms=False, *, pbc=None)”set_constraint(self, constraint=None)
Section titled “set_constraint(self, constraint=None)”set_initial_charges(self, /, charges)
Section titled “set_initial_charges(self, /, charges)”set_initial_magnetic_moments(self, /, moments)
Section titled “set_initial_magnetic_moments(self, /, moments)”set_masses(self, /, masses)
Section titled “set_masses(self, /, masses)”set_momenta(self, /, momenta)
Section titled “set_momenta(self, /, momenta)”Set ASE-compatible momenta; updates velocities.
set_pbc(self, /, pbc)
Section titled “set_pbc(self, /, pbc)”set_positions(self, /, positions)
Section titled “set_positions(self, /, positions)”set_scaled_positions(self, /, scaled)
Section titled “set_scaled_positions(self, /, scaled)”Set fractional positions (requires a cell).
set_tags(self, /, tags)
Section titled “set_tags(self, /, tags)”Replace integer tags (length n).
set_velocities(self, /, velocities)
Section titled “set_velocities(self, /, velocities)”wrap(self, /)
Section titled “wrap(self, /)”Wrap positions into the unit cell (in place). Needs PBC cell.
get_default_device() -> 'DeviceSelection'
Section titled “get_default_device() -> 'DeviceSelection'”Return Atomli’s CPU baseline or explicit process device override.
set_default_device(device: 'Any' = None, *, adapter: 'Optional[Any]' = None) -> 'None'
Section titled “set_default_device(device: 'Any' = None, *, adapter: 'Optional[Any]' = None) -> 'None'”Set Atomli’s process-global default compute device.
Examples::
atomli.gpu.set_default_device("gpu")atomli.gpu.set_default_device("gpu:0")atomli.gpu.set_default_device("gpu:pci:0000:61:00.0")atomli.gpu.set_default_device(atomli.gpu.adapters()[0])New GPU-capable calculators inherit this selection when their own device=
argument is omitted. An explicit calculator device= remains an override.
Passing None clears the process override. Automatic selection is owned by
each calculator. "gpu" chooses real hardware only; software/emulated WGPU
adapters such as llvmpipe are unsupported in released packages.
view(atoms, data=None, viewer=None, repeat=None, block=False, height=None, **look)
Section titled “view(atoms, data=None, viewer=None, repeat=None, block=False, height=None, **look)”Show a structure or trajectory. Mirrors ase.visualize.view.
The first five parameters are ASE’s, in ASE’s order, so an unmodified ASE
script calling view(atoms, None, 'ase', (2, 2, 2)) positionally binds the
same way here.
atoms: An Atoms, or a sequence of them shown as a trajectory.
data: Accepted for ASE signature compatibility and ignored. ASE
passes it to an external GUI; there is no external GUI here.
viewer: None, "ase" (ASE’s own default spelling) or "tako" all
select the built-in viewer. Any other name raises, rather than
silently showing something the caller did not ask for.
repeat: Supercell repetition, e.g. (2, 2, 2), applied before display.
block: Accepted for ASE signature compatibility and ignored. Nothing
blocks: the viewer is a cell output, not a window to wait on.
height: Viewer height; a bare number is read as pixels.
look: Appearance options passed to the renderer: style,
colorScheme, material, background, atomScale, bondScale,
bondColorMode, edges, bonds, labels, axes, cell,
polyhedra, autoRotate, controls, title, width.
Returns: A Viewer, which renders itself in a notebook cell.
read(filename, index=-1, format=None)
Section titled “read(filename, index=-1, format=None)”Read structures from a file. Mirrors ase.io.read.
write(filename, images, format=None, append=False)
Section titled “write(filename, images, format=None, append=False)”Write structures to a file. Mirrors ase.io.write.
iread(filename, index=slice(None, None, None), format=None)
Section titled “iread(filename, index=slice(None, None, None), format=None)”Iterate over structures in a file. Mirrors ase.io.iread.