The use of magnetic moment, kpoints, ionmov, supercells, and DOS

Total energy, geometry optimization, DFT+U, spin....

Moderator: bguster

Locked
ssh77
Posts: 23
Joined: Fri May 22, 2020 6:00 pm

The use of magnetic moment, kpoints, ionmov, supercells, and DOS

Post by ssh77 » Mon Jun 15, 2020 7:04 pm

Hi,
I was trying to test a couple of different parameters related to the magnetic moment, kpoints and the ionmov, supercell but don't know if there's something wrong.

The compound is an Mn-oxide with an antiferromagnetic structure and I expect the Mn moment to be ~4 µB/ion but when I run the calculation I reach more than 6 Bohr magnetons which is far too much. Since the structure is hexagonaI would also need to calculate the kpoints centered at the Gamma point.
I would also like to run a relaxation of the atomic cores and the full cell relaxation using ionmov. Further I would like to know how supercells are made and how the electronic DOS is easiest plotted with nice graphs similar to the Sumo software used for VASP (https://sumo.readthedocs.io/en/latest/gallery.html ).

So, more specifically:

1) I would like to have a spin poarized DOS. To refine the magnetic moment I use a spin polarized calculation with
nsppol 2
nspden 2
nspinor 1
spinat with 0 0 4 on the magnetic atom positions as starting magnetic moments (I hope this is correctly understood)
However, I was told by the err file that I should use spinmagntarget, which I have put to 0. So I don't know which one decides the starting moment
------------------------------------------------------------------------
2) for kpoints I use
chksymbreak 0
ngkpt 4 4 4 for the grid resolution
shiftk 0 0 0 I assume this decides if it is Gamma centered or not?
-------------------------------------------------------------------------
3) to relax the atomic cores I use
ionmov 2
optcell 0
toldff 5.0d-5 the convergence criteria for the forces (can I change the units here?)

However, I don't understand if abinit has some specific priority when running, i.e., if electronic SCF is first made then secondly the ionmov step and then SCF again and then ionmov for each step in the convegence? Or does it skip the SCF and go directly to the ionmov and move around the atoms or cores? When I check the output file I only notice the ionmov written as step 1/1 so I don't undertstand if this step is done with each SCF or not. In VASP I think each SCF step includes a atomic or nucleus movement before running SCF again and repeating the movement of the atoms/cores. What is the procedure in abinit? If I set nstep 50 and toldff 5d-5, will the SCF stop when the forces have reached 5d-5 even before SCF has reached 50? and will it otherwise just continue until lthe limit 50 is reached?
--------------------------------------------------------------------------
4) I would like to try and test the difference in energies between different cell sizes, how do I get supercells in abinit? do I multiply the cell parameters with a scalar e.g., a 4 4 4 cell with 2*4 2*4 2*4 to show abinit that I want a supercell or do I need to make a cif with a cell X times larger? that is not practical for a supercell with sya, 500 atoms or larger to add each atom manually :?
---------------------------------------------------------------------------
5) I would like to make chained calculations so that I first calculate only SCF, then use the ionmov for atomic cores, and finally geometry.
Can I somehow link the ndtset so that each calculaltion continues from the latest results?

Also I didn't quite understand the use of the udtset, why is there 2 different values that add up to ndtset.
--------------------------------------------------------------------------
6) Currently I can only plot the eDOS by using the "abiopen.py *_GSR.nc --expose -sns=talk" from base tutorial 3 for silicon. But The band structure looks horrible and I doubt that people publish such ugly band structures, at least the ones I have obtained.

I have used the abipy obtion to create the k-path for the space group from a cif file, which is something like:

iscf -2
tolwfr 1d-16
# K-path in reduced coordinates:
ndivsm 10
kptopt -11
kptbounds
+0.00000 +0.00000 +0.00000 # $\Gamma$
+0.50000 +0.00000 +0.00000 # M
+0.33333 +0.33333 +0.00000 # K
+0.00000 +0.00000 +0.00000 # $\Gamma$
+0.00000 +0.00000 +0.50000 # A
+0.50000 +0.00000 +0.50000 # L
+0.33333 +0.33333 +0.50000 # H
+0.00000 +0.00000 +0.50000 # A
+0.50000 +0.00000 +0.50000 # L
+0.50000 +0.00000 +0.00000 # M
+0.33333 +0.33333 +0.00000 # K
+0.33333 +0.33333 +0.50000 # H

How is this information supposed to be used? When I try and plot the DOS as mentioned, I get a horrible band structure and total DOS. However, for the abipy k-path creator one should rerun a non-SCF using the information above, but nothing changes. So currently the accuracy and looks of the band structure and DOS plots are horrible and I don't know if they are reliable, or if I need to replot them somehow using a different software.
Is there a way to convert abinit output to vasp output files? that way I will be able to use the sumo software which is really fantastic but only made for VASP.

I would be grateful if somebody is able to help clearing these questions out for me, that would be extremely helpful.

/ssh77

User avatar
gmatteo
Posts: 291
Joined: Sun Aug 16, 2009 5:40 pm

Re: The use of magnetic moment, kpoints, ionmov, supercells, and DOS

Post by gmatteo » Fri Jun 19, 2020 3:56 am

spinat with 0 0 4 on the magnetic atom positions as starting magnetic moments (I hope this is correctly understood)
spinat is a [3, natom] array so you have to match the initial atomic magnetization with the atomic site as specified by xred or xcart.
Note also that Abinit supports AFM symmetries as nsppol is internally defined as the number of **independent** spin polarizations. To run an AFM calculation use nspden = 2 and nsppol 1 (and make sure that the AFM group detected by Abinit is what you expect)
2) for kpoints I use
chksymbreak 0
ngkpt 4 4 4 for the grid resolution
shiftk 0 0 0 I assume this decides if it is Gamma centered or not?
Right, shiftk defines the nshiftk shifts (by default shiftk is 0.5 0.5 0.5 and nshiftk is 1)
Setting chksymbreak 0 to zero is always a bit risky as your k-sampling may break the symmetry of the crystal
I think the documentation of shiftk reports the recommended values of shiftk and nshiftk for the different lattices.

toldff 5.0d-5 the convergence criteria for the forces (can I change the units here?)
Not, as far as I know. The parser supports energies, lengths, and time but not forces that must be specified in atomic units.

I check the output file I only notice the ionmov written as step 1/1 so I don't understand if this step is done with each SCF or not.
By default, Abinit solves the SCF problem at fixed geometry and then moves the atoms (lattice).
There are "movers" that use additional inner loops but I've never used them.
I agree that the output is confusing.
If I set nstep 50 and toldff 5d-5, will the SCF stop when the forces have reached 5d-5 even before SCF has reached 50? and will it otherwise just continue until lthe limit 50 is reached?
It will stop as soon as the toldff condition is fulfilled twice else it will continue until 50 iterations are reached then the code computes forces and stresses and decides how to move stuff.
This can trigger problems in "problematic systems" if the SCF does not converge quickly. In this case, indeed, Abinit stops after to 50-th iteration and you may be moving atoms (lattice parameters) in the wrong direction.
For problematic cases, I would suggest to increase nstep to 100
--------------------------------------------------------------------------
4) I would like to try and test the difference in energies between different cell sizes, how do I get supercells in abinit? do I multiply the cell parameters with a scalar e.g., a 4 4 4 cell with 2*4 2*4 2*4 to show abinit that I want a supercell or do I need to make a cif with a cell X times larger? that is not practical for a supercell with sya, 500 atoms or larger to add each atom manually
Since you have installed AbiPy, you can use the abistruct.py script to build a supercell.
Use

abistruct.py supercell FILE -s 2 2 2

to build a 2x2x2 supercell from the structure read from FILE (FILE may be an Abinit input file, nc file, CIF file, POSCAR ...)
Issue abistruct.py supercell --help for the options supported by the `supercell` command
and abistruct.py --help for the global help
6) Currently I can only plot the eDOS by using the "abiopen.py *_GSR.nc --expose -sns=talk" from base tutorial 3 for silicon. But The band structure looks horrible and I doubt that people publish such ugly band structures, at least the ones I have obtained.
Well, there may be several reasons why your band structure looks ugly.
First of all, AbiPy does not check whether you GSR file provides an energy spectrum along a high-symmetry k-path or not.
abiopen is just plotting the eigenvalues read from the GSR file (even if the GSR does not contain a k-path this kind of plot can be very useful to understand if the system at the end of the GS run has an energy gap and I use it a lot for a quick analysis).
So the question is "are you sure you are plotting a GSR with energies along a k-path and that the ecut is reasonable?"
Have you seen this example:https://abinit.github.io/abipy/gallery/ ... ds-edos-py .
If the problem persists, please send me the input files.
I have used the abipy option to create the k-path for the space group from a cif file, which is something like:

iscf -2
tolwfr 1d-16
# K-path in reduced coordinates:
ndivsm 10
kptopt -11
kptbounds
+0.00000 +0.00000 +0.00000 # $\Gamma$
+0.50000 +0.00000 +0.00000 # M
+0.33333 +0.33333 +0.00000 # K
+0.00000 +0.00000 +0.00000 # $\Gamma$
+0.00000 +0.00000 +0.50000 # A
+0.50000 +0.00000 +0.50000 # L
+0.33333 +0.33333 +0.50000 # H
+0.00000 +0.00000 +0.50000 # A
+0.50000 +0.00000 +0.50000 # L
+0.50000 +0.00000 +0.00000 # M
+0.33333 +0.33333 +0.00000 # K
+0.33333 +0.33333 +0.50000 # H

How is this information supposed to be used? When I try and plot the DOS as mentioned, I get a horrible band structure and total DOS. However, for the abipy k-path creator one should rerun a non-SCF using the information above, but nothing changes. So currently the accuracy and looks of the band structure and DOS plots are horrible and I don't know if they are reliable, or if I need to replot them somehow using a different software.
Is there a way to convert abinit output to vasp output files? that way I will be able to use the sumo software which is really fantastic but only made for VASP.

I would be grateful if somebody is able to help clearing these questions out for me, that would be extremely helpful.
The input file generated by AbiPy is supposed to be used as a template to perform NSCF calculations.
In a NSCF calculation, you always need to use the `getden` or `irden` variables to read the DEN file from a previous dataset.
So one should always add the dataset index to the input variables reported by AbiPy when creating an input file for band structure calculations.
In a typical two-step SCF+NSCF calculation, I would do something like:

Code: Select all

ndtset 2

# DATASET 1 GS calculation to get the DEN
tolvrs1 1-e8

# DATASET 2 NSCF bandstructure calculation using the DEN file produced above.
getden2 -1.  # Read DEN file for previous dataset
iscf2 -2
tolwfr2 1d-16
# K-path in reduced coordinates:
ndivsm2 10
kptopt2 -11
kptbounds2
+0.00000 +0.00000 +0.00000 # $\Gamma$
+0.50000 +0.00000 +0.00000 # M
+0.33333 +0.33333 +0.00000 # K
+0.00000 +0.00000 +0.00000 # $\Gamma$
+0.00000 +0.00000 +0.50000 # A
+0.50000 +0.00000 +0.50000 # L
+0.33333 +0.33333 +0.50000 # H
+0.00000 +0.00000 +0.50000 # A
+0.50000 +0.00000 +0.50000 # L
+0.50000 +0.00000 +0.00000 # M
+0.33333 +0.33333 +0.00000 # K
+0.33333 +0.33333 +0.50000 # H
BTW: In Abinit9, it's possible to use getden_filepath = "out_DEN" to start a NSCF run from a previous DEN file without having to use the getden syntax.

ssh77
Posts: 23
Joined: Fri May 22, 2020 6:00 pm

Re: The use of magnetic moment, kpoints, ionmov, supercells, and DOS

Post by ssh77 » Thu Jun 25, 2020 4:10 pm

Thanks for the answers! I still have some questions on some of the answers to clarify them.

1)

the array [3, natom] for the spinat, does it represent 3 coordinates and number of atoms according to xred?
In my case I have 30 atoms and have set the magnetic moment to 4 for the Mn positions along the z-coordinate.

spinat 0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 4 #Mn atoms
0 0 4
0 0 4
0 0 4
0 0 4
0 0 4
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0


Question: Is this the right way to do it? I don't understand why the moment is moving towards 6 Bohr magnetons when it should be around 4.

2)

"Abinit supports AFM symmetries as nsppol is internally defined as the number of **independent** spin polarizations. To run an AFM calculation use nspden = 2 and nsppol 1 (and make sure that the AFM group detected by Abinit is what you expect)"

Question: I understood it from the abinit help that spin polarization is not possible using AFM configuration, or will it generate a spin polarized DOS still with this setting?

3)

"shiftk defines the nshiftk shifts (by default shiftk is 0.5 0.5 0.5 and nshiftk is 1)
Setting chksymbreak 0 to zero is always a bit risky as your k-sampling may break the symmetry of the crystal
I think the documentation of shiftk reports the recommended values of shiftk and nshiftk for the different lattices."
Question:So I should still use the ngkpt but only add the correct shiftk and nshiftk for the lattice I use?

4)

"By default, Abinit solves the SCF problem at fixed geometry and then moves the atoms (lattice)."

