gemdat.transitions
This module contains classes for computing jumps and transitions between sites.
Transitions(*, trajectory, diff_trajectory, sites, events, states, inner_states)
Container class for transitions between sites.
Attributes:
-
events
(ndarray
) β5-column numpy array holding all transition events
-
n_sites
(int
) βTotal number of sites
-
states
(ndarray
) βFor each time step, for each atom, track the index of the site it is at. Assingn NOSITE if the atom is in transition
Parameters:
-
trajectory
(Trajectory
) βFull trajectory of all sites in the simulation
-
diff_trajectory
(Trajectory
) βTrajectory of species of interest (e.g. diffusing) for which transitions are generated
-
sites
(Structure
) βStructure with known sites used for calculation of events
-
events
(ndarray
) βInput events
-
states
(ndarray
) βInput states
-
inner_states
(ndarray
) βInput states for inner sites
Source code in src/gemdat/transitions.py
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 |
|
n_events: int
property
Return number of events.
n_floating: int
property
Return number of floating species.
n_sites: int
property
Return number of sites.
n_states: int
property
Return number of states.
atom_locations()
Calculate fraction of time atoms spent at a type of site.
Returns:
Source code in src/gemdat/transitions.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 |
|
from_trajectory(*, trajectory, sites, floating_specie, site_radius=None, site_inner_fraction=1.0)
classmethod
Compute transitions between given sites for floating specie.
Parameters:
-
sites
(Structure
) βInput structure with known sites
-
floating_specie
(str
) βName of the floating specie to calculate transitions for
-
site_radius
(float | dict[str, float] | None
, default:None
) βA custom site radius in Γ ngstrom to determine if an atom is at a site. A dict keyed by the site label can be used to have a site per atom type, e.g. `site_radius = {'Li1': 1.0, 'Li2': 1.2}.
-
site_inner_fraction
(float
, default:1.0
) βA fraction of the site radius which is determined to be the
inner site
which is used in jump calculations
Returns:
-
transitions
(Transitions
) β
Source code in src/gemdat/transitions.py
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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
jumps(minimal_residence=0, **kwargs)
Analyze transitions and classify them as jumps.
Parameters:
-
minimal_residence
(int
, default:0
) βminimal residence, number of timesteps that an atom needs to reside on a destination site to count as a jump, passed through to conversion method
-
**kwargs
(dict
, default:{}
) βThese parameters are passed to the gemdat.Jumps initializer.
Returns:
-
jumps
(Jumps
) β
Source code in src/gemdat/transitions.py
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
|
matrix()
Convert list of transition events to dense matrix.
Returns:
-
transitions_matrix
(ndarray
) βSquare matrix with number of each transitions
Source code in src/gemdat/transitions.py
187 188 189 190 191 192 193 194 195 196 |
|
occupancy()
Calculate occupancy per site.
Returns:
-
sites
(Structure
) βStructure with occupancies set on the sites.
Source code in src/gemdat/transitions.py
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
|
split(n_parts=10)
Split data into equal parts in time for statistics.
Parameters:
-
n_parts
(int
, default:10
) βNumber of parts to split the data into
Returns:
-
parts
(list[Transitions]
) βList with
Transitions
object for each part
Source code in src/gemdat/transitions.py
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
|
states_next()
Calculate atom transition states per time step by backward filling
self.states
.
Returns:
-
ndarray
βOutput array with atom transition states.
states_next
contains the index of the next site for every atom.
Source code in src/gemdat/transitions.py
198 199 200 201 202 203 204 205 206 207 208 209 |
|
states_prev()
Calculate atom transition states per time step by forward filling
self.states
.
Returns:
-
ndarray
βOutput array with atom transition states.
states_prev
contains the index of the previous site for every atom.
Source code in src/gemdat/transitions.py
211 212 213 214 215 216 217 218 219 220 221 222 |
|