Extended ASE atoms
We have added commonly used structure analysis for individual structures of disordered materials to the ASE Atoms object. The new methods are listed below. The ASE Atoms are automatically converted to a glass_Atoms object when they are passed to the vitrum classes.
GlassAtoms
Bases: Atoms
Extended ASE Atoms class for glass structure analysis.
Source code in src/vitrum/glass_Atoms.py
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 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 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 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 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | |
get_all_angles(center_type, neigh_types, cutoff='Auto')
Calculate the angular distribution of a given pair of target atoms within a specified range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_type
|
str
|
The atomic symbol of the central atom. |
required |
neigh_types
|
Union[str, List[str]]
|
The atomic symbols of the neighbor atoms. |
required |
cutoff
|
Union[float, int, List[float], str]
|
Range within which to calculate the angular distribution. Defaults to "Auto". Can be a list of cutoffs for each neighbor type, or a specific cutoff for all. |
'Auto'
|
Returns:
| Type | Description |
|---|---|
List[ndarray]
|
List[np.ndarray]: A list of arrays containing the angular distribution values. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If center_type or neigh_types are not present in the structure. |
Source code in src/vitrum/glass_Atoms.py
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 146 147 148 149 150 151 152 | |
get_bridging_analysis(center_type, bridge_type, former_types=None, cutoff='Auto')
Calculate the number of bridges for each center atom of a given type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_type
|
str
|
The type of the center atoms. |
required |
bridge_type
|
str
|
The type of the bridge atoms. |
required |
former_types
|
Optional[List[str]]
|
A list of types of the former atoms. Defaults to None. |
None
|
cutoff
|
Union[float, int, str]
|
The cutoff distance for considering a bridge. If "Auto", the cutoff is determined by finding the minimum value after the peak in the radial distribution function. If a float or int, the cutoff is set to the specified value. Defaults to "Auto". |
'Auto'
|
Returns:
| Type | Description |
|---|---|
List[int]
|
List[int]: A list of the number of bridges for each center atom. |
Source code in src/vitrum/glass_Atoms.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 | |
get_coordination_number(center_type, neigh_type, cutoff='Auto')
Calculate the coordination number of a given pair of target atoms within a specified range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_type
|
str
|
The atomic symbol of the central atom. |
required |
neigh_type
|
str
|
The atomic symbol of the neighbor atoms. |
required |
cutoff
|
Union[float, int, str]
|
The range within which to calculate the coordination number. Defaults to "Auto". |
'Auto'
|
Returns:
| Type | Description |
|---|---|
List[int]
|
List[int]: A list containing the coordination numbers for each center atom. |
Source code in src/vitrum/glass_Atoms.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 | |
get_density()
Calculate the density of the structure.
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Density in g/cm^3. |
Source code in src/vitrum/glass_Atoms.py
241 242 243 244 245 246 247 248 | |
get_dist()
Calculate the distances between all pairs of atoms in the Atoms object.
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: An array of shape (n_atoms, n_atoms) containing the distances between each pair of atoms. |
Source code in src/vitrum/glass_Atoms.py
18 19 20 21 22 23 24 25 26 27 28 | |
get_neighbors(center_type, cutoff)
Calculate the number of neighbors for each center atom of a given type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
center_type
|
str
|
The type of the center atoms. |
required |
cutoff
|
Union[float, int, dict]
|
The cutoff distance for considering a neighbor. If a float or int, the cutoff is set to the specified value. If a dictionary, it should map atom types to their respective cutoffs. |
required |
Returns:
| Type | Description |
|---|---|
List[int]
|
List[int]: A list of the number of neighbors for each center atom. |
Source code in src/vitrum/glass_Atoms.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 | |
get_pdf(target_atoms, rrange=10, nbin=100, indicies=None)
Calculate the probability density function (PDF) of a given pair of target atoms within a specified range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
target_atoms
|
List[Union[str, int]]
|
A list of two elements representing the target atoms. Each element can be either a string (chemical symbol) or an integer (atomic number). |
required |
rrange
|
float
|
The range within which to calculate the PDF. Defaults to 10.0. |
10
|
nbin
|
int
|
The number of bins to use for the histogram. Defaults to 100. |
100
|
indicies
|
Optional[List[ndarray]]
|
A list of two arrays representing the indices of the target atoms. Specifying this parameter will override the target_atoms parameter. Defaults to None. |
None
|
Returns:
| Type | Description |
|---|---|
|
Tuple[np.ndarray, np.ndarray]: - xval: An array of shape (nbin,) containing the distance values. - pdf: An array of shape (nbin,) containing the PDF values. |
Source code in src/vitrum/glass_Atoms.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 74 75 76 77 78 79 80 81 82 83 | |
set_new_chemical_symbols(symbol_map)
Set new chemical symbols for the atoms in the object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
symbol_map
|
Dict[int, str]
|
A dictionary mapping atomic numbers to new chemical symbols. |
required |
Source code in src/vitrum/glass_Atoms.py
30 31 32 33 34 35 36 37 38 | |