Diffusion
The diffusion class requires a list of Atoms objects with unwrapped atom coordinates during diffusion and a list of sampled times.
Diffusion
Class for analyzing diffusion in glass structures.
Source code in src/vitrum/diffusion.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
__init__(trajectory, sample_times)
Initializes a new instance of the class with the given a trajectory as a list of Atoms objects.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
trajectory
|
List[Atoms]
|
A list of Atoms objects representing the trajectory. |
required |
sample_times
|
List[float]
|
A list of sampled times. |
required |
Source code in src/vitrum/diffusion.py
12 13 14 15 16 17 18 19 20 21 22 23 24 | |
get_diffusion_coef(skip_first=100, msds=None)
Calculate the diffusion coefficients.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skip_first
|
int
|
Number of initial time steps to skip for linear regression. Defaults to 100. |
100
|
msds
|
Optional[ndarray]
|
Pre-calculated MSDs. If None, they are calculated. |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: Array of diffusion coefficients. |
Source code in src/vitrum/diffusion.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
get_mean_square_displacements()
Calculates the mean square displacement for each atom in the trajectory.
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: An array of mean square displacements. Rows correspond to: 0: Total MSD 1+: MSD for each species in self.species order. |
Source code in src/vitrum/diffusion.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | |
get_van_hove_self_correlation(target_atom, t_window=None, nbin=70)
Calculate the Van Hove self-correlation function.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_atom
|
str
|
The chemical symbol of the target atom. |
required |
t_window
|
Optional[int]
|
Time window stride. Defaults to None. |
None
|
nbin
|
int
|
Number of bins for histogram. Defaults to 70. |
70
|
Returns:
| Type | Description |
|---|---|
Tuple[ndarray, ndarray]
|
Tuple[np.ndarray, np.ndarray]: - edges: Bin edges (distance). - hist: Histogram values (probability). |
Source code in src/vitrum/diffusion.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |