encyclopedia.py 14.9 KB
Newer Older
1
import numpy as np
2
from elasticsearch_dsl import InnerDoc
3
from nomad.metainfo import MSection, Section, SectionProxy, SubSection, Quantity, Reference, MEnum, units
4
from nomad.datamodel.metainfo.public import section_dos, section_k_band
5
6


7
class WyckoffVariables(MSection):
8
9
10
11
    m_def = Section(
        a_flask=dict(skip_none=True),
        a_elastic=dict(type=InnerDoc),
        description="""
12
        Contains the variables associated with a Wyckoff set.
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
        """
    )
    x = Quantity(
        type=float,
        description="""
        The x variable if present.
        """
    )
    y = Quantity(
        type=float,
        description="""
        The y variable if present.
        """
    )
    z = Quantity(
        type=float,
        description="""
        The z variable if present.
        """
    )
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48


class WyckoffSet(MSection):
    m_def = Section(
        a_flask=dict(skip_none=True),
        a_elastic=dict(type=InnerDoc),
        description="""
        Section for storing Wyckoff set information.
        """
    )
    wyckoff_letter = Quantity(
        type=str,
        description="""
        The Wyckoff letter for this set.
        """
    )
49
50
51
52
53
54
55
56
57
58
59
60
61
    indices = Quantity(
        type=np.dtype('i4'),
        shape=["1..*"],
        description="""
        Indices of the atoms belonging to this group.
        """
    )
    element = Quantity(
        type=str,
        description="""
        Chemical element at this Wyckoff position.
        """
    )
62
    variables = SubSection(sub_section=WyckoffVariables.m_def, repeats=False)
63
64


65
class IdealizedStructure(MSection):
66
67
68
69
    m_def = Section(
        a_flask=dict(skip_none=True),
        a_elastic=dict(type=InnerDoc),
        description="""
70
71
72
73
74
        Contains structural information for an idealized representation of the
        material used in the calculation. This idealization is used for
        visualizing the material and for calculating the structural properties.
        The properties of the idealized structure may slightly vary from the
        original structure used in the calculation.
75
76
        """
    )
77
78
79
    atom_labels = Quantity(
        type=str,
        shape=['1..*'],
80
        description="""
81
        Type (element, species) of each atom.
82
83
        """
    )
84
    atom_positions = Quantity(
85
        type=np.dtype(np.float64),
86
        shape=['number_of_atoms', 3],
87
        description="""
88
89
90
91
92
        Atom positions given in coordinates that are relative to the idealized
        cell.
        """
    )
    lattice_vectors = Quantity(
93
        type=np.dtype(np.float64),
94
95
96
97
98
99
100
101
        shape=[3, 3],
        description="""
        Lattice vectors of the idealized structure. For bulk materials it is
        the Bravais cell. This cell is representative and is idealized to match
        the detected symmetry properties.
        """
    )
    lattice_vectors_primitive = Quantity(
102
        type=np.dtype(np.float64),
103
104
105
106
107
108
109
110
        shape=[3, 3],
        description="""
        Lattice vectors of the the primitive unit cell in a form to be visualized
        within the idealized cell. This cell is representative and is
        idealized to match the detected symmemtry properties.
        """
    )
    lattice_parameters = Quantity(
111
        type=np.dtype(np.float64),
112
113
114
115
116
117
118
119
120
121
122
123
124
        shape=[6],
        description="""
        Lattice parameters of the idealized cell. The lattice parameters can
        only be reported consistently after idealization and may not perfectly
        correspond to the original simulation cell.
        """
    )
    periodicity = Quantity(
        type=np.bool,
        shape=[3],
        description="""
        Automatically detected true periodicity of each lattice direction. May
        not correspond to the periodicity used in the calculation.
125
126
        """
    )
127
128
    number_of_atoms = Quantity(
        type=int,
129
        description="""
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
        Number of atoms in the idealized structure."
        """
    )
    cell_volume = Quantity(
        type=float,
        description="""
        Volume of the idealized cell. The cell volume can only be reported
        consistently after idealization and may not perfectly correspond to the
        original simulation cell.
        """
    )


class Bulk(MSection):
    m_def = Section(
        a_flask=dict(skip_none=True),
        a_elastic=dict(type=InnerDoc),
        description="""
        Contains information that is specific to bulk crystalline materials.
149
150
        """
    )
