TB2J 0.9.9rc17__py3-none-any.whl → 0.9.9rc19__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.
TB2J/Jdownfolder.py CHANGED
@@ -136,7 +136,7 @@ class JDownfolder_pickle:
136
136
  outpath,
137
137
  qmesh=[7, 7, 7],
138
138
  iso_only=False,
139
- method="pwf",
139
+ method="lowdin",
140
140
  **kwargs,
141
141
  ):
142
142
  self.exc = SpinIO.load_pickle(path=inpath, fname="TB2J.pickle")
@@ -146,6 +146,7 @@ class JDownfolder_pickle:
146
146
  self.ligands = ligands
147
147
  self.outpath = outpath
148
148
  self.method = method
149
+ print("Using method:", self.method)
149
150
 
150
151
  # read atomic structure
151
152
  self.atoms = self.exc.atoms
@@ -176,7 +177,7 @@ class JDownfolder_pickle:
176
177
 
177
178
  def _downfold(self, **kwargs):
178
179
  JR2 = self.exc.get_full_Jtensor_for_Rlist(asr=True)
179
- if self.method == "lowdin":
180
+ if self.method.lower() == "lowdin":
180
181
  d = JDownfolder(
181
182
  JR2,
182
183
  self.exc.Rlist,
TB2J/MAEGreen.py CHANGED
@@ -1,7 +1,6 @@
1
1
  import gc
2
2
  from pathlib import Path
3
3
 
4
- import matplotlib.pyplot as plt
5
4
  import numpy as np
6
5
  import tqdm
7
6
  from HamiltonIO.abacus.abacus_wrapper import AbacusSplitSOCParser
@@ -32,7 +31,9 @@ class MAEGreen(ExchangeNCL):
32
31
  """
33
32
  super().__init__(**kwargs)
34
33
  self.natoms = len(self.atoms)
35
- if angles is None or angles == "axis":
34
+ if angles is None or angles == "xyz":
35
+ self.set_angles_xyz()
36
+ elif angles == "axis":
36
37
  self.set_angles_axis()
37
38
  elif angles == "scan":
38
39
  self.set_angles_scan()
@@ -51,6 +52,11 @@ class MAEGreen(ExchangeNCL):
51
52
  self.es_atom = np.zeros((nangles, self.natoms), dtype=complex)
52
53
  self.es_atom_orb = DefaultDict(lambda: 0)
53
54
 
55
+ def set_angles_xyz(self):
56
+ """theta and phi are defined as the x, y, z, xy, yz, xz, xyz, x-yz, -xyz, -x-yz axis."""
57
+ self.thetas = [np.pi / 2, np.pi / 2, 0.0]
58
+ self.phis = [np.pi / 2, 0, 0.0]
59
+
54
60
  def set_angles_axis(self):
55
61
  """theta and phi are defined as the x, y, z, xy, yz, xz, xyz, x-yz, -xyz, -x-yz axis."""
56
62
  self.thetas = [0, np.pi / 2, np.pi / 2, np.pi / 2, np.pi, 0, np.pi / 2, 0, 0, 0]
@@ -75,7 +81,6 @@ class MAEGreen(ExchangeNCL):
75
81
  self.thetas = thetas
76
82
  self.phis = phis
77
83
  self.angle_pairs = list(zip(thetas, phis))
78
- # remove duplicates of angles using sets.
79
84
  self.angle_pairs = list(set(self.angle_pairs))
80
85
  self.thetas, self.phis = zip(*self.angle_pairs)
81
86
 
@@ -248,11 +253,11 @@ class MAEGreen(ExchangeNCL):
248
253
  Path(output_path).mkdir(exist_ok=True)
249
254
  fname = f"{output_path}/MAE.dat"
250
255
  fname_orb = f"{output_path}/MAE_orb.dat"
251
- fname_tensor = f"{output_path}/MAE_tensor.dat"
252
- if figure3d is not None:
253
- fname_fig3d = f"{output_path}/{figure3d}"
254
- if figure_contourf is not None:
255
- fname_figcontourf = f"{output_path}/{figure_contourf}"
256
+ # fname_tensor = f"{output_path}/MAE_tensor.dat"
257
+ # if figure3d is not None:
258
+ # fname_fig3d = f"{output_path}/{figure3d}"
259
+ # if figure_contourf is not None:
260
+ # fname_figcontourf = f"{output_path}/{figure_contourf}"
256
261
 
257
262
  # ouput with eigenvalues.
258
263
  if with_eigen:
@@ -277,18 +282,18 @@ class MAEGreen(ExchangeNCL):
277
282
  f.write(f"{ea*1e3:.8f} ")
278
283
  f.write("\n")
279
284
 
280
- self.ani = self.fit_anisotropy_tensor()
281
- with open(fname_tensor, "w") as f:
282
- f.write("# Anisotropy tensor in meV\n")
283
- f.write(f"{self.ani.tensor_strings(include_isotropic=False)}\n")
285
+ # self.ani = self.fit_anisotropy_tensor()
286
+ # with open(fname_tensor, "w") as f:
287
+ # f.write("# Anisotropy tensor in meV\n")
288
+ # f.write(f"{self.ani.tensor_strings(include_isotropic=False)}\n")
284
289
 
285
- if figure3d is not None:
286
- self.ani.plot_3d(figname=fname_fig3d, show=False)
290
+ # if figure3d is not None:
291
+ # self.ani.plot_3d(figname=fname_fig3d, show=False)
287
292
 
288
- if figure_contourf is not None:
289
- self.ani.plot_contourf(figname=fname_figcontourf, show=False)
293
+ # if figure_contourf is not None:
294
+ # self.ani.plot_contourf(figname=fname_figcontourf, show=False)
290
295
 
291
- plt.close()
296
+ # plt.close()
292
297
  gc.collect()
293
298
 
294
299
  with open(fname_orb, "w") as f:
@@ -4,6 +4,7 @@ import numpy as np
4
4
 
5
5
  from TB2J.exchange import ExchangeNCL
6
6
  from TB2J.exchangeCL2 import ExchangeCL2
7
+ from TB2J.io_merge import merge
7
8
  from TB2J.MAEGreen import MAEGreen
8
9
 
9
10
  try:
@@ -156,7 +157,7 @@ Warning: The DMI component parallel to the spin orientation, the Jani which has
156
157
  atoms=model.atoms,
157
158
  basis=basis,
158
159
  efermi=None,
159
- angles="miller",
160
+ angles="axis",
160
161
  # magnetic_elements=magnetic_elements,
161
162
  # include_orbs=include_orbs,
162
163
  **exargs,
@@ -165,9 +166,9 @@ Warning: The DMI component parallel to the spin orientation, the Jani which has
165
166
  # phis = [0, 0, 0, 0]
166
167
  # MAE.set_angles(thetas=thetas, phis=phis)
167
168
  MAE.run(output_path=f"{output_path}_anisotropy", with_eigen=False)
168
- print(
169
- f"MAE calculation finished. The results are in {output_path} directory."
170
- )
169
+ # print(
170
+ # f"MAE calculation finished. The results are in {output_path} directory."
171
+ # )
171
172
 
172
173
  angle = {"x": (np.pi / 2, 0), "y": (np.pi / 2, np.pi / 2), "z": (0, 0)}
173
174
  for key, val in angle.items():
@@ -191,3 +192,13 @@ Warning: The DMI component parallel to the spin orientation, the Jani which has
191
192
  print(
192
193
  f"All calculation finished. The results are in {output_path_full} directory."
193
194
  )
195
+
196
+ merge(
197
+ "TB2J_results_x",
198
+ "TB2J_results_y",
199
+ "TB2J_results_z",
200
+ main_path=None,
201
+ save=True,
202
+ write_path="TB2J_results",
203
+ )
204
+ print("Final TB2J_results written to TB2J_results directory.")
@@ -1,3 +1,4 @@
1
+ #!python
1
2
  from TB2J.magnon import plot_tb2j_magnon_bands
2
3
 
3
4
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TB2J
3
- Version: 0.9.9rc17
3
+ Version: 0.9.9rc19
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
@@ -1,7 +1,7 @@
1
- TB2J/Jdownfolder.py,sha256=xs0gmcKwOA3ejXqk3JPPgnYVu8CvkK8cteuvHuu1oSk,9603
1
+ TB2J/Jdownfolder.py,sha256=n5BeQCYP4mD9JsAPeE1F3ZKKR3SUxADfDbaG_rzi77k,9658
2
2
  TB2J/Jtensor.py,sha256=t6OsqrSlYW6Im4H7ykVAW8Al_pFXN4C5yj2UEsV6r7g,3181
3
3
  TB2J/MAE.py,sha256=fM8U-Dgp9HcQOEeC_kyZV1oVrygBvcux9BraUXVouvY,10994
4
- TB2J/MAEGreen.py,sha256=pCX12GDNaOz8XgMlui8NjAERM43Ux3HyOKfiD80czXI,15306
4
+ TB2J/MAEGreen.py,sha256=Iq4hlZrKEOycPvpV66_t13WIcJ1FJgBS79NleXYpFzw,15528
5
5
  TB2J/Oiju.py,sha256=cNGv8N5uH_swGq7cnAt2OyiDfqtjLlLrwseGu0E4iaM,3383
6
6
  TB2J/Oiju_epc.py,sha256=oytM3NYW7nWmklrGgNlqwIpI_JYv_hb7ZnR4o9nYNog,6809
7
7
  TB2J/__init__.py,sha256=hcEWkag_UvLm1ZSbjsgcTWkGVlR3Bwmzg1QYAwsvf-g,24
@@ -43,7 +43,7 @@ TB2J/interfaces/__init__.py,sha256=4tiLoXQ73Nlyi9L4j8jJXOYzXluVNPxQZkwfkQZEGHg,3
43
43
  TB2J/interfaces/gpaw_interface.py,sha256=GCDlJ-hRWfChvWwsgBDYSmVqO4sH9HAuGZTV9GqgN6c,1504
44
44
  TB2J/interfaces/lawaf_interface.py,sha256=PieLnmppdafOYsgeHznqOou1g9L1sam5jOm3KaObdqo,4408
45
45
  TB2J/interfaces/manager.py,sha256=PQMLEfMCT5GnDWSl2nI4JOgRPm_fysyR-6Y6l97xWcw,860
46
- TB2J/interfaces/siesta_interface.py,sha256=olvo2xdBOSNk3zn67nuKrxbW--EKPoWwEzKRBwJbrVY,7366
46
+ TB2J/interfaces/siesta_interface.py,sha256=nCrVWKXua-QzikSPhrvdFVw3OpjeKYPzLzMa7Hqc6Yc,7714
47
47
  TB2J/interfaces/wannier90_interface.py,sha256=qzRgXUBb7t1Aiegrl_RV51BB8csdtVM0EP0Z4pjmTcs,4467
48
48
  TB2J/interfaces/abacus/__init__.py,sha256=leas71oCvM_HxrF4gnO5A_VKcJmDAgsI1BUctLU3OBw,177
49
49
  TB2J/interfaces/abacus/abacus_api.py,sha256=lNV4LNkLcKw7Zux4MQYM9wnh3eFTlcSqbf4Pb7pqhrk,7243
@@ -85,20 +85,20 @@ TB2J/spinham/supercell.py,sha256=y17uUC6r3gQb278FhxIW4CABihfLTvKFj6flyXrCPR8,122
85
85
  TB2J/wannier/__init__.py,sha256=7ojCbM84PYv1X1Tbo4NHI-d3gWmQsZB_xiYqbfxVV1E,80
86
86
  TB2J/wannier/w90_parser.py,sha256=dbd63LuKyv2DVUzqRINGsbDzEsOxsQyE8_Ear_LQIRg,4620
87
87
  TB2J/wannier/w90_tb_parser.py,sha256=qt8pnuprmPp9iIAYwPkPbmEzk6ZPgMq2xognoQp7vwc,4610
88
- tb2j-0.9.9rc17.data/scripts/TB2J_downfold.py,sha256=i4BVqnpDdgrX_amookVWeLGefGBn-qeAutWiwuY9SfQ,2099
89
- tb2j-0.9.9rc17.data/scripts/TB2J_eigen.py,sha256=Qs9v2hnMm2Tpfoa4h53muUKty2dZjwx8948MBoQooNg,1128
90
- tb2j-0.9.9rc17.data/scripts/TB2J_magnon.py,sha256=q7UwAmorRcFNk4tfE7gl_ny05l6p7pbD9Wm_LkIpKEw,3101
91
- tb2j-0.9.9rc17.data/scripts/TB2J_magnon2.py,sha256=9HKNXwPlwaEnAlJXVLrbQFhWj3fGLlBAp-nMXWDTbE0,1911
92
- tb2j-0.9.9rc17.data/scripts/TB2J_magnon_dos.py,sha256=TMXQvD2dIbO5FZ4tUMmxJgCgH2O2hDAPUNfEKO4z-x4,110
93
- tb2j-0.9.9rc17.data/scripts/TB2J_merge.py,sha256=y834SF4rIRn1L1ptkhczvavQpC-8Px6DTmDOOSaq_DE,1854
94
- tb2j-0.9.9rc17.data/scripts/TB2J_rotate.py,sha256=zgiDFuYZNmzKK0rwDmTaYD2OpRlmKA_VGeBx83w2Xwc,873
95
- tb2j-0.9.9rc17.data/scripts/TB2J_rotateDM.py,sha256=kCvF7gotuqAX1VnJ06cwfVm7RrhrdtiV5v7d9P2Pn_E,567
96
- tb2j-0.9.9rc17.data/scripts/abacus2J.py,sha256=VD1ldQP-PIMyxo3Rzzwk_06fJEbbU7oiU3aRXNHK0a0,1826
97
- tb2j-0.9.9rc17.data/scripts/siesta2J.py,sha256=QJ6c0DbqxaqYEesxiL5R9nK9-flNLrr7hajKfCwirYc,2318
98
- tb2j-0.9.9rc17.data/scripts/wann2J.py,sha256=OA31VHEXbQMD-JozoLUHDF6vB9Sr62d804OApSKtSnU,3240
99
- tb2j-0.9.9rc17.dist-info/licenses/LICENSE,sha256=CbZI-jyRTjiqIcWa244cRSHJdjjtUNqGR4HeJkgEwJw,1332
100
- tb2j-0.9.9rc17.dist-info/METADATA,sha256=r-lDBhH1xqc2V1ekn53vtmh6yUSfXzjEW0vJ8B7BDGA,1688
101
- tb2j-0.9.9rc17.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
102
- tb2j-0.9.9rc17.dist-info/entry_points.txt,sha256=Hdz1WC9waUzyFVmowKnbbZ6j-J4adHh_Ko6JpxGYAtE,131
103
- tb2j-0.9.9rc17.dist-info/top_level.txt,sha256=whYa5ByLYhl5XnTPBHSWr-IGD6VWmr5Ql2bye2qwV_s,5
104
- tb2j-0.9.9rc17.dist-info/RECORD,,
88
+ tb2j-0.9.9rc19.data/scripts/TB2J_downfold.py,sha256=i4BVqnpDdgrX_amookVWeLGefGBn-qeAutWiwuY9SfQ,2099
89
+ tb2j-0.9.9rc19.data/scripts/TB2J_eigen.py,sha256=Qs9v2hnMm2Tpfoa4h53muUKty2dZjwx8948MBoQooNg,1128
90
+ tb2j-0.9.9rc19.data/scripts/TB2J_magnon.py,sha256=q7UwAmorRcFNk4tfE7gl_ny05l6p7pbD9Wm_LkIpKEw,3101
91
+ tb2j-0.9.9rc19.data/scripts/TB2J_magnon2.py,sha256=tMa7Fg_Wd2UytnrH3C_AsgGM7BciUW0iy6NiPlWvar8,1920
92
+ tb2j-0.9.9rc19.data/scripts/TB2J_magnon_dos.py,sha256=TMXQvD2dIbO5FZ4tUMmxJgCgH2O2hDAPUNfEKO4z-x4,110
93
+ tb2j-0.9.9rc19.data/scripts/TB2J_merge.py,sha256=y834SF4rIRn1L1ptkhczvavQpC-8Px6DTmDOOSaq_DE,1854
94
+ tb2j-0.9.9rc19.data/scripts/TB2J_rotate.py,sha256=zgiDFuYZNmzKK0rwDmTaYD2OpRlmKA_VGeBx83w2Xwc,873
95
+ tb2j-0.9.9rc19.data/scripts/TB2J_rotateDM.py,sha256=kCvF7gotuqAX1VnJ06cwfVm7RrhrdtiV5v7d9P2Pn_E,567
96
+ tb2j-0.9.9rc19.data/scripts/abacus2J.py,sha256=VD1ldQP-PIMyxo3Rzzwk_06fJEbbU7oiU3aRXNHK0a0,1826
97
+ tb2j-0.9.9rc19.data/scripts/siesta2J.py,sha256=QJ6c0DbqxaqYEesxiL5R9nK9-flNLrr7hajKfCwirYc,2318
98
+ tb2j-0.9.9rc19.data/scripts/wann2J.py,sha256=OA31VHEXbQMD-JozoLUHDF6vB9Sr62d804OApSKtSnU,3240
99
+ tb2j-0.9.9rc19.dist-info/licenses/LICENSE,sha256=CbZI-jyRTjiqIcWa244cRSHJdjjtUNqGR4HeJkgEwJw,1332
100
+ tb2j-0.9.9rc19.dist-info/METADATA,sha256=cKF5H3b2POxn0y0dHZYy5LhgcoCB2AyMagGuZTNy7wU,1688
101
+ tb2j-0.9.9rc19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
102
+ tb2j-0.9.9rc19.dist-info/entry_points.txt,sha256=Hdz1WC9waUzyFVmowKnbbZ6j-J4adHh_Ko6JpxGYAtE,131
103
+ tb2j-0.9.9rc19.dist-info/top_level.txt,sha256=whYa5ByLYhl5XnTPBHSWr-IGD6VWmr5Ql2bye2qwV_s,5
104
+ tb2j-0.9.9rc19.dist-info/RECORD,,