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


m_package = Package(
12
    name='nomad.datamodel.metainfo.public',
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
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
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
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
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
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
    description='None',
    a_legacy=LegacyDefinition(name='public.nomadmetainfo.json'))


class FastAccess(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(
        aliases=['fast_access'],)


class AccessoryInfo(MCategory):
    '''
    Information that *in theory* should not affect the results of the calculations (e.g.,
    timing).
    '''

    m_def = Category(
        aliases=['accessory_info'],
        a_legacy=LegacyDefinition(name='accessory_info'))


class AtomForcesType(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).
    '''

    m_def = Category(
        aliases=['atom_forces_type'],
        a_legacy=LegacyDefinition(name='atom_forces_type'))


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

    m_def = Category(
        aliases=['basis_set_description'],
        a_legacy=LegacyDefinition(name='basis_set_description'))


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

    m_def = Category(
        aliases=['configuration_core'],
        a_legacy=LegacyDefinition(name='configuration_core'))


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

    m_def = Category(
        aliases=['conserved_quantity'],
        a_legacy=LegacyDefinition(name='conserved_quantity'))


class EnergyValue(MCategory):
    '''
    This metadata stores an energy value.
    '''

    m_def = Category(
        aliases=['energy_value'],
        a_legacy=LegacyDefinition(name='energy_value'))


class ErrorEstimateContribution(MCategory):
    '''
    An estimate of a partial quantity contributing to the error for a given quantity.
    '''

    m_def = Category(
        aliases=['error_estimate_contribution'],
        a_legacy=LegacyDefinition(name='error_estimate_contribution'))


class MessageDebug(MCategory):
    '''
    A debugging message of the computational program.
    '''

    m_def = Category(
        aliases=['message_debug'],
        a_legacy=LegacyDefinition(name='message_debug'))


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

    m_def = Category(
        aliases=['parsing_message_debug'],
        a_legacy=LegacyDefinition(name='parsing_message_debug'))


class ScfInfo(MCategory):
    '''
    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.
    '''

    m_def = Category(
        aliases=['scf_info'],
        a_legacy=LegacyDefinition(name='scf_info'))


class SettingsNumericalParameter(MCategory):
    '''
    A parameter that can influence the convergence, but not the physics (unlike
    settings_physical_parameter)
    '''

    m_def = Category(
        aliases=['settings_numerical_parameter'],
        a_legacy=LegacyDefinition(name='settings_numerical_parameter'))


class SettingsPhysicalParameter(MCategory):
    '''
    A parameter that defines the physical model used. Use settings_numerical_parameter for
    parameters that that influence only the convergence/accuracy.
    '''

    m_def = Category(
        aliases=['settings_physical_parameter'],
        a_legacy=LegacyDefinition(name='settings_physical_parameter'))


class SettingsPotentialEnergySurface(MCategory):
    '''
    Contains parameters that control the potential energy surface.
    '''

    m_def = Category(
        aliases=['settings_potential_energy_surface'],
        a_legacy=LegacyDefinition(name='settings_potential_energy_surface'))


class SettingsRun(MCategory):
    '''
    Contains parameters that control the whole run (but not the *single configuration
    calculation*, see section_single_configuration_calculation).
    '''

    m_def = Category(
        aliases=['settings_run'],
        a_legacy=LegacyDefinition(name='settings_run'))


class SettingsSampling(MCategory):
    '''
    Contains parameters controlling the sampling.
    '''

    m_def = Category(
        aliases=['settings_sampling'],
        a_legacy=LegacyDefinition(name='settings_sampling'))


class SettingsScf(MCategory):
    '''
    Contains parameters connected with the convergence of the self-consistent field (SCF)
    iterations.
    '''

    m_def = Category(
        aliases=['settings_scf'],
        a_legacy=LegacyDefinition(name='settings_scf'))


class SettingsSmearing(MCategory):
    '''
    Contain parameters that control the smearing of the orbital occupation at finite
    electronic temperatures.
    '''

    m_def = Category(
        aliases=['settings_smearing'],
        a_legacy=LegacyDefinition(name='settings_smearing'))


class SettingsStressTensor(MCategory):
    '''
    Settings to calculate the stress tensor (stress_tensor) consistent with the total
    energy of the system given in energy_total.
    '''

    m_def = Category(
        aliases=['settings_stress_tensor'],
        a_legacy=LegacyDefinition(name='settings_stress_tensor'))


class StressTensorType(MCategory):
    '''
    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.
    '''

    m_def = Category(
        aliases=['stress_tensor_type'],
        a_legacy=LegacyDefinition(name='stress_tensor_type'))


class SettingsAtomInMolecule(MCategory):
    '''
    Parameters of an atom within a molecule.
    '''

    m_def = Category(
        aliases=['settings_atom_in_molecule'],
        a_legacy=LegacyDefinition(name='settings_atom_in_molecule'))


class SettingsConstraint(MCategory):
    '''
    Some parameters that describe a constraint
    '''

    m_def = Category(
        aliases=['settings_constraint'],
        a_legacy=LegacyDefinition(name='settings_constraint'))


class SettingsInteraction(MCategory):
    '''
    Some parameters that describe a bonded interaction.
    '''

    m_def = Category(
        aliases=['settings_interaction'],
        a_legacy=LegacyDefinition(name='settings_interaction'))


class SoapParameter(MCategory):
    '''
    A soap parameter
    '''

    m_def = Category(
        aliases=['soap_parameter'],
        a_legacy=LegacyDefinition(name='soap_parameter'))


class Unused(MCategory):
    '''
    This metainfo definition is not used by NOMAD data.
    '''

    m_def = Category()


class EnergyComponentPerAtom(MCategory):
    '''
    A value of an energy component per atom, concurring in defining the total energy per
    atom.
    '''

    m_def = Category(
        aliases=['energy_component_per_atom'],
        categories=[EnergyValue],
        a_legacy=LegacyDefinition(name='energy_component_per_atom'))


class EnergyComponent(MCategory):
    '''
    A value of an energy component, expected to be an extensive property.
    '''

    m_def = Category(
        aliases=['energy_component'],
        categories=[EnergyValue],
        a_legacy=LegacyDefinition(name='energy_component'))


class EnergyTypeReference(MCategory):
    '''
    This metadata stores an energy used as reference point.
    '''

    m_def = Category(
        aliases=['energy_type_reference'],
        categories=[EnergyValue],
        a_legacy=LegacyDefinition(name='energy_type_reference'))


class ErrorEstimate(MCategory):
    '''
    An estimate of the error on the converged (final) value.
    '''

    m_def = Category(
        aliases=['error_estimate'],
        categories=[ErrorEstimateContribution],
        a_legacy=LegacyDefinition(name='error_estimate'))


class MessageInfo(MCategory):
    '''
    An information message of the computational program.
    '''

    m_def = Category(
        aliases=['message_info'],
        categories=[MessageDebug],
        a_legacy=LegacyDefinition(name='message_info'))


class ParallelizationInfo(MCategory):
    '''
    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.
    '''

    m_def = Category(
        aliases=['parallelization_info'],
        categories=[AccessoryInfo],
        a_legacy=LegacyDefinition(name='parallelization_info'))


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

    m_def = Category(
        aliases=['parsing_message_info'],
        categories=[ParsingMessageDebug],
        a_legacy=LegacyDefinition(name='parsing_message_info'))


class ProgramInfo(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.
    '''

    m_def = Category(
        aliases=['program_info'],
        categories=[AccessoryInfo],
        a_legacy=LegacyDefinition(name='program_info'))


class SettingsGeometryOptimization(MCategory):
    '''
    Contains parameters controlling the geometry optimization.
    '''

    m_def = Category(
        aliases=['settings_geometry_optimization'],
        categories=[SettingsSampling],
        a_legacy=LegacyDefinition(name='settings_geometry_optimization'))


class SettingsKPoints(MCategory):
    '''
    Contains parameters that control the $k$-point mesh.
    '''

    m_def = Category(
        aliases=['settings_k_points'],
        categories=[SettingsPotentialEnergySurface],
        a_legacy=LegacyDefinition(name='settings_k_points'))


class SettingsMetadynamics(MCategory):
    '''
    Contains parameters that control the metadynamics sampling.
    '''

    m_def = Category(
        aliases=['settings_metadynamics'],
        categories=[SettingsSampling],
        a_legacy=LegacyDefinition(name='settings_metadynamics'))


class SettingsMolecularDynamics(MCategory):
    '''
    Contains parameters that control the molecular dynamics sampling.
    '''

    m_def = Category(
        aliases=['settings_molecular_dynamics'],
        categories=[SettingsSampling],
        a_legacy=LegacyDefinition(name='settings_molecular_dynamics'))


class SettingsMonteCarlo(MCategory):
    '''
    Contains parameters that control the Monte-Carlo sampling.
    '''

    m_def = Category(
        aliases=['settings_Monte_Carlo'],
        categories=[SettingsSampling],
        a_legacy=LegacyDefinition(name='settings_Monte_Carlo'))


class SettingsXC(MCategory):
    '''
    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.
    '''

    m_def = Category(
        aliases=['settings_XC'],
        categories=[SettingsPotentialEnergySurface],
        a_legacy=LegacyDefinition(name='settings_XC'))


class TimeInfo(MCategory):
    '''
    Stores information on the date and timings of the calculation. They are useful for,
    e.g., debugging or visualization purposes.
    '''

    m_def = Category(
        aliases=['time_info'],
        categories=[AccessoryInfo],
        a_legacy=LegacyDefinition(name='time_info'))


class EnergyTotalPotentialPerAtom(MCategory):
    '''
    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).
    '''

    m_def = Category(
        aliases=['energy_total_potential_per_atom'],
        categories=[EnergyComponent, EnergyValue],
        a_legacy=LegacyDefinition(name='energy_total_potential_per_atom'))


class EnergyTotalPotential(MCategory):
    '''
    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).
    '''

    m_def = Category(
        aliases=['energy_total_potential'],
        categories=[EnergyComponent, EnergyValue],
        a_legacy=LegacyDefinition(name='energy_total_potential'))


class EnergyTypeC(MCategory):
    '''
    This metadata stores the correlation (C) energy.
    '''

    m_def = Category(
        aliases=['energy_type_C'],
        categories=[EnergyComponent, EnergyValue],
        a_legacy=LegacyDefinition(name='energy_type_C'))


class EnergyTypeVanDerWaals(MCategory):
    '''
    This metadata stores the converged van der Waals energy.
    '''

    m_def = Category(
        aliases=['energy_type_van_der_Waals'],
        categories=[EnergyComponent, EnergyValue],
        a_legacy=LegacyDefinition(name='energy_type_van_der_Waals'))


class EnergyTypeXC(MCategory):
    '''
    This metadata stores the exchange-correlation (XC) energy.
    '''

    m_def = Category(
        aliases=['energy_type_XC'],
        categories=[EnergyComponent, EnergyValue],
        a_legacy=LegacyDefinition(name='energy_type_XC'))


class EnergyTypeX(MCategory):
    '''
    This metadata stores the exchange (X) energy.
    '''

    m_def = Category(
        aliases=['energy_type_X'],
        categories=[EnergyComponent, EnergyValue],
        a_legacy=LegacyDefinition(name='energy_type_X'))


class MessageWarning(MCategory):
    '''
    A warning message of the computational program.
    '''

    m_def = Category(
        aliases=['message_warning'],
        categories=[MessageInfo, MessageDebug],
        a_legacy=LegacyDefinition(name='message_warning'))


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

    m_def = Category(
        aliases=['parsing_message_warning'],
        categories=[ParsingMessageInfo, ParsingMessageDebug],
        a_legacy=LegacyDefinition(name='parsing_message_warning'))


class SettingsBarostat(MCategory):
    '''
    Contains parameters controlling the barostat in a molecular dynamics calculation.
    '''

    m_def = Category(
        aliases=['settings_barostat'],
        categories=[SettingsSampling, SettingsMolecularDynamics],
        a_legacy=LegacyDefinition(name='settings_barostat'))


class SettingsIntegrator(MCategory):
    '''
    Contains parameters that control the molecular dynamics (MD) integrator.
    '''

    m_def = Category(
        aliases=['settings_integrator'],
        categories=[SettingsSampling, SettingsMolecularDynamics],
        a_legacy=LegacyDefinition(name='settings_integrator'))


class SettingsPostHartreeFock(MCategory):
    '''
    Contains parameters for the post Hartree-Fock method.
    '''

    m_def = Category(
        aliases=['settings_post_hartree_fock'],
        categories=[SettingsXC, SettingsPotentialEnergySurface],
        a_legacy=LegacyDefinition(name='settings_post_hartree_fock'))


class SettingsRelativity(MCategory):
    '''
    Contains parameters and information connected with the relativistic treatment used in
    the calculation.
    '''

    m_def = Category(
        aliases=['settings_relativity'],
        categories=[SettingsXC, SettingsPotentialEnergySurface],
        a_legacy=LegacyDefinition(name='settings_relativity'))


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

    m_def = Category(
        aliases=['settings_self_interaction_correction'],
        categories=[SettingsXC, SettingsPotentialEnergySurface],
        a_legacy=LegacyDefinition(name='settings_self_interaction_correction'))


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

    m_def = Category(
        aliases=['settings_thermostat'],
        categories=[SettingsSampling, SettingsMolecularDynamics],
        a_legacy=LegacyDefinition(name='settings_thermostat'))


class SettingsVanDerWaals(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).
    '''

    m_def = Category(
        aliases=['settings_van_der_Waals'],
        categories=[SettingsXC, SettingsPotentialEnergySurface],
        a_legacy=LegacyDefinition(name='settings_van_der_Waals'))


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

    m_def = Category(
        aliases=['settings_XC_functional'],
        categories=[SettingsXC, SettingsPotentialEnergySurface],
        a_legacy=LegacyDefinition(name='settings_XC_functional'))


class MessageError(MCategory):
    '''
    An error message of the computational program.
    '''

    m_def = Category(
        aliases=['message_error'],
        categories=[MessageInfo, MessageDebug, MessageWarning],
        a_legacy=LegacyDefinition(name='message_error'))


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

    m_def = Category(
        aliases=['parsing_message_error'],
        categories=[ParsingMessageInfo, ParsingMessageWarning, ParsingMessageDebug],
        a_legacy=LegacyDefinition(name='parsing_message_error'))


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

    m_def = Category(
        aliases=['settings_coupled_cluster'],
        categories=[SettingsPostHartreeFock, SettingsXC, SettingsPotentialEnergySurface],
        a_legacy=LegacyDefinition(name='settings_coupled_cluster'))


class SettingsGW(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(
        aliases=['settings_GW'],
        categories=[SettingsPostHartreeFock, SettingsXC, SettingsPotentialEnergySurface],
        a_legacy=LegacyDefinition(name='settings_GW'))


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

    m_def = Category(
        aliases=['settings_MCSCF'],
        categories=[SettingsPostHartreeFock, SettingsXC, SettingsPotentialEnergySurface],
        a_legacy=LegacyDefinition(name='settings_MCSCF'))


class SettingsMollerPlessetPerturbationTheory(MCategory):
    '''
    Contains parameters for Møller–Plesset perturbation theory.
    '''

    m_def = Category(
        aliases=['settings_moller_plesset_perturbation_theory'],
        categories=[SettingsPostHartreeFock, SettingsXC, SettingsPotentialEnergySurface],
        a_legacy=LegacyDefinition(name='settings_moller_plesset_perturbation_theory'))


class SettingsMultiReference(MCategory):
    '''
    Contains parameters for the multi-reference single and double configuration
    interaction method.
    '''

    m_def = Category(
        aliases=['settings_multi_reference'],
        categories=[SettingsPostHartreeFock, SettingsXC, SettingsPotentialEnergySurface],
        a_legacy=LegacyDefinition(name='settings_multi_reference'))


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

    m_def = Section(
        aliases=['archive_context'],
        validate=False,
        a_legacy=LegacyDefinition(name='archive_context'))

    archive_gid = Quantity(
        type=str,
        shape=[],
        description='''
        unique identifier of an archive.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='archive_gid'))


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

    m_def = Section(
        aliases=['calculation_context'],
        validate=False,
        a_legacy=LegacyDefinition(name='calculation_context'))

    calculation_gid = Quantity(
        type=str,
        shape=[],
        description='''
        unique identifier of a calculation.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='calculation_gid'))


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

    m_def = Section(
        aliases=['section_atom_projected_dos'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_atom_projected_dos'))

    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).
        ''',
        a_legacy=LegacyDefinition(name='atom_projected_dos_energies'))

    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.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='atom_projected_dos_lm'))

    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).
        ''',
        a_legacy=LegacyDefinition(name='atom_projected_dos_m_kind'))

    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.
        ''',
        a_legacy=LegacyDefinition(name='atom_projected_dos_values_lm'))

    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.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='atom_projected_dos_values_total'))

    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.
        ''',
        a_legacy=LegacyDefinition(name='number_of_atom_projected_dos_values'))

    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.
        ''',
        a_legacy=LegacyDefinition(name='number_of_lm_atom_projected_dos'))


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

    m_def = Section(
        aliases=['section_atomic_multipoles'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_atomic_multipoles'))

    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).
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='atomic_multipole_kind'))

    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.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='atomic_multipole_lm'))

    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).
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='atomic_multipole_m_kind'))

    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.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='atomic_multipole_values'))

    number_of_lm_atomic_multipoles = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of $l$, $m$ combinations for atomic multipoles
        atomic_multipole_lm.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_lm_atomic_multipoles'))


