TB2J 0.9.5rc0__py3-none-any.whl → 0.9.6rc0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. TB2J/MAE.py +107 -24
  2. TB2J/anisotropy.py +672 -0
  3. TB2J/contour.py +8 -0
  4. TB2J/exchange.py +43 -103
  5. TB2J/exchangeCL2.py +11 -13
  6. TB2J/exchange_params.py +213 -0
  7. TB2J/green.py +62 -27
  8. TB2J/interfaces/__init__.py +12 -0
  9. TB2J/interfaces/abacus/__init__.py +4 -0
  10. TB2J/{abacus → interfaces/abacus}/abacus_api.py +3 -3
  11. TB2J/{abacus → interfaces/abacus}/abacus_wrapper.py +11 -8
  12. TB2J/{abacus → interfaces/abacus}/gen_exchange_abacus.py +5 -3
  13. TB2J/{abacus → interfaces/abacus}/orbital_api.py +4 -4
  14. TB2J/{abacus → interfaces/abacus}/stru_api.py +11 -11
  15. TB2J/{abacus → interfaces/abacus}/test_read_HRSR.py +0 -1
  16. TB2J/{abacus → interfaces/abacus}/test_read_stru.py +5 -3
  17. TB2J/interfaces/gpaw_interface.py +54 -0
  18. TB2J/interfaces/lawaf_interface.py +129 -0
  19. TB2J/interfaces/manager.py +23 -0
  20. TB2J/interfaces/siesta_interface.py +174 -0
  21. TB2J/interfaces/wannier90_interface.py +115 -0
  22. TB2J/io_exchange/io_exchange.py +21 -7
  23. TB2J/io_merge.py +2 -1
  24. TB2J/mathutils/fermi.py +11 -6
  25. TB2J/mathutils/lowdin.py +12 -2
  26. TB2J/mathutils/rotate_spin.py +222 -4
  27. TB2J/pauli.py +11 -3
  28. TB2J/symmetrize_J.py +120 -0
  29. TB2J/utils.py +82 -1
  30. {TB2J-0.9.5rc0.data → TB2J-0.9.6rc0.data}/scripts/abacus2J.py +5 -4
  31. {TB2J-0.9.5rc0.data → TB2J-0.9.6rc0.data}/scripts/siesta2J.py +21 -4
  32. TB2J-0.9.6rc0.data/scripts/wann2J.py +96 -0
  33. {TB2J-0.9.5rc0.dist-info → TB2J-0.9.6rc0.dist-info}/METADATA +5 -3
  34. {TB2J-0.9.5rc0.dist-info → TB2J-0.9.6rc0.dist-info}/RECORD +46 -46
  35. {TB2J-0.9.5rc0.dist-info → TB2J-0.9.6rc0.dist-info}/WHEEL +1 -1
  36. TB2J-0.9.6rc0.dist-info/entry_points.txt +3 -0
  37. TB2J/abacus/MAE.py +0 -320
  38. TB2J/abacus/__init__.py +0 -1
  39. TB2J/abacus/occupations.py +0 -278
  40. TB2J/cut_cell.py +0 -82
  41. TB2J/io_exchange/io_pickle.py +0 -0
  42. TB2J/manager.py +0 -445
  43. TB2J/mathutils.py +0 -12
  44. TB2J/patch.py +0 -50
  45. TB2J/spinham/h_matrix.py +0 -68
  46. TB2J/spinham/obtain_J.py +0 -79
  47. TB2J/supercell.py +0 -532
  48. TB2J-0.9.5rc0.data/scripts/wann2J.py +0 -194
  49. TB2J/{abacus → interfaces/abacus}/test_density_matrix.py +1 -1
  50. {TB2J-0.9.5rc0.data → TB2J-0.9.6rc0.data}/scripts/TB2J_downfold.py +0 -0
  51. {TB2J-0.9.5rc0.data → TB2J-0.9.6rc0.data}/scripts/TB2J_eigen.py +0 -0
  52. {TB2J-0.9.5rc0.data → TB2J-0.9.6rc0.data}/scripts/TB2J_magnon.py +0 -0
  53. {TB2J-0.9.5rc0.data → TB2J-0.9.6rc0.data}/scripts/TB2J_magnon_dos.py +0 -0
  54. {TB2J-0.9.5rc0.data → TB2J-0.9.6rc0.data}/scripts/TB2J_merge.py +0 -0
  55. {TB2J-0.9.5rc0.data → TB2J-0.9.6rc0.data}/scripts/TB2J_rotate.py +0 -0
  56. {TB2J-0.9.5rc0.data → TB2J-0.9.6rc0.data}/scripts/TB2J_rotateDM.py +0 -0
  57. {TB2J-0.9.5rc0.dist-info → TB2J-0.9.6rc0.dist-info}/LICENSE +0 -0
  58. {TB2J-0.9.5rc0.dist-info → TB2J-0.9.6rc0.dist-info}/top_level.txt +0 -0
@@ -1,194 +0,0 @@
1
- #!python
2
- import argparse
3
- import sys
4
- from TB2J.manager import gen_exchange
5
- from TB2J.versioninfo import print_license
6
-
7
-
8
- def run_wann2J():
9
- print_license()
10
- parser = argparse.ArgumentParser(
11
- description="wann2J: Using magnetic force theorem to calculate exchange parameter J from wannier functions"
12
- )
13
- parser.add_argument(
14
- "--path", help="path to the wannier files", default="./", type=str
15
- )
16
- parser.add_argument(
17
- "--posfile", help="name of the position file", default="POSCAR", type=str
18
- )
19
- parser.add_argument(
20
- "--prefix_spinor",
21
- help="prefix to the spinor wannier files",
22
- default="wannier90",
23
- type=str,
24
- )
25
- parser.add_argument(
26
- "--prefix_up",
27
- help="prefix to the spin up wannier files",
28
- default="wannier90.up",
29
- type=str,
30
- )
31
- parser.add_argument(
32
- "--prefix_down",
33
- help="prefix to the spin down wannier files",
34
- default="wannier90.dn",
35
- type=str,
36
- )
37
- parser.add_argument(
38
- "--elements",
39
- help="elements to be considered in Heisenberg model",
40
- default=None,
41
- type=str,
42
- nargs="*",
43
- )
44
- parser.add_argument(
45
- "--groupby",
46
- help="In the spinor case, the order of the orbitals have two conventions: 1: group by spin (orb1_up, orb2_up,... orb1_down, ...), 2,group by orbital (orb1_up, orb1_down, orb2_up, ...,). Use 'spin' in the former case and 'orbital' in the latter case. The default is spin.",
47
- default="spin",
48
- type=str,
49
- )
50
- parser.add_argument(
51
- "--write_dm",
52
- help="whether to write density matrix",
53
- action="store_true",
54
- default=False,
55
- )
56
-
57
- parser.add_argument(
58
- "--rcut",
59
- help="cutoff of spin pair distance. The default is to calculate all commensurate R point to the k mesh.",
60
- default=None,
61
- type=float,
62
- )
63
- parser.add_argument("--efermi", help="Fermi energy in eV", default=None, type=float)
64
- parser.add_argument(
65
- "--kmesh",
66
- help="kmesh in the format of kx ky kz",
67
- type=int,
68
- nargs="*",
69
- default=[5, 5, 5],
70
- )
71
- parser.add_argument(
72
- "--emin",
73
- help="energy minimum below efermi, default -14 eV",
74
- type=float,
75
- default=-14.0,
76
- )
77
- parser.add_argument(
78
- "--emax",
79
- help="energy maximum above efermi, default 0.0 eV",
80
- type=float,
81
- default=0.0,
82
- )
83
- parser.add_argument(
84
- "--nz",
85
- help="number of steps for semicircle contour, default: 100",
86
- default=100,
87
- type=int,
88
- )
89
- parser.add_argument(
90
- "--cutoff",
91
- help="The minimum of J amplitude to write, (in eV), default is 1e-5 eV",
92
- default=1e-5,
93
- type=float,
94
- )
95
- parser.add_argument(
96
- "--exclude_orbs",
97
- help="the indices of wannier functions to be excluded from magnetic site. counting start from 0",
98
- default=[],
99
- type=int,
100
- nargs="+",
101
- )
102
-
103
- parser.add_argument(
104
- "--np",
105
- help="number of cpu cores to use in parallel, default: 1",
106
- default=1,
107
- type=int,
108
- )
109
-
110
- parser.add_argument(
111
- "--use_cache",
112
- help="whether to use disk file for temporary storing wavefunctions and hamiltonian to reduce memory usage. Default: False",
113
- action="store_true",
114
- default=False,
115
- )
116
-
117
- parser.add_argument(
118
- "--description",
119
- help="add description of the calculatiion to the xml file. Essential information, like the xc functional, U values, magnetic state should be given.",
120
- type=str,
121
- default="Calculated with TB2J.",
122
- )
123
-
124
- parser.add_argument(
125
- "--spinor",
126
- action="store_true",
127
- help="Whether to use spinor wannier function.",
128
- default=False,
129
- )
130
-
131
- parser.add_argument(
132
- "--orb_decomposition",
133
- default=False,
134
- action="store_true",
135
- help="whether to do orbital decomposition in the non-collinear mode.",
136
- )
137
-
138
- parser.add_argument(
139
- "--output_path",
140
- help="The path of the output directory, default is TB2J_results",
141
- type=str,
142
- default="TB2J_results",
143
- )
144
-
145
- parser.add_argument(
146
- "--wannier_type",
147
- help="The type of Wannier function, either Wannier90 or banddownfolder",
148
- type=str,
149
- default="Wannier90",
150
- )
151
-
152
- # parser.add_argument("--qspace",
153
- # action="store_true",
154
- # help="Whether to calculate J in qspace first and transform to real space.",
155
- # default=False)
156
-
157
- args = parser.parse_args()
158
-
159
- if args.efermi is None:
160
- print("Please input fermi energy using --efermi ")
161
- sys.exit()
162
- if args.elements is None:
163
- print("Please input the magnetic elements, e.g. --elements Fe Ni")
164
- sys.exit()
165
-
166
- gen_exchange(
167
- path=args.path,
168
- colinear=(not args.spinor),
169
- groupby=args.groupby,
170
- posfile=args.posfile,
171
- efermi=args.efermi,
172
- kmesh=args.kmesh,
173
- magnetic_elements=args.elements,
174
- Rcut=args.rcut,
175
- prefix_SOC=args.prefix_spinor,
176
- prefix_up=args.prefix_up,
177
- prefix_dn=args.prefix_down,
178
- emin=args.emin,
179
- emax=args.emax,
180
- nz=args.nz,
181
- use_cache=args.use_cache,
182
- np=args.np,
183
- description=args.description,
184
- output_path=args.output_path,
185
- exclude_orbs=args.exclude_orbs,
186
- wannier_type=args.wannier_type,
187
- # qspace=args.qspace,
188
- write_density_matrix=args.write_dm,
189
- orb_decomposition=args.orb_decomposition,
190
- )
191
-
192
-
193
- if __name__ == "__main__":
194
- run_wann2J()
@@ -1,5 +1,5 @@
1
- from scipy.linalg import eigh
2
1
  import numpy as np
2
+ from scipy.linalg import eigh
3
3
 
4
4
 
5
5
  def gen_random_hermitean_matrix(n):