Skip to content

Commit 2cc5d11

Browse files
committed
Use fixed number of digits for kpoints
Otherwise, the kpoints coordinates can be 0.49999 instead of 0.5
1 parent aa8f6d0 commit 2cc5d11

File tree

13 files changed

+116
-161
lines changed

13 files changed

+116
-161
lines changed

src/aiida_wannier90/io/_write_win.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,12 @@ def _format_kpoint_path(kpoint_path):
330330
for point1, point2 in path:
331331
coord1 = point_coords[point1]
332332
coord2 = point_coords[point2]
333-
path_line = f"{point1} {coord1[0]} {coord1[1]} {coord1[2]} "
334-
path_line += f" {point2} {coord2[0]} {coord2[1]} {coord2[2]}"
333+
path_line = (
334+
f"{point1} {coord1[0]:14.10f} {coord1[1]:14.10f} {coord1[2]:14.10f} "
335+
)
336+
path_line += (
337+
f" {point2} {coord2[0]:14.10f} {coord2[1]:14.10f} {coord2[2]:14.10f}"
338+
)
335339
res.append(path_line)
336340
return res
337341

tests/calculations/test_local_input/test_default_None_.win

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ As -1.4200000000 1.4200000000 1.4200000000
1010
end atoms_cart
1111

1212
begin kpoint_path
13-
G 0.0 0.0 0.0 X 0.5 0.0 0.5
14-
X 0.5 0.0 0.5 W 0.5 0.25 0.75
15-
W 0.5 0.25 0.75 K 0.375 0.375 0.75
16-
K 0.375 0.375 0.75 G 0.0 0.0 0.0
17-
G 0.0 0.0 0.0 L 0.5 0.5 0.5
18-
L 0.5 0.5 0.5 U 0.625 0.25 0.625
19-
U 0.625 0.25 0.625 W 0.5 0.25 0.75
20-
W 0.5 0.25 0.75 L 0.5 0.5 0.5
21-
L 0.5 0.5 0.5 K 0.375 0.375 0.75
22-
U 0.625 0.25 0.625 X 0.5 0.0 0.5
13+
G 0.0000000000 0.0000000000 0.0000000000 X 0.5000000000 0.0000000000 0.5000000000
14+
X 0.5000000000 0.0000000000 0.5000000000 W 0.5000000000 0.2500000000 0.7500000000
15+
W 0.5000000000 0.2500000000 0.7500000000 K 0.3750000000 0.3750000000 0.7500000000
16+
K 0.3750000000 0.3750000000 0.7500000000 G 0.0000000000 0.0000000000 0.0000000000
17+
G 0.0000000000 0.0000000000 0.0000000000 L 0.5000000000 0.5000000000 0.5000000000
18+
L 0.5000000000 0.5000000000 0.5000000000 U 0.6250000000 0.2500000000 0.6250000000
19+
U 0.6250000000 0.2500000000 0.6250000000 W 0.5000000000 0.2500000000 0.7500000000
20+
W 0.5000000000 0.2500000000 0.7500000000 L 0.5000000000 0.5000000000 0.5000000000
21+
L 0.5000000000 0.5000000000 0.5000000000 K 0.3750000000 0.3750000000 0.7500000000
22+
U 0.6250000000 0.2500000000 0.6250000000 X 0.5000000000 0.0000000000 0.5000000000
2323
end kpoint_path
2424

2525
begin kpoints

tests/calculations/test_local_input/test_default_aiida_.win

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ As -1.4200000000 1.4200000000 1.4200000000
1010
end atoms_cart
1111