class BasisFunctionsAtomCentered(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.
    '''

    m_def = Section(
        aliases=['section_basis_functions_atom_centered'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_basis_functions_atom_centered'))


class BasisSetAtomCentered(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.
    '''

    m_def = Section(
        aliases=['section_basis_set_atom_centered'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_basis_set_atom_centered'))

    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.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='basis_set_atom_centered_ls'))

    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)$.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='basis_set_atom_centered_radial_functions'))

    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).
        ''',
        a_legacy=LegacyDefinition(name='basis_set_atom_centered_short_name'))

    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*).
        ''',
        a_legacy=LegacyDefinition(name='basis_set_atom_centered_unique_name'))

    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).
        ''',
        a_legacy=LegacyDefinition(name='basis_set_atom_number'))

    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.
        ''',
        a_legacy=LegacyDefinition(name='number_of_basis_functions_in_basis_set_atom_centered'))

    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*.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_kinds_in_basis_set_atom_centered'))

    section_basis_functions_atom_centered = SubSection(
        sub_section=SectionProxy('BasisFunctionsAtomCentered'),
        repeats=True,
        categories=[Unused],
        a_legacy=LegacyDefinition(name='section_basis_functions_atom_centered'))

    section_gaussian_basis_group = SubSection(
        sub_section=SectionProxy('GaussianBasisGroup'),
        repeats=True,
        a_legacy=LegacyDefinition(name='section_gaussian_basis_group'))


