TB2J 0.9.12.10__tar.gz → 0.9.12.15__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.

Potentially problematic release.


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

Files changed (154) hide show
  1. tb2j-0.9.12.15/.gitignore +142 -0
  2. tb2j-0.9.12.15/.readthedocs.yml +27 -0
  3. tb2j-0.9.12.15/.travis.yml +33 -0
  4. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/PKG-INFO +5 -6
  5. tb2j-0.9.12.15/TB2J/.gitignore +5 -0
  6. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/MAEGreen.py +78 -59
  7. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/contour.py +3 -2
  8. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/exchange.py +335 -47
  9. tb2j-0.9.12.15/TB2J/exchangeCL2.py +538 -0
  10. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/exchange_params.py +24 -0
  11. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/green.py +58 -33
  12. tb2j-0.9.12.15/TB2J/io_exchange/io_espins.py +276 -0
  13. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/io_exchange/io_exchange.py +10 -2
  14. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/io_exchange/io_vampire.py +3 -1
  15. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/myTB.py +11 -11
  16. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/pauli.py +32 -2
  17. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/rotate_atoms.py +9 -6
  18. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/symmetrize_J.py +2 -2
  19. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J.egg-info/PKG-INFO +5 -6
  20. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J.egg-info/SOURCES.txt +36 -1
  21. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J.egg-info/requires.txt +4 -4
  22. tb2j-0.9.12.15/buildimage.sh +51 -0
  23. tb2j-0.9.12.15/docs/Makefile +20 -0
  24. tb2j-0.9.12.15/docs/conf.py +67 -0
  25. tb2j-0.9.12.15/docs/index.rst +44 -0
  26. tb2j-0.9.12.15/docs/make.bat +35 -0
  27. tb2j-0.9.12.15/docs/src/BFOvarT.png +0 -0
  28. tb2j-0.9.12.15/docs/src/Contributors.rst +44 -0
  29. tb2j-0.9.12.15/docs/src/SrMnO3_DOS.png +0 -0
  30. tb2j-0.9.12.15/docs/src/applications.rst +9 -0
  31. tb2j-0.9.12.15/docs/src/convention.rst +18 -0
  32. tb2j-0.9.12.15/docs/src/downfold.md +28 -0
  33. tb2j-0.9.12.15/docs/src/extend.rst +45 -0
  34. tb2j-0.9.12.15/docs/src/faq.rst +79 -0
  35. tb2j-0.9.12.15/docs/src/install.rst +123 -0
  36. tb2j-0.9.12.15/docs/src/magnon_band.assets/exchange_magnon-1593690872101.png +0 -0
  37. tb2j-0.9.12.15/docs/src/magnon_band.assets/exchange_magnon.png +0 -0
  38. tb2j-0.9.12.15/docs/src/magnon_band.rst +74 -0
  39. tb2j-0.9.12.15/docs/src/multibinit.rst +89 -0
  40. tb2j-0.9.12.15/docs/src/openmx.rst +27 -0
  41. tb2j-0.9.12.15/docs/src/orbital_contribution.md +80 -0
  42. tb2j-0.9.12.15/docs/src/output.rst +52 -0
  43. tb2j-0.9.12.15/docs/src/parameters.rst +89 -0
  44. tb2j-0.9.12.15/docs/src/references.rst +36 -0
  45. tb2j-0.9.12.15/docs/src/rotate_and_merge.rst +54 -0
  46. tb2j-0.9.12.15/docs/src/siesta.rst +38 -0
  47. tb2j-0.9.12.15/docs/src/spin_model_assets/canting_DMI.png +0 -0
  48. tb2j-0.9.12.15/docs/src/spin_model_assets/tmulti5_2.png +0 -0
  49. tb2j-0.9.12.15/docs/src/tutorial.rst +18 -0
  50. tb2j-0.9.12.15/docs/src/wannier.rst +228 -0
  51. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/pyproject.toml +6 -6
  52. tb2j-0.9.12.15/upload_to_pip.sh +6 -0
  53. tb2j-0.9.12.10/TB2J/exchangeCL2.py +0 -302
  54. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/LICENSE +0 -0
  55. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/README.md +0 -0
  56. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/Jdownfolder.py +0 -0
  57. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/Jtensor.py +0 -0
  58. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/MAE.py +0 -0
  59. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/Oiju.py +0 -0
  60. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/Oiju_epc.py +0 -0
  61. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/__init__.py +0 -0
  62. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/anisotropy.py +0 -0
  63. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/basis.py +0 -0
  64. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/citation.py +0 -0
  65. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/density_matrix.py +0 -0
  66. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/downfold/Hdownfolder.py +0 -0
  67. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/epc.py +0 -0
  68. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/exchange_pert.py +0 -0
  69. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/exchange_qspace.py +0 -0
  70. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/external/__init__.py +0 -0
  71. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/external/p_tqdm.py +0 -0
  72. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/gpaw_wrapper.py +0 -0
  73. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/greentest.py +0 -0
  74. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/__init__.py +0 -0
  75. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/abacus/__init__.py +0 -0
  76. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/abacus/abacus_api.py +0 -0
  77. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/abacus/abacus_wrapper.py +0 -0
  78. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/abacus/gen_exchange_abacus.py +0 -0
  79. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/abacus/orbital_api.py +0 -0
  80. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/abacus/stru_api.py +0 -0
  81. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/abacus/test_density_matrix.py +0 -0
  82. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/abacus/test_read_HRSR.py +0 -0
  83. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/abacus/test_read_stru.py +0 -0
  84. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/gpaw_interface.py +0 -0
  85. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/lawaf_interface.py +0 -0
  86. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/manager.py +0 -0
  87. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/siesta_interface.py +0 -0
  88. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/interfaces/wannier90_interface.py +0 -0
  89. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/io_exchange/__init__.py +0 -0
  90. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/io_exchange/io_multibinit.py +0 -0
  91. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/io_exchange/io_tomsasd.py +0 -0
  92. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/io_exchange/io_txt.py +0 -0
  93. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/io_exchange/io_uppasd.py +0 -0
  94. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/io_merge.py +0 -0
  95. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/kpoints.py +0 -0
  96. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/magnon/__init__.py +0 -0
  97. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/magnon/io_exchange2.py +0 -0
  98. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/magnon/magnon3.py +0 -0
  99. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/magnon/magnon_band.py +0 -0
  100. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/magnon/magnon_dos.py +0 -0
  101. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/magnon/magnon_io.py +0 -0
  102. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/magnon/magnon_math.py +0 -0
  103. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/magnon/plot.py +0 -0
  104. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/magnon/plot_magnon_dos_cli.py +0 -0
  105. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/magnon/structure.py +0 -0
  106. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/mathutils/__init__.py +0 -0
  107. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/mathutils/auto_kpath.py +0 -0
  108. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/mathutils/fermi.py +0 -0
  109. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/mathutils/fibonacci_sphere.py +0 -0
  110. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/mathutils/kR_convert.py +0 -0
  111. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/mathutils/lowdin.py +0 -0
  112. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/mathutils/rotate_spin.py +0 -0
  113. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/mycfr.py +0 -0
  114. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/orbital_magmom.py +0 -0
  115. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/orbmap.py +0 -0
  116. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/pert.py +0 -0
  117. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/plot.py +0 -0
  118. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/rotate_siestaDM.py +0 -0
  119. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/TB2J_downfold.py +0 -0
  120. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/TB2J_eigen.py +0 -0
  121. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/TB2J_magnon.py +0 -0
  122. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/TB2J_magnon2.py +0 -0
  123. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/TB2J_magnon_dos.py +0 -0
  124. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/TB2J_merge.py +0 -0
  125. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/TB2J_plot_magnon_bands.py +0 -0
  126. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/TB2J_rotate.py +0 -0
  127. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/TB2J_rotateDM.py +0 -0
  128. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/__init__.py +0 -0
  129. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/abacus2J.py +0 -0
  130. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/siesta2J.py +0 -0
  131. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/scripts/wann2J.py +0 -0
  132. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/sisl_wrapper.py +0 -0
  133. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/spinham/__init__.py +0 -0
  134. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/spinham/base_parser.py +0 -0
  135. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/spinham/constants.py +0 -0
  136. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/spinham/hamiltonian.py +0 -0
  137. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/spinham/hamiltonian_terms.py +0 -0
  138. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/spinham/plot.py +0 -0
  139. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/spinham/qsolver.py +0 -0
  140. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/spinham/spin_api.py +0 -0
  141. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/spinham/spin_xml.py +0 -0
  142. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/spinham/supercell.py +0 -0
  143. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/tensor_rotate.py +0 -0
  144. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/thetaphi.py +0 -0
  145. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/utest.py +0 -0
  146. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/utils.py +0 -0
  147. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/versioninfo.py +0 -0
  148. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/wannier/__init__.py +0 -0
  149. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/wannier/w90_parser.py +0 -0
  150. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J/wannier/w90_tb_parser.py +0 -0
  151. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J.egg-info/dependency_links.txt +0 -0
  152. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J.egg-info/entry_points.txt +0 -0
  153. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/TB2J.egg-info/top_level.txt +0 -0
  154. {tb2j-0.9.12.10 → tb2j-0.9.12.15}/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.10
