TB2J 0.9.9.14__py3-none-any.whl → 0.9.9.16__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 (23) hide show
  1. TB2J/Jdownfolder.py +2 -2
  2. TB2J/Jtensor.py +2 -1
  3. TB2J/io_exchange/io_exchange.py +13 -1
  4. TB2J/io_exchange/io_vampire.py +1 -1
  5. {tb2j-0.9.9.14.data → tb2j-0.9.9.16.data}/scripts/TB2J_downfold.py +12 -2
  6. {tb2j-0.9.9.14.data → tb2j-0.9.9.16.data}/scripts/TB2J_merge.py +9 -5
  7. tb2j-0.9.9.16.data/scripts/TB2J_plot_magnon_bands.py +27 -0
  8. {tb2j-0.9.9.14.dist-info → tb2j-0.9.9.16.dist-info}/METADATA +11 -3
  9. {tb2j-0.9.9.14.dist-info → tb2j-0.9.9.16.dist-info}/RECORD +22 -22
  10. tb2j-0.9.9.14.data/scripts/TB2J_plot_magnon_bands.py +0 -7
  11. {tb2j-0.9.9.14.data → tb2j-0.9.9.16.data}/scripts/TB2J_eigen.py +0 -0
  12. {tb2j-0.9.9.14.data → tb2j-0.9.9.16.data}/scripts/TB2J_magnon.py +0 -0
  13. {tb2j-0.9.9.14.data → tb2j-0.9.9.16.data}/scripts/TB2J_magnon2.py +0 -0
  14. {tb2j-0.9.9.14.data → tb2j-0.9.9.16.data}/scripts/TB2J_magnon_dos.py +0 -0
  15. {tb2j-0.9.9.14.data → tb2j-0.9.9.16.data}/scripts/TB2J_rotate.py +0 -0
  16. {tb2j-0.9.9.14.data → tb2j-0.9.9.16.data}/scripts/TB2J_rotateDM.py +0 -0
  17. {tb2j-0.9.9.14.data → tb2j-0.9.9.16.data}/scripts/abacus2J.py +0 -0
  18. {tb2j-0.9.9.14.data → tb2j-0.9.9.16.data}/scripts/siesta2J.py +0 -0
  19. {tb2j-0.9.9.14.data → tb2j-0.9.9.16.data}/scripts/wann2J.py +0 -0
  20. {tb2j-0.9.9.14.dist-info → tb2j-0.9.9.16.dist-info}/WHEEL +0 -0
  21. {tb2j-0.9.9.14.dist-info → tb2j-0.9.9.16.dist-info}/entry_points.txt +0 -0
  22. {tb2j-0.9.9.14.dist-info → tb2j-0.9.9.16.dist-info}/licenses/LICENSE +0 -0
  23. {tb2j-0.9.9.14.dist-info → tb2j-0.9.9.16.dist-info}/top_level.txt +0 -0
TB2J/Jdownfolder.py CHANGED
@@ -94,7 +94,7 @@ class PWFDownfolder:
94
94
  # anchors={(0, 0, 0): (-1, -2, -3, -4)},
95
95
  # anchors={(0, 0, 0): ()},
96
96
  # use_proj=True,
97
- enhance_Amn=0.0,
97
+ enhance_Amn=1.4,
98
98
  )
99
99
  params.update(kwargs)
100
100
  wann.set_parameters(**params)
@@ -176,7 +176,7 @@ class JDownfolder_pickle:
176
176
  self.nsite = self.nM + self.nL
177
177
 
178
178
  def _downfold(self, **kwargs):
179
- JR2 = self.exc.get_full_Jtensor_for_Rlist(asr=True)
179
+ JR2 = self.exc.get_full_Jtensor_for_Rlist(order="i3j3_2D", asr=True)
180
180
  if self.method.lower() == "lowdin":