class BasisSetCellDependent(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).
    '''

    m_def = Section(
        aliases=['section_basis_set_cell_dependent'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_basis_set_cell_dependent'))

    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).
        ''',
        a_legacy=LegacyDefinition(name='basis_set_cell_dependent_kind'))

    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).
        ''',
        a_legacy=LegacyDefinition(name='basis_set_cell_dependent_name'))

    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.
        ''',
        a_legacy=LegacyDefinition(name='basis_set_planewave_cutoff'))


class BasisSet(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
1121
1122
    class, are defined in the dedicated section: section_basis_set_cell_dependent or
    section_basis_set_atom_centered. The
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
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
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
    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.
    '''

    m_def = Section(
        aliases=['section_basis_set'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_basis_set'))

    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).
        ''',
        a_legacy=LegacyDefinition(name='basis_set_kind'))

    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).
        ''',
        a_legacy=LegacyDefinition(name='basis_set_name'))

    mapping_section_basis_set_atom_centered = Quantity(
        type=Reference(SectionProxy('BasisSetAtomCentered')),
        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.
        ''',
        a_legacy=LegacyDefinition(name='mapping_section_basis_set_atom_centered'))

    mapping_section_basis_set_cell_dependent = Quantity(
        type=Reference(SectionProxy('BasisSetCellDependent')),
        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.
        ''',
        a_legacy=LegacyDefinition(name='mapping_section_basis_set_cell_dependent'))

    number_of_basis_functions = Quantity(
        type=int,
        shape=[],
        description='''
        Stores the total number of basis functions in a section_basis_set section.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_basis_functions'))


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

    m_def = Section(
        aliases=['section_restricted_uri'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_restricted_uri'))

    number_of_restricted_uri = Quantity(
        type=np.dtype(np.int32),
        shape=[],
        description='''
        The number of restricted uris in restricted_uri list.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_restricted_uri'))

    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
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='restricted_uri'))

    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'.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='restricted_uri_reason'))

    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.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='restricted_uri_issue_authority'))

    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.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='restricted_uri_end_date'))

    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'.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='restricted_uri_restriction'))

    restricted_uri_license = Quantity(
        type=str,
        shape=[],
        description='''
        The info of the license that is the reason of restriction.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='restricted_uri_license'))

    number_of_restricted_uri_files = Quantity(
        type=np.dtype(np.int32),
        shape=[],
        description='''
        The number of restricted files in restricted_uri_files list.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_restricted_uri_files'))


class CalculationToCalculationRefs(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.
    '''

    m_def = Section(
        aliases=['section_calculation_to_calculation_refs'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_calculation_to_calculation_refs'))

    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.
        ''',
        a_legacy=LegacyDefinition(name='calculation_to_calculation_external_url'))

    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.
        ''',
        a_legacy=LegacyDefinition(name='calculation_to_calculation_kind'))

    calculation_to_calculation_ref = Quantity(
        type=Reference(SectionProxy('SingleConfigurationCalculation')),
        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.
        ''',
        a_legacy=LegacyDefinition(name='calculation_to_calculation_ref'))


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

    m_def = Section(
        aliases=['section_calculation_to_folder_refs'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_calculation_to_folder_refs'))

    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.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='calculation_to_folder_external_url'))

    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.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='calculation_to_folder_kind'))


class DosFingerprint(MSection):
    '''
    Section for the fingerprint of the electronic density-of-states (DOS). DOS
    fingerprints are a modification of the D-Fingerprints reported in Chem. Mater. 2015,
    27, 3, 735–743 (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.
    '''

    m_def = Section(
        aliases=['section_dos_fingerprint'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_dos_fingerprint'))

    bins = Quantity(
        type=str,
        shape=[],
        description='''
        Byte representation of the DOS fingerprint.
        ''',
        a_legacy=LegacyDefinition(name='bins'))

    indices = Quantity(
        type=np.dtype(np.int16),
        shape=[2],
        description='''
        Indices used to compare DOS fingerprints of different energy ranges.
        ''',
        a_legacy=LegacyDefinition(name='indices'))

    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'))

    filling_factor = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        description='''
        Proportion of 1 bins in the DOS fingerprint.
        ''',
        a_legacy=LegacyDefinition(name='filling_factor'))

    grid_id = Quantity(
        type=str,
        shape=[],
        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'))


class Dos(MSection):
    '''
    Section collecting information of a (electronic-energy or vibrational-energy) density
    of states (DOS) evaluation.
    '''

    m_def = Section(
        aliases=['section_dos'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_dos'))

    dos_energies_normalized = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_dos_values'],
        unit='joule',
        description='''
        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 partial density of states.

        If not available through energy_reference_highest_occupied, the highest occupied
        energy level is detected by searching for a non-zero DOS value below (or nearby)
        the reported energy_reference_fermi. In case the highest occupied energy level
        cannot be detected accurately, the normalized values are not reported. For
        calculations with multiple spin-channels, the normalization is determined by the
        first channel.
        ''',
        a_legacy=LegacyDefinition(name='dos_energies_normalized'))

    dos_energies = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_dos_values'],
        unit='joule',
        description='''
        Array containing the set of discrete energy values for the density (electronic-
        energy or vibrational energy) of states (DOS). This is the total DOS, see
        atom_projected_dos_energies and species_projected_dos_energies for partial density
        of states.
        ''',
        a_legacy=LegacyDefinition(name='dos_energies'))

    dos_integrated_values = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_spin_channels', 'number_of_dos_values'],
        description='''
        Integrated density of states (starting at $-\\infty$), pseudo potential
        calculations should start with the number of core electrons if they cover only the
        active electrons
        ''',
        a_legacy=LegacyDefinition(name='dos_integrated_values'))

    dos_kind = Quantity(
        type=str,
        shape=[],
        description='''
        String to specify the kind of density of states (either electronic or
        vibrational).
        ''',
        a_legacy=LegacyDefinition(name='dos_kind'))

    dos_lm = Quantity(
        type=np.dtype(np.int32),
        shape=['number_of_dos_lms', 2],
        description='''
        Tuples of $l$ and $m$ values for which 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 actual adopted convention is specified by
        dos_m_kind.
        ''',
        a_legacy=LegacyDefinition(name='dos_lm'))

    dos_m_kind = Quantity(
        type=str,
        shape=[],
        description='''
        String describing what the integer numbers of $m$ in 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).
        ''',
        a_legacy=LegacyDefinition(name='dos_m_kind'))

    dos_values_lm = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_dos_lms', 'number_of_spin_channels', 'number_of_atoms', 'number_of_dos_values'],
        description='''
        Array containing the density (electronic-energy) of states values projected on the
        various spherical harmonics (integrated on all atoms), see
        atom_projected_dos_values_lm for atom values.
        ''',
        a_legacy=LegacyDefinition(name='dos_values_lm'))

    dos_values_normalized = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_spin_channels', 'number_of_dos_values'],
        description='''
        Density of states (DOS) values divided by the unit cell volume and by the number
        of atoms.
        ''',
        a_legacy=LegacyDefinition(name='dos_values_normalized'))

    dos_values = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_spin_channels', 'number_of_dos_values'],
        description='''
        Values (number of states for a given energy, the set of discrete energy values is
        given in dos_energies) of density (electronic-energy or vibrational-energy) of
        states. This refers to the simulation cell, i.e. integrating over all energies
        will give the number of electrons in the simulation cell.
        ''',
        a_legacy=LegacyDefinition(name='dos_values'))

    number_of_dos_lms = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of $l$, $m$ combinations for the given projected density of
        states (DOS) in dos_values and dos_values_lm.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_dos_lms'))

    number_of_dos_values = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of energy values for the density of states (DOS), see
        dos_energies.
        ''',
        a_legacy=LegacyDefinition(name='number_of_dos_values'))

    section_dos_fingerprint = SubSection(
        sub_section=SectionProxy('DosFingerprint'),
        repeats=False,
        a_legacy=LegacyDefinition(name='section_dos_fingerprint'))


class Eigenvalues(MSection):
    '''
    Section containing (electronic-energy) eigenvalues for one spin channel. If, for
    example, the eigenvalues of the Kohn-Sham operator are to be stored, a string
    identifying this kind of eigenvalues is put in eigenvalues_kind, the coordinates of
    the $k$-points at which the eigenvalues are evaluated is stored in
    eigenvalues_kpoints, and the energy values of the eigenstates and their occupation is
    stored in eigenvalues_values and eigenvalues_occupation, respectively.
    '''

    m_def = Section(
        aliases=['section_eigenvalues'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_eigenvalues'))

    eigenvalues_kind = Quantity(
        type=str,
        shape=[],
        description='''
        A short string describing the kind of eigenvalues, as defined in the
        [eigenvalues_kind wiki page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-
        info/wikis/metainfo/eigenvalues-kind).
        ''',
        a_legacy=LegacyDefinition(name='eigenvalues_kind'))

    eigenvalues_kpoints_multiplicity = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_eigenvalues_kpoints'],
        description='''
        Multiplicity of the $k$ point (i.e., how many distinct points per cell this
        expands to after applying all symmetries). This defaults to 1. If expansion is
        preformed then each point will have weight
        eigenvalues_kpoints_weights/eigenvalues_kpoints_multiplicity.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='eigenvalues_kpoints_multiplicity'))

    eigenvalues_kpoints_weights = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_eigenvalues_kpoints'],
        description='''
        Weights of the $k$ points (in the basis of the reciprocal lattice vectors) used
        for the evaluation of the eigenvalues tabulated in eigenvalues_values, should
        account for symmetry too.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='eigenvalues_kpoints_weights'))

    eigenvalues_kpoints = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_eigenvalues_kpoints', 3],
        description='''
        Coordinates of the $k$ points (in the basis of the reciprocal lattice vectors)
        used for the evaluation of the eigenvalues tabulated in eigenvalues_values.
        ''',
        a_legacy=LegacyDefinition(name='eigenvalues_kpoints'))

    eigenvalues_occupation = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_spin_channels', 'number_of_eigenvalues_kpoints', 'number_of_eigenvalues'],
        description='''
        Occupation of the eigenstates. The corresponding eigenvalues (energy) are given in
        eigenvalues_values. The coordinates in the reciprocal space are defined in
        eigenvalues_kpoints.
        ''',
        a_legacy=LegacyDefinition(name='eigenvalues_occupation'))

    eigenvalues_values = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_spin_channels', 'number_of_eigenvalues_kpoints', 'number_of_eigenvalues'],
        unit='joule',
        description='''
        Values of the (electronic-energy) eigenvalues. The coordinates of the
        corresponding eigenstates in the reciprocal space are defined in
        eigenvalues_kpoints and their occupations are given in eigenvalues_occupation.
        ''',
        a_legacy=LegacyDefinition(name='eigenvalues_values'))

    number_of_band_segment_eigenvalues = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of eigenvalues in a band segment, see band_energies.
        ''',
        a_legacy=LegacyDefinition(name='number_of_band_segment_eigenvalues'))

    number_of_eigenvalues_kpoints = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of $k$ points, see eigenvalues_kpoints. $k$ points are calculated
        within a run and are irreducible if a symmetry is used.
        ''',
        a_legacy=LegacyDefinition(name='number_of_eigenvalues_kpoints'))

    number_of_eigenvalues = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of eigenvalues, see eigenvalues_values.
        ''',
        a_legacy=LegacyDefinition(name='number_of_eigenvalues'))

    number_of_normalized_band_segment_eigenvalues = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of normalized eigenvalues in a band segment, see

        band_energies_normalized.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_normalized_band_segment_eigenvalues'))

    gw_qp_linearization_prefactor = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_spin_channels', 'number_of_eigenvalues_kpoints', 'number_of_eigenvalues'],
        description='''
        Linearization prefactor
        ''',
        a_legacy=LegacyDefinition(name='gw_qp_linearization_prefactor'))


class EnergyCodeIndependent(MSection):
    '''
    Section describing a code-independent total energy obtained by subtracting some
    reference energy calculated with the same code. It contains the type in
    energy_code_independent_kind and the computed code-independent total energy in
    energy_code_independent_value. The computed energy allows for comparisons among
    different codes and numerical settings.
    '''

    m_def = Section(
        aliases=['section_energy_code_independent'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_energy_code_independent'))

    energy_code_independent_kind = Quantity(
        type=str,
        shape=[],
        description='''
        Type of the code-independent total energy (obtained by subtracting a reference
        energy calculated with the same code), created to be comparable among different
        codes and numerical settings. Details can be found on the [energy_code_independent
        wiki page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-
        info/wikis/metainfo/energy-code-independent).
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='energy_code_independent_kind'))

    energy_code_independent_value = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        unit='joule',
        description='''
        Value of the code-independent total energy (obtained by subtracting a reference
        energy calculated with the same code). This value is created to be comparable
        among different codes and numerical settings. Details can be found on the
        [energy_code_independent wiki page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-
        meta-info/wikis/metainfo/energy-code-independent).
        ''',
        categories=[EnergyComponent, EnergyValue, EnergyTotalPotential, Unused],
        a_legacy=LegacyDefinition(name='energy_code_independent_value'))


