Dynamics and trajectories¶
Mean squared displacement¶
MeanSquaredDisplacement ¶
Mean squared displacement of the atoms of a trajectory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
window
|
bool
|
Average over every time origin, by fast Fourier transforms (True, default), or measure from the first frame only (False). |
True
|
unwrap
|
bool
|
Follow the atoms through the periodic boundaries (True, default), or take the positions as they are, already unwrapped (False). |
True
|
compute ¶
The displacement of a sequence of frames, such as a Trajectory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frames
|
sequence of System
|
The same atoms in every frame: matched by the |
required |
Returns:
| Type | Description |
|---|---|
DisplacementResult
|
The mean squared displacement for each lag. |
DisplacementResult
dataclass
¶
Bases: Result
Mean squared displacement against the lag.
Attributes:
| Name | Type | Description |
|---|---|---|
lag |
ndarray
|
(T,) int64 lag in frames. |
msd |
ndarray
|
(T,) float64 mean squared displacement in Ų, averaged over the atoms. |
components |
ndarray
|
(T, 3) float64, its x, y and z parts. |
Lindemann index¶
LindemannIndex ¶
Lindemann index: the fluctuation of the distances between atoms relative to their mean, which rises sharply at melting.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
unwrap
|
bool
|
Follow the atoms through the periodic boundaries (True, default), or take the positions as they are, already unwrapped (False). |
True
|
compute ¶
The index of a sequence of frames.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frames
|
sequence of System
|
The same atoms in every frame: matched by the |
required |
Returns:
| Type | Description |
|---|---|
LindemannResult
|
The index over every pair, of each atom and of each prefix of the frames. |
LindemannResult
dataclass
¶
Bases: Result
Lindemann index of a trajectory.
Attributes:
| Name | Type | Description |
|---|---|---|
index |
float64
|
The index averaged over every pair of atoms. |
atomic |
ndarray
|
(N,) float64, the index of each atom, averaged over its pairs, the atoms in the order of the first frame. |
running |
ndarray
|
(T,) float64, the index of the frames up to each one. |
Atomic temperature¶
AtomicTemperature ¶
The temperature of each atom and its neighbors, from their velocities relative to their center of mass.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cutoff
|
float64
|
The neighbors closer than cutoff, in Å, form the group of an atom. |
required |
compute ¶
The temperature of each atom.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
System
|
The atoms, with |
required |
neighbors
|
NeighborList
|
A neighbor list of this system reaching at least |
None
|
Returns:
| Type | Description |
|---|---|
TemperatureResult
|
The temperature of each atom. |
TemperatureResult
dataclass
¶
Bases: Result
The local temperature of each atom.
Attributes:
| Name | Type | Description |
|---|---|---|
temperature |
ndarray
|
(N,) float64 temperature in K; NaN for atoms without neighbors. |
Along a trajectory¶
TimeAverage ¶
The mean of a quantity over the frames of a trajectory, as OVITO's time averaging modifier.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quantity
|
str or callable
|
A column of numbers of the atoms, such as |
required |
unwrap
|
bool
|
For positions: follow the atoms through the periodic boundaries (True, default), or average the positions as they are. |
True
|
compute ¶
The mean over frames, such as a Trajectory or a slice of one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frames
|
iterable of System
|
For a column, the same atoms in every frame: matched by the
|
required |
Returns:
| Type | Description |
|---|---|
TimeAverageResult
|
The mean and the number of frames. |
TimeAverageResult
dataclass
¶
Bases: Result
Time average of a quantity.
Attributes:
| Name | Type | Description |
|---|---|---|
value |
ndarray
|
The float64 mean over the frames: of each atom in the order of the first frame for a column, (3, 3) for the box, of the shape the function gives otherwise. |
frames |
int32
|
The number of frames. |
name |
str or None
|
The column averaged; None for the box or a function. |
TimeSeries ¶
A quantity in every frame of a trajectory, as OVITO's time series modifier: a column reduced to one number per frame, or any function of a frame.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
quantity
|
str or callable
|
A column of numbers, a component such as |
required |
operation
|
str
|
For a column, one of |
'mean'
|
compute ¶
The quantity in each frame, such as of a Trajectory or a slice of one.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frames
|
iterable of System
|
The frames, in order. |
required |
Returns:
| Type | Description |
|---|---|
TimeSeriesResult
|
The values and the timesteps. |
TimeSeriesResult
dataclass
¶
Bases: Result
A quantity in each frame.
Attributes:
| Name | Type | Description |
|---|---|---|
frame |
ndarray
|
(F,) int64 the place of each frame among those given, from 0. |
values |
ndarray
|
(F,) float64, the quantity in each frame; (F, k) for one of k components or values. |
timestep |
ndarray or None
|
(F,) int64 the timestep of each frame, where every frame has one in its information. |
name |
str or None
|
The column; None for a function. |
FrameDifference ¶
The change of a column of each atom from a reference frame, as OVITO's difference between frames.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
column
|
str
|
A column of numbers, a component such as |
required |
compute ¶
The change from the reference.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
System
|
The frame. |
required |
reference
|
System
|
The reference frame, such as the first of the trajectory: its
atoms matched by the |
required |
Returns:
| Type | Description |
|---|---|
FrameDifferenceResult
|
The values of the system minus those of the reference. |
FrameDifferenceResult
dataclass
¶
Bases: Result
A column minus its values in a reference frame.
Attributes:
| Name | Type | Description |
|---|---|---|
difference |
ndarray
|
(N,) or (N, k) float64, the change of each atom of the system; added by
|
name |
str
|
The column. |
trajectory_lines ¶
The paths of atoms over the frames of a trajectory, as OVITO's generate trajectory lines.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frames
|
iterable of System
|
The same atoms in every frame: matched by the |
required |
atoms
|
array_like
|
A boolean mask or indices of the atoms of the first frame whose paths are wanted. Default all. |
None
|
unwrap
|
bool
|
Follow the atoms through the periodic boundaries (True, default), or take the positions as they are. |
True
|
Returns:
| Type | Description |
|---|---|
ndarray
|
(M, T, 3) float64, the positions of each atom in each frame, the atoms in the order of the first frame. |
Changing a trajectory¶
remove_drift ¶
The frames of a trajectory moved so that the center of mass of the atoms stays where it is in a reference frame, as OVITO's center of mass correction.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frames
|
sequence of System
|
The same atoms in every frame, such as a Trajectory: matched by the
|
required |
reference
|
int32
|
The frame whose center of mass is kept. Default 0. |
0
|
atoms
|
array_like
|
A boolean mask or indices of the atoms of the first frame whose center of mass is kept. Default all. |
None
|
unwrap
|
bool
|
Follow the atoms through the periodic boundaries to find the center of mass (True, default), or take the positions as they are. |
True
|
Returns:
| Type | Description |
|---|---|
sequence of System
|
The frames, read when they are used, each with all its atoms moved
by one translation; the boxes do not move. Its |
Raises:
| Type | Description |
|---|---|
InvalidParameter
|
If there are no frames, the reference frame is not one of them, no atoms are chosen or their masses add up to zero, or the frames do not hold the same atoms. |
freeze ¶
The values of a column in a reference frame given to the atoms of a system, as OVITO's freeze property.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
system
|
System
|
The frame that takes the values. |
required |
reference
|
System
|
The frame of the values, such as the first of the trajectory: its
atoms matched by the |
required |
column
|
str
|
A column, a component such as |
required |
name
|
str
|
The new column; by default the column, its dots as underscores,
followed by |
None
|
Returns:
| Type | Description |
|---|---|
System
|
The system with the values of the reference in the new column. |
Raises:
| Type | Description |
|---|---|
MissingProperty
|
If an atom of the system is not in the reference. |
InvalidParameter
|
Without ids, if the frames have different numbers of atoms. |
smooth_trajectory ¶
The positions and other real numbers of each frame averaged over a window of frames about it, the atoms followed through the periodic boundaries, as OVITO's smooth trajectory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
frames
|
sequence of System
|
The same atoms in every frame, such as a Trajectory: matched by the
|
required |
window
|
int32
|
The number of frames averaged: the frame, (window - 1) // 2 frames before it and window // 2 after it, the first and last frames repeated beyond the ends; 1 leaves the positions as they are. |
required |
Returns:
| Type | Description |
|---|---|
sequence of System
|
The frames, each computed when it is used: the mean positions about the atoms of that frame, the mean of every other column of real numbers (velocities, forces, values of analyses) matched by atom; columns of integers or text as they are. |
Raises:
| Type | Description |
|---|---|
InvalidParameter
|
If the window is not a positive integer or there are no frames. |