Skip to content

Commit 3a07d16

Browse files
committed
update unit treatment, verify against old test archives, add test fixtures
1 parent c6648c5 commit 3a07d16

38 files changed

+10722
-49
lines changed

src/nomad_simulation_parsers/parsers/exciting/parser.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,18 @@
4949
'x_exciting_effective_potential_convergence': {
5050
'class': PotentialConvergenceTarget,
5151
'threshold_type': 'rms',
52-
'unit': 'joule',
5352
},
5453
'x_exciting_energy_convergence': {
5554
'class': EnergyConvergenceTarget,
5655
'threshold_type': 'absolute',
57-
'unit': 'joule',
5856
},
5957
'x_exciting_charge_convergence': {
6058
'class': ChargeConvergenceTarget,
6159
'threshold_type': 'absolute',
62-
'unit': None, # dimensionless
6360
},
6461
'x_exciting_IBS_force_convergence': {
6562
'class': ForceConvergenceTarget,
6663
'threshold_type': 'absolute',
67-
'unit': 'newton',
6864
},
6965
}
7066

@@ -208,13 +204,9 @@ def get_single_point_convergence(self, source: dict[str, Any]) -> list:
208204
quantity = last_iteration.get(key_, None)
209205
if quantity is None:
210206
continue
211-
# Extract threshold value and convert to appropriate unit
212-
unit = info_['unit']
213-
threshold_value = (
214-
quantity[1].to(unit).magnitude if unit else quantity[1].magnitude
215-
)
207+
# Keep pint quantity; metainfo handles conversion based on target Quantity units.
208+
threshold_value = quantity[1]
216209