181
181
  d = JDownfolder(
182
182
  JR2,
TB2J/Jtensor.py CHANGED
@@ -64,8 +64,9 @@ def decompose_J_tensor(Jtensor):
64
64
  :returns:
65
65
 
66
66
  """
67
+ Jtensor = Jtensor.real
67
68
  Jiso = np.average(np.diag(Jtensor))
68
- Dm = (Jtensor - Jtensor.T) / 2.0
69
+ Dm = (Jtensor - Jtensor.T).real / 2.0
69
70
  D = np.array((Dm[1, 2], Dm[2, 0], Dm[0, 1]), dtype=float)
70
71
  Jani = (Jtensor + Jtensor.T) / 2 - np.eye(3) * Jiso
71
72
  return Jiso, D, Jani
@@ -430,8 +430,20 @@ Generation time: {now.strftime("%y/%m/%d %H:%M:%S")}
430
430
  for i in range(n):
431
431
  sum_JRi = np.sum(np.sum(Jmat, axis=0)[i])
432
432
  Jmat[iR0][i, i] -= sum_JRi
433
+ elif order == "i3j3_2D":
434
+ Jmat = np.zeros((nR, n3, n3), dtype=float)
435
+ for iR, R in enumerate(self.Rlist):
436
+ Jmat[iR] = self.get_full_Jtensor_for_one_R_i3j3(
437
+ R, Jiso=Jiso, Jani=Jani, DMI=DMI
438
+ ).reshape((n3, n3))
439
+ if asr:
440
+ iR0 = np.argmin(np.linalg.norm(self.Rlist, axis=1))
441
+ assert np.linalg.norm(self.Rlist[iR0]) == 0
442
+ for i in range(n3):
443
+ sum_JRi = np.sum(np.sum(Jmat, axis=0)[i])
444
+ Jmat[iR0][i, i] -= sum_JRi
433
445
  else:
434
- raise ValueError("order must be either 'i3j3' or 'ij33'.")
446
+ raise ValueError("order must be either 'i3j3' or 'ij33', or 'i3j3_2D'.")
435
447
  return Jmat
436
448
 
437
449
  def write_pickle(self, path="TB2J_results", fname="TB2J.pickle"):
@@ -60,7 +60,7 @@ def write_vampire_unitcell_file(cls, fname):
60
60
  val = np.real(Jtensor[i, j] * 2.0 / J)
61
61
  if np.abs(val) < 1e-30:
62
62
  val = 0.0
63
- myfile.write(f"{val:<012.5e} ")
63
+ myfile.write(f"{val:< 12.5e} ")
64
64
  myfile.write("\n")
65
65
 
66
66
 
@@ -1,8 +1,8 @@
1
1
  #!python
2
2
  import argparse
3
- import os
4
- import sys
3
+
5
4
  from TB2J.Jdownfolder import JDownfolder_pickle
5
+ from TB2J.versioninfo import print_license
6
6
 
7
7
 
8
8
  def main():
@@ -73,6 +73,15 @@ def main():
73
73
  if len(args.ligands) == []:
74
74
  print("List of ligand elements cannot be empty")
75
75
 
76
+ print_license()
77
+ print("Input path:", args.inpath)
78
+ print("Output path:", args.outpath)
79
+ print("Magnetic cation elements:", args.metals)
80
+ print("Ligand elements:", args.ligands)
81
+ print("k-mesh:", args.qmesh)
82
+ print("Downfolding method:", args.method)
83
+ print("Downfolding only isotropic part:", args.iso_only)
84
+ print("Begining downfolding the exchange parameters:")
76
85
  JDownfolder_pickle(
77
86
  inpath=args.inpath,
78
87
  metals=args.metals,
@@ -82,6 +91,7 @@ def main():
82
91
  iso_only=args.iso_only,
83
92
  method=args.method,
84
93
  )
94
+ print("Downfolding finished. Results are saved in:", args.outpath)
85
95
 
86
96
 
87
97
  main()
@@ -1,8 +1,8 @@
1
1
  #!python
2
2
  import argparse
3
- import os
4
- import sys
3
+
5
4
  from TB2J.io_merge import merge
5
+ from TB2J.version_info import print_license
6
6
 
7
7
 
8
8
  def main():
@@ -32,14 +32,18 @@ def main():
32
32
  "--main_path",
33
33
  help="The path containning the reference structure.",
34
34
  type=str,
35
- default=None
35
+ default=None,
36
36
  )
37
37
 
38
38
  args = parser.parse_args()
39
39
  # merge(*(args.directories), args.type.strip().lower(), path=args.output_path)
40
40
  # merge(*(args.directories), method=args.type.strip().lower(), path=args.output_path)
41
- #merge2(args.directories, args.type.strip().lower(), path=args.output_path)
41
+ # merge2(args.directories, args.type.strip().lower(), path=args.output_path)
42
+ print_license()
43
+ print("Merging the TB2J results from the following directories: ", args.directories)
42
44
  merge(*args.directories, main_path=args.main_path, write_path=args.output_path)
45
+ print("Merging completed. The results are saved in:", args.output_path)
43
46
 
44
47
 
45
- main()
48
+ if __name__ == "__main__":
49
+ main()
@@ -0,0 +1,27 @@
1
+ #!python
2
+
3
+
4
+ if __name__ == "__main__":
5
+ # add a warning messege that this functionality is under development and should not be used in production.
6
+ # make it visually distinct, e.g. with a different color or formatting.
7
+ import warnings
8
+
9
+ from TB2J.magnon.magnon3 import main
10
+
11
+ warnings.warn(
12
+ """
13
+ # !!!!!!!!!!!!!!!!!! WARNING: =============================
14
+ #
15
+ # This functionality is under development and should not be used in production.
16
+ # It is provided for testing and development purposes only.
17
+ # Please use with caution and report any issues to the developers.
18
+ #
19
+ # This warning will be removed in future releases.
20
+ # =====================================
21
+
22
+ """,
23
+ UserWarning,
24
+ stacklevel=2,
25
+ )
26
+ # Call the main function from the magnons module
27
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TB2J
3
- Version: 0.9.9.14
3
+ Version: 0.9.9.16
4
4
  Summary: TB2J: First principle to Heisenberg exchange J using tight-binding Green function method
5
5
  Author: Xu He
6
6
  Author-email: mailhexu@gmail.com
@@ -24,16 +24,24 @@ Requires-Dist: packaging>=20.0
24
24
  Requires-Dist: HamiltonIO>=0.2.4
25
25
  Requires-Dist: pre-commit
26
26
  Requires-Dist: sympair>0.1.0
27
- Requires-Dist: sisl>=0.9.0
28
27
  Requires-Dist: tomli>=2.0.0
29
28
  Requires-Dist: tomli-w>=1.0.0
30
- Requires-Dist: netcdf4
29
+ Provides-Extra: siesta
30
+ Requires-Dist: sisl>=0.9.0; extra == "siesta"
31
+ Requires-Dist: netcdf4; extra == "siesta"
32
+ Provides-Extra: lawaf
33
+ Requires-Dist: lawaf==0.2.3; extra == "lawaf"
34
+ Provides-Extra: all
35
+ Requires-Dist: sisl>=0.9.0; extra == "all"
36
+ Requires-Dist: netcdf4; extra == "all"
37
+ Requires-Dist: lawaf==0.2.3; extra == "all"
31
38
  Dynamic: author
32
39
  Dynamic: author-email
33
40
  Dynamic: classifier
34
41
  Dynamic: description
35
42
  Dynamic: license
36
43
  Dynamic: license-file
44
+ Dynamic: provides-extra
37
45
  Dynamic: requires-dist
38
46
  Dynamic: requires-python
39
47
  Dynamic: summary
@@ -1,5 +1,5 @@
1
- TB2J/Jdownfolder.py,sha256=n5BeQCYP4mD9JsAPeE1F3ZKKR3SUxADfDbaG_rzi77k,9658
2
- TB2J/Jtensor.py,sha256=Wi06AAbfKFU6f2a2jkFr9zU2cwwfVroajTp-dwCtkTE,3160
1
+ TB2J/Jdownfolder.py,sha256=ZKF0AVnwaJ4DPKfQ28NsJXhpOZE9_rsusEFtNCm5kls,9675
2
+ TB2J/Jtensor.py,sha256=WRhpp5N92a6lA1jeM1hc7jYUoTOLIdMnIIKpdOyzjR4,3192
3
3
  TB2J/MAE.py,sha256=fM8U-Dgp9HcQOEeC_kyZV1oVrygBvcux9BraUXVouvY,10994
4
4
  TB2J/MAEGreen.py,sha256=zVLjQtFDFcRmC8PYm7MOgKnkOuFJEMKr-eoNBABUsMc,15759
5
5
  TB2J/Oiju.py,sha256=cNGv8N5uH_swGq7cnAt2OyiDfqtjLlLrwseGu0E4iaM,3383
@@ -55,12 +55,12 @@ TB2J/interfaces/abacus/test_density_matrix.py,sha256=bMWWJYtDS57SpPZ-eZXZ9Hr_UK4
55
55
  TB2J/interfaces/abacus/test_read_HRSR.py,sha256=W1oO_yigT50Yb5_u-KB_IfTpM7kArGkBuMSMs0H4CTs,1235
56
56
  TB2J/interfaces/abacus/test_read_stru.py,sha256=hoKPHVco8vwzC7Gao4bOPCdAPhh29x-9DTJJqRr7AYM,788
57
57
  TB2J/io_exchange/__init__.py,sha256=LqEnG67qDVKt4hCUywDEQvUIJ7jsQjmtueOW_J16NOE,54
58
- TB2J/io_exchange/io_exchange.py,sha256=TQPsxpV0vyFq-HFRRt9GQbpnmRw-5KwyM26eb9fKaoY,22743
58
+ TB2J/io_exchange/io_exchange.py,sha256=KQNCd3G_9Ck-qQX1UMKjfEPHyv5mC3BgRot_ngpACYs,23340
59
59
  TB2J/io_exchange/io_multibinit.py,sha256=8PDmWxzGuv-GwJosj2ZTmiyNY_duFVWJ4ekCuSqGdd8,6739
60
60
  TB2J/io_exchange/io_tomsasd.py,sha256=NqkAC1Fl-CUnFA21eBzSy_S5F_oeQFJysw4UukQbN8o,4173
61
61
  TB2J/io_exchange/io_txt.py,sha256=BMr1eSILlKpgtjvDx7uw2VMAkEKSvGEPNxpaT_zev0I,10547
62
62
  TB2J/io_exchange/io_uppasd.py,sha256=bI4iPEgnK4TvCZNvb6x2xYXgjW7pEehCqmcizy2pqFU,3301
63
- TB2J/io_exchange/io_vampire.py,sha256=u4NZhqoC_JBcVq19WZfBkyM5p8u-OMuRoUrtFIcPp5E,5762
63
+ TB2J/io_exchange/io_vampire.py,sha256=vOStLmtCiWLp9GPhZpsAmrtaRHg9KSmtOM2Fky6yCQA,5762
64
64
  TB2J/magnon/__init__.py,sha256=Q69duroGIIotgW_71ZdHYarSiJLGAu9NPYgEacUk6eI,117
65
65
  TB2J/magnon/io_exchange2.py,sha256=EcC3x6H13qq61WBsr__xKzHDtSvy_dMz1tEdUaqSG2I,23265
66
66
  TB2J/magnon/magnon3.py,sha256=PFZFiyfYTIBscVu8SzvGxtrXhT-QM66EwIhWOqgSYQE,30219
@@ -91,21 +91,21 @@ TB2J/spinham/supercell.py,sha256=y17uUC6r3gQb278FhxIW4CABihfLTvKFj6flyXrCPR8,122
91
91
  TB2J/wannier/__init__.py,sha256=7ojCbM84PYv1X1Tbo4NHI-d3gWmQsZB_xiYqbfxVV1E,80
92
92
  TB2J/wannier/w90_parser.py,sha256=dbd63LuKyv2DVUzqRINGsbDzEsOxsQyE8_Ear_LQIRg,4620
93
93
  TB2J/wannier/w90_tb_parser.py,sha256=qt8pnuprmPp9iIAYwPkPbmEzk6ZPgMq2xognoQp7vwc,4610
94
- tb2j-0.9.9.14.data/scripts/TB2J_downfold.py,sha256=i4BVqnpDdgrX_amookVWeLGefGBn-qeAutWiwuY9SfQ,2099
95
- tb2j-0.9.9.14.data/scripts/TB2J_eigen.py,sha256=Qs9v2hnMm2Tpfoa4h53muUKty2dZjwx8948MBoQooNg,1128
96
- tb2j-0.9.9.14.data/scripts/TB2J_magnon.py,sha256=q7UwAmorRcFNk4tfE7gl_ny05l6p7pbD9Wm_LkIpKEw,3101
97
- tb2j-0.9.9.14.data/scripts/TB2J_magnon2.py,sha256=tMa7Fg_Wd2UytnrH3C_AsgGM7BciUW0iy6NiPlWvar8,1920
98
- tb2j-0.9.9.14.data/scripts/TB2J_magnon_dos.py,sha256=TMXQvD2dIbO5FZ4tUMmxJgCgH2O2hDAPUNfEKO4z-x4,110
99
- tb2j-0.9.9.14.data/scripts/TB2J_merge.py,sha256=y834SF4rIRn1L1ptkhczvavQpC-8Px6DTmDOOSaq_DE,1854
100
- tb2j-0.9.9.14.data/scripts/TB2J_plot_magnon_bands.py,sha256=qUbisPFLvW_j1IdTpc_jU0WiT-7CT-WErbkhNvAPM0Y,91
101
- tb2j-0.9.9.14.data/scripts/TB2J_rotate.py,sha256=zgiDFuYZNmzKK0rwDmTaYD2OpRlmKA_VGeBx83w2Xwc,873
102
- tb2j-0.9.9.14.data/scripts/TB2J_rotateDM.py,sha256=kCvF7gotuqAX1VnJ06cwfVm7RrhrdtiV5v7d9P2Pn_E,567
103
- tb2j-0.9.9.14.data/scripts/abacus2J.py,sha256=ozYI7qZyja1WEs9oCYVpeYAfVj5PGhehhmdZFcvrd3g,1795
104
- tb2j-0.9.9.14.data/scripts/siesta2J.py,sha256=QJ6c0DbqxaqYEesxiL5R9nK9-flNLrr7hajKfCwirYc,2318
105
- tb2j-0.9.9.14.data/scripts/wann2J.py,sha256=OA31VHEXbQMD-JozoLUHDF6vB9Sr62d804OApSKtSnU,3240
106
- tb2j-0.9.9.14.dist-info/licenses/LICENSE,sha256=CbZI-jyRTjiqIcWa244cRSHJdjjtUNqGR4HeJkgEwJw,1332
107
- tb2j-0.9.9.14.dist-info/METADATA,sha256=L0ldDxhLTv7uHQ--JV6Ix8gziGJgM1xFsXXaVNJEK0M,1768
108
- tb2j-0.9.9.14.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
109
- tb2j-0.9.9.14.dist-info/entry_points.txt,sha256=S81PATMTaKCIznjd3pei3Kb3q3xOy2dU-x_cAFSCS7k,194
110
- tb2j-0.9.9.14.dist-info/top_level.txt,sha256=whYa5ByLYhl5XnTPBHSWr-IGD6VWmr5Ql2bye2qwV_s,5
111
- tb2j-0.9.9.14.dist-info/RECORD,,
94
+ tb2j-0.9.9.16.data/scripts/TB2J_downfold.py,sha256=VEIiUFDkTePA13qLhITgalwGYQLMJr45I3-zrpNn3Pg,2586
95
+ tb2j-0.9.9.16.data/scripts/TB2J_eigen.py,sha256=Qs9v2hnMm2Tpfoa4h53muUKty2dZjwx8948MBoQooNg,1128
96
+ tb2j-0.9.9.16.data/scripts/TB2J_magnon.py,sha256=q7UwAmorRcFNk4tfE7gl_ny05l6p7pbD9Wm_LkIpKEw,3101
97
+ tb2j-0.9.9.16.data/scripts/TB2J_magnon2.py,sha256=tMa7Fg_Wd2UytnrH3C_AsgGM7BciUW0iy6NiPlWvar8,1920
98
+ tb2j-0.9.9.16.data/scripts/TB2J_magnon_dos.py,sha256=TMXQvD2dIbO5FZ4tUMmxJgCgH2O2hDAPUNfEKO4z-x4,110
99
+ tb2j-0.9.9.16.data/scripts/TB2J_merge.py,sha256=WQVrS2FvrjxkKukiPLY-naQxEK-d2T-bAb5n7e6ml2I,2096
100
+ tb2j-0.9.9.16.data/scripts/TB2J_plot_magnon_bands.py,sha256=wLlueNI-wU79cmPFu4LmPDwVBMerKSb5sUlTDSPQK6I,874
101
+ tb2j-0.9.9.16.data/scripts/TB2J_rotate.py,sha256=zgiDFuYZNmzKK0rwDmTaYD2OpRlmKA_VGeBx83w2Xwc,873
102
+ tb2j-0.9.9.16.data/scripts/TB2J_rotateDM.py,sha256=kCvF7gotuqAX1VnJ06cwfVm7RrhrdtiV5v7d9P2Pn_E,567
103
+ tb2j-0.9.9.16.data/scripts/abacus2J.py,sha256=ozYI7qZyja1WEs9oCYVpeYAfVj5PGhehhmdZFcvrd3g,1795
104
+ tb2j-0.9.9.16.data/scripts/siesta2J.py,sha256=QJ6c0DbqxaqYEesxiL5R9nK9-flNLrr7hajKfCwirYc,2318
105
+ tb2j-0.9.9.16.data/scripts/wann2J.py,sha256=OA31VHEXbQMD-JozoLUHDF6vB9Sr62d804OApSKtSnU,3240
106
+ tb2j-0.9.9.16.dist-info/licenses/LICENSE,sha256=CbZI-jyRTjiqIcWa244cRSHJdjjtUNqGR4HeJkgEwJw,1332
107
+ tb2j-0.9.9.16.dist-info/METADATA,sha256=Up_Wos9bysHwYYv-H8HX_uma4j3FzVP5Mc4OSmyTo2Q,2067
108
+ tb2j-0.9.9.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
109
+ tb2j-0.9.9.16.dist-info/entry_points.txt,sha256=S81PATMTaKCIznjd3pei3Kb3q3xOy2dU-x_cAFSCS7k,194
110
+ tb2j-0.9.9.16.dist-info/top_level.txt,sha256=whYa5ByLYhl5XnTPBHSWr-IGD6VWmr5Ql2bye2qwV_s,5
111
+ tb2j-0.9.9.16.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- #!python
2
-
3
-
4
- if __name__ == "__main__":
5
- from TB2J.magnon.magnon3 import main
6
-
7
- main()