Skip to content

Commit c9d128f

Browse files
authored
feat: add orbital mapping constants for ABACUS, DeePTB, and OPENMX (#25)
* feat: add orbital mapping constants for ABACUS, DeePTB, and OPENMX Add orbital number mappings and transformation matrices for ABACUS, DeePTB, and OPENMX DFT codes. These constants define the magnetic quantum number ordering and provide conversion matrices between different code conventions, enabling proper orbital basis transformations. * refactor: rename OPENMX2DeePTB to OPENMX2DFTIO for consistency Updated variable name in constants.py to align with the project's naming convention and reflect the transition from DeePTB to DFTIO. This change improves code clarity and maintains consistency across the codebase.
1 parent 75c66b5 commit c9d128f

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

dftio/constants.py

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,24 @@
1212
norb_dict = {'s':1,'e':2,'p':3,'q':4,'d':5,'j':6,'f':7,'o':8,'g':9,'h':11, "i":15, "k":21, "l": 25, "m": 35}
1313
norb_dict_r = {1:'s', 2:'e', 3:'p', 4:'q', 5:'d', 6:'j', 7:'f', 8:'o', 9:'g', 11:'h', 15:"i", 21:"k", 25:"l", 35:"m"}
1414

15+
ABACUS_orbital_number_m = {
16+
"s": [0],
17+
"p": [0, 1, -1],
18+
"d": [0, 1, -1, 2, -2],
19+
"f": [0, 1, -1, 2, -2, 3, -3],
20+
"g": [0, 1, -1, 2, -2, 3, -3, 4, -4],
21+
"h": [0, 1, -1, 2, -2, 3, -3, 4, -4, 5, -5]
22+
}
23+
24+
DeePTB_orbital_number_m = {
25+
"s": [0],
26+
"p": [-1, 0, 1],
27+
"d": [-2, -1, 0, 1, 2],
28+
"f": [-3, -2, -1, 0, 1, 2, 3],
29+
"g": [-4, -3, -2, -1, 0, 1, 2, 3, 4],
30+
"h": [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5]
31+
}
32+
1533
ABACUS2DFTIO = {
1634
0: np.eye(1, dtype=np.float32),
1735
1: np.eye(3, dtype=np.float32)[[2, 0, 1]],
@@ -57,4 +75,18 @@
5775
SIESTA2DFTIO[2][[1, 3]] *= -1
5876
SIESTA2DFTIO[3][[0, 6, 2, 4]] *= -1
5977
SIESTA2DFTIO[4][[1, 7, 3, 5]] *= -1
60-
SIESTA2DFTIO[5][[0, 10, 8, 2, 6, 4]] *= -1
78+
SIESTA2DFTIO[5][[0, 10, 8, 2, 6, 4]] *= -1
79+
80+
OPENMX_orbital_number_m = {
81+
"s": [0],
82+
"p": [1, -1, 0],
83+
"d": [0, 2, -2, 1, -1],
84+
"f": [0, 1, -1, 2, -2, 3, -3]
85+
}
86+
87+
OPENMX2DFTIO = {
88+
0: np.eye(1, dtype=np.float32),
89+
1: np.eye(3, dtype=np.float32)[[1, 2, 0]],
90+
2: np.eye(5, dtype=np.float32)[[2, 4, 0, 3, 1]],
91+
3: np.eye(7, dtype=np.float32)[[6, 4, 2, 0, 1, 3, 5]]
92+
}

0 commit comments

Comments
 (0)