How to use TB2J package with wien2k code ?

270 views
Skip to first unread message

Algerian Researcher

unread,
Jul 17, 2021, 1:53:05 PM7/17/21
to TB2J
 Hello all

I want to calculate exchange parameters with TB2j package through output results of wien2k code since the Wannier90 package in interfaced with wien2k code.

Best regards

何旭

unread,
Jul 19, 2021, 2:58:00 PM7/19/21
to TB2J
Hi, 
The procedure to use TB2J is the same with any code interfaced with Wannier90. TB2J does not communicate with the DFT code directly. 
Best regards,
HeXu

rajeev dutt

unread,
Jan 6, 2022, 5:50:57 AM1/6/22
to TB2J
I would have an issue while using the TB2J with wien2k
details are as below:

Reading atomic structure from file ./d.struct.
Reading Wannier90 hamiltonian: spin up.
Traceback (most recent call last):
  File "/usr/local/bin/wann2J.py", line 4, in <module>
    __import__('pkg_resources').run_script('TB2J==0.7.1', 'wann2J.py')
  File "/home/aparna/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 656, in run_script
    self.require(requires)[0].run_script(script_name,ns)
  File "/home/aparna/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1460, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/local/lib/python3.6/dist-packages/TB2J-0.7.1-py3.6.egg/EGG-INFO/scripts/wann2J.py", line 186, in <module>
  File "/usr/local/lib/python3.6/dist-packages/TB2J-0.7.1-py3.6.egg/EGG-INFO/scripts/wann2J.py", line 181, in run_wann2J
  File "/usr/local/lib/python3.6/dist-packages/TB2J-0.7.1-py3.6.egg/TB2J/manager.py", line 64, in gen_exchange
  File "/usr/local/lib/python3.6/dist-packages/TB2J-0.7.1-py3.6.egg/TB2J/myTB.py", line 194, in read_from_wannier_dir
  File "/usr/local/lib/python3.6/dist-packages/TB2J-0.7.1-py3.6.egg/TB2J/wannier/w90_parser.py", line 13, in parse_xyz
  File "/home/aparna/.local/lib/python3.6/site-packages/ase/io/formats.py", line 737, in read
    parallel=parallel, **kwargs))
  File "/home/aparna/.local/lib/python3.6/site-packages/ase/parallel.py", line 275, in new_generator
    for result in generator(*args, **kwargs):
  File "/home/aparna/.local/lib/python3.6/site-packages/ase/io/formats.py", line 803, in _iread
    for dct in io.read(fd, *args, **kwargs):
  File "/home/aparna/.local/lib/python3.6/site-packages/ase/io/formats.py", line 559, in wrap_read_function
    for atoms in read(filename, index, **kwargs):
  File "/home/aparna/.local/lib/python3.6/site-packages/ase/io/extxyz.py", line 773, in read_xyz
    yield _read_xyz_frame(fileobj, natoms, properties_parser, nvec)
  File "/home/aparna/.local/lib/python3.6/site-packages/ase/io/extxyz.py", line 493, in _read_xyz_frame
    info=info)
  File "/home/aparna/.local/lib/python3.6/site-packages/ase/atoms.py", line 208, in __init__
    self.new_array('numbers', symbols2numbers(symbols), int)
  File "/home/aparna/.local/lib/python3.6/site-packages/ase/symbols.py", line 22, in symbols2numbers
    numbers.append(atomic_numbers[s])
KeyError: '1'


can anyone help me in this regard ?

Xu He

unread,
Jan 9, 2022, 8:30:32 AM1/9/22
to TB2J
Hi, 
It seems TB2J cannot read the Wannier center xyz file. Could you send it? 
Best regards,
HeXu

rajeev dutt

unread,
Jan 14, 2022, 11:56:38 AM1/14/22
to TB2J

Sorry for late reply, as I was trying to settle the problem on my own.
Yes, xyz file are there. Please have a look
Fe_w2w_dn_centres.xyz
Fe_w2w_up_centres.xyz

Abderrahmane Reggad

unread,
Jan 14, 2022, 2:01:32 PM1/14/22
to TB2J
Thanks dutta for your reply and now I need the procedure to do that

Xu He

unread,
Jan 15, 2022, 4:11:07 AM1/15/22
to TB2J
Hi, 
In the xyz file:
     6
 Wannier centres, written by Wannier90 on14Jan2022 at 18:38:13
X          0.02891850       0.02908811       0.00267274
X          2.83728239       0.00086275      -0.00060105
X          1.41987726       1.41573694       1.40401673
X          1.41807448       1.42023478       1.40179970
X          0.02401803       0.01134453       0.00471827
1          0.00000000       0.00000000       0.00000000

The first 5 positions are the Wannier centers (labeled with X). And the last line is the atomic position (labeled with 1).  Usually it should be starting with atomic species:
1          0.00000000       0.00000000       0.00000000
I don't know Wien2k so I am not sure if this is due to some input or it is the default behavior of Wien2K. 
You can modify the last line to:
Fe         0.00000000       0.00000000       0.00000000

Another possible issue: some of the Wannier centers are not near the atom. Is this bcc Fe, and the 3rd and 4th Wannier functions are the eg orbitals? 
You could try to reduce the number of Wannierization iterations to 1 to make them atomic centered. 

Best wishes,
HeXu

rajeev dutt

unread,
Jan 17, 2022, 9:23:52 AM1/17/22
to TB2J
Hi HeXu,
Thanks a lot, You are right. After your suggestion,  calculation runs without an issue.


For Abderrahmane Reggad

Procedure is simple.

1. run the scf cyle for your system with wien2k
2. calculate the band-structure using WIEN2k.
3. run prepare_w2w script. : This will setup the input for wannier calculation in different directory.
4. run wannier calculation as given the wienn2wannier user manual and try to match the band-structure obtained from wannier with the Wien2k results
5. Now, you can finally follow the steps/tutorial mentioned in the TB2J manual/example.

Regards
Rajeev Dutt

mouad Ben-nana

unread,
Oct 14, 2024, 6:17:27 PM10/14/24
to TB2J

Hi all, I hope you can help me with this:

I am working with wien2wannier to obtain Wannier functions from wien2k calculations, but I am struggling to define the energy window needed for the init_w2w. 

The outputfind file shows emin = -999.00 eV, emax = 999.00 eV, and efermi = 0.6124 Ry. However, when I use these values, I receive the following error message:


findbands -all [-999.0 999.0] 

../x_lapw: No match.

If you can provide any help, I would be thankful.  

matthieu verstraete

unread,
Oct 15, 2024, 1:33:59 AM10/15/24
to mouad Ben-nana, TB2J
Hello, 

You need to write the wien2k forum or mailing list. This is independent of tb2j and we don't know wien2k at all

--
You received this message because you are subscribed to the Google Groups "TB2J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tb2j+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tb2j/40636410-b054-45fa-9ba9-577fda1d4199n%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages