encyclopedia.py 10.2 KB
Newer Older
1
import numpy as np
2
from elasticsearch_dsl import InnerDoc
3
from nomad.metainfo import MSection, Section, SubSection, Quantity, MEnum, units
4
5
6
7
8
9
10
11
12
13
14
15
16


class Material(MSection):
    m_def = Section(
        a_flask=dict(skip_none=True),
        a_elastic=dict(type=InnerDoc),
        description="""
        Section for storing the data that links this entry into a specific material.
        """
    )
    material_hash = Quantity(
        type=str,
        description="""
17
18
        A fixed length, unique material identifier in the form of a hash
        digest.
19
20
        """
    )
21
    system_type = Quantity(
22
        type=MEnum(bulk="bulk", two_d="2D", one_d="1D", unavailable="unavailable"),
23
24
25
26
        description="""
        "Character of physical system's geometry, e.g. bulk, surface... ",
        """
    )
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
    number_of_atoms = Quantity(
        type=int,
        description="""
        Number of atoms in the bravais cell."
        """
    )
    atom_labels = Quantity(
        type=str,
        shape=['1..*'],
        description="""
        Type (element, species) of each atom,
        """
    )
    atom_positions = Quantity(
        type=np.dtype('f8'),
        shape=['number_of_atoms', 3],
        description="""
        Position of each atom, given in relative coordinates.
        """
    )
47
    bravais_lattice = Quantity(
48
        type=MEnum("aP", "mP", "mS", "oP", "oS", "oI", "oF", "tP", "tI", "hR", "hP", "cP", "cI", "cF"),
49
50
51
        description="""
        The Bravais lattice type in the Pearson notation, where the first
        lowercase letter indicates the crystal system, and the second uppercase
52
53
        letter indicates the lattice type. The value can only be one of the 14
        different Bravais lattices in three dimensions.
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

        Crystal system letters:

        a = Triclinic
        m = Monoclinic
        o = Orthorhombic
        t = Tetragonal
        h = Hexagonal and Trigonal
        c = Cubic

        Lattice type letters:

        P = Primitive
        S (A, B, C) = One side/face centred
        I = Body centered
        R = Rhombohedral centring
        F = All faces centred
        """
    )
73
74
75
76
    cell_normalized = Quantity(
        type=np.dtype('f8'),
        shape=[3, 3],
        description="""
77
        Unit cell in normalized form, meaning the bravais cell. This cell is
78
        representative and is idealized to match the detected symmetry
79
        properties.
80
81
        """
    )
82
83
84
85
    cell_primitive = Quantity(
        type=np.dtype('f8'),
        shape=[3, 3],
        description="""
86
87
88
        Definition of the primitive unit cell in a form to be visualized well
        within the normalized cell. This cell is representative and is
        idealized to match the detected symmemtry properties.
89
90
        """
    )
91
92
93
94
95
96
    crystal_system = Quantity(
        type=MEnum("triclinic", "monoclinic", "orthorhombic", "tetragonal", "trigonal", "hexagonal", "cubic"),
        description="""
        The detected crystal system. One of seven possibilities in three dimensions.
        """
    )
97
98
99
100
101
102
103
    formula = Quantity(
        type=str,
        description="""
        Formula giving the composition and occurrences of the elements in the
        Hill notation for the irreducible unit cell.
        """
    )
104
105
106
107
108
109
110
111
    formula_reduced = Quantity(
        type=str,
        description="""
        Formula giving the composition and occurrences of the elements in the
        Hill notation for the irreducible unit cell. In this reduced form the
        number of occurences have been divided by the greatest common divisor.
        """
    )
112
113
114
115
116
117
118
119
120
    has_free_wyckoff_parameters = Quantity(
        type=bool,
        description="""
        Whether the material has any Wyckoff sites with free parameters. If a
        materials has free Wyckoff parameters, at least some of the atoms are
        not bound to a particular location in the structure but are allowed to
        move with possible restrictions set by the symmetry.
        """
    )
121
122
123
124
125
126
127
    material_classification = Quantity(
        type=str,
        description="""
        Contains the compound class and classification of the material
        according to springer materials in JSON format.
        """
    )
128
    material_name = Quantity(
129
130
        type=str,
        description="""
131
        Most meaningful name for a material.
132
133
        """
    )
134
135
136
137
138
139
140
    periodicity = Quantity(
        type=np.dtype('i1'),
        shape=["1..*"],
        description="""
        The indices of the periodic dimensions.
        """
    )
141
142
143
144
145
146
147
    point_group = Quantity(
        type=MEnum("1", "-1", "2", "m", "2/m", "222", "mm2", "mmm", "4", "-4", "4/m", "422", "4mm", "-42m", "4/mmm", "3", "-3", "32", "3m", "-3m", "6", "-6", "6/m", "622", "6mm", "-6m2", "6/mmm", "23", "m-3", "432", "-43m", "m-3m"),
        description="""
        Point group in Hermann-Mauguin notation, part of crystal structure
        classification. There are 32 point groups in three dimensional space.
        """
    )
148
149
150
151
152
153
154
155
156
157
158
159
    space_group_number = Quantity(
        type=int,
        description="""
        Integer representation of the space group, part of crystal structure classification, part of material definition.
        """
    )
    space_group_international_short_symbol = Quantity(
        type=str,
        description="""
        International short symbol notation of the space group.
        """
    )
160
161
162
163
164
165
    structure_prototype = Quantity(
        type=str,
        description="""
        The prototypical material for this crystal structure.
        """
    )
166
167
168
169
170
171
172
    structure_type = Quantity(
        type=str,
        description="""
        Classification according to known structure type, considering the point
        group of the crystal and the occupations with different atom types.
        """
    )
173
174
175
176
177
178
    strukturbericht_designation = Quantity(
        type=str,
        description="""
        Classification of the material according to the historically grown "strukturbericht".
        """
    )
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
    wyckoff_groups = Quantity(
        type=str,
        description="""
        Returns a list of information about the Wyckoff groups in the JSON format.

        An example of the output:
            [
                {
                    'wyckoff_letter': 'a',
                    'variables': {'z': 0.0},
                    'indices': [0, 6, 12],
                    'element': 'Bi'
                },
                {
                    'wyckoff_letter': 'b',
                    'variables': {'x': 0.50155295, 'z': 0.87461175999999996},
                    'indices': [1, 3, 4, 7, 9, 10, 13, 15, 16],
                    'element': 'Ga'
                }, ...
            ]
        """
    )
201
202


203
204
205
206
207
208
209
210
211
class Calculation(MSection):
    m_def = Section(
        a_flask=dict(skip_none=True),
        a_elastic=dict(type=InnerDoc),
        description="""
        Section for storing data related to a calculation that is identified
        from this entry.
        """
    )
212
213
    atomic_density = Quantity(
        type=float,
214
        unit=units.m**(-3),
215
216
217
218
        description="""
        Atomic density of the material (atoms/volume)."
        """
    )
219
220
221
222
223
224
    cell_angles_string = Quantity(
        type=str,
        description="""
        A summary of the cell angles, part of material definition.
        """
    )
225
226
227
228
229
230
231
232
233
    cell_volume = Quantity(
        type=float,
        description="""
        Cell volume for a specific calculation. The cell volume can only be
        reported consistently after normalization. Thus it corresponds to the
        normalized cell that is idealized to fit the detected symmetry and may
        not perfectly correspond to the original simulation cell.
        """
    )
234
235
236
237
238
239
240
241
242
243
244
245
    code_name = Quantity(
        type=str,
        description="""
        Name of the code used to perform the calculation.
        """
    )
    code_version = Quantity(
        type=str,
        description="""
        Version of the code used for the calculation.
        """
    )
246
247
248
249
    lattice_parameters = Quantity(
        type=np.dtype('f8'),
        shape=[6],
        description="""
250
251
252
253
254
        Lattice parameters of a specific calculation. The lattice parameters
        can only be reported consistently after normalization. Thus they
        correspond to the normalized cell that is idealized to fit the detected
        symmetry and may not perfectly correspond to the original simulation
        cell.
255
256
        """
    )
257
258
259
260
261
262
    mainfile_uri = Quantity(
        type=str,
        description="""
        Path of the main file.
        """
    )
263
264
265
266
267
268
269
    mass_density = Quantity(
        type=float,
        unit=units.kg / units.m**3,
        description="""
        Mass density of the material based on the structural information.
        """
    )
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
    method_hash = Quantity(
        type=str,
        description="""
        A fixed length, unique method identifier in the form of a hash
        digest.
        """
    )
    group_eos_hash = Quantity(
        type=str,
        description="""
        A fixed length, unique identifier for equation-of-state calculations.
        Only calculations wihtin the same upload will be grouped under the same
        hash.
        """
    )
    group_parametervariation_hash = Quantity(
        type=str,
        description="""
        A fixed length, unique identifier for calculations where structure is
        identical but the used computational parameters are varied.  Only
        calculations within the same upload will be grouped under the same
        hash.
        """
    )
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
    run_type = Quantity(
        type=MEnum(
            single_point="single point",
            geometry_optimization="geometry optimization",
            molecular_dynamics="molecular dynamics",
            phonon_calculation="phonon calculation",
            elastic_constants="elastic constants",
            qha_calculation="QHA calculation",
            qw_calculation="GW calculation",
            equation_of_state="equation of state",
            parameter_variation="parameter variation",
            unavailable="unavailable"),
        description="""
        Defines the type of run identified for this entry.
        """
    )
310
311


312
313
class Encyclopedia(MSection):
    m_def = Section(
Lauri Himanen's avatar
Lauri Himanen committed
314
        name="encyclopedia",
315
316
317
318
        a_flask=dict(skip_none=True),
        a_elastic=dict(type=InnerDoc)
    )
    material = SubSection(sub_section=Material.m_def, repeats=False)
319
    calculation = SubSection(sub_section=Calculation.m_def, repeats=False)