public.py 230 KB
Newer Older
1
2
3
4
import numpy as np            # pylint: disable=unused-import
import typing                 # pylint: disable=unused-import
from nomad.metainfo import (  # pylint: disable=unused-import
    MSection, MCategory, Category, Package, Quantity, Section, SubSection, SectionProxy,
5
    Reference, MEnum, derived
6
)
7
from nomad.metainfo.search_extension import Search
8
from nomad.metainfo.legacy import LegacyDefinition
9
10


11
12
13
14
m_package = Package(
    name='public_nomadmetainfo_json',
    description='None',
    a_legacy=LegacyDefinition(name='public.nomadmetainfo.json'))
15
16


17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class fast_access(MCategory):
    '''
    Used to mark archive objects that need to be stored in a fast 2nd-tier storage
    medium, because they are frequently accessed via archive API.

    If applied to a sub_section, the section will be added to the fast storage. Currently
    this only works for *root* sections that are sub_sections of `EntryArchive`.

    If applied to a reference types quantity, the referenced section will also be added
    to the fast storage, regardless if the referenced section has the category or not.
    '''

    m_def = Category()


32
33
34
35
36
37
class accessory_info(MCategory):
    '''
    Information that *in theory* should not affect the results of the calculations (e.g.,
    timing).
    '''

38
39
40
    m_def = Category(
        a_legacy=LegacyDefinition(name='accessory_info'))

41
42
43
44
45
46
47

class atom_forces_type(MCategory):
    '''
    The types of forces acting on the atoms (i.e., minus derivatives of the specific type
    of energy with respect to the atom position).
    '''

48
49
50
    m_def = Category(
        a_legacy=LegacyDefinition(name='atom_forces_type'))

51
52
53
54
55
56
57

class basis_set_description(MCategory):
    '''
    One of the parts building the basis set of the system (e.g., some atom-centered basis
    set, plane-waves or both).
    '''

58
59
60
    m_def = Category(
        a_legacy=LegacyDefinition(name='basis_set_description'))

61
62
63
64
65
66

class configuration_core(MCategory):
    '''
    Properties defining the current configuration.
    '''

67
68
69
    m_def = Category(
        a_legacy=LegacyDefinition(name='configuration_core'))

70
71
72
73
74
75
76

class conserved_quantity(MCategory):
    '''
    A quantity that is preserved during the time propagation (for example,
    kinetic+potential energy during NVE).
    '''

77
78
    m_def = Category(
        a_legacy=LegacyDefinition(name='conserved_quantity'))
79

80
81

class energy_value(MCategory):
82
    '''
83
    This metadata stores an energy value.
84
85
    '''

86
87
    m_def = Category(
        a_legacy=LegacyDefinition(name='energy_value'))
88

89
90

class error_estimate_contribution(MCategory):
91
    '''
92
    An estimate of a partial quantity contributing to the error for a given quantity.
93
94
    '''

95
96
    m_def = Category(
        a_legacy=LegacyDefinition(name='error_estimate_contribution'))
97

98
99

class message_debug(MCategory):
100
    '''
101
    A debugging message of the computational program.
102
103
    '''

104
105
    m_def = Category(
        a_legacy=LegacyDefinition(name='message_debug'))
106

107
108

class parsing_message_debug(MCategory):
109
    '''
110
    This field is used for debugging messages of the parsing program.
111
112
    '''

113
114
    m_def = Category(
        a_legacy=LegacyDefinition(name='parsing_message_debug'))
115

116
117

class scf_info(MCategory):
118
    '''
119
120
121
    Contains information on the self-consistent field (SCF) procedure, i.e. the number of
    SCF iterations (number_of_scf_iterations) or a section_scf_iteration section with
    detailed information on the SCF procedure of specified quantities.
122
123
    '''

124
125
    m_def = Category(
        a_legacy=LegacyDefinition(name='scf_info'))
126

127
128

class settings_numerical_parameter(MCategory):
129
    '''
130
131
    A parameter that can influence the convergence, but not the physics (unlike
    settings_physical_parameter)
132
133
    '''

134
135
    m_def = Category(
        a_legacy=LegacyDefinition(name='settings_numerical_parameter'))
136

137
138

class settings_physical_parameter(MCategory):
139
    '''
140
141
    A parameter that defines the physical model used. Use settings_numerical_parameter for
    parameters that that influence only the convergence/accuracy.
142
143
    '''

144
145
    m_def = Category(
        a_legacy=LegacyDefinition(name='settings_physical_parameter'))
146

147
148

class settings_potential_energy_surface(MCategory):
149
    '''
150
    Contains parameters that control the potential energy surface.
151
152
    '''

153
154
    m_def = Category(
        a_legacy=LegacyDefinition(name='settings_potential_energy_surface'))
155

156
157

class settings_run(MCategory):
158
    '''
159
160
    Contains parameters that control the whole run (but not the *single configuration
    calculation*, see section_single_configuration_calculation).
161
162
    '''

163
164
    m_def = Category(
        a_legacy=LegacyDefinition(name='settings_run'))
165

166
167

class settings_sampling(MCategory):
168
    '''
169
    Contains parameters controlling the sampling.
170
171
    '''

172
173
    m_def = Category(
        a_legacy=LegacyDefinition(name='settings_sampling'))
174

175
176

class settings_scf(MCategory):
177
    '''
178
179
    Contains parameters connected with the convergence of the self-consistent field (SCF)
    iterations.
180
181
    '''

182
183
    m_def = Category(
        a_legacy=LegacyDefinition(name='settings_scf'))
184

185
186

class settings_smearing(MCategory):
187
    '''
188
189
    Contain parameters that control the smearing of the orbital occupation at finite
    electronic temperatures.
190
191
    '''

192
193
    m_def = Category(
        a_legacy=LegacyDefinition(name='settings_smearing'))
194

195
196

class settings_stress_tensor(MCategory):
197
    '''
198
199
    Settings to calculate the stress tensor (stress_tensor) consistent with the total
    energy of the system given in energy_total.
200
201
    '''

202
203
    m_def = Category(
        a_legacy=LegacyDefinition(name='settings_stress_tensor'))
204

205
206

class stress_tensor_type(MCategory):
207
    '''
208
209
    Contains the final value of the default stress tensor (stress_tensor) and/or the value
    of the stress tensor (stress_tensor_value) of the kind defined in stress_tensor_kind.
210
211
    '''

212
213
    m_def = Category(
        a_legacy=LegacyDefinition(name='stress_tensor_type'))
214

215
216

class energy_component_per_atom(MCategory):
217
    '''
218
219
    A value of an energy component per atom, concurring in defining the total energy per
    atom.
220
221
    '''

222
223
224
    m_def = Category(
        categories=[energy_value],
        a_legacy=LegacyDefinition(name='energy_component_per_atom'))
225

226
227

class energy_component(MCategory):
228
    '''
229
    A value of an energy component, expected to be an extensive property.
230
231
    '''

232
233
234
    m_def = Category(
        categories=[energy_value],
        a_legacy=LegacyDefinition(name='energy_component'))
235

236
237

class energy_type_reference(MCategory):
238
    '''
239
    This metadata stores an energy used as reference point.
240
241
    '''

242
243
244
    m_def = Category(
        categories=[energy_value],
        a_legacy=LegacyDefinition(name='energy_type_reference'))
245

246
247

class error_estimate(MCategory):
248
    '''
249
    An estimate of the error on the converged (final) value.
250
251
    '''

252
253
254
    m_def = Category(
        categories=[error_estimate_contribution],
        a_legacy=LegacyDefinition(name='error_estimate'))
255

256
257

class message_info(MCategory):
258
    '''
259
    An information message of the computational program.
260
261
    '''

262
263
264
    m_def = Category(
        categories=[message_debug],
        a_legacy=LegacyDefinition(name='message_info'))
265

266
267

class parallelization_info(MCategory):
268
    '''
269
270
271
272
    Contains information on the parallelization of the program, i.e. which parallel
    programming language was used and its version, how many cores had been working on the
    calculation and the flags and parameters needed to run the parallelization of the
    code.
273
274
    '''

275
276
277
    m_def = Category(
        categories=[accessory_info],
        a_legacy=LegacyDefinition(name='parallelization_info'))
278

279
280

class parsing_message_info(MCategory):
281
    '''
282
    This field is used for info messages of the parsing program.
283
284
    '''

285
286
287
288
    m_def = Category(
        categories=[parsing_message_debug],
        a_legacy=LegacyDefinition(name='parsing_message_info'))

289
290
291
292
293
294
295
296

class program_info(MCategory):
    '''
    Contains information on the program that generated the data, i.e. the program_name,
    program_version, program_compilation_host and program_compilation_datetime as direct
    children of this field.
    '''

297
298
299
    m_def = Category(
        categories=[accessory_info],
        a_legacy=LegacyDefinition(name='program_info'))
300
301


302
class settings_geometry_optimization(MCategory):
303
    '''
304
    Contains parameters controlling the geometry optimization.
305
306
    '''

307
308
309
    m_def = Category(
        categories=[settings_sampling],
        a_legacy=LegacyDefinition(name='settings_geometry_optimization'))
310
311


312
class settings_k_points(MCategory):
313
    '''
314
    Contains parameters that control the $k$-point mesh.
315
316
    '''

317
318
319
    m_def = Category(
        categories=[settings_potential_energy_surface],
        a_legacy=LegacyDefinition(name='settings_k_points'))
320

321
322

class settings_metadynamics(MCategory):
323
    '''
324
    Contains parameters that control the metadynamics sampling.
325
326
    '''

327
328
329
    m_def = Category(
        categories=[settings_sampling],
        a_legacy=LegacyDefinition(name='settings_metadynamics'))
330

331
332

class settings_molecular_dynamics(MCategory):
333
    '''
334
    Contains parameters that control the molecular dynamics sampling.
335
336
    '''

337
338
339
    m_def = Category(
        categories=[settings_sampling],
        a_legacy=LegacyDefinition(name='settings_molecular_dynamics'))
340

341
342

class settings_Monte_Carlo(MCategory):
343
    '''
344
    Contains parameters that control the Monte-Carlo sampling.
345
346
    '''

347
348
349
    m_def = Category(
        categories=[settings_sampling],
        a_legacy=LegacyDefinition(name='settings_Monte_Carlo'))
350

351
352

class settings_XC(MCategory):
353
    '''
354
355
356
    Contains parameters connected with the definition of the exchange-correlation (XC)
    *method*. Here, the term *method* is a more general concept than just *functionals*
    and include, e.g., post Hartree-Fock methods, too.
357
358
    '''

359
360
361
    m_def = Category(
        categories=[settings_potential_energy_surface],
        a_legacy=LegacyDefinition(name='settings_XC'))
362

363
364

class time_info(MCategory):
365
    '''
366
367
    Stores information on the date and timings of the calculation. They are useful for,
    e.g., debugging or visualization purposes.
368
369
    '''

370
371
372
    m_def = Category(
        categories=[accessory_info],
        a_legacy=LegacyDefinition(name='time_info'))
373

374
375

class energy_total_potential_per_atom(MCategory):
376
    '''
377
378
379
380
    A value of the total potential energy per atom. Note that a direct comparison may not
    be possible because of a difference in the methods for computing total energies and
    numerical implementations of various codes might leads to different energy zeros (see
    section_energy_code_independent for a code-independent definition of the energy).
381
382
    '''

383
384
385
    m_def = Category(
        categories=[energy_component, energy_value],
        a_legacy=LegacyDefinition(name='energy_total_potential_per_atom'))
386

387
388

class energy_total_potential(MCategory):
389
    '''
390
391
392
393
    A value of the total potential energy. Note that a direct comparison may not be
    possible because of a difference in the methods for computing total energies and
    numerical implementations of various codes might leads to different energy zeros (see
    section_energy_code_independent for a code-independent definition of the energy).
394
395
    '''

396
397
398
    m_def = Category(
        categories=[energy_component, energy_value],
        a_legacy=LegacyDefinition(name='energy_total_potential'))
399

400
401

class energy_type_C(MCategory):
402
    '''
403
    This metadata stores the correlation (C) energy.
404
405
    '''

406
407
408
    m_def = Category(
        categories=[energy_component, energy_value],
        a_legacy=LegacyDefinition(name='energy_type_C'))
409

410
411

class energy_type_van_der_Waals(MCategory):
412
    '''
413
    This metadata stores the converged van der Waals energy.
414
415
    '''

416
417
418
    m_def = Category(
        categories=[energy_component, energy_value],
        a_legacy=LegacyDefinition(name='energy_type_van_der_Waals'))
419

420
421

class energy_type_XC(MCategory):
422
    '''
423
    This metadata stores the exchange-correlation (XC) energy.
424
425
    '''

426
427
428
    m_def = Category(
        categories=[energy_component, energy_value],
        a_legacy=LegacyDefinition(name='energy_type_XC'))
429

430
431

class energy_type_X(MCategory):
432
    '''
433
    This metadata stores the exchange (X) energy.
434
435
    '''

436
437
438
    m_def = Category(
        categories=[energy_component, energy_value],
        a_legacy=LegacyDefinition(name='energy_type_X'))
439

440
441

class message_warning(MCategory):
442
    '''
443
    A warning message of the computational program.
444
445
    '''

446
447
448
    m_def = Category(
        categories=[message_info, message_debug],
        a_legacy=LegacyDefinition(name='message_warning'))
449

450
451

class parsing_message_warning(MCategory):
452
    '''
453
    This field is used for warning messages of the parsing program.
454
455
    '''

456
457
458
    m_def = Category(
        categories=[parsing_message_info, parsing_message_debug],
        a_legacy=LegacyDefinition(name='parsing_message_warning'))
459

460
461

class settings_barostat(MCategory):
462
    '''
463
    Contains parameters controlling the barostat in a molecular dynamics calculation.
464
465
    '''

466
467
468
    m_def = Category(
        categories=[settings_sampling, settings_molecular_dynamics],
        a_legacy=LegacyDefinition(name='settings_barostat'))
469

470
471

class settings_integrator(MCategory):
472
    '''
473
    Contains parameters that control the molecular dynamics (MD) integrator.
474
475
    '''

476
477
478
    m_def = Category(
        categories=[settings_sampling, settings_molecular_dynamics],
        a_legacy=LegacyDefinition(name='settings_integrator'))
479

480
481

class settings_post_hartree_fock(MCategory):
482
    '''
483
    Contains parameters for the post Hartree-Fock method.
484
485
    '''

486
487
488
    m_def = Category(
        categories=[settings_XC, settings_potential_energy_surface],
        a_legacy=LegacyDefinition(name='settings_post_hartree_fock'))
489

490
491

class settings_relativity(MCategory):
492
    '''
493
494
    Contains parameters and information connected with the relativistic treatment used in
    the calculation.
495
496
    '''

497
498
499
500
    m_def = Category(
        categories=[settings_XC, settings_potential_energy_surface],
        a_legacy=LegacyDefinition(name='settings_relativity'))

501
502
503
504
505
506
507

class settings_self_interaction_correction(MCategory):
    '''
    Contains parameters and information connected with the self-interaction correction
    (SIC) method being used in self_interaction_correction_method.
    '''

508
509
510
    m_def = Category(
        categories=[settings_XC, settings_potential_energy_surface],
        a_legacy=LegacyDefinition(name='settings_self_interaction_correction'))
511
512
513
514
515
516
517
518


class settings_thermostat(MCategory):
    '''
    Contains parameters that control the thermostat in the molecular dynamics (MD)
    calculations.
    '''

519
520
521
522
    m_def = Category(
        categories=[settings_sampling, settings_molecular_dynamics],
        a_legacy=LegacyDefinition(name='settings_thermostat'))

523
524
525
526
527
528
529

class settings_van_der_Waals(MCategory):
    '''
    Contain parameters and information connected with the Van der Waals treatment used in
    the calculation to compute the Van der Waals energy (energy_van_der_Waals).
    '''

530
531
532
533
    m_def = Category(
        categories=[settings_XC, settings_potential_energy_surface],
        a_legacy=LegacyDefinition(name='settings_van_der_Waals'))

534
535
536
537
538
539
540

class settings_XC_functional(MCategory):
    '''
    Contain parameters connected with the definition of the exchange-correlation (XC)
    functional (see section_XC_functionals and XC_functional).
    '''

541
542
543
    m_def = Category(
        categories=[settings_XC, settings_potential_energy_surface],
        a_legacy=LegacyDefinition(name='settings_XC_functional'))
544

545
546

class message_error(MCategory):
547
    '''
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
    An error message of the computational program.
    '''

    m_def = Category(
        categories=[message_info, message_debug, message_warning],
        a_legacy=LegacyDefinition(name='message_error'))


class parsing_message_error(MCategory):
    '''
    This field is used for error messages of the parsing program.
    '''

    m_def = Category(
        categories=[parsing_message_info, parsing_message_warning, parsing_message_debug],
        a_legacy=LegacyDefinition(name='parsing_message_error'))


class settings_coupled_cluster(MCategory):
    '''
    Contains parameters for the coupled-cluster method (CC) in the post Hartree-Fock step.
    '''

    m_def = Category(
        categories=[settings_post_hartree_fock, settings_XC, settings_potential_energy_surface],
        a_legacy=LegacyDefinition(name='settings_coupled_cluster'))


class settings_GW(MCategory):
    '''
    Contains parameters for the GW-method in the post Hartree-Fock step, that expands the
    self-energy in terms of the single particle Green's function $G$ and the screened
    Coulomb interaction $W$.
    '''

    m_def = Category(
        categories=[settings_post_hartree_fock, settings_XC, settings_potential_energy_surface],
        a_legacy=LegacyDefinition(name='settings_GW'))


class settings_MCSCF(MCategory):
    '''
    Contains parameters for the multi-configurational self-consistent-field (MCSCF)
    method.
592
593
    '''

594
595
596
    m_def = Category(
        categories=[settings_post_hartree_fock, settings_XC, settings_potential_energy_surface],
        a_legacy=LegacyDefinition(name='settings_MCSCF'))
597

598
599

class settings_moller_plesset_perturbation_theory(MCategory):
600
    '''
601
    Contains parameters for Møller–Plesset perturbation theory.
602
603
    '''

604
605
606
    m_def = Category(
        categories=[settings_post_hartree_fock, settings_XC, settings_potential_energy_surface],
        a_legacy=LegacyDefinition(name='settings_moller_plesset_perturbation_theory'))
607

608
609

class settings_multi_reference(MCategory):
610
    '''
611
612
    Contains parameters for the multi-reference single and double configuration
    interaction method.
613
614
    '''

615
616
617
618
    m_def = Category(
        categories=[settings_post_hartree_fock, settings_XC, settings_potential_energy_surface],
        a_legacy=LegacyDefinition(name='settings_multi_reference'))

619
620
621
622
623
624

class archive_context(MSection):
    '''
    Contains information relating to an archive.
    '''

625
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='archive_context'))
626
627
628
629
630
631

    archive_gid = Quantity(
        type=str,
        shape=[],
        description='''
        unique identifier of an archive.
632
633
        ''',
        a_legacy=LegacyDefinition(name='archive_gid'))
634
635
636
637
638
639
640


class calculation_context(MSection):
    '''
    Contains information relating to a calculation.
    '''

641
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='calculation_context'))
642
643
644
645
646
647

    calculation_gid = Quantity(
        type=str,
        shape=[],
        description='''
        unique identifier of a calculation.
648
649
        ''',
        a_legacy=LegacyDefinition(name='calculation_gid'))
650
651
652
653
654
655
656
657


class section_atom_projected_dos(MSection):
    '''
    Section collecting the information on an atom projected density of states (DOS)
    evaluation.
    '''

658
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_atom_projected_dos'))
659
660
661
662
663
664
665
666

    atom_projected_dos_energies = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_atom_projected_dos_values'],
        unit='joule',
        description='''
        Array containing the set of discrete energy values for the atom-projected density
        (electronic-energy) of states (DOS).
667
668
        ''',
        a_legacy=LegacyDefinition(name='atom_projected_dos_energies'))
669
670
671
672
673
674
675
676
677
678
679
680

    atom_projected_dos_lm = Quantity(
        type=np.dtype(np.int32),
        shape=['number_of_lm_atom_projected_dos', 2],
        description='''
        Tuples of $l$ and $m$ values for which atom_projected_dos_values_lm are given. For
        the quantum number $l$ the conventional meaning of azimuthal quantum number is
        always adopted. For the integer number $m$, besides the conventional use as
        magnetic quantum number ($l+1$ integer values from $-l$ to $l$), a set of
        different conventions is accepted (see the [m_kind wiki
        page](https://gitlab.rzg.mpg.de/nomad-lab/nomad-meta-info/wikis/metainfo/m-kind).
        The adopted convention is specified by atom_projected_dos_m_kind.
681
682
        ''',
        a_legacy=LegacyDefinition(name='atom_projected_dos_lm'))
683
684
685
686
687
688
689
690

    atom_projected_dos_m_kind = Quantity(
        type=str,
        shape=[],
        description='''
        String describing what the integer numbers of $m$ in atom_projected_dos_lm mean.
        The allowed values are listed in the [m_kind wiki
        page](https://gitlab.rzg.mpg.de/nomad-lab/nomad-meta-info/wikis/metainfo/m-kind).
691
692
        ''',
        a_legacy=LegacyDefinition(name='atom_projected_dos_m_kind'))
693
694
695
696
697
698
699
700
701
702

    atom_projected_dos_values_lm = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_lm_atom_projected_dos', 'number_of_spin_channels', 'number_of_atoms', 'number_of_atom_projected_dos_values'],
        description='''
        Values correspond to the number of states for a given energy (the set of discrete
        energy values is given in atom_projected_dos_energies) divided into contributions
        from each $l,m$ channel for the atom-projected density (electronic-energy) of
        states. Here, there are as many atom-projected DOS as the number_of_atoms, the
        list of labels of the atoms and their meanings are in atom_labels.
703
704
        ''',
        a_legacy=LegacyDefinition(name='atom_projected_dos_values_lm'))
705
706
707
708
709
710
711
712
713
714
715

    atom_projected_dos_values_total = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_spin_channels', 'number_of_atoms', 'number_of_atom_projected_dos_values'],
        description='''
        Values correspond to the number of states for a given energy (the set of discrete
        energy values is given in atom_projected_dos_energies) divided into contributions
        summed up over all $l$ channels for the atom-projected density (electronic-energy)
        of states (DOS). Here, there are as many atom-projected DOS as the
        number_of_atoms, the list of labels of the atoms and their meanings are in
        atom_labels.
716
717
        ''',
        a_legacy=LegacyDefinition(name='atom_projected_dos_values_total'))
718
719
720
721
722
723
724

    number_of_atom_projected_dos_values = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of energy values for the atom-projected density of states (DOS)
        based on atom_projected_dos_values_lm and atom_projected_dos_values_total.
725
726
        ''',
        a_legacy=LegacyDefinition(name='number_of_atom_projected_dos_values'))
727
728
729
730
731
732
733

    number_of_lm_atom_projected_dos = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of $l$, $m$ combinations for the atom projected density of states
        (DOS) defined in section_atom_projected_dos.
734
735
        ''',
        a_legacy=LegacyDefinition(name='number_of_lm_atom_projected_dos'))
736
737
738
739
740
741
742
743


class section_atomic_multipoles(MSection):
    '''
    Section describing multipoles (charges/monopoles, dipoles, quadrupoles, ...) for each
    atom.
    '''

744
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_atomic_multipoles'))
745
746
747
748
749
750
751
752
753
754
755

    atomic_multipole_kind = Quantity(
        type=str,
        shape=[],
        description='''
        String describing the method used to obtain the electrostatic multipoles
        (including the electric charge, dipole, etc.) for each atom. Such multipoles
        require a charge-density partitioning scheme, specified by the value of this
        metadata. Allowed values are listed in the [atomic_multipole_kind wiki
        page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-info/wikis/metainfo/atomic-
        multipole-kind).
756
757
        ''',
        a_legacy=LegacyDefinition(name='atomic_multipole_kind'))
758
759
760
761
762
763
764
765
766
767

    atomic_multipole_lm = Quantity(
        type=np.dtype(np.int32),
        shape=['number_of_lm_atomic_multipoles', 2],
        description='''
        Tuples of $l$ and $m$ values for which the atomic multipoles (including the
        electric charge, dipole, etc.) are given. The method used to obtain the multipoles
        is specified by atomic_multipole_kind. The meaning of the integer number $l$ is
        monopole/charge for $l=0$, dipole for $l=1$, quadrupole for $l=2$, etc. The
        meaning of the integer numbers $m$ is specified by atomic_multipole_m_kind.
768
769
        ''',
        a_legacy=LegacyDefinition(name='atomic_multipole_lm'))
770
771
772
773
774
775
776
777

    atomic_multipole_m_kind = Quantity(
        type=str,
        shape=[],
        description='''
        String describing the definition for each integer number $m$ in
        atomic_multipole_lm. Allowed values are listed in the [m_kind wiki
        page](https://gitlab.rzg.mpg.de/nomad-lab/nomad-meta-info/wikis/metainfo/m-kind).
778
779
        ''',
        a_legacy=LegacyDefinition(name='atomic_multipole_m_kind'))
780
781
782
783
784
785
786

    atomic_multipole_values = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_lm_atomic_multipoles', 'number_of_atoms'],
        description='''
        Value of the multipoles (including the monopole/charge for $l$ = 0, the dipole for
        $l$ = 1, etc.) for each atom, calculated as described in atomic_multipole_kind.
787
788
        ''',
        a_legacy=LegacyDefinition(name='atomic_multipole_values'))
789
790
791
792
793
794
795

    number_of_lm_atomic_multipoles = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of $l$, $m$ combinations for atomic multipoles
        atomic_multipole_lm.
796
797
        ''',
        a_legacy=LegacyDefinition(name='number_of_lm_atomic_multipoles'))
798
799
800
801
802
803
804
805


class section_basis_functions_atom_centered(MSection):
    '''
    This section contains the description of the basis functions (at least one function)
    of the (atom-centered) basis set defined in section_basis_set_atom_centered.
    '''

806
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_basis_functions_atom_centered'))
807
808
809
810
811
812
813
814
815
816
817
818


class section_basis_set_atom_centered(MSection):
    '''
    This section describes the atom-centered basis set. The main contained information is
    a short, non unique but human-interpretable, name for identifying the basis set
    (basis_set_atom_centered_short_name), a longer, unique name
    (basis_set_atom_centered_unique_name), the atomic number of the atomic species the
    basis set is meant for (basis_set_atom_number), and a list of actual basis functions
    in the section_basis_functions_atom_centered section.
    '''

819
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_basis_set_atom_centered'))
820
821
822
823
824
825
826
827

    basis_set_atom_centered_ls = Quantity(
        type=np.dtype(np.int32),
        shape=['number_of_kinds_in_basis_set_atom_centered'],
        description='''
        Azimuthal quantum number ($l$) values (of the angular part given by the spherical
        harmonic $Y_{lm}$) of the atom-centered basis function defined in the current
        section_basis_set_atom_centered.
828
829
        ''',
        a_legacy=LegacyDefinition(name='basis_set_atom_centered_ls'))
830
831
832
833
834
835
836
837
838

    basis_set_atom_centered_radial_functions = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_kinds_in_basis_set_atom_centered', 401, 5],
        description='''
        Values of the radial function of the different basis function kinds. The values
        are numerically tabulated on a default 0.01-nm equally spaced grid from 0 to 4 nm.
        The 5 tabulated values are $r$, $f(r)$, $f'(r)$, $f(r) \\cdot r$,
        $\\frac{d}{dr}(f(r) \\cdot r)$.
839
840
        ''',
        a_legacy=LegacyDefinition(name='basis_set_atom_centered_radial_functions'))
841
842
843
844
845
846
847
848
849
850

    basis_set_atom_centered_short_name = Quantity(
        type=str,
        shape=[],
        description='''
        Code-specific, but explicative, base name for the basis set (not unique). Details
        are explained in the [basis_set_atom_centered_short_name wiki
        page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-info/wikis/metainfo/basis-
        set-atom-centered-short-name), this name should not contain the *atom kind* (to
        simplify the use of a single name for multiple elements).
851
852
        ''',
        a_legacy=LegacyDefinition(name='basis_set_atom_centered_short_name'))
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872

    basis_set_atom_centered_unique_name = Quantity(
        type=str,
        shape=[],
        description='''
        Code-specific, but explicative, base name for the basis set (not unique). This
        string starts with basis_set_atom_centered_short_name. If the basis set defined in
        this section_basis_set_atom_centered is not identical to the default definition
        (stored in a database) of the basis set with the same name stored in a database,
        then the string is extended by 10 identifiable characters as explained in the
        [basis_set_atom_centered_name wiki page](https://gitlab.mpcdf.mpg.de/nomad-
        lab/nomad-meta-info/wikis/metainfo/basis-set-atom-centered-unique-name). The
        reason for this procedure is that often atom-centered basis sets are obtained by
        fine tuning basis sets provided by the code developers or other sources. Each
        basis sets, which has normally a standard name, often reported in publications,
        has also several parameters that can be tuned. This metadata tries to keep track
        of the original basis set and its modifications. This string here defined should
        not contain the *atom kind* for which this basis set is intended for, in order to
        simplify the use of a single name for multiple *atom kinds* (see atom_labels for
        the actual meaning of *atom kind*).
873
874
        ''',
        a_legacy=LegacyDefinition(name='basis_set_atom_centered_unique_name'))
875
876
877
878
879
880
881

    basis_set_atom_number = Quantity(
        type=np.dtype(np.int32),
        shape=[],
        description='''
        Atomic number (i.e., number of protons) of the atom for which this basis set is
        constructed (0 means unspecified or a pseudo atom).
882
883
        ''',
        a_legacy=LegacyDefinition(name='basis_set_atom_number'))
884
885
886
887
888
889
890
891

    number_of_basis_functions_in_basis_set_atom_centered = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of different basis functions in a section_basis_set_atom_centered
        section. This equals the number of actual coefficients that are specified when
        using this basis set.
892
893
        ''',
        a_legacy=LegacyDefinition(name='number_of_basis_functions_in_basis_set_atom_centered'))
894
895
896
897
898
899
900
901
902

    number_of_kinds_in_basis_set_atom_centered = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of different *kinds* of radial basis functions in the
        section_basis_set_atom_centered section. Specifically, basis functions with the
        same $n$ and $l$ quantum numbers are grouped in sets. Each set counts as one
        *kind*.
903
904
        ''',
        a_legacy=LegacyDefinition(name='number_of_kinds_in_basis_set_atom_centered'))
905
906
907

    section_basis_functions_atom_centered = SubSection(
        sub_section=SectionProxy('section_basis_functions_atom_centered'),
908
909
        repeats=True,
        a_legacy=LegacyDefinition(name='section_basis_functions_atom_centered'))
910
911
912

    section_gaussian_basis_group = SubSection(
        sub_section=SectionProxy('section_gaussian_basis_group'),
913
914
        repeats=True,
        a_legacy=LegacyDefinition(name='section_gaussian_basis_group'))
915
916
917
918
919
920
921
922
923
924
925


class section_basis_set_cell_dependent(MSection):
    '''
    Section describing a cell-dependent (atom-independent) basis set, e.g. plane waves.
    The contained information is the type of basis set (in basis_set_cell_dependent_kind),
    its parameters (e.g., for plane waves in basis_set_planewave_cutoff), and a name that
    identifies the actually used basis set (a string combining the type and the
    parameter(s), stored in basis_set_cell_dependent_name).
    '''

926
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_basis_set_cell_dependent'))
927
928
929
930
931
932
933
934
935

    basis_set_cell_dependent_kind = Quantity(
        type=str,
        shape=[],
        description='''
        A string defining the type of the cell-dependent basis set (i.e., non atom
        centered such as plane-waves). Allowed values are listed in the
        [basis_set_cell_dependent_kind wiki page](https://gitlab.mpcdf.mpg.de/nomad-
        lab/nomad-meta-info/wikis/metainfo/basis-set-cell-dependent-kind).
936
937
        ''',
        a_legacy=LegacyDefinition(name='basis_set_cell_dependent_kind'))
938
939
940
941
942
943
944
945
946

    basis_set_cell_dependent_name = Quantity(
        type=str,
        shape=[],
        description='''
        A label identifying the cell-dependent basis set (i.e., non atom centered such as
        plane-waves). Allowed values are listed in the [basis_set_cell_dependent_name wiki
        page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-info/wikis/metainfo/basis-
        set-cell-dependent-name).
947
948
        ''',
        a_legacy=LegacyDefinition(name='basis_set_cell_dependent_name'))
949
950
951
952
953
954
955
956
957
958
959

    basis_set_planewave_cutoff = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        unit='joule',
        description='''
        Spherical cutoff  in reciprocal space for a plane-wave basis set. It is the energy
        of the highest plan-ewave ($\\frac{\\hbar^2|k+G|^2}{2m_e}$) included in the basis
        set. Note that normally this basis set is used for the wavefunctions, and the
        density would have 4 times the cutoff, but this actually depends on the use of the
        basis set by the method.
960
961
        ''',
        a_legacy=LegacyDefinition(name='basis_set_planewave_cutoff'))
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989


class section_basis_set(MSection):
    '''
    This section contains references to *all* basis sets used in this
    section_single_configuration_calculation. More than one basis set instance per *single
    configuration calculation* (see section_single_configuration_calculation) may be
    needed. This is true for example, for codes that implement adaptive basis sets along
    the self-consistent field (SCF) convergence (e.g., exciting). In such cases, there is
    a section_basis_set instance per SCF iteration, if necessary. Another example is
    having a basis set for wavefunctions, a different one for the density, an auxiliary
    basis set for resolution of identity (RI), etc.

    Supported are the two broad classes of basis sets: *atom-centered* (e.g., Gaussian-
    type, numerical atomic orbitals) and *cell-dependent* (like plane waves or real-space
    grids, so named because they are typically used for periodic-system calculations and
    dependent to the simulated cell as a whole).

    Basis sets used in this section_single_configuration_calculation, belonging to either
    class, are defined in the dedicated section: [section_basis_set_cell_dependent
    ](section_basis_set_cell_dependent) or section_basis_set_atom_centered. The
    correspondence between the basis sets listed in this section and the definition given
    in the dedicated sessions is given by the two concrete metadata:
    mapping_section_basis_set_cell_dependent and mapping_section_basis_set_atom_centered.
    The latter metadata is a list that connects each atom in the system with its basis
    set, where the same basis set can be assigned to more than one atom.
    '''

990
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_basis_set'))
991
992
993
994
995
996
997
998
999

    basis_set_kind = Quantity(
        type=str,
        shape=[],
        description='''
        String describing the use of the basis set, i.e, if it used for expanding a wave-
        function or an electron density. Allowed values are listed in the [basis_set_kind
        wiki page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-
        info/wikis/metainfo/basis-set-kind).
1000
1001
        ''',
        a_legacy=LegacyDefinition(name='basis_set_kind'))
1002
1003
1004
1005
1006
1007
1008
1009
1010

    basis_set_name = Quantity(
        type=str,
        shape=[],
        description='''
        String identifying the basis set in an unique way. The rules for building this
        string are specified in the [basis_set_name wiki
        page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-info/wikis/metainfo/basis-
        set-name).
1011
1012
        ''',
        a_legacy=LegacyDefinition(name='basis_set_name'))
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022

    mapping_section_basis_set_atom_centered = Quantity(
        type=Reference(SectionProxy('section_basis_set_atom_centered')),
        shape=['number_of_atoms'],
        description='''
        An array of the dimension of number_of_atoms where each atom (identified by the
        index in the array) is assigned to an atom-centered basis set, for this
        section_single_configuration_calculation. The actual definition of the atom-
        centered basis set is in the section_basis_set_atom_centered that is referred to
        by this metadata.
1023
1024
        ''',
        a_legacy=LegacyDefinition(name='mapping_section_basis_set_atom_centered'))
1025
1026
1027
1028
1029
1030
1031
1032

    mapping_section_basis_set_cell_dependent = Quantity(
        type=Reference(SectionProxy('section_basis_set_cell_dependent')),
        shape=[],
        description='''
        Assignment of the cell-dependent (i.e., non atom centered, e.g., plane-waves)
        parts of the basis set, which is defined (type, parameters) in
        section_basis_set_cell_dependent that is referred to by this metadata.
1033
1034
        ''',
        a_legacy=LegacyDefinition(name='mapping_section_basis_set_cell_dependent'))
1035
1036
1037
1038
1039
1040

    number_of_basis_functions = Quantity(
        type=int,
        shape=[],
        description='''
        Stores the total number of basis functions in a section_basis_set section.
1041
1042
        ''',
        a_legacy=LegacyDefinition(name='number_of_basis_functions'))
1043
1044
1045
1046
1047
1048
1049
1050


class section_restricted_uri(MSection):
    '''
    Restricted URIs on this calculation (Coverage: any info or files that are related with
    this calculation can be subject to restriction)
    '''

1051
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_restricted_uri'))
1052
1053
1054
1055
1056
1057

    number_of_restricted_uri = Quantity(
        type=np.dtype(np.int32),
        shape=[],
        description='''
        The number of restricted uris in restricted_uri list.
1058
1059
        ''',
        a_legacy=LegacyDefinition(name='number_of_restricted_uri'))
1060
1061
1062
1063
1064
1065
1066

    restricted_uri = Quantity(
        type=str,
        shape=['number_of_restricted_uri'],
        description='''
        The list of nomad uri(s) identifying the restricted info/file corresponding to
        this calculation
1067
1068
        ''',
        a_legacy=LegacyDefinition(name='restricted_uri'))
1069
1070
1071
1072
1073
1074
1075
1076

    restricted_uri_reason = Quantity(
        type=str,
        shape=[],
        description='''
        The reason of restriction for the uri or file. The reason can be 'propriety
        license', 'open-source redistribution restricted license', 'other license', or
        'author restricted'.
1077
1078
        ''',
        a_legacy=LegacyDefinition(name='restricted_uri_reason'))
1079
1080
1081
1082
1083
1084
1085
1086

    restricted_uri_issue_authority = Quantity(
        type=str,
        shape=[],
        description='''
        The issue authority is the restriction owner for the uri or file. This can be
        license owner such as 'VASP' or 'AMBER', 'NOMAD', or the author of the uri. For
        example the repository user name of the author.
1087
1088
        ''',
        a_legacy=LegacyDefinition(name='restricted_uri_issue_authority'))
1089
1090
1091
1092
1093
1094
1095
1096

    restricted_uri_end_date = Quantity(
        type=str,
        shape=[],
        description='''
        The deadline date of the restriction for the uri or file. The end date can be in
        date format string for those restrictions set by authors or NOMAD otherwise it is
        set to 'unlimited' for the restriction related to license.
1097
1098
        ''',
        a_legacy=LegacyDefinition(name='restricted_uri_end_date'))
1099
1100
1101
1102
1103
1104
1105

    restricted_uri_restriction = Quantity(
        type=str,
        shape=[],
        description='''
        The type of restriction for the uri or file. The type can be 'any access' or
        'license permitted'.
1106
1107
        ''',
        a_legacy=LegacyDefinition(name='restricted_uri_restriction'))
1108
1109
1110
1111
1112
1113

    restricted_uri_license = Quantity(
        type=str,
        shape=[],
        description='''
        The info of the license that is the reason of restriction.
1114
1115
        ''',
        a_legacy=LegacyDefinition(name='restricted_uri_license'))
1116
1117
1118
1119
1120
1121

    number_of_restricted_uri_files = Quantity(
        type=np.dtype(np.int32),
        shape=[],
        description='''
        The number of restricted files in restricted_uri_files list.