class EnergyVanDerWaals(MSection):
    '''
    Section containing the Van der Waals energy value (energy_van_der_Waals_value) of type
    van_der_Waals_kind. This is used when more than one Van der Waals methods are applied
    in the same *single configuration calculation*, see
    section_single_configuration_calculation. The main Van der Waals method (the one
    concurring to energy_current, and used, e.g., for evaluating the forces for a
    relaxation or dynamics) is given in energy_van_der_Waals and is defined in
    settings_van_der_Waals.
    '''

    m_def = Section(
        aliases=['section_energy_van_der_Waals'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_energy_van_der_Waals'))

    energy_van_der_Waals_kind = Quantity(
        type=str,
        shape=[],
        description='''
        Method used to compute van der Waals energy stored in energy_van_der_Waals_value.
        This metadata is used when more than one van der Waals method is applied in the
        same *single configuration calculation* (see
        section_single_configuration_calculation). The method used for van der Waals  (the
        one consistent with energy_current and, e.g., for evaluating the forces for a
        relaxation or dynamics) is defined in settings_van_der_Waals.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='energy_van_der_Waals_kind'))

    energy_van_der_Waals_value = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        unit='joule',
        description='''
        Value of van der Waals energy, calculated with the method defined in
        energy_van_der_Waals_kind. This metadata is used when more than one van der Waals
        method is applied in the same *single configuration calculation* (see
        section_single_configuration_calculation). The value of the van der Waals energy
        consistent with energy_current and used, e.g., for evaluating the forces for a
        relaxation or dynamics, is given in energy_van_der_Waals and defined in
        settings_van_der_Waals.
        ''',
        categories=[EnergyTypeVanDerWaals, EnergyComponent, EnergyValue, Unused],
        a_legacy=LegacyDefinition(name='energy_van_der_Waals_value'))

    energy_van_der_Waals = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        unit='joule',
        description='''
        Value for the converged van der Waals energy calculated using the method described
        in van_der_Waals_method, and used in energy_current. This is the van der Waals
        method consistent with, e.g., forces used for relaxation or dynamics. Alternative
        methods are listed in section_energy_van_der_Waals.
        ''',
        categories=[EnergyTypeVanDerWaals, EnergyComponent, EnergyValue, Unused],
        a_legacy=LegacyDefinition(name='energy_van_der_Waals'))


class EnergyContribution(MSection):
    '''
    Section describing the contributions to the total energy.
    '''

    m_def = Section(
        aliases=['section_energy_contribution'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_energy_contribution'))

Alvin Noe Ladines's avatar
Alvin Noe Ladines committed
1813
    energy_contribution_kind = Quantity(
1814
1815
1816
1817
1818
        type=str,
        shape=[],
        description='''
        The kind of the energy contribution. Can be one of bond, pair, coulomb, etc.
        ''',
Alvin Noe Ladines's avatar
Alvin Noe Ladines committed
1819
        a_legacy=LegacyDefinition(name='energy_contribution_kind'))
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831

    energy_contribution_value = Quantity(
        type=np.dtype(np.float64),
        shape=[],
        unit='joule',
        description='''
        Value of the energy contribution.
        ''',
        categories=[EnergyComponent, EnergyValue],
        a_legacy=LegacyDefinition(name='energy_contribution_value'))


1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
class StressTensorContribution(MSection):
    '''
    Section describing the contributions to the stress tensor.
    '''

    m_def = Section(
        aliases=['section_stress_tensor_contribution'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_stress_tensor_contribution'))

    stress_tensor_contribution_kind = Quantity(
        type=str,
        shape=[],
        description='''
        The kind of the stress tensor contribution. Can be one of bond, pair, coulomb, etc.
        ''',
        a_legacy=LegacyDefinition(name='stress_tensor_contribution_kind'))

    stress_tensor_contribution_value = Quantity(
        type=np.dtype(np.float64),
        shape=[3, 3],
        unit='joule/meter**3',
        description='''
        Value of the stress tensor contribution.
        ''',
        categories=[EnergyComponent, EnergyValue],
        a_legacy=LegacyDefinition(name='stress_tensor_contribution_value'))


class AtomStressContribution(MSection):
    '''
    Section describing the contributions to the stress tensor.
    '''

    m_def = Section(
        aliases=['section_atom_stress_contribution'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_atom_stress_contribution'))

    atom_stress_contribution_kind = Quantity(
        type=str,
        shape=[],
        description='''
        The kind of the stress tensor contribution. Can be one of bond, pair, coulomb, etc.
        ''',
        a_legacy=LegacyDefinition(name='atom_stress_tensor_contribution_kind'))

    atom_stress_contribution_value = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_atoms', 3, 3],
        unit='joule/meter**3',
        description='''
        Value of the atom stress contribution.
        ''',
        categories=[EnergyComponent, EnergyValue],
        a_legacy=LegacyDefinition(name='atom_stress_contribution_value'))


1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
class FrameSequenceUserQuantity(MSection):
    '''
    Section collecting some user-defined quantities evaluated along a sequence of frame.
    '''

    m_def = Section(
        aliases=['section_frame_sequence_user_quantity'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_frame_sequence_user_quantity'))

    frame_sequence_user_quantity_frames = Quantity(
        type=np.dtype(np.int32),
        shape=['number_of_user_quantity_evaluations_in_sequence'],
        description='''
        Array containing the strictly increasing indices referring to the frames of
        frame_sequence_user_quantity. If not given it defaults to the trivial mapping
        0,1,...
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='frame_sequence_user_quantity_frames'))

    frame_sequence_user_quantity_name = Quantity(
        type=str,
        shape=[],
        description='''
        Descriptive name of a user-defined quantity, sampled along this sequence of frames
        (i.e., a trajectory, a frame is one section_single_configuration_calculation).
        Dedicated metadata are created for the conserved energy-like quantity
        (frame_sequence_conserved_quantity), the kinetic and potential energies
        (frame_sequence_kinetic_energy and frame_sequence_potential_energy), the
        instantaneous temperature (frame_sequence_temperature) and pressure
        (frame_sequence_pressure). This metadata should be used for other quantities that
        are monitored along a sequence of frames.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='frame_sequence_user_quantity_name'))

    frame_sequence_user_quantity_stats = Quantity(
        type=np.dtype(np.float64),
        shape=[2, 'number_of_frame_sequence_user_quantity_components'],
        description='''
        Average of frame_sequence_user_quantity and its standard deviation in this
        sequence of frames (i.e., a trajectory, a frame is one
        section_single_configuration_calculation).
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='frame_sequence_user_quantity_stats'))

    frame_sequence_user_quantity = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_user_quantity_evaluations_in_sequence', 'number_of_frame_sequence_user_quantity_components'],
        description='''
        Array containing the values of the user-defined quantity defined in
        frame_sequence_user_quantity_name, evaluated along this sequence of frames (i.e.,
        trajectory, a frame is one section_single_configuration_calculation). If not all
        frames have a value the indices of the frames that have a value are stored in
        frame_sequence_kinetic_energy_frames. If not all frames have a value the indices
        of the frames that have a value are stored in
        frame_sequence_kinetic_energy_frames.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='frame_sequence_user_quantity'))

    number_of_frame_sequence_user_quantity_components = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of user-defined quantity defined by
        frame_sequence_user_quantity_name and monitored in a sequence of frames. A
        sequence is a trajectory, which can have number_of_frames_in_sequence each
        representing one section_single_configuration_calculation section.

        Dedicated metadata monitored along a sequence of frames are created for the
        conserved energy-like quantity (frame_sequence_conserved_quantity), the kinetic
1964
1965
        and potential energies (frame_sequence_kinetic_energy and
        frame_sequence_potential_energy), the instantaneous temperature
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
        (frame_sequence_temperature) and the pressure (frame_sequence_pressure).
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_frame_sequence_user_quantity_components'))

    number_of_user_quantity_evaluations_in_sequence = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of user defined quantity evaluations along a sequence of
        frame_sequence_user_quantity frames. A sequence is a trajectory, which can have
        number_of_frames_in_sequence each representing one
        section_single_configuration_calculation section.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_user_quantity_evaluations_in_sequence'))


class FrameSequence(MSection):
    '''
    Section containing a sequence of frames, i.e. a trajectory which can have
    number_of_frames_in_sequence each representing one
    section_single_configuration_calculation section evaluated with a sampling method
    (e.g, molecular dynamics, Monte Carlo, geometry optimization). The sampling method
    might be a subset of the whole trajectory.

    Information on the method used for the sampling can be found in the
    section_sampling_method section and information of each frame of the sequence are
    found in the section_single_configuration_calculation section.
    '''

    m_def = Section(
        aliases=['section_frame_sequence'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_frame_sequence'))

    frame_sequence_conserved_quantity_frames = Quantity(
        type=np.dtype(np.int32),
        shape=['number_of_conserved_quantity_evaluations_in_sequence'],
        description='''
        Array containing the strictly increasing indices of the frames the
        frame_sequence_conserved_quantity values refers to. If not given it defaults to
        the trivial mapping 0,1,...
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_conserved_quantity_frames'))

    frame_sequence_conserved_quantity_stats = Quantity(
        type=np.dtype(np.float64),
        shape=[2],
        unit='joule',
        description='''
        Average value of energy-like frame_sequence_conserved_quantity, and its standard
        deviation, over this sequence of frames (i.e., a trajectory, a frame is one
        section_single_configuration_calculation).
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_conserved_quantity_stats'))

    frame_sequence_conserved_quantity = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_conserved_quantity_evaluations_in_sequence'],
        unit='joule',
        description='''
        Array containing the values of a quantity that should be conserved,  along a
        sequence of frames (i.e., a trajectory). A frame is one
        section_single_configuration_calculation), for example the total energy in the NVE
        ensemble. If not all frames have a value the indices of the frames that have a
        value are stored in frame_sequence_conserved_quantity_frames.
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_conserved_quantity'))

    frame_sequence_continuation_kind = Quantity(
        type=Reference(SectionProxy('FrameSequence')),
        shape=[],
        description='''
        Type of continuation that has been performed from the previous sequence of frames
        (i.e., a trajectory, a frame is one section_single_configuration_calculation),
        upon restart.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='frame_sequence_continuation_kind'))

    frame_sequence_external_url = Quantity(
        type=str,
        shape=[],
        description='''
        If the energy, forces, and other quantities for the frames (a frame is one
        section_single_configuration_calculation) in  section_frame_sequence are obtained
        by calling a different code than the code that drives the sequence (e.g., a
        wrapper that drives a molecular dynamics, Monte Carlo, geometry optimization and
        calls an electronic-structure code for energy and forces for each configuration),
        this metadata holds the reference to where the
        section_single_configuration_calculation for each frame are located. The format
        for this reference is described in the [frame_sequence_external_url wiki
        page](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-meta-info/wikis/metainfo/frame-
        sequence-external-url).
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='frame_sequence_external_url'))

    frame_sequence_kinetic_energy_frames = Quantity(
        type=np.dtype(np.int32),
        shape=['number_of_kinetic_energies_in_sequence'],
        description='''
        Array containing the strictly increasing indices referring to the frames of
        frame_sequence_kinetic_energy. If not given it defaults to the trivial mapping
        0,1,...
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_kinetic_energy_frames'))

    frame_sequence_kinetic_energy_stats = Quantity(
        type=np.dtype(np.float64),
        shape=[2],
        unit='joule',
        description='''
        Average kinetic energy and its standard deviation over this sequence of frames
        (i.e., a trajectory, a frame is one section_single_configuration_calculation).
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_kinetic_energy_stats'))

    frame_sequence_kinetic_energy = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_kinetic_energies_in_sequence'],
        unit='joule',
        description='''
        Array containing the values of the kinetic energy along this sequence of frames
        (i.e., a trajectory, a frame is one section_single_configuration_calculation). If
        not all frames have a value the indices of the frames that have a value are stored
        in frame_sequence_kinetic_energy_frames.
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_kinetic_energy'))

    frame_sequence_local_frames_ref = Quantity(
        type=Reference(SectionProxy('SingleConfigurationCalculation')),
        shape=['number_of_frames_in_sequence'],
        description='''
        Reference from each frame (a frame is one
        section_single_configuration_calculation) in this section_frame_sequence to the
        corresponding section_single_configuration_calculation. Each
        section_frame_sequence binds a collection of
        section_single_configuration_calculation, because they all belong to, e.g., a
        molecular dynamics trajectory, or geometry optimization. The full information for
        each frame is stored in section_single_configuration_calculation and this metadata
        establishes the link for each frame.
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_local_frames_ref'))

    frame_sequence_potential_energy_frames = Quantity(
        type=np.dtype(np.int32),
        shape=['number_of_potential_energies_in_sequence'],
        description='''
        Array containing the strictly increasing indices referring to the frames of
        frame_sequence_potential_energy. If not given it defaults to the trivial mapping
        0,1,...
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_potential_energy_frames'))

    frame_sequence_potential_energy_stats = Quantity(
        type=np.dtype(np.float64),
        shape=[2],
        unit='joule',
        description='''
        Average potential energy and its standard deviation over this sequence of frames
        (i.e., a trajectory, a frame is one section_single_configuration_calculation).
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_potential_energy_stats'))

    frame_sequence_potential_energy = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_potential_energies_in_sequence'],
        unit='joule',
        description='''
        Array containing the value of the potential energy along this sequence of frames
        (i.e., a trajectory, a frame is one section_single_configuration_calculation).
        This is equal to energy_total of the corresponding
        section_single_configuration_calculation and repeated here in a summary array for
        easier access. If not all frames have a value the indices of the frames that have
        a value are stored in frame_sequence_potential_energy_frames.
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_potential_energy'))

    frame_sequence_pressure_frames = Quantity(
        type=np.dtype(np.int32),
        shape=['number_of_pressure_evaluations_in_sequence'],
        description='''
        Array containing the strictly increasing indices referring to the frames of
        frame_sequence_pressure. If not given it defaults to the trivial mapping 0,1,...
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='frame_sequence_pressure_frames'))

    frame_sequence_pressure_stats = Quantity(
        type=np.dtype(np.float64),
        shape=[2],
        unit='pascal',
        description='''
        Average pressure (one third of the trace of the stress tensor) and standard
        deviation over this sequence of frames (i.e., a trajectory, a frame is one
        section_single_configuration_calculation).
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='frame_sequence_pressure_stats'))

    frame_sequence_pressure = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_pressure_evaluations_in_sequence'],
        unit='pascal',
        description='''
        Array containing the values of the pressure (one third of the trace of the stress
        tensor) along this sequence of frames (a frame is one
        section_single_configuration_calculation). If not all frames have a value the
        indices of the frames that have a value are stored in
        frame_sequence_pressure_frames.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='frame_sequence_pressure'))

    frame_sequence_temperature_frames = Quantity(
        type=np.dtype(np.int32),
        shape=['number_of_temperatures_in_sequence'],
        description='''
        Array containing the strictly increasing indices referring to the frames of
        frame_sequence_temperature. If not given it defaults to the trivial mapping
        0,1,...
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_temperature_frames'))

    frame_sequence_temperature_stats = Quantity(
        type=np.dtype(np.float64),
        shape=[2],
        unit='kelvin',
        description='''
        Average temperature and its standard deviation over this sequence of frames (i.e.,
        a trajectory, a frame is one section_single_configuration_calculation).
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_temperature_stats'))

    frame_sequence_temperature = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_temperatures_in_sequence'],
        unit='kelvin',
        description='''
        Array containing the values of the instantaneous temperature (a quantity,
        proportional to frame_sequence_kinetic_energy, whose ensemble average equals the
        thermodynamic temperature) along this sequence of frames (i.e., a trajectory, a
        frame is one section_single_configuration_calculation). If not all frames have a
        value the indices of the frames that have a value are stored in
        frame_sequence_temperature_frames.
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_temperature'))

    frame_sequence_time = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_frames_in_sequence'],
        unit='second',
        description='''
        Time along this sequence of frames (i.e., a trajectory, a frame is one
        section_single_configuration_calculation). Time start is arbitrary, but when a
        sequence is a continuation of another time should be continued too.
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_time'))

    frame_sequence_to_sampling_ref = Quantity(
        type=Reference(SectionProxy('SamplingMethod')),
        shape=[],
        description='''
        Reference from the present section_frame_sequence to the section_sampling_method,
        that defines the parameters used in this sequence of frames (i.e., a trajectory, a
        frame is one section_single_configuration_calculation).
        ''',
        a_legacy=LegacyDefinition(name='frame_sequence_to_sampling_ref'))

    geometry_optimization_converged = Quantity(
        type=bool,
        shape=[],
        description='''
        Arrays specify whether a geometry optimization is converged.
        ''',
        a_legacy=LegacyDefinition(name='geometry_optimization_converged'))

    number_of_conserved_quantity_evaluations_in_sequence = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of conserved quantity evaluations in this sequence. A sequence is
        a trajectory, which can have number_of_frames_in_sequence each representing one
        section_single_configuration_calculation section.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_conserved_quantity_evaluations_in_sequence'))

    number_of_frames_in_sequence = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of frames in a sequence. A sequence is a trajectory, which can
        have number_of_frames_in_sequence each representing one
        section_single_configuration_calculation section.
        ''',
        a_legacy=LegacyDefinition(name='number_of_frames_in_sequence'))

    number_of_kinetic_energies_in_sequence = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of kinetic energy evaluations in this sequence of frames, see
        frame_sequence_kinetic_energy.
        ''',
        a_legacy=LegacyDefinition(name='number_of_kinetic_energies_in_sequence'))

    number_of_potential_energies_in_sequence = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of potential energies evaluation in this sequence. A sequence is
        a trajectory, which can have number_of_frames_in_sequence each representing one
        section_single_configuration_calculation section.
        ''',
        a_legacy=LegacyDefinition(name='number_of_potential_energies_in_sequence'))

    number_of_pressure_evaluations_in_sequence = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of pressure evaluations in this sequence. A sequence is a
        trajectory, which can have number_of_frames_in_sequence each representing one
        section_single_configuration_calculation section.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_pressure_evaluations_in_sequence'))

    number_of_temperatures_in_sequence = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of temperature frames (frame_sequence_temperature) used in the
        section_frame_sequence. A sequence is a trajectory, which can have
        number_of_frames_in_sequence each representing one
        section_single_configuration_calculation section.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_temperatures_in_sequence'))

    previous_sequence_ref = Quantity(
        type=Reference(SectionProxy('FrameSequence')),
        shape=[],
        description='''
        Contains a reference to the previous sequence. A sequence is a trajectory, which
        can have number_of_frames_in_sequence each representing one
        section_single_configuration_calculation section. If not given, a start from an
        initial configuration is assumed.
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='previous_sequence_ref'))

    section_frame_sequence_user_quantity = SubSection(
        sub_section=SectionProxy('FrameSequenceUserQuantity'),
        repeats=True,
        categories=[Unused],
        a_legacy=LegacyDefinition(name='section_frame_sequence_user_quantity'))

    section_thermodynamical_properties = SubSection(
        sub_section=SectionProxy('ThermodynamicalProperties'),
        repeats=True,
        a_legacy=LegacyDefinition(name='section_thermodynamical_properties'))


