Skip to content

Interoperability

ASE

to_ase

to_ase(system)

The system as an ase.Atoms.

Parameters:

Name Type Description Default
system System

The atoms. Elements, masses, velocities, charges and movable become the corresponding properties of ase.Atoms; other numeric columns become arrays of the same name; the box origin becomes the cell displacement; info is copied, and its energy and stress or virial, with a forces column, become a single-point calculator.

required

Returns:

Type Description
Atoms

A new object; nothing is shared with the system.

from_ase

from_ase(atoms)

An ase.Atoms as a System.

Parameters:

Name Type Description Default
atoms Atoms

The atoms. Masses set on them, momenta, initial charges and the constraints FixAtoms and FixCartesian become the columns mass, velocities, charge and movable; other arrays become columns of the same name; the cell displacement becomes the box origin; info is copied, and the energy, forces and stress of an attached calculator become energy, a forces column and stress in GPa.

required

Returns:

Type Description
System

A new system; nothing is shared with the atoms.

Raises:

Type Description
InvalidParameter

If the atoms have constraints other than FixAtoms and FixCartesian.

to_ase_calculator

to_ase_calculator(calculator)

An MDAPY calculator as an ASE calculator.

Parameters:

Name Type Description Default
calculator Calculator

Any MDAPY calculator, such as EAM or NEP.

required

Returns:

Type Description
Calculator

A calculator for ase.Atoms with the properties energy, free_energy, energies, forces, stress and stresses that the MDAPY calculator can compute; stresses in eV/ų in ASE's order xx, yy, zz, yz, xz, xy, positive under tension.

from_ase_calculator

from_ase_calculator(calculator)

An ASE calculator as an MDAPY calculator.

Parameters:

Name Type Description Default
calculator Calculator

Any ASE calculator, such as EMT or the calculator of a machine-learned potential.

required

Returns:

Type Description
Calculator

An MDAPY calculator with the properties that the ASE calculator computes: energy (the free energy where the ASE calculator gives one), atomic_energies, forces, virial from the stress and atomic_virials from the atomic stresses. Its cutoff is 0: it uses no neighbor list of mdapy.

OVITO

to_ovito

to_ovito(system)

The system as an OVITO data collection.

Parameters:

Name Type Description Default
system System

The atoms. The box becomes the simulation cell; elements, or the type column with the elements or type labels as names, become the particle types; columns with a standard property of OVITO, such as velocities or id, become that property, the one column of structure types, such as cna_structure, becomes Structure Type and several keep their names, and other numeric columns become user properties of the same name; the topology becomes bonds, angles, dihedrals and impropers; info becomes the global attributes.

required

Returns:

Type Description
DataCollection

A new data collection; nothing is shared with the system.

from_ovito

from_ovito(data)

An OVITO data collection as a System.

Parameters:

Name Type Description Default
data DataCollection

The particles, for example the output of a pipeline, pipeline.compute(). The simulation cell becomes the box (a box enclosing the particles when there is none); particle types become the type column, with element where their names are chemical symbols and type_label where they have other names; standard properties with a column of MDAPY, such as Velocity, Particle Identifier or Structure Type, become that column, and other properties columns of their names in lowercase with underscores; bonds, angles, dihedrals and impropers become the topology; global attributes become info.

required

Returns:

Type Description
System

A new system; nothing is shared with the data collection.

pymatgen

to_pymatgen

to_pymatgen(system)

The system as a pymatgen Structure.

Parameters:

Name Type Description Default
system System

The atoms, with an element column. The box becomes the lattice with its periodicity, and the positions are taken from the origin of the box; velocities (in Å/fs, as pymatgen keeps them) and movable (as selective_dynamics) and other numeric columns become site properties; info becomes the properties.

required

Returns:

Type Description
Structure

A new structure; nothing is shared with the system.

Raises:

Type Description
MissingProperty

If the system has no element column.

from_pymatgen

from_pymatgen(structure)

A pymatgen Structure or Molecule as a System.

Parameters:

Name Type Description Default
structure Structure or Molecule

The atoms, each site of one element. The lattice of a structure becomes the box, with its periodicity; a molecule gets a box that encloses it, not periodic. The site properties velocities (Å/fs) and selective_dynamics become velocities (Å/ps) and movable, other numeric site properties columns of the same name; the properties become info.

required

Returns:

Type Description
System

A new system; nothing is shared with the structure.

Raises:

Type Description
InvalidParameter

If a site is disordered, with more than one element.

freud

to_freud

to_freud(system)

The system as a freud box and points, the input of freud's analyses.

Parameters:

Name Type Description Default
system System

The atoms, in a right-handed box periodic in every direction.

required

Returns:

Name Type Description
box Box

The box, with its first vector along x and its second in the xy plane, as freud keeps boxes.

points ndarray

(N, 3) float32 positions in that box, centered on the origin as freud expects, moved into the box.

Raises:

Type Description
InvalidParameter

If the box is not periodic in every direction, or is left-handed.

from_freud

from_freud(box, points)

A freud box and points as a System.

Parameters:

Name Type Description Default
box Box

A three-dimensional box; its periodicity becomes that of the system.

required
points array_like

(N, 3) float64 positions in the box.

required

Returns:

Type Description
System

The points in a box with freud's vectors, its origin at the corner of the box centered on the origin.

Raises:

Type Description
InvalidParameter

If the box is two-dimensional.