1212
begin kpoint_path
13-
G 0.0 0.0 0.0 X 0.5 0.0 0.5
14-
X 0.5 0.0 0.5 W 0.5 0.25 0.75
15-
W 0.5 0.25 0.75 K 0.375 0.375 0.75
16-
K 0.375 0.375 0.75 G 0.0 0.0 0.0
17-
G 0.0 0.0 0.0 L 0.5 0.5 0.5
18-
L 0.5 0.5 0.5 U 0.625 0.25 0.625
19-
U 0.625 0.25 0.625 W 0.5 0.25 0.75
20-
W 0.5 0.25 0.75 L 0.5 0.5 0.5
21-
L 0.5 0.5 0.5 K 0.375 0.375 0.75
22-
U 0.625 0.25 0.625 X 0.5 0.0 0.5
13+
G 0.0000000000 0.0000000000 0.0000000000 X 0.5000000000 0.0000000000 0.5000000000
14+
X 0.5000000000 0.0000000000 0.5000000000 W 0.5000000000 0.2500000000 0.7500000000
15+
W 0.5000000000 0.2500000000 0.7500000000 K 0.3750000000 0.3750000000 0.7500000000
16+
K 0.3750000000 0.3750000000 0.7500000000 G 0.0000000000 0.0000000000 0.0000000000
17+
G 0.0000000000 0.0000000000 0.0000000000 L 0.5000000000 0.5000000000 0.5000000000
18+
L 0.5000000000 0.5000000000 0.5000000000 U 0.6250000000 0.2500000000 0.6250000000
19+
U 0.6250000000 0.2500000000 0.6250000000 W 0.5000000000 0.2500000000 0.7500000000
20+
W 0.5000000000 0.2500000000 0.7500000000 L 0.5000000000 0.5000000000 0.5000000000
21+
L 0.5000000000 0.5000000000 0.5000000000 K 0.3750000000 0.3750000000 0.7500000000
22+
U 0.6250000000 0.2500000000 0.6250000000 X 0.5000000000 0.0000000000 0.5000000000
2323
end kpoint_path
2424

2525
begin kpoints

tests/calculations/test_local_input/test_default_plot.win

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ As -1.4200000000 1.4200000000 1.4200000000
1111
end atoms_cart
1212

1313
begin kpoint_path
14-
G 0.0 0.0 0.0 X 0.5 0.0 0.5
15-
X 0.5 0.0 0.5 W 0.5 0.25 0.75
16-
W 0.5 0.25 0.75 K 0.375 0.375 0.75
17-
K 0.375 0.375 0.75 G 0.0 0.0 0.0
18-
G 0.0 0.0 0.0 L 0.5 0.5 0.5
19-
L 0.5 0.5 0.5 U 0.625 0.25 0.625
20-
U 0.625 0.25 0.625 W 0.5 0.25 0.75
21-
W 0.5 0.25 0.75 L 0.5 0.5 0.5
22-
L 0.5 0.5 0.5 K 0.375 0.375 0.75
23-
U 0.625 0.25 0.625 X 0.5 0.0 0.5
14+
G 0.0000000000 0.0000000000 0.0000000000 X 0.5000000000 0.0000000000 0.5000000000
15+
X 0.5000000000 0.0000000000 0.5000000000 W 0.5000000000 0.2500000000 0.7500000000
16+
W 0.5000000000 0.2500000000 0.7500000000 K 0.3750000000 0.3750000000 0.7500000000
17+
K 0.3750000000 0.3750000000 0.7500000000 G 0.0000000000 0.0000000000 0.0000000000
18+
G 0.0000000000 0.0000000000 0.0000000000 L 0.5000000000 0.5000000000 0.5000000000
19+
L 0.5000000000 0.5000000000 0.5000000000 U 0.6250000000 0.2500000000 0.6250000000
20+
U 0.6250000000 0.2500000000 0.6250000000 W 0.5000000000 0.2500000000 0.7500000000
21+
W 0.5000000000 0.2500000000 0.7500000000 L 0.5000000000 0.5000000000 0.5000000000
22+
L 0.5000000000 0.5000000000 0.5000000000 K 0.3750000000 0.3750000000 0.7500000000
23+
U 0.6250000000 0.2500000000 0.6250000000 X 0.5000000000 0.0000000000 0.5000000000
2424
end kpoint_path
2525

