19
19
import numpy as np
20
20
21
21
from nomad .metainfo import Quantity , Section , Context , SubSection , MEnum
22
+ from nomad .datamodel .data import ArchiveSection
22
23
23
24
from nomad_simulations .physical_property import PhysicalProperty
24
25
26
+
25
27
class FermiLevel (PhysicalProperty ):
26
28
"""
27
29
Energy required to add or extract a charge from a material at zero temperature. It can be also defined as the chemical potential at zero temperature.
@@ -82,6 +84,7 @@ def normalize(self, archive, logger) -> None:
82
84
# List of classical energy contribuions
83
85
####################################################
84
86
87
+
85
88
class PotentialEnergy (PhysicalProperty ):
86
89
"""
87
90
Section containing the potential energy of a (sub)system.
@@ -98,6 +101,7 @@ class PotentialEnergy(PhysicalProperty):
98
101
def normalize (self , archive , logger ) -> None :
99
102
super ().normalize (archive , logger )
100
103
104
+
101
105
class KineticEnergy (PhysicalProperty ):
102
106
"""
103
107
Section containing the kinetic energy of a (sub)system.
@@ -152,6 +156,7 @@ class VDWEnergy(PhysicalProperty):
152
156
def normalize (self , archive , logger ) -> None :
153
157
super ().normalize (archive , logger )
154
158
159
+
155
160
class ElectrostaticEnergy (PhysicalProperty ):
156
161
"""
157
162
Section containing all electrostatic contributions to the potential energy of a (sub)system.
@@ -168,6 +173,7 @@ class ElectrostaticEnergy(PhysicalProperty):
168
173
def normalize (self , archive , logger ) -> None :
169
174
super ().normalize (archive , logger )
170
175
176
+
171
177
class ElectrostaticShortRangeEnergy (PhysicalProperty ):
172
178
"""
173
179
Section containing short-range electrostatic contributions to the potential energy of a (sub)system.
@@ -184,6 +190,7 @@ class ElectrostaticShortRangeEnergy(PhysicalProperty):
184
190
def normalize (self , archive , logger ) -> None :
185
191
super ().normalize (archive , logger )
186
192
193
+
187
194
class ElectrostaticLongRangeEnergy (PhysicalProperty ):
188
195
"""
189
196
Section containing long-range electrostatic contributions to the potential energy of a (sub)system.
@@ -200,6 +207,7 @@ class ElectrostaticLongRangeEnergy(PhysicalProperty):
200
207
def normalize (self , archive , logger ) -> None :
201
208
super ().normalize (archive , logger )
202
209
210
+
203
211
class BondedEnergy (PhysicalProperty ):
204
212
"""
205
213
Section containing all bonded (i.e., intramolecular) contributions to the potential energy of a (sub)system.
@@ -216,6 +224,7 @@ class BondedEnergy(PhysicalProperty):
216
224
def normalize (self , archive , logger ) -> None :
217
225
super ().normalize (archive , logger )
218
226
227
+
219
228
class BondEnergy (PhysicalProperty ):
220
229
"""
221
230
Section containing contributions to the potential energy from bond interactions of a (sub)system.
@@ -232,6 +241,7 @@ class BondEnergy(PhysicalProperty):
232
241
def normalize (self , archive , logger ) -> None :
233
242
super ().normalize (archive , logger )
234
243
244
+
235
245
class AngleEnergy (PhysicalProperty ):
236
246
"""
237
247
Section containing contributions to the potential energy from angle interactions of a (sub)system.
@@ -248,6 +258,7 @@ class AngleEnergy(PhysicalProperty):
248
258
def normalize (self , archive , logger ) -> None :
249
259
super ().normalize (archive , logger )
250
260
261
+
251
262
class DihedralEnergy (PhysicalProperty ):
252
263
"""
253
264
Section containing contributions to the potential energy from dihedral interactions of a (sub)system.
@@ -264,6 +275,7 @@ class DihedralEnergy(PhysicalProperty):
264
275
def normalize (self , archive , logger ) -> None :
265
276
super ().normalize (archive , logger )
266
277
278
+
267
279
class ImproperDihedralEnergy (PhysicalProperty ):
268
280
"""
269
281
Section containing contributions to the potential energy from improper dihedral interactions of a (sub)system.
@@ -280,6 +292,7 @@ class ImproperDihedralEnergy(PhysicalProperty):
280
292
def normalize (self , archive , logger ) -> None :
281
293
super ().normalize (archive , logger )
282
294
295
+
283
296
class ExternalEnergy (PhysicalProperty ):
284
297
"""
285
298
Section containing contributions to the potential energy from external interactions of a (sub)system.
@@ -296,6 +309,7 @@ class ExternalEnergy(PhysicalProperty):
296
309
def normalize (self , archive , logger ) -> None :
297
310
super ().normalize (archive , logger )
298
311
312
+
299
313
class ClassicalEnergyContributions (ArchiveSection ):
300
314
"""
301
315
Section containing contributions to the potential energy from a classical force field.
@@ -309,9 +323,13 @@ class ClassicalEnergyContributions(ArchiveSection):
309
323
310
324
electrostatic = SubSection (sub_section = ElectrostaticEnergy .m_def , repeats = False )
311
325
312
- electrostatic_short_range = SubSection (sub_section = ElectrostaticShortRangeEnergy .m_def , repeats = False )
326
+ electrostatic_short_range = SubSection (
327
+ sub_section = ElectrostaticShortRangeEnergy .m_def , repeats = False
328
+ )
313
329
314
- electrostatic_long_range = SubSection (sub_section = ElectrostaticLongRangeEnergy .m_def , repeats = False )
330
+ electrostatic_long_range = SubSection (
331
+ sub_section = ElectrostaticLongRangeEnergy .m_def , repeats = False
332
+ )
315
333
316
334
bonded = SubSection (sub_section = BondedEnergy .m_def , repeats = False )
317
335
@@ -321,7 +339,9 @@ class ClassicalEnergyContributions(ArchiveSection):
321
339
322
340
dihedral = SubSection (sub_section = DihedralEnergy .m_def , repeats = False )
323
341
324
- improper_dihedral = SubSection (sub_section = ImproperDihedralEnergy .m_def , repeats = False )
342
+ improper_dihedral = SubSection (
343
+ sub_section = ImproperDihedralEnergy .m_def , repeats = False
344
+ )
325
345
326
346
external = SubSection (sub_section = ExternalEnergy .m_def , repeats = False )
327
347
@@ -330,10 +350,12 @@ def normalize(self, archive, logger) -> None:
330
350
# Set the name of the section
331
351
self .name = self .m_def .name
332
352
353
+
333
354
######################################
334
355
# List of quantum energy contributions
335
356
######################################
336
357
358
+
337
359
class ElectronicEnergy (PhysicalProperty ):
338
360
"""
339
361
Section containing the electronic energy of a (sub)system.
@@ -347,12 +369,11 @@ class ElectronicEnergy(PhysicalProperty):
347
369
""" ,
348
370
)
349
371
350
- contributions = SubSection (sub_section = EnergyContributions .m_def , repeats = True )
351
-
352
372
def normalize (self , archive , logger ) -> None :
353
373
super ().normalize (archive , logger )
354
374
allowed_contributions = ['PotKin' ]
355
375
376
+
356
377
class ElectronicKineticEnergy (PhysicalProperty ):
357
378
"""
358
379
Section containing the electronic kinetic energy of a (sub)system.
@@ -369,11 +390,13 @@ class ElectronicKineticEnergy(PhysicalProperty):
369
390
def normalize (self , archive , logger ) -> None :
370
391
super ().normalize (archive , logger )
371
392
393
+
372
394
class XCEnergy (PhysicalProperty ):
373
395
"""
374
396
Section containing the exchange-correlation (XC) energy of a (sub)system,
375
397
calculated using the functional stored in XC_functional.
376
398
"""
399
+
377
400
# ! Someone check this description!
378
401
# ? Do we really want to specify the method here? This can't be user-defined?
379
402
@@ -388,6 +411,7 @@ class XCEnergy(PhysicalProperty):
388
411
def normalize (self , archive , logger ) -> None :
389
412
super ().normalize (archive , logger )
390
413
414
+
391
415
class XCPotentialEnergy (PhysicalProperty ):
392
416
"""
393
417
Section containing the potential energy contribution to the exchange-correlation (XC) energy,
@@ -396,6 +420,7 @@ class XCPotentialEnergy(PhysicalProperty):
396
420
of XC that is in the sum of the eigenvalues. Value associated with the
397
421
configuration, should be the most converged value. |
398
422
"""
423
+
399
424
# ! Someone check this description!
400
425
# ? Do we really want to specify the method here? This can't be user-defined?
401
426
@@ -410,12 +435,14 @@ class XCPotentialEnergy(PhysicalProperty):
410
435
def normalize (self , archive , logger ) -> None :
411
436
super ().normalize (archive , logger )
412
437
438
+
413
439
# ? XCCorrelationEnergy?
414
440
class CorrelationEnergy (PhysicalProperty ):
415
441
"""
416
442
Section containing the correlation energy of a (sub)system,
417
443
calculated using the method described in XC_functional.
418
444
"""
445
+
419
446
# ! Someone check this description!
420
447
# ? Do we really want to specify the method here? This can't be user-defined?
421
448
@@ -430,12 +457,14 @@ class CorrelationEnergy(PhysicalProperty):
430
457
def normalize (self , archive , logger ) -> None :
431
458
super ().normalize (archive , logger )
432
459
460
+
433
461
# ? XCExchangeEnergy?
434
462
class ExchangeEnergy (PhysicalProperty ):
435
463
"""
436
464
Section containing the exchange energy of a (sub)system,
437
465
calculated using the method described in XC_functional.
438
466
"""
467
+
439
468
# ! Someone check this description!
440
469
# ? Do we really want to specify the method here? This can't be user-defined?
441
470
@@ -468,11 +497,13 @@ class ZeroTemperatureEnergy(PhysicalProperty):
468
497
def normalize (self , archive , logger ) -> None :
469
498
super ().normalize (archive , logger )
470
499
500
+
471
501
class ZeroPointEnergy (PhysicalProperty ):
472
502
"""
473
503
Section containing the zero-point vibrational energy of a (sub)system,
474
504
calculated using the method described in zero_point_method.
475
505
"""
506
+
476
507
# ! Someone check this description!
477
508
# ? Do we really want to specify the method here? This can't be user-defined?
478
509
@@ -487,6 +518,7 @@ class ZeroPointEnergy(PhysicalProperty):
487
518
def normalize (self , archive , logger ) -> None :
488
519
super ().normalize (archive , logger )
489
520
521
+
490
522
class ElectrostaticEnergy (PhysicalProperty ):
491
523
"""
492
524
Section containing the electrostatic energy (nuclei + electrons) of a (sub)system.
@@ -503,6 +535,7 @@ class ElectrostaticEnergy(PhysicalProperty):
503
535
def normalize (self , archive , logger ) -> None :
504
536
super ().normalize (archive , logger )
505
537
538
+
506
539
class NuclearRepulsionEnergy (PhysicalProperty ):
507
540
"""
508
541
Section containing the nuclear-nuclear repulsion energy of a (sub)system.
@@ -524,11 +557,14 @@ class QuantumEnergyContributions(ArchiveSection):
524
557
"""
525
558
Section containing contributions to the potential energy from a DFT calculation.
526
559
"""
527
- ...
560
+
561
+ ...
528
562
529
563
electronic = SubSection (sub_section = ElectronicEnergy .m_def , repeats = False )
530
564
531
- electronic_kinetic = SubSection (sub_section = ElectronicKineticEnergy .m_def , repeats = False )
565
+ electronic_kinetic = SubSection (
566
+ sub_section = ElectronicKineticEnergy .m_def , repeats = False
567
+ )
532
568
533
569
xc = SubSection (sub_section = XCEnergy .m_def , repeats = False )
534
570
@@ -538,18 +574,24 @@ class QuantumEnergyContributions(ArchiveSection):
538
574
539
575
exchange = SubSection (sub_section = ExchangeEnergy .m_def , repeats = False )
540
576
541
- zero_temperature = SubSection (sub_section = ZeroTemperatureEnergy .m_def , repeats = False )
577
+ zero_temperature = SubSection (
578
+ sub_section = ZeroTemperatureEnergy .m_def , repeats = False
579
+ )
542
580
543
581
zero_point = SubSection (sub_section = ZeroPointEnergy .m_def , repeats = False )
544
582
545
583
electrostatic = SubSection (sub_section = ElectrostaticEnergy .m_def , repeats = False )
546
584
547
- nuclear_repulsion = SubSection (sub_section = NuclearRepulsionEnergy .m_def , repeats = False )
585
+ nuclear_repulsion = SubSection (
586
+ sub_section = NuclearRepulsionEnergy .m_def , repeats = False
587
+ )
588
+
548
589
549
590
##########################
550
591
# Other / General energies
551
592
##########################
552
593
594
+
553
595
class TotalEnergy (PhysicalProperty ):
554
596
"""
555
597
Section containing the total energy of a (sub)system.
@@ -564,12 +606,17 @@ class TotalEnergy(PhysicalProperty):
564
606
)
565
607
# ? Do we need these descriptions under value? It ends up simply duplicating the section info to some extent.
566
608
567
- classical_contributions = SubSection (sub_section = ClassicalEnergyContributions .m_def , repeats = False )
609
+ classical_contributions = SubSection (
610
+ sub_section = ClassicalEnergyContributions .m_def , repeats = False
611
+ )
568
612
569
- quantum_contributions = SubSection (sub_section = QuantumEnergyContributions .m_def , repeats = False )
613
+ quantum_contributions = SubSection (
614
+ sub_section = QuantumEnergyContributions .m_def , repeats = False
615
+ )
570
616
571
617
def normalize (self , archive , logger ) -> None :
572
618
super ().normalize (archive , logger )
619
+ #? Should we set total energy value as sum of all contributions if not set explicitly?
573
620
574
621
# madelung = SubSection(
575
622
# sub_section=EnergyEntry.m_def,
@@ -709,7 +756,6 @@ def normalize(self, archive, logger) -> None:
709
756
# """,
710
757
# )
711
758
712
-
713
759
# # TODO this should be removed and replaced by correction in EnergyEntry
714
760
# current = SubSection(
715
761
# sub_section=EnergyEntry.m_def,
@@ -723,8 +769,6 @@ def normalize(self, archive, logger) -> None:
723
769
# )
724
770
725
771
726
-
727
-
728
772
# # ? Do we want to allow this?
729
773
# class EnergyCustom(PhysicalProperty):
730
774
# """
0 commit comments