TB2J 0.9.10.1__py3-none-any.whl → 0.9.12.17__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.

Potentially problematic release.


This version of TB2J might be problematic. Click here for more details.

Files changed (49) hide show
  1. TB2J/.gitignore +5 -0
  2. TB2J/Jdownfolder.py +43 -19
  3. TB2J/MAEGreen.py +78 -60
  4. TB2J/__init__.py +3 -1
  5. TB2J/anisotropy.py +2 -2
  6. TB2J/basis.py +0 -3
  7. TB2J/contour.py +3 -2
  8. TB2J/exchange.py +335 -48
  9. TB2J/exchangeCL2.py +289 -51
  10. TB2J/exchange_params.py +25 -1
  11. TB2J/gpaw_wrapper.py +0 -3
  12. TB2J/green.py +58 -33
  13. TB2J/interfaces/wannier90_interface.py +4 -4
  14. TB2J/io_exchange/io_espins.py +276 -0
  15. TB2J/io_exchange/io_exchange.py +53 -12
  16. TB2J/io_exchange/io_txt.py +9 -8
  17. TB2J/io_exchange/io_uppasd.py +0 -1
  18. TB2J/io_exchange/io_vampire.py +3 -1
  19. TB2J/magnon/magnon3.py +76 -28
  20. TB2J/magnon/plot_magnon_dos_cli.py +115 -3
  21. TB2J/myTB.py +11 -11
  22. TB2J/pauli.py +32 -2
  23. TB2J/plot.py +8 -7
  24. TB2J/rotate_atoms.py +10 -7
  25. TB2J/scripts/TB2J_downfold.py +97 -0
  26. TB2J/scripts/TB2J_eigen.py +49 -0
  27. TB2J/scripts/TB2J_magnon.py +117 -0
  28. TB2J/scripts/TB2J_magnon2.py +78 -0
  29. TB2J/scripts/TB2J_magnon_dos.py +5 -0
  30. TB2J/scripts/TB2J_merge.py +49 -0
  31. TB2J/scripts/TB2J_plot_magnon_bands.py +22 -0
  32. TB2J/scripts/TB2J_rotate.py +29 -0
  33. TB2J/scripts/TB2J_rotateDM.py +21 -0
  34. TB2J/scripts/__init__.py +0 -0
  35. TB2J/scripts/abacus2J.py +61 -0
  36. TB2J/scripts/siesta2J.py +78 -0
  37. TB2J/scripts/wann2J.py +101 -0
  38. TB2J/spinham/hamiltonian.py +0 -1
  39. TB2J/symmetrize_J.py +2 -2
  40. TB2J/tensor_rotate.py +1 -2
  41. TB2J/versioninfo.py +3 -0
  42. TB2J/wannier/w90_tb_parser.py +0 -2
  43. {tb2j-0.9.10.1.dist-info → tb2j-0.9.12.17.dist-info}/METADATA +7 -7
  44. {tb2j-0.9.10.1.dist-info → tb2j-0.9.12.17.dist-info}/RECORD +48 -33
  45. tb2j-0.9.12.17.dist-info/entry_points.txt +15 -0
  46. tb2j-0.9.10.1.dist-info/entry_points.txt +0 -16
  47. {tb2j-0.9.10.1.dist-info → tb2j-0.9.12.17.dist-info}/WHEEL +0 -0
  48. {tb2j-0.9.10.1.dist-info → tb2j-0.9.12.17.dist-info}/licenses/LICENSE +0 -0
  49. {tb2j-0.9.10.1.dist-info → tb2j-0.9.12.17.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env python3
2
+ import argparse
3
+
4
+ from TB2J.plot import write_eigen
5
+ from TB2J.versioninfo import print_license
6
+
7
+ """
8
+ The script to plot the magnon band structure.
9
+ """
10
+
11
+
12
+ def write_eigen_info():
13
+ print_license()
14
+ parser = argparse.ArgumentParser(
15
+ description="TB2J_eigen.py: Write the eigen values and eigen vectors to file."
16
+ )
17
+ parser.add_argument(
18
+ "--path", default="./", type=str, help="The path of the TB2J_results file"
19
+ )
20
+
21
+ parser.add_argument(
22
+ "--qmesh",
23
+ help="qmesh in the format of kx ky kz. Monkhorst pack or Gamma-centered.",
24
+ type=int,
25
+ nargs="*",
26
+ default=[8, 8, 8],
27
+ )
28
+
29
+ parser.add_argument(
30
+ "--gamma",
31
+ help="whether shift the qpoint grid to Gamma-centered. Default: False",
32
+ action="store_true",
33
+ default=True,
34
+ )
35
+
36
+ parser.add_argument(
37
+ "--output_fname",
38
+ type=str,
39
+ help="The file name of the output. Default: eigenJq.txt",
40
+ default="eigenJq.txt",
41
+ )
42
+
43
+ args = parser.parse_args()
44
+
45
+ write_eigen(args.qmesh, args.gamma, output_fname=args.output_fname)
46
+
47
+
48
+ if __name__ == "__main__":
49
+ write_eigen_info()
@@ -0,0 +1,117 @@
1
+ #!/usr/bin/env python3
2
+ import argparse
3
+
4
+ from TB2J.plot import plot_magnon_band, write_eigen
5
+ from TB2J.versioninfo import print_license
6
+
7
+ """
8
+ The script to plot the magnon band structure.
9
+ """
10
+
11
+
12
+ def plot_magnon():
13
+ print_license()
14
+ parser = argparse.ArgumentParser(
15
+ description="TB2J_magnon: Plot magnon band structure from the TB2J magnetic interaction parameters"
16
+ )
17
+ parser.add_argument(
18
+ "--fname",
19
+ default="exchange.xml",
20
+ type=str,
21
+ help="exchange xml file name. default: exchange.xml",
22
+ )
23
+
24
+ parser.add_argument(
25
+ "--qpath",
26
+ default=None,
27
+ type=str,
28
+ 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.",
29
+ )
30
+
31
+ parser.add_argument(
32
+ "--figfname",
33
+ default=None,
34
+ type=str,
35
+ 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.",
36
+ )
37
+
38
+ parser.add_argument(
39
+ "--Jq",
40
+ action="store_true",
41
+ help="To plot the eigenvalues of -J(q) instead of the magnon band",
42
+ default=False,
43
+ )
44
+
45
+ parser.add_argument(
46
+ "--no_Jiso",
47
+ action="store_true",
48
+ help="switch off isotropic exchange",
49
+ default=None,
50
+ )
51
+
52
+ parser.add_argument(
53
+ "--no_dmi", action="store_true", help="switch off dmi", default=None
54
+ )
55
+
56
+ parser.add_argument(
57
+ "--no_Jani",
58
+ action="store_true",
59
+ help="switch off anisotropic exchange",
60
+ default=None,
61
+ )
62
+
63
+ parser.add_argument(
64
+ "--write_emin", action="store_true", help="switch to write emin", default=False
65
+ )
66
+
67
+ parser.add_argument(
68
+ "--show",
69
+ action="store_true",
70
+ help="whether to show magnon band structure.",
71
+ default=False,
72
+ )
73
+
74
+ args = parser.parse_args()
75
+ if args.Jq:
76
+ if args.figfname is None:
77
+ args.figfname = "Eigen_Jq.pdf"
78
+ print(
79
+ "Plotting the eigenvalues of -J(q). The figure is written to %s"
80
+ % (args.figfname)
81
+ )
82
+ else:
83
+ if args.figfname is None:
84
+ args.figfname = "magnon_band.pdf"
85
+ print(
86
+ "Plotting the magnon band structure. The figure is written to %s"
87
+ % (args.figfname)
88
+ )
89
+
90
+ def nonone(x):
91
+ if x is None:
92
+ return x
93
+ else:
94
+ return not x
95
+
96
+ if args.write_emin:
97
+ write_eigen(
98
+ has_exchange=nonone(args.no_Jiso),
99
+ has_dmi=nonone(args.no_dmi),
100
+ has_bilinear=nonone(args.no_Jani),
101
+ )
102
+ else:
103
+ plot_magnon_band(
104
+ fname=args.fname,
105
+ knames=args.qpath,
106
+ npoints=300,
107
+ Jq=args.Jq,
108
+ figfname=args.figfname,
109
+ show=args.show,
110
+ has_exchange=nonone(args.no_Jiso),
111
+ has_dmi=nonone(args.no_dmi),
112
+ has_bilinear=nonone(args.no_Jani),
113
+ )
114
+
115
+
116
+ if __name__ == "__main__":
117
+ plot_magnon()
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env python3
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()
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env python3
2
+
3
+ from TB2J.plot import command_line_plot_magnon_dos
4
+
5
+ command_line_plot_magnon_dos()
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env python3
2
+ import argparse
3
+
4
+ from TB2J.io_merge import merge
5
+ from TB2J.versioninfo 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()
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env python3
2
+ import warnings
3
+
4
+ from TB2J.magnon.magnon3 import main
5
+
6
+ warnings.warn(
7
+ """
8
+ # !!!!!!!!!!!!!!!!!! WARNING: =============================
9
+ #
10
+ # This functionality is under development and should not be used in production.
11
+ # It is provided for testing and development purposes only.
12
+ # Please use with caution and report any issues to the developers.
13
+ #
14
+ # This warning will be removed in future releases.
15
+ # =====================================
16
+
17
+ """,
18
+ UserWarning,
19
+ stacklevel=2,
20
+ )
21
+ # Call the main function from the magnons module
22
+ main()
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env python3
2
+ import argparse
3
+
4
+ from TB2J.rotate_atoms import rotate_xyz
5
+
6
+
7
+ def main():
8
+ parser = argparse.ArgumentParser(description="")
9
+ parser.add_argument(
10
+ "fname", help="name of the file containing the atomic structure", type=str
11
+ )
12
+ parser.add_argument(
13
+ "--ftype",
14
+ 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) ",
15
+ default="xyz",
16
+ type=str,
17
+ )
18
+ parser.add_argument(
19
+ "--noncollinear",
20
+ action="store_true",
21
+ help="If present, six different configurations will be generated. These are required for non-collinear systems.",
22
+ )
23
+
24
+ args = parser.parse_args()
25
+ rotate_xyz(args.fname, ftype=args.ftype, noncollinear=args.noncollinear)
26
+
27
+
28
+ if __name__ == "__main__":
29
+ main()
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env python3
2
+ import argparse
3
+
4
+ from TB2J.rotate_siestaDM import rotate_DM
5
+
6
+
7
+ def main():
8
+ parser = argparse.ArgumentParser(description="")
9
+ parser.add_argument("--fdf_fname", help="Name of the *.fdf siesta file.")
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()
File without changes
@@ -0,0 +1,61 @@
1
+ #!/usr/bin/env python3
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()
@@ -0,0 +1,78 @@
1
+ #!/usr/bin/env python3
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()
TB2J/scripts/wann2J.py ADDED
@@ -0,0 +1,101 @@
1
+ #!/usr/bin/env python3
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()
@@ -19,7 +19,6 @@ from .plot import group_band_path
19
19
  from ase.cell import Cell
20
20
  from .qsolver import QSolver
21
21
  import json
22
- import os
23
22
 
24
23
 
25
24
  class NumpyEncoder(json.JSONEncoder):
TB2J/symmetrize_J.py CHANGED
@@ -33,7 +33,7 @@ class TB2JSymmetrizer:
33
33
  print("Symmetry found:")
34
34
  print(finder.spacegroup)
35
35
  print("-" * 30)
36
- self.pgdict = finder.get_symmetry_pair_group_dict()
36
+ self.pgdict = finder.get_symmetry_pair_list_dict()
37
37
  self.exc = exc
38
38
  self.new_exc = copy.deepcopy(exc)
39
39
  self.Jonly = Jonly
@@ -48,7 +48,7 @@ class TB2JSymmetrizer:
48
48
  symJdict = {}
49
49
  # Jdict = self.exc.exchange_Jdict
50
50
  # ngroup = self.pgdict
51
- for pairgroup in self.pgdict.groups:
51
+ for pairgroup in self.pgdict.pairlists:
52
52
  ijRs = pairgroup.get_all_ijR()
53
53
  ijRs_spin = [self.exc.ijR_index_atom_to_spin(*ijR) for ijR in ijRs]
54
54
  Js = [self.exc.get_J(*ijR_spin) for ijR_spin in ijRs_spin]
TB2J/tensor_rotate.py CHANGED
@@ -1,7 +1,6 @@
1
1
  import numpy as np
2
- import scipy as sp
3
2
  from scipy.spatial.transform import Rotation
4
- from numpy.linalg import norm, det
3
+ from numpy.linalg import norm
5
4
 
6
5
 
7
6
  # Rotation from a to b
TB2J/versioninfo.py CHANGED
@@ -1,7 +1,10 @@
1
+ import importlib.metadata
1
2
  from datetime import datetime
2
3
 
3
4
  import TB2J
4
5
 
6
+ __version__ = importlib.metadata.version("TB2J")
7
+
5
8
 
6
9
  def print_license():
7
10
  print(
@@ -2,10 +2,8 @@
2
2
  parse the tb files in Wannier90
3
3
  """
4
4
 
5
- import os
6
5
  import re
7
6
  import numpy as np
8
- from typing import List, Tuple, Dict
9
7
 
10
8
 
11
9
  def ssrline(file):