2626
begin kpoints

tests/calculations/test_local_input/test_default_remote.win

Lines changed: 0 additions & 49 deletions
This file was deleted.

tests/calculations/test_local_input/test_default_wannier_.win

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ As -1.4200000000 1.4200000000 1.4200000000
1010
end atoms_cart
1111

1212
begin kpoint_path
13-
G 0.0 0.0 0.0 X 0.5 0.0 0.5
14-
X 0.5 0.0 0.5 W 0.5 0.25 0.75
15-
W 0.5 0.25 0.75 K 0.375 0.375 0.75
16-
K 0.375 0.375 0.75 G 0.0 0.0 0.0
17-
G 0.0 0.0 0.0 L 0.5 0.5 0.5
18-
L 0.5 0.5 0.5 U 0.625 0.25 0.625
19-
U 0.625 0.25 0.625 W 0.5 0.25 0.75
20-
W 0.5 0.25 0.75 L 0.5 0.5 0.5
21-
L 0.5 0.5 0.5 K 0.375 0.375 0.75
22-
U 0.625 0.25 0.625 X 0.5 0.0 0.5
13+
G 0.0000000000 0.0000000000 0.0000000000 X 0.5000000000 0.0000000000 0.5000000000
14+
X 0.5000000000 0.0000000000 0.5000000000 W 0.5000000000 0.2500000000 0.7500000000
15+
W 0.5000000000 0.2500000000 0.7500000000 K 0.3750000000 0.3750000000 0.7500000000
16+
K 0.3750000000 0.3750000000 0.7500000000 G 0.0000000000 0.0000000000 0.0000000000
17+
G 0.0000000000 0.0000000000 0.0000000000 L 0.5000000000 0.5000000000 0.5000000000
18+
L 0.5000000000 0.5000000000 0.5000000000 U 0.6250000000 0.2500000000 0.6250000000
19+
U 0.6250000000 0.2500000000 0.6250000000 W 0.5000000000 0.2500000000 0.7500000000
20+
W 0.5000000000 0.2500000000 0.7500000000 L 0.5000000000 0.5000000000 0.5000000000
21+
L 0.5000000000 0.5000000000 0.5000000000 K 0.3750000000 0.3750000000 0.7500000000
22+
U 0.6250000000 0.2500000000 0.6250000000 X 0.5000000000 0.0000000000 0.5000000000
2323
end kpoint_path
2424

2525
begin kpoints

tests/calculations/test_local_input/test_diffusivity.win

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ As -1.4200000000 1.4200000000 1.4200000000
1010
end atoms_cart
1111

1212
begin kpoint_path
13-
G 0.0 0.0 0.0 X 0.5 0.0 0.5
14-
X 0.5 0.0 0.5 W 0.5 0.25 0.75
15-
W 0.5 0.25 0.75 K 0.375 0.375 0.75
16-
K 0.375 0.375 0.75 G 0.0 0.0 0.0
17-
G 0.0 0.0 0.0 L 0.5 0.5 0.5
18-
L 0.5 0.5 0.5 U 0.625 0.25 0.625
19-
U 0.625 0.25 0.625 W 0.5 0.25 0.75
20-
W 0.5 0.25 0.75 L 0.5 0.5 0.5
21-
L 0.5 0.5 0.5 K 0.375 0.375 0.75
22-
U 0.625 0.25 0.625 X 0.5 0.0 0.5
13+
G 0.0000000000 0.0000000000 0.0000000000 X 0.5000000000 0.0000000000 0.5000000000
14+
X 0.5000000000 0.0000000000 0.5000000000 W 0.5000000000 0.2500000000 0.7500000000
15+
W 0.5000000000 0.2500000000 0.7500000000 K 0.3750000000 0.3750000000 0.7500000000
16+
K 0.3750000000 0.3750000000 0.7500000000 G 0.0000000000 0.0000000000 0.0000000000
17+
G 0.0000000000 0.0000000000 0.0000000000 L 0.5000000000 0.5000000000 0.5000000000
18+
L 0.5000000000 0.5000000000 0.5000000000 U 0.6250000000 0.2500000000 0.6250000000
19+
U 0.6250000000 0.2500000000 0.6250000000 W 0.5000000000 0.2500000000 0.7500000000
20+
W 0.5000000000 0.2500000000 0.7500000000 L 0.5000000000 0.5000000000 0.5000000000
21+
L 0.5000000000 0.5000000000 0.5000000000 K 0.3750000000 0.3750000000 0.7500000000
22+
U 0.6250000000 0.2500000000 0.6250000000 X 0.5000000000 0.0000000000 0.5000000000
2323
end kpoint_path
2424

