ASEWrappers package
Submodules
ASEWrappers.DataContainer module
ASEWrappers.atomic_structure module
- class ASEWrappers.atomic_structure.AtomicStructure(atoms, supercells=[1, 1, 1], special_label=None, label=None)[source]
Bases:
objectWrapper for the ASE atoms object and a Potential.
This class provides a way to represent an atomic structure inluding its potential. It provides methods to compute relevant instantaneous quantities as well as some conveniance features for a better MD workflow.
- Parameters:
atoms (ase.Atoms)
- _atoms
The underlying atoms object
- Type:
ASE Atoms
- _label
A unique hashlabel for the structure
- Type:
str
- property cell
3×3 cell matrix defining the simulation cell.
- Type:
numpy.ndarray
- property cellpar
Cell parameters (a, b, c, α, β, γ).
- Type:
numpy.ndarray
- cohesive_energy(potential_energy=None)[source]
Compute the cohesive energy per atom.
Cohesive energy is defined as the difference between the sum of isolated atomic energies and the bulk structure energy, divided by the number of atoms:
E_coh = (Σ E_atom − E_bulk) / N
- Parameters:
potential_energy (float, optional) – Bulk structure potential energy (eV). If not provided, it is computed automatically.
- Returns:
Cohesive energy per atom (eV/atom).
- Return type:
float
- computeMSD(orig_struct)[source]
Compute mean-square displacement relative to a reference structure.
- Parameters:
orig_struct (AtomicStructure) – Reference configuration.
- Returns:
Mean-square displacement (Ų).
- Return type:
float
- Raises:
TypeError – If orig_struct is not an AtomicStructure.
- computeNearestNeighbour()[source]
Compute the mean nearest-neighbor distance.
- Returns:
Mean nearest-neighbor distance (Å).
- Return type:
float
- Raises:
ValueError – If nearest neighbors cannot be found for an atom.
- property forces
Forces acting on each atom (eV/Å).
- Raises:
RuntimeError – If no potential calculator is defined.
- Type:
numpy.ndarray
- classmethod fromFile(path, pbc=[True, True, True], supercells=[1, 1, 1], potential=None)[source]
Creates a AtomicStructure object directly from a structure file
- Parameters:
path (str) – Path to the file containing the crystal structure
pbc (Bool) – Whether to use periodic boundary conditions or not
supercells (list[int]) – Number of supercells to use in each direction
potential (Potential) – Interatomic potential to use
- getAtoms()[source]
Unsafe helper: return the underlying ASE Atoms object.
- Returns:
Raw Atoms object (use with caution).
- Return type:
ase.Atoms
- property get_all_distances
Pairwise atomic distances (Å).
- Type:
numpy.ndarray
- property get_atomic_numbers
Atomic numbers of all atoms.
- Type:
numpy.ndarray
- property get_cell
Return the cell matrix.
- Type:
numpy.ndarray
- property internal_pressure
Compute internal pressure using atomic units internally. Instantaneous: P = (1/3V) [ 2 N E_kin + sum_i r_i · f_i ] Returns a mean over the instantaneous frames in the trajectory Unit: ev/Å^3
- Returns:
Internal pressure
- Return type:
P (float)
- property kinetic_energy
Total kinetic energy (eV).
- Raises:
RuntimeError – If no potential calculator is defined.
- Type:
float
- property label
Label of the given structure
- Returns:
label of the structure
- Return type:
(str)
- property lattice_constant
Average in-plane lattice constant (Å).
- Type:
float
- property masses
Atomic masses (amu).
- Type:
numpy.ndarray
- property positions
Positions of all atoms
- Return type:
list[Atoms]
- property potential
Potential that is used
- Returns:
The structures potential
- Return type:
- property potential_energy
Total potential energy of the structure (eV).
- Raises:
RuntimeError – If no potential calculator is defined.
- Type:
float
- setVelocitiesMB(temperature_K)[source]
Assign velocities from a Maxwell–Boltzmann distribution.
The procedure removes net linear and angular momentum.
- Parameters:
temperature_K (float) – Target temperature in Kelvin.
- property stress
Stress tensor in Voigt notation (eV/ų).
- Raises:
RuntimeError – If no potential calculator is defined.
- Type:
numpy.ndarray
- property symbols
Chemical symbols of all atoms.
- Type:
list[str]
- property temperature
Instantaneous temperature (K).
- Type:
float
- property total_energy
Total energy (potential + kinetic) in eV.
- Raises:
RuntimeError – If no potential calculator is defined.
- Type:
float
- property velocities
Atomic velocities (Å/fs).
- Type:
numpy.ndarray | None
- property volume
Volume of the cell (ų).
- Type:
float
ASEWrappers.contextManager module
ASEWrappers.integrator module
- class ASEWrappers.integrator.BerendsenNPTIntegrator(timestep, temperature_K, pressure, compressibility)[source]
Bases:
IntegratorBerendsen NPT integrator (NPT ensemble).
- property ensemble
Thermodynamic ensemble (NPT).
- Type:
str
- class ASEWrappers.integrator.Integrator(timestep)[source]
Bases:
objectBase class for all molecular dynamics integrators.
This class defines the common interface for ASE-based integrators, including timestep handling, attachment of callback functions, and running integration loops.
- attach(attachment, interval)[source]
Attach a callback function to the integrator.
- Parameters:
attachment (callable) – Function executed every interval steps.
interval (int) – Number of steps between calls.
- property ensemble
Thermodynamic ensemble associated with the integrator.
- Type:
str
- run(atomic_structure, steps)[source]
Run the integrator on the provided atomic structure.
- Parameters:
atomic_structure (AtomicStructure) – Structure to integrate.
steps (int) – Number of MD steps to perform.
- class ASEWrappers.integrator.IsotropicMTKNPTIntegrator(timestep, temperature_K, pressure, tdamp, pdamp)[source]
Bases:
IntegratorMTK NPT integrator with isotropic cell fluctuations (NPT ensemble).
- property ensemble
Thermodynamic ensemble (NPT).
- Type:
str
- class ASEWrappers.integrator.LangevinIntegrator(timestep, temperature_K, friction)[source]
Bases:
IntegratorLangevin molecular dynamics integrator (NVT ensemble).
- property ensemble
Thermodynamic ensemble (NVT).
- Type:
str
- class ASEWrappers.integrator.VelocityVerletIntegrator(timestep)[source]
Bases:
IntegratorVelocity-Verlet molecular dynamics integrator (NVE ensemble).
- property ensemble
Thermodynamic ensemble (NVE).
- Type:
str
ASEWrappers.potential module
- class ASEWrappers.potential.EMTPotential[source]
Bases:
PotentialEffective Medium Theory (EMT) potential.
- class ASEWrappers.potential.LennardJonesPotential(atomic_numbers, sigmas, epsilons, rc=None)[source]
Bases:
PotentialLennard-Jones pair potential.
- class ASEWrappers.potential.MACEPotential(model_path='/home/runner/work/Isacks-Co/Isacks-Co/SourceCode/MACEModels/mace-mpa-0-medium.model')[source]
Bases:
PotentialMACE machine-learning interatomic potential.