TB2J 0.9.12.9__tar.gz → 0.9.12.13__tar.gz

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 (153) hide show
  1. tb2j-0.9.12.13/.gitignore +142 -0
  2. tb2j-0.9.12.13/.readthedocs.yml +27 -0
  3. tb2j-0.9.12.13/.travis.yml +33 -0
  4. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/PKG-INFO +2 -2
  5. tb2j-0.9.12.13/TB2J/.gitignore +5 -0
  6. tb2j-0.9.12.13/TB2J/io_exchange/io_espins.py +276 -0
  7. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/io_exchange/io_exchange.py +10 -2
  8. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/io_exchange/io_vampire.py +3 -1
  9. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/rotate_atoms.py +9 -6
  10. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/symmetrize_J.py +2 -2
  11. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J.egg-info/PKG-INFO +2 -2
  12. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J.egg-info/SOURCES.txt +36 -1
  13. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J.egg-info/requires.txt +1 -1
  14. tb2j-0.9.12.13/buildimage.sh +51 -0
  15. tb2j-0.9.12.13/docs/Makefile +20 -0
  16. tb2j-0.9.12.13/docs/conf.py +67 -0
  17. tb2j-0.9.12.13/docs/index.rst +44 -0
  18. tb2j-0.9.12.13/docs/make.bat +35 -0
  19. tb2j-0.9.12.13/docs/src/BFOvarT.png +0 -0
  20. tb2j-0.9.12.13/docs/src/Contributors.rst +44 -0
  21. tb2j-0.9.12.13/docs/src/SrMnO3_DOS.png +0 -0
  22. tb2j-0.9.12.13/docs/src/applications.rst +9 -0
  23. tb2j-0.9.12.13/docs/src/convention.rst +18 -0
  24. tb2j-0.9.12.13/docs/src/downfold.md +28 -0
  25. tb2j-0.9.12.13/docs/src/extend.rst +45 -0
  26. tb2j-0.9.12.13/docs/src/faq.rst +79 -0
  27. tb2j-0.9.12.13/docs/src/install.rst +123 -0
  28. tb2j-0.9.12.13/docs/src/magnon_band.assets/exchange_magnon-1593690872101.png +0 -0
  29. tb2j-0.9.12.13/docs/src/magnon_band.assets/exchange_magnon.png +0 -0
  30. tb2j-0.9.12.13/docs/src/magnon_band.rst +74 -0
  31. tb2j-0.9.12.13/docs/src/multibinit.rst +89 -0
  32. tb2j-0.9.12.13/docs/src/openmx.rst +27 -0
  33. tb2j-0.9.12.13/docs/src/orbital_contribution.md +80 -0
  34. tb2j-0.9.12.13/docs/src/output.rst +52 -0
  35. tb2j-0.9.12.13/docs/src/parameters.rst +89 -0
  36. tb2j-0.9.12.13/docs/src/references.rst +36 -0
  37. tb2j-0.9.12.13/docs/src/rotate_and_merge.rst +54 -0
  38. tb2j-0.9.12.13/docs/src/siesta.rst +38 -0
  39. tb2j-0.9.12.13/docs/src/spin_model_assets/canting_DMI.png +0 -0
  40. tb2j-0.9.12.13/docs/src/spin_model_assets/tmulti5_2.png +0 -0
  41. tb2j-0.9.12.13/docs/src/tutorial.rst +18 -0
  42. tb2j-0.9.12.13/docs/src/wannier.rst +228 -0
  43. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/pyproject.toml +2 -2
  44. tb2j-0.9.12.13/upload_to_pip.sh +6 -0
  45. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/LICENSE +0 -0
  46. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/README.md +0 -0
  47. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/Jdownfolder.py +0 -0
  48. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/Jtensor.py +0 -0
  49. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/MAE.py +0 -0
  50. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/MAEGreen.py +0 -0
  51. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/Oiju.py +0 -0
  52. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/Oiju_epc.py +0 -0
  53. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/__init__.py +0 -0
  54. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/anisotropy.py +0 -0
  55. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/basis.py +0 -0
  56. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/citation.py +0 -0
  57. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/contour.py +0 -0
  58. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/density_matrix.py +0 -0
  59. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/downfold/Hdownfolder.py +0 -0
  60. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/epc.py +0 -0
  61. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/exchange.py +0 -0
  62. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/exchangeCL2.py +0 -0
  63. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/exchange_params.py +0 -0
  64. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/exchange_pert.py +0 -0
  65. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/exchange_qspace.py +0 -0
  66. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/external/__init__.py +0 -0
  67. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/external/p_tqdm.py +0 -0
  68. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/gpaw_wrapper.py +0 -0
  69. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/green.py +0 -0
  70. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/greentest.py +0 -0
  71. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/__init__.py +0 -0
  72. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/abacus/__init__.py +0 -0
  73. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/abacus/abacus_api.py +0 -0
  74. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/abacus/abacus_wrapper.py +0 -0
  75. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/abacus/gen_exchange_abacus.py +0 -0
  76. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/abacus/orbital_api.py +0 -0
  77. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/abacus/stru_api.py +0 -0
  78. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/abacus/test_density_matrix.py +0 -0
  79. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/abacus/test_read_HRSR.py +0 -0
  80. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/abacus/test_read_stru.py +0 -0
  81. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/gpaw_interface.py +0 -0
  82. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/lawaf_interface.py +0 -0
  83. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/manager.py +0 -0
  84. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/siesta_interface.py +0 -0
  85. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/interfaces/wannier90_interface.py +0 -0
  86. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/io_exchange/__init__.py +0 -0
  87. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/io_exchange/io_multibinit.py +0 -0
  88. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/io_exchange/io_tomsasd.py +0 -0
  89. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/io_exchange/io_txt.py +0 -0
  90. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/io_exchange/io_uppasd.py +0 -0
  91. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/io_merge.py +0 -0
  92. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/kpoints.py +0 -0
  93. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/magnon/__init__.py +0 -0
  94. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/magnon/io_exchange2.py +0 -0
  95. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/magnon/magnon3.py +0 -0
  96. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/magnon/magnon_band.py +0 -0
  97. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/magnon/magnon_dos.py +0 -0
  98. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/magnon/magnon_io.py +0 -0
  99. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/magnon/magnon_math.py +0 -0
  100. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/magnon/plot.py +0 -0
  101. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/magnon/plot_magnon_dos_cli.py +0 -0
  102. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/magnon/structure.py +0 -0
  103. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/mathutils/__init__.py +0 -0
  104. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/mathutils/auto_kpath.py +0 -0
  105. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/mathutils/fermi.py +0 -0
  106. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/mathutils/fibonacci_sphere.py +0 -0
  107. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/mathutils/kR_convert.py +0 -0
  108. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/mathutils/lowdin.py +0 -0
  109. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/mathutils/rotate_spin.py +0 -0
  110. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/myTB.py +0 -0
  111. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/mycfr.py +0 -0
  112. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/orbital_magmom.py +0 -0
  113. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/orbmap.py +0 -0
  114. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/pauli.py +0 -0
  115. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/pert.py +0 -0
  116. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/plot.py +0 -0
  117. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/rotate_siestaDM.py +0 -0
  118. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/TB2J_downfold.py +0 -0
  119. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/TB2J_eigen.py +0 -0
  120. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/TB2J_magnon.py +0 -0
  121. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/TB2J_magnon2.py +0 -0
  122. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/TB2J_magnon_dos.py +0 -0
  123. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/TB2J_merge.py +0 -0
  124. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/TB2J_plot_magnon_bands.py +0 -0
  125. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/TB2J_rotate.py +0 -0
  126. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/TB2J_rotateDM.py +0 -0
  127. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/__init__.py +0 -0
  128. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/abacus2J.py +0 -0
  129. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/siesta2J.py +0 -0
  130. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/scripts/wann2J.py +0 -0
  131. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/sisl_wrapper.py +0 -0
  132. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/spinham/__init__.py +0 -0
  133. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/spinham/base_parser.py +0 -0
  134. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/spinham/constants.py +0 -0
  135. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/spinham/hamiltonian.py +0 -0
  136. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/spinham/hamiltonian_terms.py +0 -0
  137. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/spinham/plot.py +0 -0
  138. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/spinham/qsolver.py +0 -0
  139. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/spinham/spin_api.py +0 -0
  140. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/spinham/spin_xml.py +0 -0
  141. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/spinham/supercell.py +0 -0
  142. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/tensor_rotate.py +0 -0
  143. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/thetaphi.py +0 -0
  144. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/utest.py +0 -0
  145. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/utils.py +0 -0
  146. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/versioninfo.py +0 -0
  147. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/wannier/__init__.py +0 -0
  148. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/wannier/w90_parser.py +0 -0
  149. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J/wannier/w90_tb_parser.py +0 -0
  150. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J.egg-info/dependency_links.txt +0 -0
  151. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J.egg-info/entry_points.txt +0 -0
  152. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/TB2J.egg-info/top_level.txt +0 -0
  153. {tb2j-0.9.12.9 → tb2j-0.9.12.13}/setup.cfg +0 -0