2525
begin kpoints

tests/calculations/test_local_input/test_list_projections.win

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ As -1.4200000000 1.4200000000 1.4200000000
1010
end atoms_cart
1111

1212
begin kpoint_path
13-
G 0.0 0.0 0.0 X 0.5 0.0 0.5
14-
X 0.5 0.0 0.5 W 0.5 0.25 0.75
15-
W 0.5 0.25 0.75 K 0.375 0.375 0.75
16-
K 0.375 0.375 0.75 G 0.0 0.0 0.0
17-
G 0.0 0.0 0.0 L 0.5 0.5 0.5
18-
L 0.5 0.5 0.5 U 0.625 0.25 0.625
19-
U 0.625 0.25 0.625 W 0.5 0.25 0.75
20-
W 0.5 0.25 0.75 L 0.5 0.5 0.5
21-
L 0.5 0.5 0.5 K 0.375 0.375 0.75
22-
U 0.625 0.25 0.625 X 0.5 0.0 0.5
13+
G 0.0000000000 0.0000000000 0.0000000000 X 0.5000000000 0.0000000000 0.5000000000
14+
X 0.5000000000 0.0000000000 0.5000000000 W 0.5000000000 0.2500000000 0.7500000000
15+
W 0.5000000000 0.2500000000 0.7500000000 K 0.3750000000 0.3750000000 0.7500000000
16+
K 0.3750000000 0.3750000000 0.7500000000 G 0.0000000000 0.0000000000 0.0000000000
17+
G 0.0000000000 0.0000000000 0.0000000000 L 0.5000000000 0.5000000000 0.5000000000
18+
L 0.5000000000 0.5000000000 0.5000000000 U 0.6250000000 0.2500000000 0.6250000000
19+
U 0.6250000000 0.2500000000 0.6250000000 W 0.5000000000 0.2500000000 0.7500000000
20+
W 0.5000000000 0.2500000000 0.7500000000 L 0.5000000000 0.5000000000 0.5000000000
21+
L 0.5000000000 0.5000000000 0.5000000000 K 0.3750000000 0.3750000000 0.7500000000
22+
U 0.6250000000 0.2500000000 0.6250000000 X 0.5000000000 0.0000000000 0.5000000000
2323
end kpoint_path
2424

2525
begin kpoints

tests/calculations/test_local_input/test_no_projections.win

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ As -1.4200000000 1.4200000000 1.4200000000
1010
end atoms_cart
1111

