TB2J 0.9.9rc9__py3-none-any.whl → 0.9.9rc11__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/exchange.py CHANGED
@@ -1,6 +1,6 @@
1
1
  import os
2
2
  import pickle
3
- from collections import OrderedDict, defaultdict
3
+ from collections import defaultdict
4
4
 
5
5
  import numpy as np
6
6
  from tqdm import tqdm
@@ -97,7 +97,7 @@ class Exchange(ExchangeParams):
97
97
  def _prepare_orb_dict(self):
98
98
  """
99
99
  Generate orbital and magnetic atom mappings needed for exchange calculations.
100
-
100
+
101
101
  Creates:
102
102
  - self.orb_dict: Maps atom indices to their orbital indices
103
103
  - self.labels: Maps atom indices to their orbital labels
@@ -114,13 +114,13 @@ class Exchange(ExchangeParams):
114
114
  def _create_orbital_mappings(self):
115
115
  """Create mappings between atoms and their orbitals."""
116
116
  self.orb_dict = {} # {atom_index: [orbital_indices]}
117
- self.labels = {} # {atom_index: [orbital_labels]}
117
+ self.labels = {} # {atom_index: [orbital_labels]}
118
118
  atom_symbols = symbol_number(self.atoms)
119
119
 
120
120
  for orb_idx, base in enumerate(self.basis):
121
121
  if orb_idx in self.exclude_orbs:
122
122
  continue
123
-
123
+
124
124
  # Extract atom and orbital info
125
125
  if isinstance(base, str):
126
126
  atom_sym, orb_sym = base.split("|")[:2]
@@ -152,7 +152,10 @@ class Exchange(ExchangeParams):
152
152
  tags = self.atoms.get_tags()
153
153
 
154
154
  for atom_idx, (sym, tag) in enumerate(zip(symbols, tags)):
155
- if sym in self.magnetic_elements or f"{sym}{tag}" in self.magnetic_elements:
155
+ if (
156
+ sym in self.magnetic_elements
157
+ or f"{sym}{tag}" in self.magnetic_elements
158
+ ):
156
159
  self.ind_mag_atoms.append(atom_idx)
157
160
  print(f"Magnetic atoms: {self.ind_mag_atoms}")
158
161
 
TB2J/exchange_params.py CHANGED
@@ -15,7 +15,7 @@ class ExchangeParams:
15
15
  efermi: float
16
16
  basis = []
17
17
  magnetic_elements = []
18
- index_magnetic_atoms = None
18
+ index_magnetic_atoms = None
19
19
  include_orbs = {}
20
20
  _kmesh = [4, 4, 4]
21
21
  emin: float = -15
TB2J/rotate_siestaDM.py CHANGED
@@ -1,28 +1,28 @@
1
1
  import sisl
2
2
 
3
+
3
4
  def rotate_siesta_DM(DM, noncollinear=False):
4
-
5
- angles_list = [ [0.0, 90.0, 0.0], [0.0, 90.0, 90.0] ]
5
+ angles_list = [[0.0, 90.0, 0.0], [0.0, 90.0, 90.0]]
6
6
  if noncollinear:
7
7
  angles_list += [[0.0, 45.0, 0.0], [0.0, 90.0, 45.0], [0.0, 45.0, 90.0]]
8
8
 
9
9
  for angles in angles_list:
10
10
  yield DM.spin_rotate(angles)
11
11
 
12
- def read_label(fdf_fname):
13
12
 
14
- label = 'siesta'
15
- with open(fdf_fname, 'r') as File:
13
+ def read_label(fdf_fname):
14
+ label = "siesta"
15
+ with open(fdf_fname, "r") as File:
16
16
  for line in File:
17
- corrected_line = line.lower().replace('.', '').replace('-', '')
18
- if 'systemlabel' in corrected_line:
17
+ corrected_line = line.lower().replace(".", "").replace("-", "")
18
+ if "systemlabel" in corrected_line:
19
19
  label = line.split()[1]
20
20
  break
21
21
 
22
22
  return label
23
23
 
24
- def rotate_DM(fdf_fname, noncollinear=False):
25
24
 
25
+ def rotate_DM(fdf_fname, noncollinear=False):
26
26
  fdf = sisl.get_sile(fdf_fname)
27
27
  DM = fdf.read_density_matrix()
28
28
  label = read_label(fdf_fname)
@@ -33,4 +33,6 @@ def rotate_DM(fdf_fname, noncollinear=False):
33
33
  rotated_DM.write(f"{label}_{i+1}.DM")
34
34
  DM.write(f"{label}_0.DM")
35
35
 
36
- print(f"The output has been written to the {label}_i.DM files. {label}_0.DM contains the reference density matrix.")
36
+ print(
37
+ f"The output has been written to the {label}_i.DM files. {label}_0.DM contains the reference density matrix."
38
+ )
@@ -2,9 +2,9 @@
2
2
  import argparse
3
3
  import sys
4
4
 
5
+ from TB2J.exchange_params import add_exchange_args_to_parser
5
6
  from TB2J.interfaces import gen_exchange_abacus
6
7
  from TB2J.versioninfo import print_license
7
- from TB2J.exchange_params import add_exchange_args_to_parser
8
8
 
9
9
 
10
10
  def run_abacus2J():
@@ -26,7 +26,6 @@ def run_abacus2J():
26
26
  # Add common exchange arguments
27
27
  parser = add_exchange_args_to_parser(parser)
28
28
 
29
-
30
29
  args = parser.parse_args()
31
30
 
32
31
  if args.elements is None:
@@ -2,9 +2,9 @@
2
2
  import argparse
3
3
  import sys
4
4
 
5
+ from TB2J.exchange_params import add_exchange_args_to_parser
5
6
  from TB2J.interfaces import gen_exchange_siesta
6
7
  from TB2J.versioninfo import print_license
7
- from TB2J.exchange_params import add_exchange_args_to_parser
8
8
 
9
9
 
10
10
  def run_siesta2J():
@@ -32,7 +32,6 @@ def run_siesta2J():
32
32
  # Add common exchange arguments
33
33
  parser = add_exchange_args_to_parser(parser)
34
34
 
35
-
36
35
  args = parser.parse_args()
37
36
 
38
37
  if args.elements is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TB2J
3
- Version: 0.9.9rc9
3
+ Version: 0.9.9rc11
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
@@ -21,7 +21,7 @@ Requires-Dist: ase>=3.19
21
21
  Requires-Dist: tqdm
22
22
  Requires-Dist: pathos
23
23
  Requires-Dist: packaging>=20.0
24
- Requires-Dist: HamiltonIO>=0.1.9
24
+ Requires-Dist: HamiltonIO>=0.1.10
25
25
  Requires-Dist: pre-commit
26
26
  Requires-Dist: sympair>0.1.0
27
27
  Requires-Dist: sisl>=0.9.0
@@ -11,9 +11,9 @@ TB2J/citation.py,sha256=gcQeyJZaT1Qrtsl8Y3s4neOH3-vvgmIcCvXeV2o3vj0,2891
11
11
  TB2J/contour.py,sha256=zLHQZZ3hhgLkLFPATCraLOJyLJKLC0fba_L_5sRz23o,3246
12
12
  TB2J/density_matrix.py,sha256=D5k8Oe21OCiLVORNYbo4TZOFG0slrQSbj91kJ3TMFjs,1514
13
13
  TB2J/epc.py,sha256=zLbtqZJhDr8DnnGN6YENcXwrMb3Qxu6KB08mLy9Pw20,3474
14
- TB2J/exchange.py,sha256=eVZ2Prm9faSPZNUJELTsGbfOPCw3QqUKIy5E_7tL03s,27015
14
+ TB2J/exchange.py,sha256=HSvB_keITEeaoNG661feoEcCwjkQlavQQiIi1ONsI3Y,27035
15
15
  TB2J/exchangeCL2.py,sha256=P7bklMXVYX_tn9DbjEPqeTir1SeZyfPBIP1fhWUzLmY,11419
16
- TB2J/exchange_params.py,sha256=xw3STJlumf5tNhnfzICzWzAl7srOy-wnyLsi-rImdSQ,7883
16
+ TB2J/exchange_params.py,sha256=eEO7DX9Hy9HiQ_ZyAvsBcc7KhB6jeKJKZzrhf74YKMk,7882
17
17
  TB2J/exchange_pert.py,sha256=jmFMtQbYa_uczM4VAeS6TijkIHRFIqEzZJswzE9Wfuo,8523
18
18
  TB2J/exchange_qspace.py,sha256=ZL68qBGFUaQ9BsSPsJaaoWOr9RssPiqX34R_9I3nk_8,8436
19
19
  TB2J/gpaw_wrapper.py,sha256=aJ--9Dtyq7jOP1Hkh-Sh1nWcfXm6zKcljOCO0DNCAr0,6890
@@ -29,7 +29,7 @@ TB2J/pauli.py,sha256=ESpAhk6LG5ugzuW1YFUTqiDxcg-pQ7wNnzR2FtUnvKM,5295
29
29
  TB2J/pert.py,sha256=RaCJfewl0doht4cjAnzzGKe-uj2le4aqe0iPKFrq9fo,1192
30
30
  TB2J/plot.py,sha256=AnFIFWE2vlmj7Z6f_7-dX_O1stJN-qbuiurPj43dUCM,4104
31
31
  TB2J/rotate_atoms.py,sha256=Dwptn-wdDW4zYzjYb95yxTzuZOe9WPuLjh3d3-YcSs0,3277
32
- TB2J/rotate_siestaDM.py,sha256=eR97rspdrRaK9YTwQwUKfobI0S9UnEcbEZ2f5IgR7Tk,1070
32
+ TB2J/rotate_siestaDM.py,sha256=I4ytO8uFP8_GFyBs9-zMdiMSZS3Y3lj2dSLfNBNI2ZY,1078
33
33
  TB2J/sisl_wrapper.py,sha256=A5x1-tt8efUSPeGY5wM5m6-pJYQFXTCzQHVqD6RBa2g,14792
34
34
  TB2J/symmetrize_J.py,sha256=IypvLL0JxExq-cmqc4o0nLL8psE7OC9ijj9YMcsqJeA,4487
35
35
  TB2J/tensor_rotate.py,sha256=4-DfT_Mg5e40fbd74M5W0D5DqmUq-kVOOLDkkkI834A,8083
@@ -80,19 +80,19 @@ TB2J/spinham/supercell.py,sha256=y17uUC6r3gQb278FhxIW4CABihfLTvKFj6flyXrCPR8,122
80
80
  TB2J/wannier/__init__.py,sha256=7ojCbM84PYv1X1Tbo4NHI-d3gWmQsZB_xiYqbfxVV1E,80
81
81
  TB2J/wannier/w90_parser.py,sha256=dbd63LuKyv2DVUzqRINGsbDzEsOxsQyE8_Ear_LQIRg,4620
82
82
  TB2J/wannier/w90_tb_parser.py,sha256=qt8pnuprmPp9iIAYwPkPbmEzk6ZPgMq2xognoQp7vwc,4610
83
- tb2j-0.9.9rc9.data/scripts/TB2J_downfold.py,sha256=i4BVqnpDdgrX_amookVWeLGefGBn-qeAutWiwuY9SfQ,2099
84
- tb2j-0.9.9rc9.data/scripts/TB2J_eigen.py,sha256=Qs9v2hnMm2Tpfoa4h53muUKty2dZjwx8948MBoQooNg,1128
85
- tb2j-0.9.9rc9.data/scripts/TB2J_magnon.py,sha256=q7UwAmorRcFNk4tfE7gl_ny05l6p7pbD9Wm_LkIpKEw,3101
86
- tb2j-0.9.9rc9.data/scripts/TB2J_magnon_dos.py,sha256=TMXQvD2dIbO5FZ4tUMmxJgCgH2O2hDAPUNfEKO4z-x4,110
87
- tb2j-0.9.9rc9.data/scripts/TB2J_merge.py,sha256=y834SF4rIRn1L1ptkhczvavQpC-8Px6DTmDOOSaq_DE,1854
88
- tb2j-0.9.9rc9.data/scripts/TB2J_rotate.py,sha256=zgiDFuYZNmzKK0rwDmTaYD2OpRlmKA_VGeBx83w2Xwc,873
89
- tb2j-0.9.9rc9.data/scripts/TB2J_rotateDM.py,sha256=kCvF7gotuqAX1VnJ06cwfVm7RrhrdtiV5v7d9P2Pn_E,567
90
- tb2j-0.9.9rc9.data/scripts/abacus2J.py,sha256=n9sOFZvPMPSzyBJjfpX4dnn7ek4bbOUBrhcEABdYUR8,1635
91
- tb2j-0.9.9rc9.data/scripts/siesta2J.py,sha256=yl43Hoz9XCmjiZ4P1w7UM1BtmJg-eSbMpAm-2_eEUlA,2160
92
- tb2j-0.9.9rc9.data/scripts/wann2J.py,sha256=Z5MSAtS5i5OrPlwDURnPr87dtYF4GbH_NixUi6WYsA8,3043
93
- tb2j-0.9.9rc9.dist-info/licenses/LICENSE,sha256=CbZI-jyRTjiqIcWa244cRSHJdjjtUNqGR4HeJkgEwJw,1332
94
- tb2j-0.9.9rc9.dist-info/METADATA,sha256=52dNL8vQEWQYUP7KsQfqUGLmaK-y4nSY6MhN9f2j_Sc,1687
95
- tb2j-0.9.9rc9.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
96
- tb2j-0.9.9rc9.dist-info/entry_points.txt,sha256=Hdz1WC9waUzyFVmowKnbbZ6j-J4adHh_Ko6JpxGYAtE,131
97
- tb2j-0.9.9rc9.dist-info/top_level.txt,sha256=whYa5ByLYhl5XnTPBHSWr-IGD6VWmr5Ql2bye2qwV_s,5
98
- tb2j-0.9.9rc9.dist-info/RECORD,,
83
+ tb2j-0.9.9rc11.data/scripts/TB2J_downfold.py,sha256=i4BVqnpDdgrX_amookVWeLGefGBn-qeAutWiwuY9SfQ,2099
84
+ tb2j-0.9.9rc11.data/scripts/TB2J_eigen.py,sha256=Qs9v2hnMm2Tpfoa4h53muUKty2dZjwx8948MBoQooNg,1128
85
+ tb2j-0.9.9rc11.data/scripts/TB2J_magnon.py,sha256=q7UwAmorRcFNk4tfE7gl_ny05l6p7pbD9Wm_LkIpKEw,3101
86
+ tb2j-0.9.9rc11.data/scripts/TB2J_magnon_dos.py,sha256=TMXQvD2dIbO5FZ4tUMmxJgCgH2O2hDAPUNfEKO4z-x4,110
87
+ tb2j-0.9.9rc11.data/scripts/TB2J_merge.py,sha256=y834SF4rIRn1L1ptkhczvavQpC-8Px6DTmDOOSaq_DE,1854
88
+ tb2j-0.9.9rc11.data/scripts/TB2J_rotate.py,sha256=zgiDFuYZNmzKK0rwDmTaYD2OpRlmKA_VGeBx83w2Xwc,873
89
+ tb2j-0.9.9rc11.data/scripts/TB2J_rotateDM.py,sha256=kCvF7gotuqAX1VnJ06cwfVm7RrhrdtiV5v7d9P2Pn_E,567
90
+ tb2j-0.9.9rc11.data/scripts/abacus2J.py,sha256=r6P9upWah9Dpeqli-oLD7a1wnQc8rvHT6ed0qw4lUYE,1634
91
+ tb2j-0.9.9rc11.data/scripts/siesta2J.py,sha256=Px6eB4OOa00hoCzCoXcuNGiH025udgxudkDfuzGYMRE,2159
92
+ tb2j-0.9.9rc11.data/scripts/wann2J.py,sha256=Z5MSAtS5i5OrPlwDURnPr87dtYF4GbH_NixUi6WYsA8,3043
93
+ tb2j-0.9.9rc11.dist-info/licenses/LICENSE,sha256=CbZI-jyRTjiqIcWa244cRSHJdjjtUNqGR4HeJkgEwJw,1332
94
+ tb2j-0.9.9rc11.dist-info/METADATA,sha256=abMsJvPl5oFwGXxPYnh-Pu1s8IqeEc7iD8a9BMkspa4,1689
95
+ tb2j-0.9.9rc11.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
96
+ tb2j-0.9.9rc11.dist-info/entry_points.txt,sha256=Hdz1WC9waUzyFVmowKnbbZ6j-J4adHh_Ko6JpxGYAtE,131
97
+ tb2j-0.9.9rc11.dist-info/top_level.txt,sha256=whYa5ByLYhl5XnTPBHSWr-IGD6VWmr5Ql2bye2qwV_s,5
98
+ tb2j-0.9.9rc11.dist-info/RECORD,,