1122
1123
        ''',
        a_legacy=LegacyDefinition(name='number_of_restricted_uri_files'))
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143


class section_calculation_to_calculation_refs(MSection):
    '''
    Section that describes the relationship between different
    section_single_configuration_calculation sections.

    For instance, one calculation is a perturbation performed using a self-consistent
    field (SCF) calculation as starting point, or a simulated system is partitioned in
    regions with different but connected Hamiltonians (e.g., QM/MM, or a region treated
    via Kohn-Sham DFT embedded into a region treated via orbital-free DFT).

    The kind of relationship between the calculation defined in this section and the
    referenced one is described by calculation_to_calculation_kind. The referenced
    section_single_configuration_calculation is identified via
    calculation_to_calculation_ref (typically used for a
    section_single_configuration_calculation in the same section_run) or
    calculation_to_calculation_external_url.
    '''

1144
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_calculation_to_calculation_refs'))
1145
1146
1147
1148
1149
1150
1151
1152

    calculation_to_calculation_external_url = Quantity(
        type=str,
        shape=[],
        description='''
        URL used to reference an externally stored calculation. The kind of relationship
        between the present and the referenced section_single_configuration_calculation is
        specified by calculation_to_calculation_kind.
1153
1154
        ''',
        a_legacy=LegacyDefinition(name='calculation_to_calculation_external_url'))
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172

    calculation_to_calculation_kind = Quantity(
        type=str,
        shape=[],
        description='''
        String defining the relationship between the referenced
        section_single_configuration_calculation and the present
        section_single_configuration_calculation. Valid values are described in the
        [calculation_to_calculation_kind wiki page](https://gitlab.mpcdf.mpg.de/nomad-
        lab/nomad-meta-info/wikis/metainfo/calculation-to-calculation-kind). Often
        calculations are connected, for instance, one calculation is a perturbation
        performed using a self-consistent field (SCF) calculation as starting point, or a
        simulated system is partitioned in regions with different but connected
        Hamiltonians (e.g., QM/MM, or a region treated via Kohn-Sham DFT embedded into a
        region treated via orbital-free DFT). Hence, the need of keeping track of these
        connected calculations. The referenced calculation is identified via
        calculation_to_calculation_ref (typically used for a calculation in the same
        section_run) or calculation_to_calculation_external_url.
1173
1174
        ''',
        a_legacy=LegacyDefinition(name='calculation_to_calculation_kind'))
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185

    calculation_to_calculation_ref = Quantity(
        type=Reference(SectionProxy('section_single_configuration_calculation')),
        shape=[],
        description='''
        Reference to another calculation. If both this and
        calculation_to_calculation_external_url are given, then
        calculation_to_calculation_ref is a local copy of the URL given in
        calculation_to_calculation_external_url. The kind of relationship between the
        present and the referenced section_single_configuration_calculation is specified
        by calculation_to_calculation_kind.
1186
1187
        ''',
        a_legacy=LegacyDefinition(name='calculation_to_calculation_ref'))
1188
1189
1190
1191
1192
1193
1194
1195
1196


class section_calculation_to_folder_refs(MSection):
    '''
    Section that describes the relationship between
    section_single_configuration_calculationa and the folder containing the original
    calulations
    '''

1197
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_calculation_to_folder_refs'))
1198
1199
1200
1201
1202
1203
1204
1205
1206

    calculation_to_folder_external_url = Quantity(
        type=str,
        shape=[],
        description='''
        URL used to reference a folder containing external calculations. The kind of
        relationship between the present and the referenced
        section_single_configuration_calculation is specified by
        calculation_to_folder_kind.
1207
1208
        ''',
        a_legacy=LegacyDefinition(name='calculation_to_folder_external_url'))
1209
1210
1211
1212
1213
1214
1215

    calculation_to_folder_kind = Quantity(
        type=str,
        shape=[],
        description='''
        String defining the relationship between the referenced
        section_single_configuration_calculation and a folder containing calculations.
1216
1217
        ''',
        a_legacy=LegacyDefinition(name='calculation_to_folder_kind'))
1218
1219


1220
1221
1222
class section_dos_fingerprint(MSection):
    '''
    Section for the fingerprint of the electronic density-of-states (DOS).
1223
    DOS fingerprints are a modification of the D-Fingerprints reported in Chem. Mater. 2015, 27, 3, 735–743
1224
1225
1226
    (doi:10.1021/cm503507h). The fingerprint consists of a binary representation of the DOS,
    that is used to evaluate the similarity of materials based on their electronic structure.
    '''
1227

1228
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_dos_fingerprint'))
1229

1230
1231
1232
1233
1234
1235
    bins = Quantity(
        type=str,
        description='''
        Byte representation of the DOS fingerprint.
        ''',
        a_legacy=LegacyDefinition(name='bins'))
1236

1237
    indices = Quantity(
1238
        type=np.dtype(np.int16),
1239
        shape=[2],
1240
1241
1242
1243
        description='''
        Indices used to compare DOS fingerprints of different energy ranges.
        ''',
        a_legacy=LegacyDefinition(name='indices'))
1244

1245
1246
1247
1248
1249
1250
1251
    stepsize = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        description='''
        Stepsize of interpolation in the first step of the generation of DOS fingerprints.
        ''',
        a_legacy=LegacyDefinition(name='stepsize'))
1252

1253
1254
1255
1256
    filling_factor = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        description='''
1257
        Proportion of 1 bins in the DOS fingerprint.
1258
1259
        ''',
        a_legacy=LegacyDefinition(name='filling_factor'))
1260

1261
1262
1263
1264
1265
1266
1267
1268
    grid_id = Quantity(
        type=str,
        description='''
        Identifier of the DOS grid that was used for the creation of the fingerprint.
        Similarity can only be calculated if the same grid was used for both fingerprints.
        ''',
        a_legacy=LegacyDefinition(name='grid_id'))

1269

1270
1271
1272
1273
1274
1275
class section_dos(MSection):
    '''
    Section collecting information of a (electronic-energy or vibrational-energy) density
    of states (DOS) evaluation.
    '''

1276
    m_def = Section(validate=False, a_legacy=LegacyDefinition(name='section_dos'))
1277
1278
1279
1280
1281
1282

    dos_energies_normalized = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_dos_values'],
        unit='joule',
        description='''
1283
1284
1285
        Array containing the set of discrete energy values with respect to the
        highest occupied energy level. This is the total DOS, see
        atom_projected_dos_energies and species_projected_dos_energies for
1286
        partial density of states.
1287
1288