Problem in calculating exchange parameter in CrN

626 views
Skip to first unread message

Sourav Rudra

unread,
Mar 31, 2022, 9:04:11 AM3/31/22
to TB2J
Dear developers,

I am Sourav Rudra , PhD. student of Jawaharlal Nehru Centre for Advanced Scientific Research, Bengaluru, India. I am currently trying to use TB2J package for finding Cr - Cr exchange interaction using Quantum Espresso(QE) and Winnier90 codes. My CrN system is antiferromagnetic and the input unit cell contains total 8 atom ( 2 Cr(up) , 2 Cr(down) and 4 N atom) with Hubbard_U on d-orbital of both Cr up and down. After Wannier90 calculation on this same unit cell I found both QE and Wannier90 bands structure under disentanglement_frozen_window matches well also Wannier functions  are localized on atoms. ( for spin up calculation localized on 2 Cr(up) and 4 N , for down spin calculation localized on 2 Cr(down) and 4 N) In the wannier90 CrN_up.win file i have taken Cr1(i.e. up spin) d and N p and Cr_down.win file Cr2(i.e. down spin) and N p as projectors . After that when i submitted TB2J code error came. I am not still finding any way to solve the error. I have attached here all the regarding files.

run_command for TB2J: wann2J.py --posfile CrN.scf.in --efermi 14.7896 --kmesh 5 5 5 --emin -7.7896 --emax 0.0 --prefix_up CrN_up --prefix_down CrN_down --elements Cr1 Cr2
error: TB2J version 0.7.1.1
Copyright (C) 2018-2020  TB2J group.
This software is distributed with the 2-Clause BSD License, without any warranty. For more details, see the LICENSE file delivered with this software.


Reading atomic structure from file ./CrN.scf.in.
Reading Wannier90 hamiltonian: spin up.
Reading Wannier90 hamiltonian: spin down.
Starting to calculate exchange.
A gap is found at -8.029665997904534, set emin to it.
Green's function Calculation started.
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 100/100 [00:00<00:00, 250.74it/s]
Traceback (most recent call last):
  File "/home/hulk/TB2Jenv/bin/wann2J.py", line 186, in <module>
    run_wann2J()
  File "/home/hulk/TB2Jenv/bin/wann2J.py", line 181, in run_wann2J
    orb_decomposition=args.orb_decomposition
  File "/home/hulk/TB2Jenv/lib/python3.6/site-packages/TB2J/manager.py", line 138, in gen_exchange
    exchange.run(path=output_path)
  File "/home/hulk/TB2Jenv/lib/python3.6/site-packages/TB2J/exchange.py", line 752, in run
    self.calculate_all()
  File "/home/hulk/TB2Jenv/lib/python3.6/site-packages/TB2J/exchangeCL2.py", line 269, in calculate_all
    self.get_rho_atom()
  File "/home/hulk/TB2Jenv/lib/python3.6/site-packages/TB2J/exchangeCL2.py", line 203, in get_rho_atom
    tup = np.real(np.trace(self.rho_up[np.ix_(iorb, iorb)]))
IndexError: invalid index to scalar variable.

at the same time I have also started with  including N also like
wann2J.py --posfile CrN.scf.in --efermi 14.7896 --kmesh 5 5 5 --emin -7.7896 --emax 0.0 --prefix_up CrN_up --prefix_down CrN_down --elements Cr1 Cr2 N.
This works but exchange.out file in TB2J_results contains only N-N interaction no Cr-Cr interactions are there. Please help me to solve this such that i am able to find out Cr-Cr interactions also.

Best regards,
Sourav Rudra
CPMU,ICMS
JNCASR,Jakkur
Bengaluru,India
Capture1.PNG2.PNG3.PNG4.PNG

Xu He

unread,
Mar 31, 2022, 9:56:15 AM3/31/22
to Sourav Rudra, TB2J

Dear Sourav,

Thanks for the detailed description.

- In the Wannier90  input, use Cr instead of Cr1. For both spin up and spin down, you'll need not only the occupied orbitals but also the unoccupied ones. As in TB2J, the local spin field, which is the difference between Hamiltonian for spin up and spin down for each magnetic site are needed.

- In the --element option, use Cr instead of Cr1 Cr2.

Best wishes,

HeXu

--
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/bf17fe26-34a8-47bc-8ebf-29c444fbd49bn%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sourav Rudra

unread,
Mar 31, 2022, 10:16:10 AM3/31/22
to TB2J
Thank you so much. I will follow your opinion. So i have to change Cr1 and Cr2 as Cr and begin_projection as Cr : d and N: p in wannier90 input file.
so using this projection will the num_wan be still 22 as i used before or it will change to 32 as total 4 Cr atom is in my unit cell 2 for Cr up and 2 for Cr down spin.

Sourav Rudra

unread,
Mar 31, 2022, 10:17:04 AM3/31/22
to TB2J
please clarify me whether am i correct or not.

Xu He

unread,
Mar 31, 2022, 10:18:06 AM3/31/22
to TB2J
Hi,
I think you need 32 wannier functions for each spin. 4*5 Cr d oribitals, and 4*3 N p oribitals. And the energy window should be adjusted accordingly. Best wishes,
HeXu

Sourav Rudra

unread,
Mar 31, 2022, 10:58:38 AM3/31/22
to TB2J
thank you. I will do and inform you.

Sourav Rudra

unread,
Mar 31, 2022, 11:19:51 AM3/31/22
to TB2J
also some clarifications needed. whether am i using spin = up for up spin wannier calculation as before in CrN_up.win file and nscf calculation with nosym =.true. ?
Thanking you

Xu He

unread,
Mar 31, 2022, 11:38:50 AM3/31/22
to Sourav Rudra, TB2J


On 3/31/22 17:19, Sourav Rudra wrote:
also some clarifications needed. whether am i using spin = up for up spin wannier calculation as before in CrN_up.win file
Yes

and nscf calculation with nosym =.true. ?
Yes

Sourav Rudra

unread,
Apr 4, 2022, 12:20:17 PM4/4/22
to TB2J
thanks for your guidance, now TB2J runs perfectly. I have noticed that in my system N atoms are slightly magnetized due to hybridization with Cr d orbitals, without down-folding running TB2J with Cr and N both as magnetic elements I have found Cr(up)-Cr(down) J_iso=-10.67mev but with downfolding (removing ligand N effect)  J_iso becomes -9.89mev. is this consistent?  After this I ran Multibinit to get neel temperature but there Cv and chi has some noisy data. can you please help me to solve how to remove noisy data?
Multibinit code:

prt_model = 0

#--------------------------------------------------------------
#Monte carlo / molecular dynamics
#--------------------------------------------------------------
dynamics =  0    ! disable molecular dynamics

ncell =   16 16 16  ! size of supercell.
#-------------------------------------------------------------
#Spin dynamics
#------------------------------------------------------------
spin_dynamics=1  ! enable spin dynamics
spin_mag_field= 0.0 0.0 0.0   ! external magnetic field
spin_ntime_pre =50000          ! warming up steps.
spin_ntime =    200000             ! number of steps.
spin_nctime=5000               ! number of time steps between two nc file write
spin_dt=1e-16 s               ! time step.
spin_init_state = 1           ! random initial spin

spin_temperature=1e-09

spin_var_temperature=1        ! switch on variable temperature calculation
spin_temperature_start=0      ! starting point of temperature
spin_temperature_end=350      ! ending point of temperature.
spin_temperature_nstep=70      ! number of temperature steps.

!spin_sia_add = 1              ! add a single ion anistropy (SIA) term?
!spin_sia_k1amp = 1e-6         ! amplitude of SIA (in Ha), how large should be used?
!spin_sia_k1dir = 0.0 0.0 1.0  ! direction of SIA

spin_calc_thermo_obs = 1      ! calculate thermodynamics related observables
spin_write_traj = 0       
I have done it with taking both Cr and N as magnetic element without down-folding.experimental value of T_N is 270K but my calculation seems to be 319K.
thanking you,
Sourav Rudra
5.PNG6.PNG

Xu He

unread,
Apr 4, 2022, 1:24:52 PM4/4/22
to Sourav Rudra, TB2J

Hi,

- For the TB2J results, it looks quite nice although I don't know the details. Looks like the ligand magnetization effect is not quite strong, which is quite normal. 

- For the Multibinit calculation:  To make is less noisy, making the supercell larger, and use a larger spin_ntime will be useful.  Adding a tiny SIA (uncomment the SIA lines) might also help.  One thing to note is that the Cv at 0K is meaningless, so it's better to remove that point from the figure.

- The agreement with experiment seems quite good. It is usually not expected that the result should completely agree, as the model is based on approximations and both computation and experiments are with errors.

Best wishes,

HeXu

Sourav Rudra

unread,
Apr 5, 2022, 4:05:45 AM4/5/22
to TB2J
I need some more help also. It takes a lot of time to run spin dynamics for this calculation it has taken 30 hrs. so increasing spin_ntime will take a lot of time to execute. will spin_ntime 300000 and spin_ntime_pre 50000  better? I have also taken spin_dynamics = 3 (Monte Carlo) on 28 28 28 ncell and 500000 spin_ntime but cv and x came to be negative for MC case.In the time of J calculation I have not taken any SIA. So in Multibinit ,can i add small SIA? if i can then sia_k1amp =1e-06 and sia_kidir = 0.0 0.0 1.0 hold good?
Also i have found that in tutorial spin_ntime = 10* spin_ntime_pre. is it mandatory in all case? My magnon dispersion has come with negative magnon energy. is this due to Pseudo potential
effect? by changing Pseudo potential  can i get positive magnon energy? As negative energy is not physically meaningful.1.PNG
Thanking you
Sourav Rudra

Xu He

unread,
Apr 5, 2022, 6:29:59 AM4/5/22
to Sourav Rudra, TB2J


On 4/5/22 10:05, Sourav Rudra wrote:
I need some more help also. It takes a lot of time to run spin dynamics for this calculation it has taken 30 hrs. so increasing spin_ntime will take a lot of time to execute. will spin_ntime 300000 and spin_ntime_pre 50000  better?

There are several options:

- Use mpi.  Currently the scaling of cpu numbers is not quite good in the spin dynamics, but it could help.

- Split the calculation into different temperature ranges and run them in parallel.

- Tune the time step to reduce the number of total time steps required. You'll need to try with different values to gain some intuition on what number is the best for the system. Perhaps use a small supercell size. But be careful not to use a too large time step which will make the dynamics diverge.  There is always a balance between efficiency and stability.


I have also taken spin_dynamics = 3 (Monte Carlo) on 28 28 28 ncell and 500000 spin_ntime but cv and x came to be negative for MC case.

This is weird. Could you send me the input files including the TB2J results and the Multibinit input/output? Looks like a bug in Multibinit for MC. In principle these numbers cannot be negative from the equation.


In the time of J calculation I have not taken any SIA. So in Multibinit ,can i add small SIA? if i can then sia_k1amp =1e-06 and sia_kidir = 0.0 0.0 1.0 hold good?
Yes, adding a tiny SIA shouldn't change the result but will make the calculation a little more stable.
Also i have found that in tutorial spin_ntime = 10* spin_ntime_pre. is it mandatory in all case?
No. You can tune the values to gain the best efficiency. Just make sure that before doing the statistics, the spins are already in equilibrium (during the ntime_pre) but do not spend too many extra time steps on it.
My magnon dispersion has come with negative magnon energy. is this due to Pseudo potential
effect? by changing Pseudo potential  can i get positive magnon energy? As negative energy is not physically

Note that the current implementation of magnon band structure is only for FERROMAGNETIC materials. The negative energy means the ground state is not ferromagnetic. As from your result indeed it is antiferromagnetic.

Best regards,

HeXu




Sourav Rudra

unread,
Apr 5, 2022, 7:02:25 AM4/5/22
to TB2J
I was using 40 processor to run the job in mpi.
mpirun -np 40 Multibinit <mb.files> mb.txt &
I have taken 0K to 350K with Temperature step 5K then ran it parallel with 40 processor taken 30 hrs. with spin_dynamics 1.
time steps means spin_dt? I have already taken it small. 1e-16.
I have attached files for MC. I have done MC for a single temperature at T=300K.
thanking you
Sourav Rudra
mb.in
mb.txt_28_MC
exchange.out

Xu He

unread,
Apr 5, 2022, 2:06:12 PM4/5/22
to Sourav Rudra, TB2J

Hi,

-I guess the compuation time could be reduced if you use a smaller number of CPUs. The parallelization in the spin dynamics is not yet optimized and the scaling is quite bad...
From my experience, it is only helpful with a few CPUs, and  it actually slows down the computation when the number is further increased.

- Indeed with the Monte carlo method, these quantities are broken. I have found where the bug is and it will be fixed in the next release of Multibinit.Thanks.

- Yes, I mean spin_dt. If you want to make the simulation faster, try with tuning this parameter to get a balance between stability and efficiency. Small spin_dt will be more stable but requires more steps, whereas larger with large spin_dt there is the risk of divergence. So this needs some careful test.

Best wishes,

HeXu

Sourav Rudra

unread,
Apr 5, 2022, 2:46:12 PM4/5/22
to TB2J
OK.thank you. I will try with 20 CPUs from next time.

Sourav Rudra

unread,
Apr 12, 2022, 6:28:31 AM4/12/22
to TB2J
Dear HeXu,
                                    In Multibinit spin_dynamics there is also a tag called spin_temperature. I am calculating spin_dynamics over the temperature range 200-400K so in input I did not put the tag spin_temperature. But the code has taken default value of spin_temperature as 325K in the mb.out output file then calculated and written all the thermodynamic properties at different temperatures. I don't understand it's reason and will this create any problem in calculation?

Thanking you
Sourav Rudra

Xu He

unread,
Apr 12, 2022, 10:04:38 AM4/12/22
to TB2J
Dear Sourav,
Could you share the multibinit input and output files? Thanks. 
Best wishes,
HeXu

Sourav Rudra

unread,
Apr 12, 2022, 10:45:03 AM4/12/22
to TB2J
I have attached the input and output files here
Thanking you
mb.in
mb.out

mail...@gmail.com