217-
# Instantiate the appropriate convergence target class
218210
target = info_['class'](
219211
threshold=threshold_value,
220212
threshold_type=info_['threshold_type'],
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
Distance between is = 1 (C), ia = 1 and
3+
is = 1 (C), ia = 1 : 0.000000000
4+
is = 1 (C), ia = 2 : 2.913049651
5+
6+
Distance between is = 1 (C), ia = 2 and
7+
is = 1 (C), ia = 1 : 2.913049651
8+
is = 1 (C), ia = 2 : 0.000000000
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<spdb xsi:noNamespaceSchemaLocation="../../xml/species.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
3+
<sp chemicalSymbol="C" name="carbon" z="-6.00000" mass="21894.16673">
4+
<muffinTin rmin="0.100000E-04" radius="1.4500" rinf="21.0932" radialmeshPoints="250"/>
5+
<atomicState n="1" l="0" kappa="1" occ="2.00000" core="true"/>
6+
<atomicState n="2" l="0" kappa="1" occ="2.00000" core="false"/>
7+
<atomicState n="2" l="1" kappa="1" occ="1.00000" core="false"/>
8+
<atomicState n="2" l="1" kappa="2" occ="1.00000" core="false"/>
9+
<basis>
10+
<default type="lapw" trialEnergy="0.1500" searchE="false"/>
11+
<custom l="0" type="apw+lo" trialEnergy="0.1500" searchE="true"/>
12+
<custom l="1" type="apw+lo" trialEnergy="0.1500" searchE="true"/>
13+
</basis>
14+
</sp>
15+
</spdb>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- This file was automatically generated.
3+
Linearization energies with searchE=true have been replaced by energies
4+
found using findlinentype='Wigner_Seitz' method.
5+
If a principal quantum number was given, linearization energies have been
6+
set to energies found using the Wigner-Seitz algorithm in the first scf iteration.-->
7+
<spdb xsi:noNamespaceSchemaLocation="../../xml/species.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
8+
<sp chemicalSymbol="C" name="carbon" z="-6.00000" mass="21894.16673">
9+
<muffinTin rmin="0.100000E-04" radius="1.4500" rinf="21.0932" radialmeshPoints="250"/>
10+
<atomicState n="1" l="0" kappa="1" occ="2.00000" core="true"/>
11+
<atomicState n="2" l="0" kappa="1" occ="2.00000" core="false"/>
12+
<atomicState n="2" l="1" kappa="1" occ="1.00000" core="false"/>
13+
<atomicState n="2" l="1" kappa="2" occ="1.00000" core="false"/>
14+
<basis>
15+
<default type="lapw" trialEnergy="0.1500" searchE="false"/>
16+
<custom type="apw" l="0" trialEnergy="0.1500" searchE="false"/>
17+
<custom type="apw" l="1" trialEnergy="0.3125" searchE="false"/>
18+
<custom type="lapw" l="2" trialEnergy="0.1500" searchE="false"/>
19+
<custom type="lapw" l="3" trialEnergy="0.1500" searchE="false"/>
20+
<custom type="lapw" l="4" trialEnergy="0.1500" searchE="false"/>
21+
<custom type="lapw" l="5" trialEnergy="0.1500" searchE="false"/>
22+
<custom type="lapw" l="6" trialEnergy="0.1500" searchE="false"/>
23+
<custom type="lapw" l="7" trialEnergy="0.1500" searchE="false"/>
24+
<custom type="lapw" l="8" trialEnergy="0.1500" searchE="false"/>
25+
<lo l="0">
26+
<wf matchingOrder="0" trialEnergy="0.1500" searchE="false"/>
27+
<wf matchingOrder="1" trialEnergy="0.1500" searchE="false"/>
28+
</lo>
29+
<lo l="1">
30+
<wf matchingOrder="0" trialEnergy="0.3125" searchE="false"/>
31+
<wf matchingOrder="1" trialEnergy="0.3125" searchE="false"/>
32+
</lo>
33+
</basis>
34+
</sp>
35+
</spdb>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.5087817042
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
8 : nkpt
2+
10 : nstsv
3+
4+
1 0.000000000 0.000000000 0.000000000 : k-point, vkl
5+
(state, eigenvalue and occupancy below)
6+
1 -0.3652303541 2.000000000
7+
2 0.4288651422 2.000000000
8+
3 0.4288671870 2.000000000
9+
4 0.4288671870 2.000000000
10+
5 0.6328468691 0.000000000
11+
6 0.6328485236 0.000000000
12+
7 0.6328485236 0.000000000
13+
8 0.9250664263 0.000000000
14+
9 1.128197512 0.000000000
15+
10 1.402770649 0.000000000
16+
17+
18+
2 0.2500000000 0.000000000 0.000000000 : k-point, vkl
19+
(state, eigenvalue and occupancy below)
20+
1 -0.3017662274 2.000000000
21+
2 0.1841819549 2.000000000
22+
3 0.3638303792 2.000000000
23+
4 0.3638322409 2.000000000
24+
5 0.7140503692 0.000000000
25+
6 0.7140524064 0.000000000
26+
7 0.7287158604 0.000000000
27+
8 0.9680942499 0.000000000
28+
9 1.182244465 0.000000000
29+
10 1.246081171 0.000000000
30+
31+
32+
3 0.5000000000 0.000000000 0.000000000 : k-point, vkl
33+
(state, eigenvalue and occupancy below)
34+
1 -0.1497185148 2.000000000
35+
2 -0.6871213661E-01 2.000000000
36+
3 0.3248925341 2.000000000
37+
4 0.3248941941 2.000000000
38+
5 0.7375309846 0.000000000
39+
6 0.7375327368 0.000000000
40+
7 0.7562124037 0.000000000
41+
8 1.000142603 0.000000000
42+
9 1.228434616 0.000000000
43+
10 1.316183240 0.000000000
44+
45+
46+
4 0.2500000000 0.2500000000 0.000000000 : k-point, vkl
47+
(state, eigenvalue and occupancy below)
48+
1 -0.2807169897 2.000000000
49+
2 0.2630978693 2.000000000
50+
3 0.2751887854 2.000000000
51+
4 0.2751900286 2.000000000
52+
5 0.5886962213 0.000000000
53+
6 0.8003970010 0.000000000
54+
7 0.8555909698 0.000000000
55+
8 0.8555926852 0.000000000
56+
9 1.170304205 0.000000000
57+
10 1.238174191 0.000000000
58+
59+
60+
5 0.5000000000 0.2500000000 0.000000000 : k-point, vkl
61+
(state, eigenvalue and occupancy below)
62+
1 -0.1418898330 2.000000000
63+
2 0.2930369925E-01 2.000000000
64+
3 0.1783591410 2.000000000
65+
4 0.2473377526 2.000000000
66+
5 0.6475075476 0.000000000
67+
6 0.8457699795 0.000000000
68+
7 0.9001488302 0.000000000
69+
8 0.9203745444 0.000000000
70+
9 1.172357364 0.000000000
71+
10 1.297095125 0.000000000
72+
73+
74+
6 0.7500000000 0.2500000000 0.000000000 : k-point, vkl
75+
(state, eigenvalue and occupancy below)
76+
1 -0.1997138689 2.000000000
77+
2 0.1073952352 2.000000000
78+
3 0.1451374331 2.000000000
79+
4 0.3168359408 2.000000000
80+
5 0.7171252673 0.000000000
81+
6 0.7964166202 0.000000000
82+
7 0.8829995453 0.000000000
83+
8 0.9414062092 0.000000000
84+
9 1.145133404 0.000000000
85+
10 1.184988269 0.000000000
86+
87+
88+
7 0.5000000000 0.5000000000 0.000000000 : k-point, vkl
89+
(state, eigenvalue and occupancy below)
90+
1 -0.4250126180E-01 2.000000000
91+
2 -0.4250112791E-01 2.000000000
92+
3 0.1944557416 2.000000000
93+
4 0.1944568917 2.000000000
94+
5 0.5977542762 0.000000000
95+
6 0.5977549283 0.000000000
96+
7 1.049893157 0.000000000
97+
8 1.049895489 0.000000000
98+
9 1.283047366 0.000000000
99+
10 1.283047901 0.000000000
100+
101+
102+
8 0.7500000000 0.5000000000 0.2500000000 : k-point, vkl
103+
(state, eigenvalue and occupancy below)
104+
1 -0.1198761314E-01 2.000000000
105+
2 -0.1198742709E-01 2.000000000
106+
3 0.1174508490 2.000000000
107+
4 0.1174515484 2.000000000
108+
5 0.8138579496 0.000000000
109+
6 0.8138582050 0.000000000
110+
7 0.8838336133 0.000000000
111+
8 0.8838344149 0.000000000
112+
9 1.212360974 0.000000000
113+
10 1.212362468 0.000000000
114+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
Species : 1 (C)
3+
atom 1 is equivalent to atom(s)
4+
1 2
5+
atom 2 is equivalent to atom(s)
6+
1 2
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
Species : 1 (C), atom : 1
3+
n = 1, l = 0, k = 1 : -9.287891198
4+
5+
Species : 1 (C), atom : 2
6+
n = 1, l = 0, k = 1 : -9.287891198
896 Bytes
Binary file not shown.
864 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)