@@ -0,0 +1,142 @@
1
+ doc/refs/*.pdf
2
+
3
+
4
+ # vim files
5
+ *.swp
6
+
7
+ # Latex
8
+ *.aux
9
+
10
+
11
+ # file for AI IDE
12
+ # kiro
13
+ .kiro/
14
+ # cline
15
+ .cline
16
+ # roo coder
17
+ .roo
18
+
19
+
20
+ # xyz files
21
+
22
+ .DS_Store
23
+
24
+ # Byte-compiled / optimized / DLL files
25
+ __pycache__/
26
+ *.py[cod]
27
+ *$py.class
28
+
29
+ # numpy results
30
+ *.npy
31
+
32
+ # png files
33
+
34
+ # C extensions
35
+ *.so
36
+ *.a
37
+
38
+ # Fortran extensions
39
+ *.fpp
40
+ *.mod
41
+ *.o
42
+
43
+ # F90wrap files
44
+ *.plist
45
+
46
+ # Distribution / packaging
47
+ .Python
48
+ env/
49
+ build/
50
+ develop-eggs/
51
+ dist/
52
+ downloads/
53
+ eggs/
54
+ .eggs/
55
+ lib/
56
+ lib64/
57
+ parts/
58
+ sdist/
59
+ var/
60
+ wheels/
61
+ *.egg-info/
62
+ *.egg-info/*
63
+ .installed.cfg
64
+ *.egg
65
+
66
+ # temporary files
67
+ temp/
68
+
69
+ # PyInstaller
70
+ # Usually these files are written by a python script from a template
71
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
72
+ *.manifest
73
+ *.spec
74
+
75
+ # Installer logs
76
+ pip-log.txt
77
+ pip-delete-this-directory.txt
78
+
79
+ # Unit test / coverage reports
80
+ htmlcov/
81
+ .tox/
82
+ .coverage
83
+ .coverage.*
84
+ .cache
85
+ nosetests.xml
86
+ coverage.xml
87
+ *.cover
88
+ .hypothesis/
89
+
90
+ # Translations
91
+ *.mo
92
+ *.pot
93
+
94
+ # Django stuff:
95
+ *.log
96
+ local_settings.py
97
+
98
+ # Flask stuff:
99
+ instance/
100
+ .webassets-cache
101
+
102
+ # Scrapy stuff:
103
+ .scrapy
104
+
105
+ # Sphinx documentation
106
+ docs/_build/
107
+
108
+ # PyBuilder
109
+ target/
110
+
111
+ # Jupyter Notebook
112
+ .ipynb_checkpoints
113
+
114
+ # pyenv
115
+ .python-version
116
+
117
+ # celery beat schedule file
118
+ celerybeat-schedule
119
+
120
+ # SageMath parsed files
121
+ *.sage.py
122
+
123
+ # dotenv
124
+ .env
125
+
126
+ # virtualenv
127
+ .venv
128
+ venv/
129
+ ENV/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
@@ -0,0 +1,27 @@
1
+ # .readthedocs.yml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ # Required
6
+ version: 2
7
+ build:
8
+ os: "ubuntu-22.04"
9
+ tools:
10
+ python: "3.11"
11
+
12
+ # Build documentation in the docs/ directory with Sphinx
13
+ sphinx:
14
+ configuration: docs/conf.py
15
+
16
+ # Build documentation with MkDocs
17
+ #mkdocs:
18
+ # configuration: mkdocs.yml
19
+
20
+ # Optionally build your docs in additional formats such as PDF
21
+ formats:
22
+ - pdf
23
+
24
+ # Optionally set the version of Python and requirements required to build your docs
25
+ python:
26
+ install:
27
+ - requirements: docs/requirements.txt
@@ -0,0 +1,33 @@
1
+ language: python
2
+ python:
3
+ - "3.7"
4
+ - "3.8"
5
+ - "3.9"
6
+ - "3.10"
7
+ - "3.11"
8
+ cache: pip
9
+
10
+ addons:
11
+ apt:
12
+ packages: &common_packages
13
+ - gfortran
14
+ - libatlas-base-dev
15
+ - liblapack-dev
16
+ - libnetcdf-dev
17
+ - libnetcdff-dev
18
+ - eatmydata
19
+ - ccache
20
+ before_install:
21
+ - if [[ $TRAVIS_PYTHON_VERSION == 3.7 ]]; then pip install -U importlib_metadata; fi
22
+
23
+ install:
24
+ - pip install -r requirements.txt
25
+ - pip install sisl
26
+ - pip install -e .
27
+ script:
28
+ - pwd
29
+ - cd examples/abinit-w90/SrMnO3
30
+ - ls -lah
31
+ - sh get_J.sh
32
+ - cd TB2J_results/Multibinit
33
+ - TB2J_magnon.py --figfname magnon.png
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TB2J
3
- Version: 0.9.12.9
3
+ Version: 0.9.12.13
4
4
  Summary: TB2J: First principle to Heisenberg exchange J using tight-binding Green function method
5
5
  Author-email: Xu He <mailhexu@gmail.com>
6
6
  Maintainer-email: Xu He <mailhexu@gmail.com>
@@ -35,7 +35,7 @@ Requires-Dist: pathos
35
35
  Requires-Dist: packaging>=20.0
36
36
  Requires-Dist: HamiltonIO>=0.2.4
37
37
  Requires-Dist: pre-commit
38
- Requires-Dist: sympair>0.1.0
38
+ Requires-Dist: sympair>0.1.1
39
39
  Requires-Dist: tomli>=2.0.0
40
40
  Requires-Dist: tomli-w>=1.0.0
41
41
  Requires-Dist: typing_extensions
@@ -0,0 +1,5 @@
1
+ *.o
2
+ *.x
3
+ *.mod
4
+ exchanges.sublime-project
5
+ exchanges.sublime-workspace
@@ -0,0 +1,276 @@
1
+ import os
2
+
3
+ import numpy as np
4
+
5
+
6
+ def _get_shell_index(cls, key):
7
+ """Determine shell index based on distance grouping.
8
+
9
+ Parameters
10
+ ----------
11
+ cls : SpinIO
12
+ SpinIO instance
13
+ key : tuple
14
+ (R, i, j) key for exchange parameter
15
+
16
+ Returns
17
+ -------
18
+ int
19
+ Shell index (1 for nearest neighbors, 2 for next nearest, etc.)
20
+ """
21
+ if not hasattr(cls, "_distance_shells"):
22
+ # Calculate all distances and group into shells
23
+ distances = []
24
+ for k in cls.exchange_Jdict:
25
+ if cls.distance_dict and k in cls.distance_dict:
26
+ distances.append(cls.distance_dict[k][1])
27
+
28
+ if distances:
29
+ # Sort distances and group by rounding to nearest 0.01 Å
30
+ sorted_distances = sorted(set(round(d * 100) for d in distances))
31
+ cls._distance_shells = {}
32
+ for shell_idx, dist_int in enumerate(sorted_distances, 1):
33
+ cls._distance_shells[dist_int / 100] = shell_idx
34
+ else:
35
+ cls._distance_shells = {}
36
+
37
+ if cls.distance_dict and key in cls.distance_dict:
38
+ distance = cls.distance_dict[key][1]
39
+ rounded_dist = round(distance * 100)
40
+ return cls._distance_shells.get(rounded_dist / 100, 1)
41
+
42
+ return 1
43
+
44
+
45
+ def write_espins(cls, path="TB2J_results/ESPInS"):
46
+ """Write ESPInS format input files.
47
+
48
+ Parameters
49
+ ----------
50
+ cls : SpinIO
51
+ SpinIO instance containing exchange parameters
52
+ path : str
53
+ Output directory path
54
+ """
55
+ if not os.path.exists(path):
56
+ os.makedirs(path)
57
+
58
+ write_espins_input(cls, os.path.join(path, "espins.in"))
59
+
60
+
61
+ def write_espins_input(cls, fname):
62
+ """Write the main ESPInS input file.
63
+
64
+ Parameters
65
+ ----------
66
+ cls : SpinIO
67
+ SpinIO instance
68
+ fname : str
69
+ Output filename
70
+ """
71
+ with open(fname, "w") as myfile:
72
+ # Write unit cell
73
+ myfile.write("! ESPInS input file generated by TB2J\n")
74
+ # myfile.write("! Compatible with ESPInS version > 1.0 \n")
75
+ myfile.write("! The unit cell in angstrom\n")
76
+ myfile.write("Begin Unit_Cell_Cart\n")
77
+ cell = cls.atoms.get_cell()
78
+ for i in range(3):
79
+ myfile.write(" " + " ".join(f"{x:12.8f}" for x in cell[i]) + "\n")
80
+ myfile.write("End Unit_Cell_Cart\n\n")
81
+
82
+ # Write atomic positions
83
+ myfile.write("! Atomic positions in reduced coordinates\n")
84
+ myfile.write("Begin Atoms_Frac\n")
85
+ scaled_positions = cls.atoms.get_scaled_positions()
86
+ symbols = cls.atoms.get_chemical_symbols()
87
+
88
+ for i, (symbol, pos) in enumerate(zip(symbols, scaled_positions)):
89
+ if cls.index_spin[i] >= 0: # Only magnetic atoms
90
+ myfile.write(
91
+ f" {symbol:<8} {pos[0]:10.7f} {pos[1]:10.7f} {pos[2]:10.7f} 1.00\n"
92
+ )
93
+ myfile.write("End Atoms_Frac\n\n\n")
94
+
95
+ # Write temperature settings (default values)
96
+ myfile.write("tem_start = 1\n")
97
+ myfile.write("tem_end = 30\n")
98
+ myfile.write("tems_num = 30\n")
99
+ # myfile.write("!! tems_mode = man\n")
100
+ # myfile.write("!! tems = 5.00 10.00 15.00 20.00\n\n")
101
+
102
+ # Write Monte Carlo parameters (default values)
103
+ myfile.write("! Pt = .True.\n")
104
+ myfile.write("! Pt_steps_swap = 40\n\n")
105
+
106
+ myfile.write("steps_warmup = 100000\n")
107
+ myfile.write("steps_mc = 100000\n")
108
+ myfile.write("steps_measure = 2\n\n")
109
+
110
+ myfile.write("initial_sconfig = ferro\n")
111
+ myfile.write("mcarlo_mode = random\n\n")
112
+
113
+ myfile.write("supercell_size = 10 10 1\n\n")
114
+
115
+ # Write Hamiltonian settings
116
+ myfile.write(" ## Hamiltonian\n")
117
+ myfile.write("Ham_bij = .False.\n")
118
+ myfile.write("Ham_jij_matrix = .True.\n")
119
+ myfile.write("! We don't have single ion anisotropy, put it to .False.\n")
120
+ myfile.write("Ham_singleion_matrix = .False.\n\n\n")
121
+
122
+ # Write single ion anisotropy matrix if available
123
+ # if cls.has_uniaxial_anistropy:
124
+ # myfile.write("! Don't put this block\n")
125
+ # myfile.write("!Begin SingleIon_Matrix\n")
126
+ # # Placeholder for single ion anisotropy
127
+ # myfile.write("@Axx=0.000 , Axy=-1.65e-07 , Axz=6e-08 , Ayx=-1.65e-07 , Ayy=7.73e-05 , Ayz=-1.5e-05 , Azx=6e-08 , Azz= 6.8e-05\n")
128
+ # myfile.write("!End SingleIon_Matrix\n\n")
129
+
130
+ # Write exchange parameters
131
+ myfile.write(
132
+ """! f1 is the fractional coordinate of atom i, and f2 is of atom j (rj+Rj). Then jij in eV, sh is index of shell, t1 is index of i, t2 is index of j (counting from 1). \n
133
+ !The convention of the Hamiltonian is H = - sum_<ij> Jij Si Sj, and i, j are ordererd so that there is no double counting (ij and ji). To convert from TB2J exchange.out (which has both ij and ji), multiply Jij by 2. \n
134
+ \n"""
135
+ )
136
+
137
+ if cls.has_exchange:
138
+ myfile.write("Begin Jij_parameters\n")
139
+
140
+ # Create a list of unique exchange parameters sorted by distance
141
+ exchange_list = []
142
+ # written_keys = set()
143
+
144
+ for key, jval in cls.exchange_Jdict.items():
145
+ R, i, j = key
146
+
147
+ # Skip if this is the symmetric counterpart of an already written pair
148
+ # symmetric_key = (tuple(-np.array(R)), j, i)
149
+ # if symmetric_key in written_keys:
150
+ # continue
151
+
152
+ # Get distance for sorting
153
+ distance = (
154
+ cls.distance_dict[key][1]
155
+ if cls.distance_dict and key in cls.distance_dict
156
+ else 0.0
157
+ )
158
+
159
+ exchange_list.append((distance, key, jval))
160
+ # written_keys.add(key)
161
+
162
+ # Sort by distance
163
+ exchange_list.sort(key=lambda x: x[0])
164
+
165
+ for distance, key, jval in exchange_list:
166
+ R, i, j = key
167
+ iatom = cls.iatom(i)
168
+ jatom = cls.iatom(j)
169
+
170
+ # Get fractional coordinates
171
+ pos_i = cls.atoms.get_scaled_positions()[iatom]
172
+ pos_j = cls.atoms.get_scaled_positions()[jatom]
173
+
174
+ # Calculate fractional coordinates for j+R
175
+ pos_jR = pos_j + R
176
+ # Determine shell index based on distance
177
+ shell = _get_shell_index(cls, key)
178
+
179
+ myfile.write(
180
+ f" f1= {pos_i[0]:10.6f}, {pos_i[1]:10.6f}, {pos_i[2]:10.6f}:f2= {pos_jR[0]:10.6f}, {pos_jR[1]:10.6f}, {pos_jR[2]:10.6f}:jij= {jval*2:10.8f}!:sh= {shell}!:t1= {i+1}:t2= {j+1}\n"
181
+ )
182
+
183
+ myfile.write("End Jij_parameters\n\n")
184
+
185
+ # Write exchange matrix if available
186
+ if cls.has_exchange:
187
+ myfile.write(
188
+ "! Each matrix element is corresponding to the previous block. The J tensor include the isotropic, anisotropic exchange and DMI. \n"
189
+ )
190
+ myfile.write("Begin Jij_matrix\n")
191
+
192
+ # Create a list of unique exchange parameters sorted by distance
193
+ exchange_list = []
194
+ # written_keys = set()
195
+
196
+ for key in cls.exchange_Jdict:
197
+ R, i, j = key
198
+
199
+ # Skip if this is the symmetric counterpart of an already written pair
200
+ # symmetric_key = (tuple(-np.array(R)), j, i)
201
+ # if symmetric_key in written_keys:
202
+ # continue
203
+
204
+ # Get distance for sorting
205
+ distance = (
206
+ cls.distance_dict[key][1]
207
+ if cls.distance_dict and key in cls.distance_dict
208
+ else 0.0
209
+ )
210
+
211
+ exchange_list.append((distance, key))
212
+ # written_keys.add(key)
213
+
214
+ # Sort by distance
215
+ exchange_list.sort(key=lambda x: x[0])
216
+
217
+ for distance, key in exchange_list:
218
+ R, i, j = key
219
+ # Get full J tensor
220
+ J_tensor = cls.get_J_tensor(i, j, R, Jiso=True, Jani=True, DMI=True) * 2
221
+
222
+ # Format matrix elements exactly as in the example
223
+ myfile.write(
224
+ f"Jxx={J_tensor[0, 0]:.8f}, Jxy={J_tensor[0, 1]:.8f}, Jxz={J_tensor[0, 2]:.8f}, Jyx={J_tensor[1, 0]:.8f}, Jyy={J_tensor[1, 1]:.8f}, Jyz={J_tensor[1, 2]:.8f}, Jzx={J_tensor[2, 0]:.8f}, Jzy={J_tensor[2, 1]:.8f}, Jzz={J_tensor[2, 2]:.8f}\n"
225
+ )
226
+
227
+ myfile.write("End Jij_matrix\n\n")
228
+
229
+ # Write biquadratic exchange if available
230
+ # if cls.has_biquadratic and cls.biquadratic_Jdict:
231
+ if False:
232
+ myfile.write("! Biquadratic, don't put it. \n")
233
+ myfile.write("Begin Bij_parameters\n")
234
+
235
+ # Create a list of unique biquadratic parameters sorted by distance
236
+ biquadratic_list = []
237
+ written_keys = set()
238
+
239
+ for key, bval in cls.biquadratic_Jdict.items():
240
+ R, i, j = key
241
+
242
+ # Skip if this is the symmetric counterpart of an already written pair
243
+ symmetric_key = (tuple(-np.array(R)), j, i)
244
+ if symmetric_key in written_keys:
245
+ continue
246
+
247
+ # Get distance for sorting
248
+ distance = (
249
+ cls.distance_dict[key][1]
250
+ if cls.distance_dict and key in cls.distance_dict
251
+ else 0.0
252
+ )
253
+
254
+ biquadratic_list.append((distance, key, bval))
255
+ written_keys.add(key)
256
+
257
+ # Sort by distance
258
+ biquadratic_list.sort(key=lambda x: x[0])
259
+
260
+ for distance, key, bval in biquadratic_list:
261
+ R, i, j = key
262
+ iatom = cls.iatom(i)
263
+ jatom = cls.iatom(j)
264
+
265
+ # Get fractional coordinates
266
+ pos_i = cls.atoms.get_scaled_positions()[iatom]
267
+ pos_j = cls.atoms.get_scaled_positions()[jatom]
268
+
269
+ # Calculate fractional coordinates for j+R
270
+ pos_jR = pos_j + np.dot(R, np.linalg.inv(cls.atoms.get_cell()))
271
+
272
+ myfile.write(
273
+ f" f1= {pos_i[0]:10.6f}, {pos_i[1]:10.6f}, {pos_i[2]:10.6f}:f2= {pos_jR[0]:10.6f}, {pos_jR[1]:10.6f}, {pos_jR[2]:10.6f}:bij= {bval:10.6f} !t1= {i+1}:t2= {j+1}\n"
274
+ )
275
+
276
+ myfile.write("End Bij_parameters\n")
@@ -149,6 +149,7 @@ class SpinIO(object):
149
149
  self.has_biquadratic = not (
150
150
  biquadratic_Jdict == {} or biquadratic_Jdict is None
151
151
  )
152
+
152
153
  self.biquadratic_Jdict = biquadratic_Jdict
153
154
 
154
155
  if NJT_ddict is not None:
@@ -459,9 +460,10 @@ Generation time: {now.strftime("%y/%m/%d %H:%M:%S")}
459
460
  if asr:
460
461
  iR0 = np.argmin(np.linalg.norm(self.Rlist, axis=1))
461
462
  assert np.linalg.norm(self.Rlist[iR0]) == 0
462
- sum_JR = np.sum(np.sum(Jmat, axis=0))
463
+ sum_JR = np.sum(np.sum(Jmat, axis=0), axis=0)
464
+ print(sum_JR)
463
465
  for i in range(n3):
464
- Jmat[iR0][i, i] -= sum_JRi[i]
466
+ Jmat[iR0][i, i] -= sum_JR[i]
465
467
  elif order == "ij":
466
468
  Jmat = np.zeros((nR, n, n), dtype=float)
467
469
  for iR, R in enumerate(self.Rlist):
@@ -521,6 +523,7 @@ Generation time: {now.strftime("%y/%m/%d %H:%M:%S")}
521
523
  self.write_multibinit(path=os.path.join(path, "Multibinit"))
522
524
  self.write_tom_format(path=os.path.join(path, "TomASD"))
523
525
  self.write_vampire(path=os.path.join(path, "Vampire"))
526
+ self.write_espins(path=os.path.join(path, "ESPInS"))
524
527
 
525
528
  self.plot_all(savefile=os.path.join(path, "JvsR.pdf"))
526
529
  # self.write_Jq(kmesh=[9, 9, 9], path=path)
@@ -684,6 +687,11 @@ Generation time: {now.strftime("%y/%m/%d %H:%M:%S")}
684
687
 
685
688
  write_uppasd(self, path=path)
686
689
 
690
+ def write_espins(self, path):
691
+ from TB2J.io_exchange.io_espins import write_espins
692
+
693
+ write_espins(self, path=path)
694
+
687
695
 
688
696
  def gen_distance_dict(ind_mag_atoms, atoms, Rlist):
689
697
  distance_dict = {}
@@ -66,7 +66,7 @@ def write_vampire_unitcell_file(cls, fname):
66
66
 
67
67
  def write_vampire_mat_file(cls, fname):
68
68
  mat_tmpl = """#---------------------------------------------------
69
- # Material {id}
69
+ # Material {id}
70
70
  #---------------------------------------------------
71
71
  material[{id}]:material-name={name}
72
72
  material[{id}]:damping-constant={damping}
@@ -75,6 +75,8 @@ material[{id}]:uniaxial-anisotropy-constant={k1}
75
75
  material[{id}]:material-element={name}
76
76
  material[{id}]:initial-spin-direction = {spinat}
77
77
  material[{id}]:uniaxial-anisotropy-direction = {k1dir}
78
+ # The following line is required for vampire 5 and later.
79
+ material[{id}]:unit-cell-category = {id}
78
80
  #---------------------------------------------------
79
81
  """
80
82
  with open(fname, "w") as myfile:
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env python3
2
2
  import copy
3
- from ase.io import read, write
3
+
4
4
  import numpy as np
5
+ from ase.io import read, write
5
6
  from TB2J.tensor_rotate import Rzx, Rzy, Rzz
6
7
 
7
8
 
@@ -15,14 +16,16 @@ def rotate_atom_xyz(atoms, noncollinear=False):
15
16
  will be generated.
16
17
  """
17
18
 
19
+ yield atoms
18
20
  rotation_axes = [(1, 0, 0), (0, 1, 0)]
19
21
  if noncollinear:
20
22
  rotation_axes += [(1, 1, 0), (1, 0, 1), (0, 1, 1)]
21
-
23
+
22
24
  for axis in rotation_axes:
23
25
  rotated_atoms = copy.deepcopy(atoms)
24
26
  rotated_atoms.rotate(90, axis, rotate_cell=True)
25
27
  yield rotated_atoms
28
+ yield atoms
26
29
 
27
30
 
28
31
  def rotate_atom_spin_one_rotation(atoms, Rotation):
@@ -109,7 +112,7 @@ def rotate_xyz(fname, ftype="xyz", noncollinear=False):
109
112
  rotated = rotate_atom_xyz(atoms, noncollinear=noncollinear)
110
113
 
111
114
  for i, rotated_atoms in enumerate(rotated):
112
- write(f"atoms_{i+1}.{ftype}", rotated_atoms)
113
- write(f"atoms_0.{ftype}", atoms)
114
-
115
- print(f"The output has been written to the atoms_i.{ftype} files. atoms_0.{ftype} contains the reference structure.")
115
+ write(f"atoms_{i}.{ftype}", rotated_atoms)
116
+ print(
117
+ f"The output has been written to the atoms_i.{ftype} files. atoms_0.{ftype} contains the reference structure."
118
+ )
@@ -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]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: TB2J
3
- Version: 0.9.12.9
3
+ Version: 0.9.12.13
4
4
  Summary: TB2J: First principle to Heisenberg exchange J using tight-binding Green function method
5
5
  Author-email: Xu He <mailhexu@gmail.com>
6
6
  Maintainer-email: Xu He <mailhexu@gmail.com>
@@ -35,7 +35,7 @@ Requires-Dist: pathos
35
35
  Requires-Dist: packaging>=20.0
36
36
  Requires-Dist: HamiltonIO>=0.2.4
37
37
  Requires-Dist: pre-commit
38
- Requires-Dist: sympair>0.1.0
38
+ Requires-Dist: sympair>0.1.1
39
39
  Requires-Dist: tomli>=2.0.0
40
40
  Requires-Dist: tomli-w>=1.0.0
41
41
  Requires-Dist: typing_extensions
@@ -1,6 +1,12 @@
1
+ .gitignore
2
+ .readthedocs.yml
3
+ .travis.yml
1
4
  LICENSE
2
5
  README.md
6
+ buildimage.sh
3
7
  pyproject.toml
8
+ upload_to_pip.sh
9
+ TB2J/.gitignore
4
10
  TB2J/Jdownfolder.py
5
11
  TB2J/Jtensor.py
6
12
  TB2J/MAE.py
@@ -65,6 +71,7 @@ TB2J/interfaces/abacus/test_density_matrix.py
65
71
  TB2J/interfaces/abacus/test_read_HRSR.py
66
72
  TB2J/interfaces/abacus/test_read_stru.py
67
73
  TB2J/io_exchange/__init__.py
74
+ TB2J/io_exchange/io_espins.py
68
75
  TB2J/io_exchange/io_exchange.py
69
76
  TB2J/io_exchange/io_multibinit.py
70
77
  TB2J/io_exchange/io_tomsasd.py
@@ -113,4 +120,32 @@ TB2J/spinham/spin_xml.py
113
120
  TB2J/spinham/supercell.py
114
121
  TB2J/wannier/__init__.py
115
122
  TB2J/wannier/w90_parser.py
116
- TB2J/wannier/w90_tb_parser.py
123
+ TB2J/wannier/w90_tb_parser.py
124
+ docs/Makefile
125
+ docs/conf.py
126
+ docs/index.rst
127
+ docs/make.bat
128
+ docs/src/BFOvarT.png
129
+ docs/src/Contributors.rst
130
+ docs/src/SrMnO3_DOS.png
131
+ docs/src/applications.rst
132
+ docs/src/convention.rst
133
+ docs/src/downfold.md
134
+ docs/src/extend.rst
135
+ docs/src/faq.rst
136
+ docs/src/install.rst
137
+ docs/src/magnon_band.rst
138
+ docs/src/multibinit.rst
139
+ docs/src/openmx.rst
140
+ docs/src/orbital_contribution.md
141
+ docs/src/output.rst
142
+ docs/src/parameters.rst
143
+ docs/src/references.rst
144
+ docs/src/rotate_and_merge.rst
145
+ docs/src/siesta.rst
146
+ docs/src/tutorial.rst
147
+ docs/src/wannier.rst
148
+ docs/src/magnon_band.assets/exchange_magnon-1593690872101.png
149
+ docs/src/magnon_band.assets/exchange_magnon.png
150
+ docs/src/spin_model_assets/canting_DMI.png
151
+ docs/src/spin_model_assets/tmulti5_2.png