aiida¶
Convert an OPTIMADE structure, in the format of
StructureResource
to an AiiDA StructureData
Node.
For more information on the AiiDA code see their website.
This conversion function relies on the aiida-core
package.
AIIDA_NOT_FOUND = 'AiiDA not found, cannot convert structure to an AiiDA StructureData'
module-attribute
¶
__all__ = ('get_aiida_structure_data')
module-attribute
¶
AdapterPackageNotFound
¶
Bases: OptimadeWarning
The package for an adapter cannot be found.
Source code in optimade/adapters/warnings.py
6 7 |
|
ConversionWarning
¶
Bases: OptimadeWarning
A non-critical error/fallback/choice happened during conversion of an entry to format.
Source code in optimade/adapters/warnings.py
10 11 |
|
OptimadeStructure
¶
Bases: EntryResource
Representing a structure.
Source code in optimade/models/structures.py
1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 |
|
OptimadeStructureSpecies
¶
Bases: BaseModel
A list describing the species of the sites of this structure.
Species can represent pure chemical elements, virtual-crystal atoms representing a statistical occupation of a given site by multiple chemical elements, and/or a location to which there are attached atoms, i.e., atoms whose precise location are unknown beyond that they are attached to that position (frequently used to indicate hydrogen atoms attached to another element, e.g., a carbon with three attached hydrogens might represent a methyl group, -CH3).
- Examples:
[ {"name": "Ti", "chemical_symbols": ["Ti"], "concentration": [1.0]} ]
: any site with this species is occupied by a Ti atom.[ {"name": "Ti", "chemical_symbols": ["Ti", "vacancy"], "concentration": [0.9, 0.1]} ]
: any site with this species is occupied by a Ti atom with 90 % probability, and has a vacancy with 10 % probability.[ {"name": "BaCa", "chemical_symbols": ["vacancy", "Ba", "Ca"], "concentration": [0.05, 0.45, 0.5], "mass": [0.0, 137.327, 40.078]} ]
: any site with this species is occupied by a Ba atom with 45 % probability, a Ca atom with 50 % probability, and by a vacancy with 5 % probability. The mass of this site is (on average) 88.5 a.m.u.[ {"name": "C12", "chemical_symbols": ["C"], "concentration": [1.0], "mass": [12.0]} ]
: any site with this species is occupied by a carbon isotope with mass 12.[ {"name": "C13", "chemical_symbols": ["C"], "concentration": [1.0], "mass": [13.0]} ]
: any site with this species is occupied by a carbon isotope with mass 13.[ {"name": "CH3", "chemical_symbols": ["C"], "concentration": [1.0], "attached": ["H"], "nattached": [3]} ]
: any site with this species is occupied by a methyl group, -CH3, which is represented without specifying precise positions of the hydrogen atoms.
Source code in optimade/models/structures.py
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 |
|
get_aiida_structure_data(optimade_structure)
¶
Get AiiDA StructureData
from OPTIMADE structure.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
optimade_structure |
StructureResource
|
OPTIMADE structure. |
required |
Returns:
Type | Description |
---|---|
StructureData
|
AiiDA |
Source code in optimade/adapters/structures/aiida.py
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 |
|
pad_cell(lattice_vectors, padding=None)
¶
Turn any null
/None
values into a float
in given tuple
of
lattice_vectors
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lattice_vectors |
tuple[Vector3D, Vector3D, Vector3D]
|
A 3x3 cartesian cell. This is the
|
required |
padding |
Optional[float]
|
A value with which |
None
|
Returns:
Type | Description |
---|---|
tuple
|
The possibly redacted/padded |
tuple
|
the value has been redacted/padded or not, i.e., whether it contained |
tuple
|
values. |
Source code in optimade/adapters/structures/utils.py
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 |
|
species_from_species_at_sites(species_at_sites)
¶
When a list of species dictionaries is not provided, this function can be used to infer the species from the provided species_at_sites.
In this use case, species_at_sites is assumed to provide a list of element symbols, and refers to situations with no mixed occupancy, i.e., the constructed species list will contain all unique species with concentration equal to 1 and the species_at_site tag will be used as the chemical symbol.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
species_at_sites |
list[str]
|
The list found under the species_at_sites field. |
required |
Returns:
Type | Description |
---|---|
list[Species]
|
An OPTIMADE species list. |
Source code in optimade/adapters/structures/utils.py
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 |
|