3
+ Version: 0.9.12.15
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>
@@ -23,7 +23,6 @@ Classifier: Intended Audience :: Science/Research
23
23
  Classifier: Topic :: Scientific/Engineering :: Chemistry
24
24
  Classifier: Topic :: Scientific/Engineering :: Physics
25
25
  Classifier: License :: OSI Approved :: BSD License
26
- Requires-Python: >=3.6
27
26
  Description-Content-Type: text/markdown
28
27
  License-File: LICENSE
29
28
  Requires-Dist: numpy
@@ -33,9 +32,9 @@ Requires-Dist: ase>=3.19
33
32
  Requires-Dist: tqdm
34
33
  Requires-Dist: pathos
35
34
  Requires-Dist: packaging>=20.0
36
- Requires-Dist: HamiltonIO>=0.2.4
35
+ Requires-Dist: HamiltonIO>=0.2.6
37
36
  Requires-Dist: pre-commit
38
- Requires-Dist: sympair>0.1.0
37
+ Requires-Dist: sympair>0.1.1
39
38
  Requires-Dist: tomli>=2.0.0
40
39
  Requires-Dist: tomli-w>=1.0.0
41
40
  Requires-Dist: typing_extensions
@@ -43,11 +42,11 @@ Provides-Extra: siesta
43
42
  Requires-Dist: sisl>=0.9.0; extra == "siesta"