unread,
Apr 12, 2022, 11:57:14 AM4/12/22
to tb...@googlegroups.com
Hi,
The 325K is only in the output because all the parameters (used or not) are printed. It won't be used in the calculation.
But it is indeed confusing when it is printed. I will consider removing it in the output. Thanks.
Best wishes,
HeXu
> >> meaningful.1.PNG
> >>> _*Multibinit code*_:
> >>> 5.PNG6.PNG
> >>>>> *run_command for
> >>>>> TB2J*: wann2J.py
> >>>>> --posfile
> >>>>> CrN.scf.in
> >>>>> <http://CrN.scf.in> --efermi
> >>>>> 14.7896 --kmesh 5
> >>>>> 5 5 --emin -7.7896
> >>>>> --emax 0.0
> >>>>> --prefix_up CrN_up
> >>>>> --prefix_down
> >>>>> CrN_down
> >>>>> --elements Cr1 Cr2
> >>>>> _*error*_: TB2J
> >>>>> version 0.7.1.1
> >>>>> Copyright (C)
> >>>>> 2018-2020  TB2J group.
> >>>>> This software is
> >>>>> distributed with
> >>>>> the 2-Clause BSD
> >>>>> License, without
> >>>>> any warranty. For
> >>>>> more details, see
> >>>>> the LICENSE file
> >>>>> delivered with
> >>>>> this software.
> >>>>>
> >>>>>
> >>>>> Reading atomic
> >>>>> structure from
> >>>>> file ./CrN.scf.in
> >>>>> <http://CrN.scf.in>.
> >>>>> <http://CrN.scf.in> --efermi
> >>>>> 14.7896 --kmesh 5
> >>>>> 5 5 --emin -7.7896
> >>>>> --emax 0.0
> >>>>> --prefix_up CrN_up
> >>>>> --prefix_down
> >>>>> CrN_down
> >>>>> --elements Cr1 Cr2 N.
> >>>>> This works but
> >>>>> exchange.out file
> >>>>> in TB2J_results
> >>>>> contains only N-N
> >>>>> interaction no
> >>>>> Cr-Cr interactions
> >>>>> are there. Please
> >>>>> help me to solve
> >>>>> this such that i
> >>>>> am able to find
> >>>>> out Cr-Cr
> >>>>> interactions also.
> >>>>>
> >>>>> Best regards,
> >>>>> Sourav Rudra
> >>>>> CPMU,ICMS
> >>>>> JNCASR,Jakkur
> >>>>> Bengaluru,India
> >>>>> Capture1.PNG2.PNG3.PNG4.PNG
> >>>>> --
> >>>>> 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/bf17fe26-34a8-47bc-8ebf-29c444fbd49bn%40googlegroups.com
> >>>>> <https://groups.google.com/d/msgid/tb2j/bf17fe26-34a8-47bc-8ebf-29c444fbd49bn%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >>>>> For more options,
> >>>>> visit
> >>>>> https://groups.google.com/d/optout
> >>>>> <https://groups.google.com/d/optout>.
> >>>>
> >>>> --
> >>>> 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/2b4cf70c-cc3c-4efe-ad56-695efaa3dc7dn%40googlegroups.com
> >>>> <https://groups.google.com/d/msgid/tb2j/2b4cf70c-cc3c-4efe-ad56-695efaa3dc7dn%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >>>>
> >>>> For more options, visit
> >>>> https://groups.google.com/d/optout
> >>>> <https://groups.google.com/d/optout>.
> >>>
> >>> --
> >>> 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/1a80d6af-8b97-454e-aab5-f245ae45d20dn%40googlegroups.com
> >>> <https://groups.google.com/d/msgid/tb2j/1a80d6af-8b97-454e-aab5-f245ae45d20dn%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >>>
> >>> For more options, visit
> >>> https://groups.google.com/d/optout
> >>> <https://groups.google.com/d/optout>.
> >>
> >> --
> >> 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/84c6571b-7062-438d-ae01-5c611b46caa7n%40googlegroups.com
> >> <https://groups.google.com/d/msgid/tb2j/84c6571b-7062-438d-ae01-5c611b46caa7n%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >>
> >> For more options, visit
> >> https://groups.google.com/d/optout
> >> <https://groups.google.com/d/optout>.
> >
> > --
> > 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/8ff66138-afe4-49ea-9a9d-5fb686d4a245n%40googlegroups.com
> > <https://groups.google.com/d/msgid/tb2j/8ff66138-afe4-49ea-9a9d-5fb686d4a245n%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >
> > For more options, visit
> > https://groups.google.com/d/optout
> > <https://groups.google.com/d/optout>.
>
> --
> 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
> <mailto:tb2j+uns...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tb2j/7d1317e4-158b-47ed-b473-750943bfa743n%40googlegroups.com
> <https://groups.google.com/d/msgid/tb2j/7d1317e4-158b-47ed-b473-750943bfa743n%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>

Sourav Rudra

unread,
Apr 13, 2022, 9:01:44 AM4/13/22
to TB2J
thank you.Also I have a small query about the calculations at different temperatures. Are calculations for one particular temperature independent of previous temperature or dependent?
Such that I have done 200 to 400 K in 10 K steps and now i want to calculate 250 to 300 in 5K steps with the other parameters remaining same will i get different values of cv chi from previous calculationat 250 260 280 K ... ?
Reply all
Reply to author
Forward
0 new messages