151
    bravais_lattice = Quantity(
152
        type=MEnum("aP", "mP", "mS", "oP", "oS", "oI", "oF", "tP", "tI", "hR", "hP", "cP", "cI", "cF"),
153
154
155
        description="""
        The Bravais lattice type in the Pearson notation, where the first
        lowercase letter indicates the crystal system, and the second uppercase
156
157
        letter indicates the lattice type. The value can only be one of the 14
        different Bravais lattices in three dimensions.
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

        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
        """
    )
177
178
179
180
181
182
    crystal_system = Quantity(
        type=MEnum("triclinic", "monoclinic", "orthorhombic", "tetragonal", "trigonal", "hexagonal", "cubic"),
        description="""
        The detected crystal system. One of seven possibilities in three dimensions.
        """
    )
183
184
185
186
187
188
189
190
191
    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.
        """
    )
192
193
194
195
196
197
198
    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.
        """
    )
199
200
201
    space_group_number = Quantity(
        type=int,
        description="""
202
203
        Integer representation of the space group, part of crystal structure
        classification, part of material definition.
204
205
206
207
208
209
210
211
        """
    )
    space_group_international_short_symbol = Quantity(
        type=str,
        description="""
        International short symbol notation of the space group.
        """
    )
212
213
214
215
216
217
    structure_prototype = Quantity(
        type=str,
        description="""
        The prototypical material for this crystal structure.
        """
    )
218
219
220
221
222
223
224
    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.
        """
    )
225
226
227
228
229
230
    strukturbericht_designation = Quantity(
        type=str,
        description="""
        Classification of the material according to the historically grown "strukturbericht".
        """
    )
231
    wyckoff_sets = SubSection(sub_section=WyckoffSet.m_def, repeats=True)
232

233
234
235
236
237

class Material(MSection):
    m_def = Section(
        a_flask=dict(skip_none=True),
        a_elastic=dict(type=InnerDoc),
238
        description="""
239
240
        Contains an overview of the type of material that was detected in this
        entry.
241
242
        """
    )
243
244
    material_type = Quantity(
        type=MEnum(bulk="bulk", two_d="2D", one_d="1D", unavailable="unavailable"),
245
        description="""
246
        "Broad structural classification for the material, e.g. bulk, 2D, 1D... ",
247
248
        """
    )
249
250
    material_hash = Quantity(
        type=str,
251
        description="""
252
253
        A fixed length, unique material identifier in the form of a hash
        digest.
254
255
        """
    )
256
257
    material_name = Quantity(
        type=str,
258
        description="""
259
        Most meaningful name for a material.
260
261
        """
    )
262
    material_classification = Quantity(
263
        type=str,
264
        description="""
265
266
        Contains the compound class and classification of the material
        according to springer materials in JSON format.
267
268
        """
    )
269
270
    formula = Quantity(
        type=str,
271
        description="""
272
273
274
        Formula giving the composition and occurrences of the elements in the
        Hill notation. For periodic materials the formula is calculated fom the
        primitive unit cell.
275
276
        """
    )
277
278
    formula_reduced = Quantity(
        type=str,
279
        description="""
280
281
282
        Formula giving the composition and occurrences of the elements in the
        Hill notation whre the number of occurences have been divided by the
        greatest common divisor.
283
284
        """
    )
285

286
287
288
289
290
291
    # The idealized structure for this material
    idealized_structure = SubSection(sub_section=IdealizedStructure.m_def, repeats=False)

    # Bulk-specific properties
    bulk = SubSection(sub_section=Bulk.m_def, repeats=False)

292
293
294
295
296
297

class Method(MSection):
    m_def = Section(
        a_flask=dict(skip_none=True),
        a_elastic=dict(type=InnerDoc),
        description="""
298
299
        Contains an overview of the methodology that was detected in this
        entry.
300
301
302
        """
    )
    method_type = Quantity(
303
        type=MEnum("DFT", "GW", "unavailable", DFTU="DFT+U"),
304
        description="""
305
        Generic name for the used methodology.
306
307
        """
    )
308
309
    basis_set_type = Quantity(
        type=MEnum("Numeric AOs", "Gaussians", "(L)APW+lo", "FLAPW (full-potential linearized augmented planewave)", "Plane waves", "Real-space grid", "Local-orbital minimum-basis"),
310
        description="""
311
        Basic type of the used basis set.
312
313
        """
    )
314
315
316
317
318
319
    core_electron_treatment = Quantity(
        type=MEnum("full all electron", "all electron frozen core", "pseudopotential", "unavailable"),
        description="""
        How the core electrons are described.
        """
    )
320
321
322
323
324
325
    functional_long_name = Quantity(
        type=str,
        description="""
        Full identified for the used exchange-correlation functional.
        """
    )
Lauri Himanen's avatar
Lauri Himanen committed
326
327
328
329
330
331
    functional_type = Quantity(
        type=str,
        description="""
        Basic type of the used exchange-correlation functional.
        """
    )
332
333
334
    method_hash = Quantity(
        type=str,
        description="""