44
43
  Requires-Dist: netcdf4; extra == "siesta"
45
44
  Provides-Extra: lawaf
46
- Requires-Dist: lawaf==0.2.3; extra == "lawaf"
45
+ Requires-Dist: lawaf>=0.2.3; extra == "lawaf"
47
46
  Provides-Extra: all
48
47
  Requires-Dist: sisl>=0.9.0; extra == "all"
49
48
  Requires-Dist: netcdf4; extra == "all"
50
- Requires-Dist: lawaf==0.2.3; extra == "all"
49
+ Requires-Dist: lawaf>=0.2.3; extra == "all"
51
50
  Dynamic: license-file
52
51
 
53
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)
@@ -0,0 +1,5 @@
1
+ *.o
2
+ *.x
3
+ *.mod
4
+ exchanges.sublime-project
5
+ exchanges.sublime-workspace
@@ -51,7 +51,7 @@ class MAEGreen(ExchangeNCL):
51
51
 
52
52
  nangles = len(self.thetas)
53
53
  self.es = np.zeros(nangles, dtype=complex)
54
- self.es_atom = np.zeros((nangles, self.natoms), dtype=complex)
54
+ self.es_matrix = np.zeros((nangles, self.natoms, self.natoms), dtype=complex)
55
55
  self.es_atom_orb = DefaultDict(lambda: 0)