1212
begin kpoint_path
13-
G 0.0 0.0 0.0 X 0.5 0.0 0.5
14-
X 0.5 0.0 0.5 W 0.5 0.25 0.75
15-
W 0.5 0.25 0.75 K 0.375 0.375 0.75
16-
K 0.375 0.375 0.75 G 0.0 0.0 0.0
17-
G 0.0 0.0 0.0 L 0.5 0.5 0.5
18-
L 0.5 0.5 0.5 U 0.625 0.25 0.625
19-
U 0.625 0.25 0.625 W 0.5 0.25 0.75
20-
W 0.5 0.25 0.75 L 0.5 0.5 0.5
21-
L 0.5 0.5 0.5 K 0.375 0.375 0.75
22-
U 0.625 0.25 0.625 X 0.5 0.0 0.5
13+
G 0.0000000000 0.0000000000 0.0000000000 X 0.5000000000 0.0000000000 0.5000000000
14+
X 0.5000000000 0.0000000000 0.5000000000 W 0.5000000000 0.2500000000 0.7500000000
15+
W 0.5000000000 0.2500000000 0.7500000000 K 0.3750000000 0.3750000000 0.7500000000
16+
K 0.3750000000 0.3750000000 0.7500000000 G 0.0000000000 0.0000000000 0.0000000000
17+
G 0.0000000000 0.0000000000 0.0000000000 L 0.5000000000 0.5000000000 0.5000000000
18+
L 0.5000000000 0.5000000000 0.5000000000 U 0.6250000000 0.2500000000 0.6250000000
19+
U 0.6250000000 0.2500000000 0.6250000000 W 0.5000000000 0.2500000000 0.7500000000
20+
W 0.5000000000 0.2500000000 0.7500000000 L 0.5000000000 0.5000000000 0.5000000000
21+
L 0.5000000000 0.5000000000 0.5000000000 K 0.3750000000 0.3750000000 0.7500000000
22+
U 0.6250000000 0.2500000000 0.6250000000 X 0.5000000000 0.0000000000 0.5000000000
2323
end kpoint_path
2424

2525
begin kpoints

tests/calculations/test_local_input/test_spin_projections.win

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ As -1.4200000000 1.4200000000 1.4200000000
1111
end atoms_cart
1212

1313
begin kpoint_path
14-
G 0.0 0.0 0.0 X 0.5 0.0 0.5
15-
X 0.5 0.0 0.5 W 0.5 0.25 0.75
16-
W 0.5 0.25 0.75 K 0.375 0.375 0.75
17-
K 0.375 0.375 0.75 G 0.0 0.0 0.0
18-
G 0.0 0.0 0.0 L 0.5 0.5 0.5
19-
L 0.5 0.5 0.5 U 0.625 0.25 0.625
20-
U 0.625 0.25 0.625 W 0.5 0.25 0.75
21-
W 0.5 0.25 0.75 L 0.5 0.5 0.5
22-
L 0.5 0.5 0.5 K 0.375 0.375 0.75
23-
U 0.625 0.25 0.625 X 0.5 0.0 0.5
14+
G 0.0000000000 0.0000000000 0.0000000000 X 0.5000000000 0.0000000000 0.5000000000
15+
X 0.5000000000 0.0000000000 0.5000000000 W 0.5000000000 0.2500000000 0.7500000000
16+
W 0.5000000000 0.2500000000 0.7500000000 K 0.3750000000 0.3750000000 0.7500000000
17+
K 0.3750000000 0.3750000000 0.7500000000 G 0.0000000000 0.0000000000 0.0000000000
18+
G 0.0000000000 0.0000000000 0.0000000000 L 0.5000000000 0.5000000000 0.5000000000
19+
L 0.5000000000 0.5000000000 0.5000000000 U 0.6250000000 0.2500000000 0.6250000000
20+
U 0.6250000000 0.2500000000 0.6250000000 W 0.5000000000 0.2500000000 0.7500000000
21+
W 0.5000000000 0.2500000000 0.7500000000 L 0.5000000000 0.5000000000 0.5000000000
22+
L 0.5000000000 0.5000000000 0.5000000000 K 0.3750000000 0.3750000000 0.7500000000
23+
U 0.6250000000 0.2500000000 0.6250000000 X 0.5000000000 0.0000000000 0.5000000000
2424
end kpoint_path
2525

2626
begin kpoints

0 commit comments

Comments
 (0)