TB2J 0.9.9.15__py3-none-any.whl → 0.9.10.1__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
@@ -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
@@ -0,0 +1,233 @@
1
+ import numpy as np
2
+
3
+ from .io_exchange import ExchangeIO
4
+ from .io_exchange.structure import get_attribute_array
5
+ from .kpoints import monkhorst_pack
6
+ from .mathutils import get_rotation_arrays
7
+
8
+
9
+ def combine_arrays(u, v):
10
+ return np.concatenate(
11
+ [u * v, np.roll(u, -1, axis=-1) * v, np.roll(v, -1, axis=-1) * u], axis=-1
12
+ )
13
+
14
+
15
+ class ExchangeDownfolder(ExchangeIO):
16
+ def __init__(self, **kwargs):
17
+ reference_axes = kwargs.pop("reference_axes", None)
18
+ kwargs["kmesh"] = kwargs.pop("kmesh", [7, 7, 7])
19
+ super().__init__(**kwargs)
20
+ self._old_values = None
21
+
22
+ if reference_axes is None:
23
+ reference_axes = np.zeros((6, 3))
24
+ reference_axes[:3] = np.eye(3)
25
+ reference_axes[3:] = np.array(
26
+ [[0.0, 1.0, 1.0], [1.0, 0.0, 1.0], [1.0, 1.0, 0.0]]
27
+ ) / np.sqrt(2)
28
+ self.reference_axes = reference_axes
29
+
30
+ @property
31
+ def reference_axes(self):
32
+ return self._axes
33
+
34
+ @reference_axes.setter
35
+ def reference_axes(self, values):
36
+ axes = get_attribute_array(values, "reference_axes")
37
+ if axes.ndim != 2 or axes.shape[-1] != 3:
38
+ raise ValueError("The reference axes must be an array of shape (n, 3)")
39
+ self._axes = axes
40
+
41
+ @property
42
+ def kpoints(self):
43
+ return self._kpoints
44
+
45
+ @ExchangeIO.kmesh.setter
46
+ def kmesh(self, value):
47
+ ExchangeIO.kmesh.fset(self, value)
48
+ self._kpoints = monkhorst_pack(self._kmesh)
49
+
50
+ def set_downfolded_magnetic_sites(self, metals):
51
+ # vectors = self.vectors
52
+ old_pairs = self.interacting_pairs
53
+ self._old_magnetic_elements = self.magnetic_elements
54
+
55
+ self.magnetic_elements = metals
56
+ indices = [old_pairs.index(pair) for pair in self.interacting_pairs]
57
+ self._old_values = self._exchange_values.copy()
58
+ self.set_vectors(values=self.vectors[indices])
59
+
60
+ def _generate_u_matrix(self):
61
+ """
62
+ Constructs the matrix with the coefficients that relate the exchange tensor J_{ij} to the matrix A_{ij}.
63
+ These coefficients only depend on the vectors u_i which depend on the orientations of the magnetic moments.
64
+
65
+ """
66
+ i, j = self.i, self.j
67
+ if self.collinear:
68
+ flat_magmoms = self.magmoms[self._index_spin]
69
+ magmoms = np.zeros((flat_magmoms.shape[0], 3))
70
+ magmoms[:, 2] = flat_magmoms
71
+ else:
72
+ magmoms = self.magmoms[self._index_spin]
73
+ magmoms /= np.linalg.norm(magmoms, axis=-1)[:, None]
74
+
75
+ U, _ = zip(
76
+ *[get_rotation_arrays(magmoms, u=u[None, :]) for u in self.reference_axes]
77
+ )
78
+ U = np.stack(U).swapaxes(0, 1)
79
+
80
+ u1 = combine_arrays(U[i], U[j].conj())
81
+ ur = combine_arrays(U[i], U[j])
82
+ ui = combine_arrays(U[i].conj(), U[j].conj())
83
+ u2 = combine_arrays(U[i].conj(), U[j])
84
+ u = np.concatenate([u1, ur, ui, u2], axis=1)
85
+
86
+ self.u_matrix = u
87
+
88
+ def _compute_AB_coefficients(self, Hk):
89
+ """
90
+ Computes the coefficients corresponding to A_{ij}(d), B_{ij}(d) from the dynamical matrix h(k). They are
91
+ required to reconstruct the exchange tensor J_{ij}(d).
92
+ These 18 coefficients are stored in an array with the shape (npairs, 18, nvectors)
93
+
94
+ """
95
+ i, j = self.i, self.j
96
+ n = i.max() + 1
97
+
98
+ ABk = Hk[:, :, [i, i, i + n, i + n], [j, j + n, j, j + n]]
99
+ ABk = np.moveaxis(ABk, [2, 3], [1, 0]).reshape(len(i), 24, -1)
100
+
101
+ exp_summand = np.exp(2j * np.pi * self.vectors @ self.kpoints.T)
102
+ AB = np.einsum("nik,ndk->nid", ABk[..., ::-1], exp_summand) / len(self.kpoints)
103
+
104
+ self.AB_coefficients = AB
105
+
106
+ def compute_exchange_tensor(self, Hk):
107
+ """
108
+ Computes the exchange tensor that best fits the dynamical matrix Hk
109
+
110
+ Parameters
111
+ ----------
112
+ Hk : ndarray
113
+ Dynamical matrix corresponding to the points on a k-grid, constructed for different reference axes.
114
+ It has the shape (naxes, nkpoints, 2*natoms, 2*natoms)
115
+
116
+ Returns
117
+ -------
118
+ output : ndarray
119
+ An exchange tensor with shape (npairs, ninteractions, 3, 3)
120
+ """
121
+ n = Hk.shape[-1] // 2
122
+ # diag = np.diag_indices(n)
123
+ self.i, self.j = np.triu_indices(n)
124
+
125
+ self._generate_u_matrix()
126
+ self._compute_AB_coefficients(Hk)
127
+
128
+ ii = np.where(self.i == self.j)
129
+ i0 = np.where((self.vectors == 0).all(axis=-1))
130
+ J = np.stack(
131
+ [
132
+ np.linalg.lstsq(mat, coeffs, rcond=None)[0]
133
+ for mat, coeffs in zip(self.u_matrix, self.AB_coefficients)
134
+ ]
135
+ ).swapaxes(1, 2)
136
+ J = J[:, :, [0, 6, 5, 3, 1, 7, 8, 4, 2]].reshape(len(self.i), -1, 3, 3)
137
+ J *= -1
138
+ J[ii] *= 2
139
+ J[i0] *= 0
140
+
141
+ del self.i, self.j, self.u_matrix, self.AB_coefficients
142
+
143
+ return J
144
+
145
+ def set_exchange_tensor(self, J):
146
+ idig = np.diag_indices(3)
147
+ Jiso = J[:, :, *idig].mean(axis=-1)
148
+
149
+ idmi = ([1, 2, 0], [2, 0, 1])
150
+ DMI = (J - J.swapaxes(-1, -2)) / 2
151
+
152
+ Jani = (J + J.swapaxes(-1, -2)) / 2
153
+ Jani[:, :, *idig] -= Jiso[:, :, None]
154
+
155
+ self._exchange_values[:, :, 3] = Jiso
156
+ if not self.collinear:
157
+ self._exchange_values[:, :, 6:9] = DMI[:, :, *idmi]
158
+ self._exchange_values[:, :, 9:] = Jani.reshape(Jani.shape[:2] + (9,))
159
+
160
+ @staticmethod
161
+ def downfold_matrix(matrix, basis):
162
+ eigvals, eigvecs = np.linalg.eigh(matrix)
163
+ A = np.einsum("...ki,...kj->...ij", eigvecs.conj(), basis)
164
+ W, _, Vh = np.linalg.svd(A, full_matrices=False)
165
+ U = np.einsum("...ik,...kj->...ij", W, Vh)
166
+ downfolded_matrix = np.einsum(
167
+ "...ki,...kj->...ij", U.conj(), eigvals[..., None] * U
168
+ )
169
+
170
+ return downfolded_matrix
171
+
172
+ @staticmethod
173
+ def lowdin_partition(matrix, indices):
174
+ N = matrix.shape[-1] // 2
175
+ null_indices = np.array([i for i in range(N) if i not in indices])
176
+ diag_indices = np.diag_indices(2 * null_indices.size)
177
+
178
+ idx = np.concatenate([indices, indices + N])[None, :]
179
+ jdx = np.concatenate([null_indices, null_indices + N])[None, :]
180
+
181
+ Hii = matrix[..., idx.T, idx]
182
+ Hij = matrix[..., idx.T, jdx]
183
+ Hji = matrix[..., jdx.T, idx]
184
+ Hjj = matrix[..., jdx.T, jdx]
185
+
186
+ eigvals = np.linalg.eigvalsh(matrix)
187
+ Hjj[..., *diag_indices] -= eigvals.min()
188
+ correction = np.einsum("...ij,...jk,...kl->...il", Hij, np.linalg.inv(Hjj), Hji)
189
+
190
+ return Hii - correction
191
+
192
+ def downfold(self, metals, **params):
193
+ try:
194
+ metals = metals.split()
195
+ except AttributeError:
196
+ try:
197
+ metals = list(metals)
198
+ except (ValueError, TypeError):
199
+ raise TypeError("argument must be a list of element symbols.")
200
+
201
+ if any(metal not in self.magnetic_elements for metal in metals):
202
+ wrong_symbols = [
203
+ metal for metal in metals if metal not in self.magnetic_elements
204
+ ]
205
+ raise ValueError(
206
+ f"The metal symbols '{wrong_symbols}' are not magnetic elements."
207
+ )
208
+ else:
209
+ magnetic_sites = [
210
+ symbol for symbol in self.elements if symbol in self.magnetic_elements
211
+ ]
212
+ # nsites = len(magnetic_sites)
213
+ metal_indices = np.array(
214
+ [i for i, element in enumerate(magnetic_sites) if element in metals]
215
+ )
216
+
217
+ Hq = np.stack(
218
+ [self.Hq(self.kpoints, u=u[None, :]) for u in self.reference_axes]
219
+ )
220
+ downfolded_Hq = self.lowdin_partition(Hq, metal_indices)
221
+
222
+ self.set_downfolded_magnetic_sites(metals)
223
+ J = self.compute_exchange_tensor(downfolded_Hq)
224
+ self.set_exchange_tensor(J.real)
225
+
226
+ return J
227
+
228
+ def reset(self):
229
+ if self.old_values is not None:
230
+ self.magnetic_elements = self._old_magnetic_elements
231
+ self._exchange_values = self._old_values
232
+ self.old_values = None
233
+ self.old_magnetic_elements = None
@@ -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"):
File without changes
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.4
2
+ Name: TB2J
3
+ Version: 0.9.10.1
4
+ Summary: TB2J: First principle to Heisenberg exchange J using tight-binding Green function method
5
+ Author-email: Xu He <mailhexu@gmail.com>
6
+ Maintainer-email: Xu He <mailhexu@gmail.com>
7
+ License: BSD-2-Clause
8
+ Project-URL: Homepage, https://github.com/mailhexu/TB2J
9
+ Project-URL: Documentation, https://tb2j.readthedocs.io/en/latest/
10
+ Project-URL: Repository, https://github.com/mailhexu/TB2J
11
+ Project-URL: Issues, https://github.com/mailhexu/TB2J/issues
12
+ Keywords: magnetism,DFT,Heisenberg,exchange,physics
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.6
16
+ Classifier: Programming Language :: Python :: 3.7
17
+ Classifier: Programming Language :: Python :: 3.8
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Operating System :: OS Independent
22
+ Classifier: Intended Audience :: Science/Research
23
+ Classifier: Topic :: Scientific/Engineering :: Chemistry
24
+ Classifier: Topic :: Scientific/Engineering :: Physics
25
+ Classifier: License :: OSI Approved :: BSD License
26
+ Requires-Python: >=3.6
27
+ Description-Content-Type: text/markdown
28
+ License-File: LICENSE
29
+ Requires-Dist: numpy<2.0
30
+ Requires-Dist: scipy
31
+ Requires-Dist: matplotlib
32
+ Requires-Dist: ase>=3.19
33
+ Requires-Dist: tqdm
34
+ Requires-Dist: pathos
35
+ Requires-Dist: packaging>=20.0
36
+ Requires-Dist: HamiltonIO>=0.2.4
37
+ Requires-Dist: pre-commit
38
+ Requires-Dist: sympair>0.1.0
39
+ Requires-Dist: tomli>=2.0.0
40
+ Requires-Dist: tomli-w>=1.0.0
41
+ Provides-Extra: siesta
42
+ Requires-Dist: sisl>=0.9.0; extra == "siesta"
43
+ Requires-Dist: netcdf4; extra == "siesta"
44
+ Provides-Extra: lawaf
45
+ Requires-Dist: lawaf==0.2.3; extra == "lawaf"
46
+ Provides-Extra: all
47
+ Requires-Dist: sisl>=0.9.0; extra == "all"
48
+ Requires-Dist: netcdf4; extra == "all"
49
+ Requires-Dist: lawaf==0.2.3; extra == "all"
50
+ Dynamic: license-file
51
+
52
+ [![Python application](https://github.com/mailhexu/TB2J/actions/workflows/python-app.yml/badge.svg)](https://github.com/mailhexu/TB2J/actions/workflows/python-app.yml)
53
+ [![Documentation Status](https://readthedocs.org/projects/tb2j/badge/?version=latest)](https://tb2j.readthedocs.io/en/latest/?badge=latest)
54
+ [![Build Status](https://app.travis-ci.com/mailhexu/TB2J.svg?branch=master)](https://app.travis-ci.com/mailhexu/TB2J)
55
+ [![Downloads](https://pepy.tech/badge/tb2j)](https://pepy.tech/project/tb2j)
56
+
57
+ ## Description
58
+
59
+ TB2J is a open source python package for calculating the magnetic interaction parameters in Heisenberg models from DFT. It use the magnetic force theorem and take the local rigid spin rotation as a perturbation in the Green's function method.
60
+
61
+ The TB2J project is initialized in the PhyTheMa and Nanomat teams in the University of Liege.
62
+
63
+ The features include:
64
+ - Calculates parameters in Heisenberg model, including isotropic exchange, anisotropic exchange, Dyzanoshinskii-Moriya interaction.
65
+ - Can use the input from many DFT codes with Wannier90, e.g. Abinit, Quantum Espresso, Siesta, VASP, etc.
66
+ - Can use input from DFT codes with numerical orbitals from Siesta, OpenMX and ABACUS.
67
+ - Calculate magnon band structure from the Heisenberg Hamiltonian.
68
+ - Generate input for spin dynamics/Monte Carlo codes MULTIBINIT.
69
+ - Require only ground state DFT calculation.
70
+ - No need for supercells.
71
+ - Calculate magnetic interaction up to large distance.
72
+ - Minimal user input, which allows for a black-box like experience and automatic workflows.
73
+ - Versatile API on both the input (DFT Hamiltonian) and the output (Heisenberg model) sides.
74
+
75
+ For more information, see the documentation on
76
+ <https://tb2j.readthedocs.io/en/latest/>
77
+
78
+ ## Dependencies
79
+ * python (tested for ver 3.6)
80
+ * numpy
81
+ * scipy
82
+ * ASE (atomic simulation environment)
83
+ * matplotlib (optional) if you want to plot magnon band structure directly.
84
+ * sisl (optional) for Siesta interface
85
+
86
+ ## Installation
87
+ pip install TB2J
88
+
89
+ ## Message:
90
+ - We welcome contributions. If you would like to add the interface to other codes, or extend the capability of TB2J, please contact us! <mailhexu_AT_gmail_DOT_com>
91
+
@@ -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
@@ -37,6 +37,7 @@ TB2J/thetaphi.py,sha256=Z7N3EOSM7rjHd7b9HxMYLPQO__uR0VwEiV9b471Yudc,399
37
37
  TB2J/utest.py,sha256=z_ahi7tpHQF9WlHNQihcQ7qzfezRJQXQt28eB1X_z64,3897
38
38
  TB2J/utils.py,sha256=DHkc7BK0KUGesfoAv1OxMgIw_iZzcFXh--3ybsFSd_c,12535
39
39
  TB2J/versioninfo.py,sha256=atoCpy6lEcGTCC3xahrxEJjoHgoYVtL41Q_3Ryvp76I,338
40
+ TB2J/downfold/Hdownfolder.py,sha256=EmNy5SCxR-5u64Yprec3PX7H3tvaMj0-jOnsVolDRbs,8152
40
41
  TB2J/external/__init__.py,sha256=yD_ZIMi76H49rj6GAQpiB7UlKa3TgSaMkkLHT6M-8w8,137
41
42
  TB2J/external/p_tqdm.py,sha256=ug1jy3-43r8iW7bC37xzPSIe0EjYKH_GUluGzMiQiDw,5831
42
43
  TB2J/interfaces/__init__.py,sha256=4tiLoXQ73Nlyi9L4j8jJXOYzXluVNPxQZkwfkQZEGHg,307
@@ -55,7 +56,7 @@ TB2J/interfaces/abacus/test_density_matrix.py,sha256=bMWWJYtDS57SpPZ-eZXZ9Hr_UK4
55
56
  TB2J/interfaces/abacus/test_read_HRSR.py,sha256=W1oO_yigT50Yb5_u-KB_IfTpM7kArGkBuMSMs0H4CTs,1235
56
57
  TB2J/interfaces/abacus/test_read_stru.py,sha256=hoKPHVco8vwzC7Gao4bOPCdAPhh29x-9DTJJqRr7AYM,788
57
58
  TB2J/io_exchange/__init__.py,sha256=LqEnG67qDVKt4hCUywDEQvUIJ7jsQjmtueOW_J16NOE,54
58
- TB2J/io_exchange/io_exchange.py,sha256=TQPsxpV0vyFq-HFRRt9GQbpnmRw-5KwyM26eb9fKaoY,22743
59
+ TB2J/io_exchange/io_exchange.py,sha256=KQNCd3G_9Ck-qQX1UMKjfEPHyv5mC3BgRot_ngpACYs,23340
59
60
  TB2J/io_exchange/io_multibinit.py,sha256=8PDmWxzGuv-GwJosj2ZTmiyNY_duFVWJ4ekCuSqGdd8,6739
60
61
  TB2J/io_exchange/io_tomsasd.py,sha256=NqkAC1Fl-CUnFA21eBzSy_S5F_oeQFJysw4UukQbN8o,4173
61
62
  TB2J/io_exchange/io_txt.py,sha256=BMr1eSILlKpgtjvDx7uw2VMAkEKSvGEPNxpaT_zev0I,10547
@@ -91,21 +92,9 @@ TB2J/spinham/supercell.py,sha256=y17uUC6r3gQb278FhxIW4CABihfLTvKFj6flyXrCPR8,122
91
92
  TB2J/wannier/__init__.py,sha256=7ojCbM84PYv1X1Tbo4NHI-d3gWmQsZB_xiYqbfxVV1E,80
92
93
  TB2J/wannier/w90_parser.py,sha256=dbd63LuKyv2DVUzqRINGsbDzEsOxsQyE8_Ear_LQIRg,4620
93
94
  TB2J/wannier/w90_tb_parser.py,sha256=qt8pnuprmPp9iIAYwPkPbmEzk6ZPgMq2xognoQp7vwc,4610
94
- tb2j-0.9.9.15.data/scripts/TB2J_downfold.py,sha256=i4BVqnpDdgrX_amookVWeLGefGBn-qeAutWiwuY9SfQ,2099
95
- tb2j-0.9.9.15.data/scripts/TB2J_eigen.py,sha256=Qs9v2hnMm2Tpfoa4h53muUKty2dZjwx8948MBoQooNg,1128
96
- tb2j-0.9.9.15.data/scripts/TB2J_magnon.py,sha256=q7UwAmorRcFNk4tfE7gl_ny05l6p7pbD9Wm_LkIpKEw,3101
97
- tb2j-0.9.9.15.data/scripts/TB2J_magnon2.py,sha256=tMa7Fg_Wd2UytnrH3C_AsgGM7BciUW0iy6NiPlWvar8,1920
98
- tb2j-0.9.9.15.data/scripts/TB2J_magnon_dos.py,sha256=TMXQvD2dIbO5FZ4tUMmxJgCgH2O2hDAPUNfEKO4z-x4,110
99
- tb2j-0.9.9.15.data/scripts/TB2J_merge.py,sha256=WQVrS2FvrjxkKukiPLY-naQxEK-d2T-bAb5n7e6ml2I,2096
100
- tb2j-0.9.9.15.data/scripts/TB2J_plot_magnon_bands.py,sha256=wLlueNI-wU79cmPFu4LmPDwVBMerKSb5sUlTDSPQK6I,874
101
- tb2j-0.9.9.15.data/scripts/TB2J_rotate.py,sha256=zgiDFuYZNmzKK0rwDmTaYD2OpRlmKA_VGeBx83w2Xwc,873
102
- tb2j-0.9.9.15.data/scripts/TB2J_rotateDM.py,sha256=kCvF7gotuqAX1VnJ06cwfVm7RrhrdtiV5v7d9P2Pn_E,567
103
- tb2j-0.9.9.15.data/scripts/abacus2J.py,sha256=ozYI7qZyja1WEs9oCYVpeYAfVj5PGhehhmdZFcvrd3g,1795
104
- tb2j-0.9.9.15.data/scripts/siesta2J.py,sha256=QJ6c0DbqxaqYEesxiL5R9nK9-flNLrr7hajKfCwirYc,2318
105
- tb2j-0.9.9.15.data/scripts/wann2J.py,sha256=OA31VHEXbQMD-JozoLUHDF6vB9Sr62d804OApSKtSnU,3240
106
- tb2j-0.9.9.15.dist-info/licenses/LICENSE,sha256=CbZI-jyRTjiqIcWa244cRSHJdjjtUNqGR4HeJkgEwJw,1332
107
- tb2j-0.9.9.15.dist-info/METADATA,sha256=4MA4Id_pqZPASA3ig_9xiICywGLB06rlUT6bPiccdW4,1768
108
- tb2j-0.9.9.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
109
- tb2j-0.9.9.15.dist-info/entry_points.txt,sha256=S81PATMTaKCIznjd3pei3Kb3q3xOy2dU-x_cAFSCS7k,194
110
- tb2j-0.9.9.15.dist-info/top_level.txt,sha256=whYa5ByLYhl5XnTPBHSWr-IGD6VWmr5Ql2bye2qwV_s,5
111
- tb2j-0.9.9.15.dist-info/RECORD,,
95
+ tb2j-0.9.10.1.dist-info/licenses/LICENSE,sha256=CbZI-jyRTjiqIcWa244cRSHJdjjtUNqGR4HeJkgEwJw,1332
96
+ tb2j-0.9.10.1.dist-info/METADATA,sha256=aCAWVmSmHiwD7uwDvnlBQocGJaXPpqJAbBtOoJznASc,4138
97
+ tb2j-0.9.10.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
98
+ tb2j-0.9.10.1.dist-info/entry_points.txt,sha256=RuFfrRenhXgzZA1ND_4j4D8ylTXl6VbWLyV3fDx6KKw,734
99
+ tb2j-0.9.10.1.dist-info/top_level.txt,sha256=whYa5ByLYhl5XnTPBHSWr-IGD6VWmr5Ql2bye2qwV_s,5
100
+ tb2j-0.9.10.1.dist-info/RECORD,,
@@ -0,0 +1,16 @@
1
+ [console_scripts]
2
+ TB2J_downfold.py = scripts.TB2J_downfold:main
3
+ TB2J_eigen.py = scripts.TB2J_eigen:main
4
+ TB2J_magnon.py = scripts.TB2J_magnon:main
5
+ TB2J_magnon2.py = scripts.TB2J_magnon2:main
6
+ TB2J_magnon_dos.py = scripts.TB2J_magnon_dos:main
7
+ TB2J_merge.py = scripts.TB2J_merge:main
8
+ TB2J_plot_magnon_bands.py = scripts.TB2J_plot_magnon_bands:main
9
+ TB2J_plot_magnon_dos.py = TB2J.magnon.plot_magnon_dos_cli:main
10
+ TB2J_rotate.py = scripts.TB2J_rotate:main
11
+ TB2J_rotateDM.py = scripts.TB2J_rotateDM:main
12
+ TB2J_symmetrize.py = TB2J.symmetrize_J:symmetrize_J_cli
13
+ abacus2J.py = scripts.abacus2J:run_abacus2J
14
+ lawaf2J.py = TB2J.interfaces.lawaf_interface:lawaf2J_cli
15
+ siesta2J.py = scripts.siesta2J:run_siesta2J
16
+ wann2J.py = scripts.wann2J:run_wann2J
@@ -1,87 +0,0 @@
1
- #!python
2
- import argparse
3
- import os
4
- import sys
5
- from TB2J.Jdownfolder import JDownfolder_pickle
6
-
7
-
8
- def main():
9
- parser = argparse.ArgumentParser(
10
- description="TB2J_downfold: Downfold the exchange parameter with ligand spin as independent variable to that only with metal site spin as independent variables."
11
- )
12
- parser.add_argument(
13
- "--inpath",
14
- "-i",
15
- type=str,
16
- help="The path of the input TB2J results before the downfolding.",
17
- default="TB2J_results",
18
- )
19
-
20
- parser.add_argument(
21
- "--outpath",
22
- "-o",
23
- type=str,
24
- help="The path of the output TB2J results path after the downfolding",
25
- default="TB2J_results_downfolded",
26
- )
27
-
28
- parser.add_argument(
29
- "--metals",
30
- "-m",
31
- type=str,
32
- help="List of magnetic cation elements",
33
- nargs="+",
34
- default=[],
35
- )
36
-
37
- parser.add_argument(
38
- "--ligands",
39
- "-l",
40
- type=str,
41
- help="List of ligand elements",
42
- nargs="+",
43
- default=[],
44
- )
45
-
46
- parser.add_argument(
47
- "--qmesh",
48
- help="kmesh in the format of kx ky kz",
49
- type=int,
50
- nargs="*",
51
- default=[5, 5, 5],
52
- )
53
-
54
- parser.add_argument(
55
- "--iso_only",
56
- help="whether to downfold only the isotropic part. The other parts will be neglected.",
57
- action="store_true",
58
- default=False,
59
- )
60
-
61
- parser.add_argument(
62
- "--method",
63
- help="The method to downfold the exchange parameter. Options are Lowdin and PWF (projected Wannier function). ",
64
- type=str,
65
- default="Lowdin",
66
- )
67
-
68
- args = parser.parse_args()
69
-
70
- if len(args.metals) == []:
71
- print("List of magnetic cation elements cannot be empty")
72
-
73
- if len(args.ligands) == []:
74
- print("List of ligand elements cannot be empty")
75
-
76
- JDownfolder_pickle(
77
- inpath=args.inpath,
78
- metals=args.metals,
79
- ligands=args.ligands,
80
- outpath=args.outpath,
81
- qmesh=args.qmesh,
82
- iso_only=args.iso_only,
83
- method=args.method,
84
- )
85
-
86
-
87
- main()
@@ -1,47 +0,0 @@
1
- #!python
2
- from TB2J.plot import write_eigen
3
- from TB2J.versioninfo import print_license
4
- import argparse
5
-
6
- """
7
- The script to plot the magnon band structure.
8
- """
9
-
10
-
11
- def write_eigen_info():
12
- print_license()
13
- parser = argparse.ArgumentParser(
14
- description="TB2J_eigen.py: Write the eigen values and eigen vectors to file."
15
- )
16
- parser.add_argument(
17
- "--path", default="./", type=str, help="The path of the TB2J_results file"
18
- )
19
-
20
- parser.add_argument(
21
- "--qmesh",
22
- help="qmesh in the format of kx ky kz. Monkhorst pack or Gamma-centered.",
23
- type=int,
24
- nargs="*",
25
- default=[8, 8, 8],
26
- )
27
-
28
- parser.add_argument(
29
- "--gamma",
30
- help="whether shift the qpoint grid to Gamma-centered. Default: False",
31
- action="store_true",
32
- default=True,
33
- )
34
-
35
- parser.add_argument(
36
- "--output_fname",
37
- type=str,
38
- help="The file name of the output. Default: eigenJq.txt",
39
- default="eigenJq.txt",
40
- )
41
-
42
- args = parser.parse_args()
43
-
44
- write_eigen(args.qmesh, args.gamma, output_fname=args.output_fname)
45
-
46
-
47
- write_eigen_info()
@@ -1,116 +0,0 @@
1
- #!python
2
- from TB2J.plot import plot_magnon_band, write_eigen
3
- from TB2J.versioninfo import print_license
4
- import argparse
5
-
6
- """
7
- The script to plot the magnon band structure.
8
- """
9
-
10
-
11
- def plot_magnon():
12
- print_license()
13
- parser = argparse.ArgumentParser(
14
- description="TB2J_magnon: Plot magnon band structure from the TB2J magnetic interaction parameters"
15
- )
16
- parser.add_argument(
17
- "--fname",
18
- default="exchange.xml",
19
- type=str,
20
- help="exchange xml file name. default: exchange.xml",
21
- )
22
-
23
- parser.add_argument(
24
- "--qpath",
25
- default=None,
26
- type=str,
27
- help="The names of special q-points. If not given, the path will be automatically choosen. See https://wiki.fysik.dtu.dk/ase/ase/dft/kpoints.html for the table of special kpoints and the default path.",
28
- )
29
-
30
- parser.add_argument(
31
- "--figfname",
32
- default=None,
33
- type=str,
34
- help="The file name of the figure. It should be e.g. png, pdf or other types of files which could be generated by matplotlib.",
35
- )
36
-
37
- parser.add_argument(
38
- "--Jq",
39
- action="store_true",
40
- help="To plot the eigenvalues of -J(q) instead of the magnon band",
41
- default=False,
42
- )
43
-
44
- parser.add_argument(
45
- "--no_Jiso",
46
- action="store_true",
47
- help="switch off isotropic exchange",
48
- default=None,
49
- )
50
-
51
- parser.add_argument(
52
- "--no_dmi", action="store_true", help="switch off dmi", default=None
53
- )
54
-
55
- parser.add_argument(
56
- "--no_Jani",
57
- action="store_true",
58
- help="switch off anisotropic exchange",
59
- default=None,
60
- )
61
-
62
- parser.add_argument(
63
- "--write_emin", action="store_true", help="switch to write emin", default=False
64
- )
65
-
66
- parser.add_argument(
67
- "--show",
68
- action="store_true",
69
- help="whether to show magnon band structure.",
70
- default=False,
71
- )
72
-
73
- args = parser.parse_args()
74
- if args.Jq:
75
- if args.figfname is None:
76
- args.figfname = "Eigen_Jq.pdf"
77
- print(
78
- "Plotting the eigenvalues of -J(q). The figure is written to %s"
79
- % (args.figfname)
80
- )
81
- else:
82
- if args.figfname is None:
83
- args.figfname = "magnon_band.pdf"
84
- print(
85
- "Plotting the magnon band structure. The figure is written to %s"
86
- % (args.figfname)
87
- )
88
-
89
- def nonone(x):
90
- if x is None:
91
- return x
92
- else:
93
- return not x
94
-
95
- if args.write_emin:
96
- write_eigen(
97
- has_exchange=nonone(args.no_Jiso),
98
- has_dmi=nonone(args.no_dmi),
99
- has_bilinear=nonone(args.no_Jani),
100
- )
101
- else:
102
- plot_magnon_band(
103
- fname=args.fname,
104
- knames=args.qpath,
105
- npoints=300,
106
- Jq=args.Jq,
107
- figfname=args.figfname,
108
- show=args.show,
109
- has_exchange=nonone(args.no_Jiso),
110
- has_dmi=nonone(args.no_dmi),
111
- has_bilinear=nonone(args.no_Jani),
112
- )
113
-
114
-
115
- if __name__ == "__main__":
116
- plot_magnon()
@@ -1,78 +0,0 @@
1
- #!python
2
- from TB2J.magnon import plot_tb2j_magnon_bands
3
-
4
-
5
- def plot_tb2j_magnon_bands_cli():
6
- """Command line interface for plotting magnon band structures from TB2J data."""
7
- import argparse
8
-
9
- parser = argparse.ArgumentParser(
10
- description="Plot magnon band structure from TB2J data",
11
- formatter_class=argparse.ArgumentDefaultsHelpFormatter,
12
- )
13
-
14
- parser.add_argument(
15
- "-f", "--file", default="TB2J.pickle", help="Path to TB2J pickle file"
16
- )
17
-
18
- parser.add_argument(
19
- "-p",
20
- "--path",
21
- help="High-symmetry k-point path (e.g., 'GXMG' for square lattice)",
22
- )
23
-
24
- parser.add_argument(
25
- "-n",
26
- "--npoints",
27
- type=int,
28
- default=300,
29
- help="Number of k-points for band structure calculation",
30
- )
31
-
32
- parser.add_argument(
33
- "-a",
34
- "--anisotropic",
35
- action="store_true",
36
- help="Include anisotropic interactions",
37
- )
38
-
39
- parser.add_argument(
40
- "-q",
41
- "--quadratic",
42
- action="store_true",
43
- help="Include biquadratic interactions",
44
- )
45
-
46
- parser.add_argument("-o", "--output", help="Output filename for the plot")
47
-
48
- parser.add_argument(
49
- "--no-pbc",
50
- nargs="+",
51
- type=int,
52
- choices=[0, 1, 2],
53
- help="Disable periodic boundary conditions in specified directions (0=x, 1=y, 2=z)",
54
- )
55
-
56
- args = parser.parse_args()
57
-
58
- # Set up periodic boundary conditions
59
- pbc = [True, True, True]
60
- if args.no_pbc:
61
- for direction in args.no_pbc:
62
- pbc[direction] = False
63
- pbc = tuple(pbc)
64
-
65
- # Plot the bands
66
- plot_tb2j_magnon_bands(
67
- pickle_file=args.file,
68
- path=args.path,
69
- npoints=args.npoints,
70
- anisotropic=args.anisotropic,
71
- quadratic=args.quadratic,
72
- pbc=pbc,
73
- filename=args.output,
74
- )
75
-
76
-
77
- if __name__ == "__main__":
78
- plot_tb2j_magnon_bands_cli()
@@ -1,5 +0,0 @@
1
- #!python
2
-
3
- from TB2J.plot import plot_magnon_dos, command_line_plot_magnon_dos
4
-
5
- command_line_plot_magnon_dos()
@@ -1,49 +0,0 @@
1
- #!python
2
- import argparse
3
-
4
- from TB2J.io_merge import merge
5
- from TB2J.version_info import print_license
6
-
7
-
8
- def main():
9
- parser = argparse.ArgumentParser(
10
- description="TB2J_merge: merge the exchange parameters calculated from different directions. It can accept two types of calculations, first, the lattice structures are rotated from the original structure, from z to x, y, and z, respectively. The structures could be generated using the TB2J_rotate.py command. The second type is the three calculations have the spins along the x, y, and z axis, respectively."
11
- )
12
- parser.add_argument(
13
- "directories",
14
- type=str,
15
- nargs="+",
16
- help="The three directories the TB2J calculations are done. Inside each of them, there should be a TB2J_results directory which contains the magnetic interaction parameter files. e.g. Fe_x Fe_y Fe_z. Alternatively, it could be the TB2J results directories.",
17
- )
18
-
19
- parser.add_argument(
20
- "--type",
21
- "-T",
22
- type=str,
23
- help="The type of calculations, either structure of spin, meaning that the three calculations are done by rotating the structure/spin. ",
24
- )
25
- parser.add_argument(
26
- "--output_path",
27
- help="The path of the output directory, default is TB2J_results",
28
- type=str,
29
- default="TB2J_results",
30
- )
31
- parser.add_argument(
32
- "--main_path",
33
- help="The path containning the reference structure.",
34
- type=str,
35
- default=None,
36
- )
37
-
38
- args = parser.parse_args()
39
- # merge(*(args.directories), args.type.strip().lower(), path=args.output_path)
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)
42
- print_license()
43
- print("Merging the TB2J results from the following directories: ", args.directories)
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)
46
-
47
-
48
- if __name__ == "__main__":
49
- main()
@@ -1,27 +0,0 @@
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,28 +0,0 @@
1
- #!python
2
- import argparse
3
- from TB2J.rotate_atoms import rotate_atom_xyz, rotate_xyz, check_ftype
4
-
5
-
6
- def main():
7
- parser = argparse.ArgumentParser(description="")
8
- parser.add_argument(
9
- "fname", help="name of the file containing the atomic structure", type=str
10
- )
11
- parser.add_argument(
12
- "--ftype",
13
- help="type of the output files, e.g. xyz. Please use the format which contains the full cell matrix. (e.g. .cif file should not be used) ",
14
- default="xyz",
15
- type=str,
16
- )
17
- parser.add_argument(
18
- "--noncollinear",
19
- action="store_true",
20
- help="If present, six different configurations will be generated. These are required for non-collinear systems."
21
- )
22
-
23
- args = parser.parse_args()
24
- rotate_xyz(args.fname, ftype=args.ftype, noncollinear=args.noncollinear)
25
-
26
-
27
- if __name__ == "__main__":
28
- main()
@@ -1,21 +0,0 @@
1
- #!python
2
- import argparse
3
- from TB2J.rotate_siestaDM import rotate_DM
4
-
5
- def main():
6
- parser = argparse.ArgumentParser(description="")
7
- parser.add_argument(
8
- "--fdf_fname", help="Name of the *.fdf siesta file."
9
- )
10
- parser.add_argument(
11
- "--noncollinear",
12
- action="store_true",
13
- help="If present, six different configurations will be generated. These are required for non-collinear systems."
14
- )
15
-
16
- args = parser.parse_args()
17
- rotate_DM(args.fdf_fname, noncollinear=args.noncollinear)
18
-
19
-
20
- if __name__ == "__main__":
21
- main()
@@ -1,61 +0,0 @@
1
- #!python
2
- import argparse
3
- import sys
4
-
5
- from TB2J.exchange_params import add_exchange_args_to_parser
6
- from TB2J.interfaces import gen_exchange_abacus
7
- from TB2J.versioninfo import print_license
8
-
9
-
10
- def run_abacus2J():
11
- print_license()
12
- parser = argparse.ArgumentParser(
13
- description="abacus2J: Using magnetic force theorem to calculate exchange parameter J from abacus Hamiltonian in the LCAO mode"
14
- )
15
- # Add ABACUS specific arguments
16
- parser.add_argument(
17
- "--path", help="the path of the abacus calculation", default="./", type=str
18
- )
19
- parser.add_argument(
20
- "--suffix",
21
- help="the label of the abacus calculation. There should be an output directory called OUT.suffix",
22
- default="abacus",
23
- type=str,
24
- )
25
-
26
- # Add common exchange arguments
27
- parser = add_exchange_args_to_parser(parser)
28
-
29
- args = parser.parse_args()
30
-
31
- index_magnetic_atoms = args.index_magnetic_atoms
32
- if index_magnetic_atoms is not None:
33
- index_magnetic_atoms = [i - 1 for i in index_magnetic_atoms]
34
-
35
- if args.elements is None and index_magnetic_atoms is None:
36
- print("Please input the magnetic elements, e.g. --elements Fe Ni")
37
- sys.exit()
38
-
39
- # include_orbs = {}
40
-
41
- gen_exchange_abacus(
42
- path=args.path,
43
- suffix=args.suffix,
44
- kmesh=args.kmesh,
45
- magnetic_elements=args.elements,
46
- include_orbs={},
47
- Rcut=args.rcut,
48
- emin=args.emin,
49
- nz=args.nz,
50
- description=args.description,
51
- output_path=args.output_path,
52
- use_cache=args.use_cache,
53
- nproc=args.np,
54
- exclude_orbs=args.exclude_orbs,
55
- orb_decomposition=args.orb_decomposition,
56
- index_magnetic_atoms=index_magnetic_atoms,
57
- )
58
-
59
-
60
- if __name__ == "__main__":
61
- run_abacus2J()
@@ -1,78 +0,0 @@
1
- #!python
2
- import argparse
3
- import sys
4
-
5
- from TB2J.exchange_params import add_exchange_args_to_parser
6
- from TB2J.interfaces import gen_exchange_siesta
7
- from TB2J.versioninfo import print_license
8
-
9
-
10
- def run_siesta2J():
11
- print_license()
12
- parser = argparse.ArgumentParser(
13
- description="siesta2J: Using magnetic force theorem to calculate exchange parameter J from siesta Hamiltonian"
14
- )
15
- # Add siesta specific arguments
16
- parser.add_argument(
17
- "--fdf_fname", help="path of the input fdf file", default="./", type=str
18
- )
19
- parser.add_argument(
20
- "--fname",
21
- default="exchange.xml",
22
- type=str,
23
- help="exchange xml file name. default: exchange.xml",
24
- )
25
- parser.add_argument(
26
- "--split_soc",
27
- help="whether the SOC part of the Hamiltonian can be read from the output of siesta. Default: False",
28
- action="store_true",
29
- default=False,
30
- )
31
-
32
- # Add common exchange arguments
33
- parser = add_exchange_args_to_parser(parser)
34
-
35
- args = parser.parse_args()
36
-
37
- if args.elements is None:
38
- print("Please input the magnetic elements, e.g. --elements Fe Ni")
39
- sys.exit()
40
-
41
- # include_orbs = {}
42
- # for element in args.elements:
43
- # if "_" in element:
44
- # elem = element.split("_")[0]
45
- # orb = element.split("_")[1:]
46
- # include_orbs[elem] = orb
47
- # else:
48
- # include_orbs[element] = None
49
-
50
- index_magnetic_atoms = args.index_magnetic_atoms
51
- if index_magnetic_atoms is not None:
52
- index_magnetic_atoms = [i - 1 for i in index_magnetic_atoms]
53
-
54
- gen_exchange_siesta(
55
- fdf_fname=args.fdf_fname,
56
- kmesh=args.kmesh,
57
- # magnetic_elements=list(include_orbs.keys()),
58
- # include_orbs=include_orbs,
59
- magnetic_elements=args.elements,
60
- include_orbs={},
61
- Rcut=args.rcut,
62
- emin=args.emin,
63
- emax=args.emax,
64
- nz=args.nz,
65
- description=args.description,
66
- output_path=args.output_path,
67
- use_cache=args.use_cache,
68
- nproc=args.np,
69
- exclude_orbs=args.exclude_orbs,
70
- orb_decomposition=args.orb_decomposition,
71
- read_H_soc=args.split_soc,
72
- orth=args.orth,
73
- index_magnetic_atoms=index_magnetic_atoms,
74
- )
75
-
76
-
77
- if __name__ == "__main__":
78
- run_siesta2J()
@@ -1,101 +0,0 @@
1
- #!python
2
- import argparse
3
- import sys
4
-
5
- from TB2J.exchange_params import add_exchange_args_to_parser
6
- from TB2J.interfaces import gen_exchange
7
- from TB2J.versioninfo import print_license
8
-
9
-
10
- def run_wann2J():
11
- print_license()
12
- parser = argparse.ArgumentParser(
13
- description="wann2J: Using magnetic force theorem to calculate exchange parameter J from wannier functions"
14
- )
15
- parser.add_argument(
16
- "--path", help="path to the wannier files", default="./", type=str
17
- )
18
- parser.add_argument(
19
- "--posfile", help="name of the position file", default="POSCAR", type=str
20
- )
21
- parser.add_argument(
22
- "--prefix_spinor",
23
- help="prefix to the spinor wannier files",
24
- default="wannier90",
25
- type=str,
26
- )
27
- parser.add_argument(
28
- "--prefix_up",
29
- help="prefix to the spin up wannier files",
30
- default="wannier90.up",
31
- type=str,
32
- )
33
- parser.add_argument(
34
- "--prefix_down",
35
- help="prefix to the spin down wannier files",
36
- default="wannier90.dn",
37
- type=str,
38
- )
39
- parser.add_argument(
40
- "--groupby",
41
- 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.",
42
- default="spin",
43
- type=str,
44
- )
45
- parser.add_argument(
46
- "--wannier_type",
47
- help="The type of Wannier function, either Wannier90 or banddownfolder",
48
- type=str,
49
- default="Wannier90",
50
- )
51
-
52
- # parser.add_argument("--qspace",
53
- # action="store_true",
54
- # help="Whether to calculate J in qspace first and transform to real space.",
55
- # default=False)
56
-
57
- add_exchange_args_to_parser(parser)
58
-
59
- args = parser.parse_args()
60
-
61
- if args.efermi is None:
62
- print("Please input fermi energy using --efermi ")
63
- sys.exit()
64
- if args.elements is None and args.index_magnetic_atoms is None:
65
- print("Please input the magnetic elements, e.g. --elements Fe Ni")
66
- sys.exit()
67
-
68
- index_magnetic_atoms = args.index_magnetic_atoms
69
- if index_magnetic_atoms is not None:
70
- index_magnetic_atoms = [i - 1 for i in index_magnetic_atoms]
71
-
72
- gen_exchange(
73
- path=args.path,
74
- colinear=(not args.spinor),
75
- groupby=args.groupby,
76
- posfile=args.posfile,
77
- efermi=args.efermi,
78
- kmesh=args.kmesh,
79
- magnetic_elements=args.elements,
80
- Rcut=args.rcut,
81
- prefix_SOC=args.prefix_spinor,
82
- prefix_up=args.prefix_up,
83
- prefix_dn=args.prefix_down,
84
- emin=args.emin,
85
- emax=args.emax,
86
- nz=args.nz,
87
- use_cache=args.use_cache,
88
- nproc=args.np,
89
- description=args.description,
90
- output_path=args.output_path,
91
- exclude_orbs=args.exclude_orbs,
92
- wannier_type=args.wannier_type,
93
- # qspace=args.qspace,
94
- write_density_matrix=args.write_dm,
95
- orb_decomposition=args.orb_decomposition,
96
- index_magnetic_atoms=index_magnetic_atoms,
97
- )
98
-
99
-
100
- if __name__ == "__main__":
101
- run_wann2J()
@@ -1,41 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: TB2J
3
- Version: 0.9.9.15
4
- Summary: TB2J: First principle to Heisenberg exchange J using tight-binding Green function method
5
- Author: Xu He
6
- Author-email: mailhexu@gmail.com
7
- License: BSD-2-clause
8
- Classifier: Development Status :: 3 - Alpha
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: Operating System :: OS Independent
11
- Classifier: Intended Audience :: Science/Research
12
- Classifier: Topic :: Scientific/Engineering :: Chemistry
13
- Classifier: Topic :: Scientific/Engineering :: Physics
14
- Classifier: License :: OSI Approved :: BSD License
15
- Requires-Python: >=3.6
16
- License-File: LICENSE
17
- Requires-Dist: numpy<2.0
18
- Requires-Dist: scipy
19
- Requires-Dist: matplotlib
20
- Requires-Dist: ase>=3.19
21
- Requires-Dist: tqdm
22
- Requires-Dist: pathos
23
- Requires-Dist: packaging>=20.0
24
- Requires-Dist: HamiltonIO>=0.2.4
25
- Requires-Dist: pre-commit
26
- Requires-Dist: sympair>0.1.0
27
- Requires-Dist: sisl>=0.9.0
28
- Requires-Dist: tomli>=2.0.0
29
- Requires-Dist: tomli-w>=1.0.0
30
- Requires-Dist: netcdf4
31
- Dynamic: author
32
- Dynamic: author-email
33
- Dynamic: classifier
34
- Dynamic: description
35
- Dynamic: license
36
- Dynamic: license-file
37
- Dynamic: requires-dist
38
- Dynamic: requires-python
39
- Dynamic: summary
40
-
41
- TB2J is a Python package aimed to compute automatically the magnetic interactions (superexchange and Dzyaloshinskii-Moriya) between atoms of magnetic crystals from DFT Hamiltonian based on Wannier functions or Linear combination of atomic orbitals. It uses the Green's function method and take the local rigid spin rotation as a perturbation. The package can take the output from Wannier90, which is interfaced with many density functional theory codes or from codes based on localised orbitals. A minimal user input is needed, which allows for an easily integration into a high-throughput workflows.
@@ -1,4 +0,0 @@
1
- [console_scripts]
2
- TB2J_plot_magnon_dos.py = TB2J.magnon.plot_magnon_dos_cli:main
3
- TB2J_symmetrize.py = TB2J.symmetrize_J:symmetrize_J_cli
4
- lawaf2J.py = TB2J.interfaces.lawaf_interface:lawaf2J_cli