56
56
 
57
57
  def set_angles_xyz(self):
@@ -153,7 +153,7 @@ class MAEGreen(ExchangeNCL):
153
153
  Hsoc_k = self.tbmodel.get_Hk_soc(self.G.kpts)
154
154
  na = len(thetas)
155
155
  dE_angle = np.zeros(na, dtype=complex)
156
- dE_angle_atom = np.zeros((na, self.natoms), dtype=complex)
156
+ dE_angle_matrix = np.zeros((na, self.natoms, self.natoms), dtype=complex)
157
157
  # dE_angle_orbitals = np.zeros((na, self.natoms, self.norb, self.norb), dtype=complex)
158
158
  dE_angle_atom_orb = DefaultDict(lambda: 0)
159
159
  for iangle, (theta, phi) in enumerate(zip(thetas, phis)):
@@ -178,23 +178,30 @@ class MAEGreen(ExchangeNCL):
178
178
  # dE_angle[iangle] += np.trace(GdH@GdH) * self.G.kweights[ik]
179
179
  # dE_angle[iangle] += np.trace(GdH@G0K[ik].T.conj()@dHi ) * self.G.kweights[ik]
180
180
  dE_angle[iangle] += dG2sum * self.G.kweights[ik]
181
+
182
+ # Calculate atom-atom matrix interactions
181
183
  for iatom in range(self.natoms):
182
184
  iorb = self.iorb(iatom)
183
- # dG2= dG2[::2, ::2] + dG2[1::2, 1::2] + dG2[1::2, ::2] + dG2[::2, 1::2]
184
- dE_atom_orb = dG2[np.ix_(iorb, iorb)] * self.G.kweights[ik]
185
- dE_atom_orb = (
186
- dE_atom_orb[::2, ::2]
187
- + dE_atom_orb[1::2, 1::2]
188
- + dE_atom_orb[1::2, ::2]
189
- + dE_atom_orb[::2, 1::2]
190
- )
191
- dE_atom = np.sum(dE_atom_orb)
192
- mmat = self.mmats[iatom]
193
- dE_atom_orb = mmat.T @ dE_atom_orb @ mmat
194
- dE_angle_atom_orb[(iangle, iatom)] += dE_atom_orb
195
- # dE_atom = np.sum(dG2diag[iorb]) * self.G.kweights[ik]
196
- dE_angle_atom[iangle, iatom] += dE_atom
197
- return dE_angle, dE_angle_atom, dE_angle_atom_orb
185
+ for jatom in range(self.natoms):
186
+ jorb = self.iorb(jatom)
187
+ # Calculate cross terms between atoms i and j
188
+ dE_ij_orb = dG2[np.ix_(iorb, jorb)] * self.G.kweights[ik]
189
+ dE_ij_orb = (
190
+ dE_ij_orb[::2, ::2]
191
+ + dE_ij_orb[1::2, 1::2]
192
+ + dE_ij_orb[1::2, ::2]
193
+ + dE_ij_orb[::2, 1::2]
194
+ )
195
+ dE_ij = np.sum(dE_ij_orb)
196
+ # Transform to local orbital basis
197
+ mmat_i = self.mmats[iatom]
198
+ mmat_j = self.mmats[jatom]
199
+ dE_ij_orb = mmat_i.T @ dE_ij_orb @ mmat_j
200
+ dE_angle_matrix[iangle, iatom, jatom] += dE_ij
201
+ # Store orbital-resolved data for diagonal terms
202
+ if iatom == jatom:
203
+ dE_angle_atom_orb[(iangle, iatom)] += dE_ij_orb
204
+ return dE_angle, dE_angle_matrix, dE_angle_atom_orb
198
205
 
199
206
  def get_perturbed_R(self, e, thetas, phis):
200
207
  self.tbmodel.set_so_strength(0.0)
