TB2J 0.9.9rc16__py3-none-any.whl → 0.9.9rc18__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 (26) hide show
  1. TB2J/MAEGreen.py +18 -11
  2. TB2J/interfaces/siesta_interface.py +14 -7
  3. TB2J/io_exchange/__init__.py +2 -0
  4. TB2J/magnon/__init__.py +3 -0
  5. TB2J/magnon/io_exchange2.py +688 -0
  6. TB2J/magnon/plot.py +58 -0
  7. TB2J/magnon/structure.py +348 -0
  8. TB2J/mathutils/__init__.py +1 -0
  9. TB2J/mathutils/magnons.py +45 -0
  10. tb2j-0.9.9rc18.data/scripts/TB2J_magnon2.py +77 -0
  11. {tb2j-0.9.9rc16.data → tb2j-0.9.9rc18.data}/scripts/abacus2J.py +2 -2
  12. {tb2j-0.9.9rc16.dist-info → tb2j-0.9.9rc18.dist-info}/METADATA +1 -1
  13. {tb2j-0.9.9rc16.dist-info → tb2j-0.9.9rc18.dist-info}/RECORD +26 -20
  14. {tb2j-0.9.9rc16.dist-info → tb2j-0.9.9rc18.dist-info}/WHEEL +1 -1
  15. {tb2j-0.9.9rc16.data → tb2j-0.9.9rc18.data}/scripts/TB2J_downfold.py +0 -0
  16. {tb2j-0.9.9rc16.data → tb2j-0.9.9rc18.data}/scripts/TB2J_eigen.py +0 -0
  17. {tb2j-0.9.9rc16.data → tb2j-0.9.9rc18.data}/scripts/TB2J_magnon.py +0 -0
  18. {tb2j-0.9.9rc16.data → tb2j-0.9.9rc18.data}/scripts/TB2J_magnon_dos.py +0 -0
  19. {tb2j-0.9.9rc16.data → tb2j-0.9.9rc18.data}/scripts/TB2J_merge.py +0 -0
  20. {tb2j-0.9.9rc16.data → tb2j-0.9.9rc18.data}/scripts/TB2J_rotate.py +0 -0
  21. {tb2j-0.9.9rc16.data → tb2j-0.9.9rc18.data}/scripts/TB2J_rotateDM.py +0 -0
  22. {tb2j-0.9.9rc16.data → tb2j-0.9.9rc18.data}/scripts/siesta2J.py +0 -0
  23. {tb2j-0.9.9rc16.data → tb2j-0.9.9rc18.data}/scripts/wann2J.py +0 -0
  24. {tb2j-0.9.9rc16.dist-info → tb2j-0.9.9rc18.dist-info}/entry_points.txt +0 -0
  25. {tb2j-0.9.9rc16.dist-info → tb2j-0.9.9rc18.dist-info}/licenses/LICENSE +0 -0
  26. {tb2j-0.9.9rc16.dist-info → tb2j-0.9.9rc18.dist-info}/top_level.txt +0 -0
TB2J/MAEGreen.py CHANGED
@@ -32,7 +32,9 @@ class MAEGreen(ExchangeNCL):
32
32
  """
33
33
  super().__init__(**kwargs)
34
34
  self.natoms = len(self.atoms)
35
- if angles is None or angles == "axis":
35
+ if angles is None or angles == "xyz":
36
+ self.set_angles_xyz()
37
+ elif angles == "axis":
36
38
  self.set_angles_axis()
37
39
  elif angles == "scan":
38
40
  self.set_angles_scan()
@@ -51,6 +53,12 @@ class MAEGreen(ExchangeNCL):
51
53
  self.es_atom = np.zeros((nangles, self.natoms), dtype=complex)
52
54
  self.es_atom_orb = DefaultDict(lambda: 0)
53
55
 
56
+ def set_angles_xyz(self):
57
+ """theta and phi are defined as the x, y, z, xy, yz, xz, xyz, x-yz, -xyz, -x-yz axis."""
58
+ self.thetas = [ np.pi / 2, np.pi / 2, 0.0]
59
+ self.phis = [ np.pi / 2, 0, 0.0]
60
+
61
+
54
62
  def set_angles_axis(self):
55
63
  """theta and phi are defined as the x, y, z, xy, yz, xz, xyz, x-yz, -xyz, -x-yz axis."""
56
64
  self.thetas = [0, np.pi / 2, np.pi / 2, np.pi / 2, np.pi, 0, np.pi / 2, 0, 0, 0]
@@ -75,7 +83,6 @@ class MAEGreen(ExchangeNCL):
75
83
  self.thetas = thetas
76
84
  self.phis = phis
77
85
  self.angle_pairs = list(zip(thetas, phis))
78
- # remove duplicates of angles using sets.
79
86
  self.angle_pairs = list(set(self.angle_pairs))
80
87
  self.thetas, self.phis = zip(*self.angle_pairs)
81
88
 
@@ -277,18 +284,18 @@ class MAEGreen(ExchangeNCL):
277
284
  f.write(f"{ea*1e3:.8f} ")
278
285
  f.write("\n")
279
286
 
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")
287
+ #self.ani = self.fit_anisotropy_tensor()
288
+ #with open(fname_tensor, "w") as f:
289
+ # f.write("# Anisotropy tensor in meV\n")
290
+ # f.write(f"{self.ani.tensor_strings(include_isotropic=False)}\n")
284
291
 
285
- if figure3d is not None:
286
- self.ani.plot_3d(figname=fname_fig3d, show=False)
292
+ #if figure3d is not None:
293
+ # self.ani.plot_3d(figname=fname_fig3d, show=False)
287
294
 
288
- if figure_contourf is not None:
289
- self.ani.plot_contourf(figname=fname_figcontourf, show=False)
295
+ #if figure_contourf is not None:
296
+ # self.ani.plot_contourf(figname=fname_figcontourf, show=False)
290
297
 
291
- plt.close()
298
+ #plt.close()
292
299
  gc.collect()
293
300
 
294
301
  with open(fname_orb, "w") as f:
@@ -5,6 +5,7 @@ import numpy as np
5
5
  from TB2J.exchange import ExchangeNCL
6
6
  from TB2J.exchangeCL2 import ExchangeCL2
7
7
  from TB2J.MAEGreen import MAEGreen
8
+ from TB2J.io_merge import merge
8
9
 
9
10
  try:
10
11
  from HamiltonIO.siesta import SislParser
@@ -156,18 +157,18 @@ 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,
163
164
  )
164
- # thetas = [0, np.pi / 2, np.pi, 3 * np.pi / 2]
165
- # phis = [0, 0, 0, 0]
166
- # MAE.set_angles(thetas=thetas, phis=phis)
165
+ #thetas = [0, np.pi / 2, np.pi, 3 * np.pi / 2]
166
+ #phis = [0, 0, 0, 0]
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,9 @@ 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
+
197
+ merge("TB2J_results_x", "TB2J_results_y", "TB2J_results_z", main_path=None, save=True, write_path='TB2J_results')
198
+ print("Final TB2J_results written to TB2J_results directory.")
199
+
200
+
@@ -1 +1,3 @@
1
1
  from .io_exchange import SpinIO
2
+
3
+ __all__ = ["SpinIO"]
@@ -0,0 +1,3 @@
1
+ from .io_exchange2 import ExchangeIO, plot_tb2j_magnon_bands
2
+
3
+ __all__ = ["ExchangeIO", "plot_tb2j_magnon_bands"]