class GaussianBasisGroup(MSection):
    '''
    Section that describes a group of Gaussian contractions. Groups allow one to calculate
    the primitive Gaussian integrals once for several different linear combinations of
    them. This defines basis functions with radial part $f_i(r) = r^{l_i} \\sum_{j} c_{i j}
    A(l_i, \\alpha_j) exp(-\\alpha_j r^2)$ where $A(l_i, \\alpha_j)$ is a the normalization
    coefficient for primitive Gaussian basis functions. Here, $\\alpha_j$ is defined in
    gaussian_basis_group_exponents, $l_i$ is given in gaussian_basis_group_ls, and $c_{i
    j}$ is given in gaussian_basis_group_contractions, whereas the radial part is given by
    the spherical harmonics $Y_{l m}$.

    This section is defined only if the original basis function uses Gaussian basis
    functions, and the sequence of radial functions $f_i$ across all
    section_gaussian_basis_group in section_basis_set_atom_centered should match the one
    of basis_set_atom_centered_radial_functions.
    '''

    m_def = Section(
        aliases=['section_gaussian_basis_group'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_gaussian_basis_group'))

    gaussian_basis_group_contractions = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_gaussian_basis_group_contractions', 'number_of_gaussian_basis_group_exponents'],
        description='''
        contraction coefficients $c_{i j}$ defining the contracted basis functions with
        respect to *normalized* primitive Gaussian functions. They define the Gaussian
        basis functions as described in section_gaussian_basis_group.
        ''',
        a_legacy=LegacyDefinition(name='gaussian_basis_group_contractions'))

    gaussian_basis_group_exponents = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_gaussian_basis_group_exponents'],
        unit='1 / meter ** 2',
        description='''
        Exponents $\\alpha_j$ of the Gaussian functions defining this basis set
        $exp(-\\alpha_j r^2)$. One should be careful about the units of the coefficients.
        ''',
        a_legacy=LegacyDefinition(name='gaussian_basis_group_exponents'))

    gaussian_basis_group_ls = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_gaussian_basis_group_contractions'],
        description='''
        Azimuthal quantum number ($l$) values (of the angular part given by the spherical
        harmonic $Y_{l m}$ of the various contracted basis functions).
        ''',
        a_legacy=LegacyDefinition(name='gaussian_basis_group_ls'))

    number_of_gaussian_basis_group_contractions = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of different contractions, i.e. resulting basis functions in a
        section_gaussian_basis_group section.
        ''',
        a_legacy=LegacyDefinition(name='number_of_gaussian_basis_group_contractions'))

    number_of_gaussian_basis_group_exponents = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of different Gaussian exponents in a section_gaussian_basis_group
        section.
        ''',
        a_legacy=LegacyDefinition(name='number_of_gaussian_basis_group_exponents'))


class KBandNormalized(MSection):
    '''
    This section stores information on a normalized $k$-band (electronic band structure)
    evaluation along one-dimensional pathways in the $k$ (reciprocal) space given in
    section_k_band_segment. Eigenvalues calculated at the actual $k$-mesh used for
    energy_total evaluations, can be found in the section_eigenvalues section.
    '''

    m_def = Section(
        aliases=['section_k_band_normalized'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_k_band_normalized'))

    k_band_path_normalized_is_standard = Quantity(
        type=bool,
        shape=[],
        description='''
        If the normalized path is along the default path defined in W. Setyawan and S.
        Curtarolo, [Comput. Mater. Sci. **49**, 299-312
        (2010)](http://dx.doi.org/10.1016/j.commatsci.2010.05.010).
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='k_band_path_normalized_is_standard'))

    section_k_band_segment_normalized = SubSection(
        sub_section=SectionProxy('KBandSegmentNormalized'),
        repeats=True,
        a_legacy=LegacyDefinition(name='section_k_band_segment_normalized'))


class KBandSegmentNormalized(MSection):
    '''
    Section collecting the information on a normalized $k$-band segment. This section
    stores band structures along a one-dimensional pathway in the $k$ (reciprocal) space.

    Eigenvalues calculated at the actual $k$-mesh used for energy_total evaluations are
    defined in section_eigenvalues and the band structures are represented as third-order
    tensors: one dimension for the spin channels, one for the sequence of $k$ points for
    the segment (given in number_of_k_points_per_segment), and one for the sequence of
    eigenvalues at a given $k$ point. The values of the $k$ points in each segment are
    stored in band_k_points. The energies and occupation for each eigenstate, at each $k$
    point, segment, and spin channel are stored in band_energies and band_occupations,
    respectively. The labels for the segment are specified in band_segm_labels.
    '''

    m_def = Section(
        aliases=['section_k_band_segment_normalized'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_k_band_segment_normalized'))

    band_energies_normalized = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_spin_channels', 'number_of_normalized_k_points_per_segment', 'number_of_normalized_band_segment_eigenvalues'],
        unit='joule',
        description='''
        $k$-dependent energies of the electronic band segment (electronic band structure)
        with respect to the top of the valence band. This is a third-order tensor, with
        one dimension used for the spin channels, one for the $k$ points for each segment,
        and one for the eigenvalue sequence.
        ''',
        a_legacy=LegacyDefinition(name='band_energies_normalized'))

    band_k_points_normalized = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_normalized_k_points_per_segment', 3],
        description='''
        Fractional coordinates of the $k$ points (in the basis of the reciprocal-lattice
        vectors) for which the normalized electronic energies are given.
        ''',
        a_legacy=LegacyDefinition(name='band_k_points_normalized'))

    band_occupations_normalized = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_spin_channels', 'number_of_normalized_k_points_per_segment', 'number_of_normalized_band_segment_eigenvalues'],
        description='''
        Occupation of the $k$-points along the normalized electronic band. The size of the
        dimensions of this third-order tensor are the same as for the tensor in
        band_energies.
        ''',
        a_legacy=LegacyDefinition(name='band_occupations_normalized'))

    band_segm_labels_normalized = Quantity(
        type=str,
        shape=[2],
        description='''
        Start and end labels of the points in the segment (one-dimensional pathways)
        sampled in the $k$-space, using the conventional symbols, e.g., Gamma, K, L. The
        coordinates (fractional, in the reciprocal space) of the start and end points for
        each segment are given in band_segm_start_end_normalized
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='band_segm_labels_normalized'))

    band_segm_start_end_normalized = Quantity(
        type=np.dtype(np.float64),
        shape=[2, 3],
        description='''
        Fractional coordinates of the start and end point (in the basis of the reciprocal
        lattice vectors) of the segment sampled in the $k$ space. The conventional symbols
        (e.g., Gamma, K, L) of the same points are given in band_segm_labels
        ''',
        a_legacy=LegacyDefinition(name='band_segm_start_end_normalized'))

    number_of_normalized_k_points_per_segment = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of $k$ points in the segment of the normalized band structure
        (see section_k_band_segment_normalized).
        ''',
        categories=[Unused],
        a_legacy=LegacyDefinition(name='number_of_normalized_k_points_per_segment'))


class KBandSegment(MSection):
    '''
    Section collecting the information on a $k$-band or $q$-band segment. This section
    stores band structures along a one-dimensional pathway in the $k$ or $q$ (reciprocal)
    space.

    Eigenvalues calculated at the actual $k$-mesh used for energy_total evaluations are
    defined in section_eigenvalues and the band structures are represented as third-order
    tensors: one dimension for the spin channels, one for the sequence of $k$ or $q$
    points for the segment (given in number_of_k_points_per_segment), and one for the
    sequence of eigenvalues at a given $k$ or $q$ point. The values of the $k$ or $q$
    points in each segment are stored in band_k_points. The energies and occupation for
    each eigenstate, at each $k$ or $q$ point, segment, and spin channel are stored in
    band_energies and band_occupations, respectively. The labels for the segment are
    specified in band_segm_labels.
    '''

    m_def = Section(
        aliases=['section_k_band_segment'],
        validate=False,
        a_legacy=LegacyDefinition(name='section_k_band_segment'))

    band_energies = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_spin_channels', 'number_of_k_points_per_segment', 'number_of_band_segment_eigenvalues'],
        unit='joule',
        description='''
        $k$-dependent or $q$-dependent  energies of the electronic or vibrational band
        segment (electronic/vibrational band structure). This is a third-order tensor,
        with one dimension used for the spin channels (1 in case of a vibrational band
        structure), one for the $k$ or $q$ points for each segment, and one for the
        eigenvalue sequence.
        ''',
        a_legacy=LegacyDefinition(name='band_energies'))

    band_k_points = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_k_points_per_segment', 3],
        description='''
        Fractional coordinates of the $k$ or $q$ points (in the basis of the reciprocal-
        lattice vectors) for which the electronic energy are given.
        ''',
        a_legacy=LegacyDefinition(name='band_k_points'))

    band_occupations = Quantity(
        type=np.dtype(np.float64),
        shape=['number_of_spin_channels', 'number_of_k_points_per_segment', 'number_of_band_segment_eigenvalues'],
        description='''
        Occupation of the $k$-points along the electronic band. The size of the dimensions
        of this third-order tensor are the same as for the tensor in band_energies.
        ''',
        a_legacy=LegacyDefinition(name='band_occupations'))

    band_segm_labels = Quantity(
        type=str,
        shape=[2],
        description='''
        Start and end labels of the points in the segment (one-dimensional pathways)
        sampled in the $k$-space or $q$-space, using the conventional symbols, e.g.,
        Gamma, K, L. The coordinates (fractional, in the reciprocal space) of the start
        and end points for each segment are given in band_segm_start_end
        ''',
        a_legacy=LegacyDefinition(name='band_segm_labels'))

    band_segm_start_end = Quantity(
        type=np.dtype(np.float64),
        shape=[2, 3],
        description='''
        Fractional coordinates of the start and end point (in the basis of the reciprocal
        lattice vectors) of the segment sampled in the $k$ space. The conventional symbols
        (e.g., Gamma, K, L) of the same points are given in band_segm_labels
        ''',
        a_legacy=LegacyDefinition(name='band_segm_start_end'))

    number_of_k_points_per_segment = Quantity(
        type=int,
        shape=[],
        description='''
        Gives the number of $k$ points in the segment of the band structure, see
        section_k_band_segment.
        ''',
        a_legacy=LegacyDefinition(name='number_of_k_points_per_segment'))


class BandGap(MSection):
    '''
    This section stores information for a band gap within a band structure.
    '''

    m_def = Section(
        aliases=[