335
336
337
338
        A fixed length, unique method identifier in the form of a hash digest.
        The hash is created by using several method settings as seed. This hash
        is only defined if a set of well-defined method settings is available
        for the used program.
339
340
341
342
343
344
        """
    )
    group_eos_hash = Quantity(
        type=str,
        description="""
        A fixed length, unique identifier for equation-of-state calculations.
345
346
        Only calculations within the same upload and with a method hash
        available will be grouped under the same hash.
347
348
349
350
351
352
        """
    )
    group_parametervariation_hash = Quantity(
        type=str,
        description="""
        A fixed length, unique identifier for calculations where structure is
353
        identical but the used computational parameters are varied. Only
354
355
        calculations within the same upload and with a method hash available
        will be grouped under the same hash.
356
357
        """
    )
358
359
360
    gw_starting_point = Quantity(
        type=str,
        description="""
361
362
        The exchange-correlation functional that was used as a starting point
        for this GW calculation.
363
364
365
366
367
368
369
370
        """
    )
    gw_type = Quantity(
        type=MEnum("G0W0", "scGW"),
        description="""
        Basic type of GW calculation.
        """
    )
371
    smearing_kind = Quantity(
372
        type=str,
373
374
375
376
377
378
379
380
381
382
383
384
        description="""
        Smearing function used for the electronic structure calculation.
        """
    )
    smearing_parameter = Quantity(
        type=float,
        description="""
        Parameter for smearing, usually the width.
        """
    )


385
class Calculation(MSection):
386
387
388
389
    m_def = Section(
        a_flask=dict(skip_none=True),
        a_elastic=dict(type=InnerDoc),
        description="""
390
391
        Contains an overview of the type of calculation that was detected in
        this entry.
392
393
        """
    )
394
    calculation_type = Quantity(
395
396
397
398
399
400
401
        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",
402
            gw_calculation="GW calculation",
403
404
405
406
            equation_of_state="equation of state",
            parameter_variation="parameter variation",
            unavailable="unavailable"),
        description="""
407
        Defines the type of calculation that was detected for this entry.
408
409
        """
    )
410
411


412
class Properties(MSection):
413
414
415
416
    m_def = Section(
        a_flask=dict(skip_none=True),
        a_elastic=dict(type=InnerDoc),
        description="""
417
418
        Contains a summary of the physical properties that have been calculated
        in this entry.
419
420
        """
    )
421
    atomic_density = Quantity(
422
        type=float,
423
        unit=units.m**(-3),
424
        description="""
425
        Atomic density of the material (atoms/volume)."
426
427
        """
    )
428
429
430
    mass_density = Quantity(
        type=float,
        unit=units.kg / units.m**3,
431
        description="""
432
        Mass density of the material.
433
434
435
        """
    )
    energies = Quantity(
436
        type=str,
437
        description="""
438
        Code dependent energy values, corrected to be per formula unit.
439
440
        """
    )
441
    electronic_band_structure = Quantity(
442
        type=Reference(section_k_band.m_def),
443
        shape=[],
444
        description="""
445
        Reference to an electronic band structure.
446
447
        """
    )
448
    electronic_dos = Quantity(
449
        type=Reference(section_dos.m_def),
450
        shape=[],
451
        description="""
452
        Reference to an electronic density of states.
453
454
        """
    )
455
    phonon_band_structure = Quantity(
456
        type=Reference(section_k_band.m_def),
457
        shape=[],
458
        description="""
459
        Reference to a phonon band structure.
460
461
        """
    )
462
    phonon_dos = Quantity(
463
        type=Reference(section_dos.m_def),
464
        shape=[],
465
        description="""
466
        Reference to a phonon density of states.
467
468
        """
    )
469
470


471
class section_encyclopedia(MSection):
472
473
    m_def = Section(
        a_flask=dict(skip_none=True),
474
475
        a_elastic=dict(type=InnerDoc),
        description="""
476
        Section which stores information for the NOMAD Encyclopedia.
477
        """
478
479
    )
    material = SubSection(sub_section=Material.m_def, repeats=False)
480
481
    method = SubSection(sub_section=Method.m_def, repeats=False)
    properties = SubSection(sub_section=Properties.m_def, repeats=False)
482
    calculation = SubSection(sub_section=Calculation.m_def, repeats=False)