@@ -232,16 +239,16 @@ class MAEGreen(ExchangeNCL):
232
239
  npole = len(self.contour.path)
233
240
  results = map(func, tqdm.tqdm(self.contour.path, total=npole))
234
241
  for i, result in enumerate(results):
235
- dE_angle, dE_angle_atom, dE_angle_atom_orb = result
242
+ dE_angle, dE_angle_matrix, dE_angle_atom_orb = result
236
243
  self.es += dE_angle * self.contour.weights[i]
237
- self.es_atom += dE_angle_atom * self.contour.weights[i]
244
+ self.es_matrix += dE_angle_matrix * self.contour.weights[i]
238
245
  for key, value in dE_angle_atom_orb.items():
239
246
  self.es_atom_orb[key] += (
240
247
  dE_angle_atom_orb[key] * self.contour.weights[i]
241
248
  )
242
249
 
243
250
  self.es = -np.imag(self.es) / (2 * np.pi)
244
- self.es_atom = -np.imag(self.es_atom) / (2 * np.pi)
251
+ self.es_matrix = -np.imag(self.es_matrix) / (2 * np.pi)
245
252
  for key, value in self.es_atom_orb.items():
246
253
  self.es_atom_orb[key] = -np.imag(value) / (2 * np.pi)
247
254
 
@@ -259,6 +266,7 @@ class MAEGreen(ExchangeNCL):
259
266
  Path(output_path).mkdir(exist_ok=True)
260
267
  fname = f"{output_path}/MAE.dat"
261
268
  fname_orb = f"{output_path}/MAE_orb.dat"
269
+ fname_matrix = f"{output_path}/MAE_matrix.dat"
262
270
  # fname_tensor = f"{output_path}/MAE_tensor.dat"
263
271
  # if figure3d is not None:
264
272
  # fname_fig3d = f"{output_path}/{figure3d}"
@@ -269,24 +277,32 @@ class MAEGreen(ExchangeNCL):
269
277
  if with_eigen:
270
278
  fname_eigen = f"{output_path}/MAE_eigen.dat"
271
279
  with open(fname_eigen, "w") as f:
272
- f.write("# theta, phi, MAE(total), MAE(atom-wise) Unit: meV\n")
273
- for i, (theta, phi, e, es) in enumerate(
274
- zip(self.thetas, self.phis, self.es2, self.es_atom)
280
+ f.write("# theta, phi, MAE(total) Unit: meV\n")
281
+ for i, (theta, phi, e) in enumerate(
282
+ zip(self.thetas, self.phis, self.es2)
275
283
  ):
276
- f.write(f"{theta:.5f} {phi:.5f} {e*1e3:.8f} ")
277
- for ea in es:
278
- f.write(f"{ea*1e3:.8f} ")
279
- f.write("\n")
284
+ f.write(f"{theta:.5f} {phi:.5f} {e*1e3:.8f}\n")
280
285
 
281
286
  with open(fname, "w") as f:
282
- f.write("# theta (rad), phi(rad), MAE(total), MAE(atom-wise) Unit: meV\n")
283
- for i, (theta, phi, e, es) in enumerate(
284
- zip(self.thetas, self.phis, self.es, self.es_atom)
285
- ):
286
- f.write(f"{theta%np.pi:.5f} {phi%(2*np.pi):.5f} {e*1e3:.8f} ")
287
- for ea in es:
288
- f.write(f"{ea*1e3:.8f} ")
289
- f.write("\n")
287
+ f.write("# theta (rad), phi(rad), MAE(total) Unit: meV\n")
288
+ for i, (theta, phi, e) in enumerate(zip(self.thetas, self.phis, self.es)):
289
+ f.write(f"{theta%np.pi:.5f} {phi%(2*np.pi):.5f} {e*1e3:.8f}\n")
290
+
291
+ # Write matrix data to MAE_matrix.dat
292
+ with open(fname_matrix, "w") as fmat:
293
+ fmat.write("# MAE atom-atom interaction matrices\n")
294
+ fmat.write("# Format: angle_index theta phi atom_i atom_j MAE_ij(meV)\n")
295
+ fmat.write("# Units: theta and phi in radians, MAE in meV\n")
296
+ for iangle, (theta, phi) in enumerate(zip(self.thetas, self.phis)):
297
+ for iatom in range(self.natoms):
298
+ for jatom in range(self.natoms):
299
+ mae_ij = (
300
+ self.es_matrix[iangle, iatom, jatom] * 1e3
301
+ ) # Convert to meV
302
+ fmat.write(
303
+ f"{iangle:4d} {theta:.5f} {phi:.5f} {iatom:4d} {jatom:4d} {mae_ij:.8f}\n"
304
+ )
305
+ fmat.write("\n") # Empty line between angles for readability
290
306
 
291
307
  # self.ani = self.fit_anisotropy_tensor()
292
308
  # with open(fname_tensor, "w") as f:
@@ -312,34 +328,37 @@ class MAEGreen(ExchangeNCL):
312
328
  for orb in self.orbital_names[iatom]:
313
329
  f.write(f"{orb} ")
314
330
  f.write("\n")
315
- for i, (theta, phi, e, eatom) in enumerate(
316
- zip(self.thetas, self.phis, self.es, self.es_atom)
317
- ):
331
+ for i, (theta, phi, e) in enumerate(zip(self.thetas, self.phis, self.es)):
318
332
  f.write("-" * 60 + "\n")
319
333
  f.write(f"Angle {i:03d}: theta={theta:.5f} phi={phi:.5f} \n ")
320
334
  f.write(f"E: {e*1e3:.8f} \n")
321
- for iatom, ea in enumerate(eatom):
322
- f.write(f"Atom {iatom:03d}: {ea*1e3:.8f} \n")
323
- f.write("Orbital: ")
324
- eorb = self.es_atom_orb[(i, iatom)]
325
-
326
- # write numpy matrix to file
327
- f.write(
328
- np.array2string(
329
- eorb * 1e3, precision=4, separator=",", suppress_small=True
330
- )
331
- )
332
-
333
- eorb_diff = eorb - self.es_atom_orb[(0, iatom)]
334
- f.write("Diference to the first angle: ")
335
- f.write(
336
- np.array2string(
337
- eorb_diff * 1e3,
338
- precision=4,
339
- separator=",",
340
- suppress_small=True,
335
+ for iatom in range(self.natoms):
336
+ f.write(f"Atom {iatom:03d} orbital matrix:\n")
337
+ if (i, iatom) in self.es_atom_orb:
338
+ eorb = self.es_atom_orb[(i, iatom)]
339
+ # write numpy matrix to file
340
+ f.write(
341
+ np.array2string(
342
+ eorb * 1e3,
343
+ precision=4,
344
+ separator=",",
345
+ suppress_small=True,
346
+ )
341
347
  )
342
- )
348
+ f.write("\n")
349
+
350
+ if (0, iatom) in self.es_atom_orb:
351
+ eorb_diff = eorb - self.es_atom_orb[(0, iatom)]
352
+ f.write("Difference to the first angle: ")
353
+ f.write(
354
+ np.array2string(
355
+ eorb_diff * 1e3,
356
+ precision=4,
357
+ separator=",",
358
+ suppress_small=True,
359
+ )
360
+ )
361
+ f.write("\n")
343
362
  f.write("\n")
344
363
 
345
364
  def run(self, output_path="TB2J_anisotropy", with_eigen=False):
@@ -27,8 +27,9 @@ class Contour:
27
27
  integrate f along the path
28
28
  """
29
29
  ret = 0
30
- for i in range(len(values)):
31
- ret += values[i] * self.weights[i]
30
+ ret = np.einsum("i...,i->...", values, self.weights)
31
+ # for i in range(len(values)):
32
+ # ret += values[i] * self.weights[i]
32
33
  return ret
33
34
 
34
35
  def build_path_semicircle(self, npoints, endpoint=True):