mailhexu / TB2J

a python package for computing magnetic interaction parameters
BSD 2-Clause "Simplified" License
67 stars 29 forks source link

Problem with translate_home_cell = .true. #2

Closed nicolastd closed 3 years ago

nicolastd commented 3 years ago

Dear developers,

I just experience a problem using TB2J (Github version 0.3.5), on top of Wannier90. If I add the line "translate_home_cell = .true." to the Wannier90, TB2J stops with the backtrace below. This error disappear if I comment this line.

Green's function Calculation started. Traceback (most recent call last): | (ETA: --:--:--) File "/u/tnico/TB2J/bin/wann2J.py", line 4, in import('pkg_resources').run_script('TB2J==0.3.5', 'wann2J.py') File "/raven/u/system/soft/SLE_15/packages/x86_64/anaconda/3/2020.02/lib/python3.7/site-packages/pkg_resources/init.py", line 667, in run_script self.require(requires)[0].run_script(script_name, ns) File "/raven/u/system/soft/SLE_15/packages/x86_64/anaconda/3/2020.02/lib/python3.7/site-packages/pkg_resources/init.py", line 1470, in run_script exec(script_code, namespace, namespace) File "/u/tnico/.local/lib/python3.7/site-packages/TB2J-0.3.5-py3.7.egg/EGG-INFO/scripts/wann2J.py", line 154, in File "/u/tnico/.local/lib/python3.7/site-packages/TB2J-0.3.5-py3.7.egg/EGG-INFO/scripts/wann2J.py", line 150, in run_wann2J File "/u/tnico/.local/lib/python3.7/site-packages/TB2J-0.3.5-py3.7.egg/TB2J/manager.py", line 170, in gen_exchange File "/u/tnico/.local/lib/python3.7/site-packages/TB2J-0.3.5-py3.7.egg/TB2J/exchange.py", line 567, in run File "/u/tnico/.local/lib/python3.7/site-packages/TB2J-0.3.5-py3.7.egg/TB2J/exchange.py", line 521, in calculate_all File "/u/tnico/.local/lib/python3.7/site-packages/TB2J-0.3.5-py3.7.egg/TB2J/exchange.py", line 326, in get_all_A File "/u/tnico/.local/lib/python3.7/site-packages/TB2J-0.3.5-py3.7.egg/TB2J/exchange.py", line 296, in get_A_ijR File "/u/tnico/.local/lib/python3.7/site-packages/TB2J-0.3.5-py3.7.egg/TB2J/pauli.py", line 133, in pauli_block_all ValueError: operands could not be broadcast together with shapes (9,9) (10,10)

mailhexu commented 3 years ago

Hi, translate_home_cell should not be used. I'll add it to the documentation. see https://github.com/wannier-developers/wannier90/issues/39 for more details.

Could you also check if the wannier function centers are close enough to the atoms? The error message shows that TB2J find 19 Wannier functions near one atom (spin up + spin down), which should be an even number. This hints some WF get too far away from the atom.

nicolastd commented 3 years ago

Hi,

Thanks for the reply and the clarification. The Wannier functions are probably not well converged, as this was a test calculation to see if I could run TB2J.