Question: So abinit runs first, ALL SCF at fixed geometry, say if I have 50 SCF it will first run 50 SCF as usual, and then stat running the ionmov until the convergence criteria for ionmov is reached? So they are totally separated without inner loops?

I will try the SCF and NSCF that you proposed for the k-path after adding the answers for the above questions.
Hopefully the DOS and magnetic moments reach better values more as in the literature.

The supercell generator appears to work fine, and generates a large matrix with all xred cooredinates for each atom.

Just regarding the visualization that exists in the abistruct.py, how does it know where vesta is installed? If I install vesta for the visualization it should somehow find vesta.

Thanks!
ssh77

ssh77
Posts: 23
Joined: Fri May 22, 2020 6:00 pm

Re: The use of magnetic moment, kpoints, ionmov, supercells, and DOS

Post by ssh77 » Sun Jul 05, 2020 6:42 pm

Any further comments on the additional questions?

ebousquet
Posts: 469
Joined: Tue Apr 19, 2011 11:13 am
Location: University of Liege, Belgium

Re: The use of magnetic moment, kpoints, ionmov, supercells, and DOS

Post by ebousquet » Mon Jul 06, 2020 2:45 pm

ssh77 wrote:
Thu Jun 25, 2020 4:10 pm
the array [3, natom] for the spinat, does it represent 3 coordinates and number of atoms according to xred?
In my case I have 30 atoms and have set the magnetic moment to 4 for the Mn positions along the z-coordinate.

spinat 0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 4 #Mn atoms
0 0 4
0 0 4
0 0 4
0 0 4
0 0 4
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0


Question: Is this the right way to do it? I don't understand why the moment is moving towards 6 Bohr magnetons when it should be around 4.
Yes, to me it looks right for each atom in xred you have to define a spinat with x, y, z component of the amgnetization, which, in the case of collinear magnetism, is reduced to 0 0 m (only z component is read but 0 should be put for x and y component).
Why you get 6 instead of 4 Bohr magneton is either a problem of convergence or a metastable state in which the system is going but usually it is more the opposite (the final magnetic moment appear lower or much lower than the one expected, if much lower means low spin instead of high spin, but in your case could you expect a high-spin configuration that can explain the larger value? It might be a metastable state, to avoid it you can try to start with a lower magnetic moment in your spinat).
ssh77 wrote:
Thu Jun 25, 2020 4:10 pm
2)
"Abinit supports AFM symmetries as nsppol is internally defined as the number of **independent** spin polarizations. To run an AFM calculation use nspden = 2 and nsppol 1 (and make sure that the AFM group detected by Abinit is what you expect)"

Question: I understood it from the abinit help that spin polarization is not possible using AFM configuration, or will it generate a spin polarized DOS still with this setting?
nspden=2 and nsppol=1 is still a magnetic calculation (2 components of the density for up and down spin in the case of collinear magnetism) but because the up channel is strictly equal to the down channel in perfect AFM, Abinit uses this symmetry to compute only one of the two channels and get the second one from the first one. So, it is still magnetic, yes.
ssh77 wrote:
Thu Jun 25, 2020 4:10 pm
3)
"shiftk defines the nshiftk shifts (by default shiftk is 0.5 0.5 0.5 and nshiftk is 1)
Setting chksymbreak 0 to zero is always a bit risky as your k-sampling may break the symmetry of the crystal
I think the documentation of shiftk reports the recommended values of shiftk and nshiftk for the different lattices."
Question:So I should still use the ngkpt but only add the correct shiftk and nshiftk for the lattice I use?
Yes, but shiftk is only here to reduce the number of k-points to be calculated depending on the symmetry of the lattice, it should not affect the physical result.
ssh77 wrote:
Thu Jun 25, 2020 4:10 pm
4)
"By default, Abinit solves the SCF problem at fixed geometry and then moves the atoms (lattice)."

Question: So abinit runs first, ALL SCF at fixed geometry, say if I have 50 SCF it will first run 50 SCF as usual, and then stat running the ionmov until the convergence criteria for ionmov is reached? So they are totally separated without inner loops?
Yes, at a given structure it converges the electronic density/WF and then computes the forces to move the atoms and restart SCF, etc

generator appears to work fine, and generates a large matrix with all xred cooredinates for each atom.
ssh77 wrote:
Thu Jun 25, 2020 4:10 pm
Just regarding the visualization that exists in the abistruct.py, how does it know where vesta is installed? If I install vesta for the visualization it should somehow find vesta.
I do not know about that, maybe Matteo will respond to this?

Best wishes,
Eric

Locked