Merge lp:~albertog/siesta/merge-OSSO into lp:siesta

Proposed by Alberto Garcia
Status: Superseded
Proposed branch: lp:~albertog/siesta/merge-OSSO
Merge into: lp:siesta
Diff against target: 28535 lines (+15688/-10454)
185 files modified
Docs/Contributors.txt (+2/-1)
Docs/SOC_offsite_notes.txt (+25/-0)
Docs/siesta.tex (+122/-79)
Src/Makefile (+38/-34)
Src/atm_types.f (+6/-3)
Src/atmfuncs.f (+2/-0)
Src/atmparams.f (+5/-1)
Src/atom.F (+193/-141)
Src/bands.F (+4/-4)
Src/basis_io.F (+31/-5)
Src/broadcast_basis.F (+6/-0)
Src/compute_energies.F90 (+175/-56)
Src/dfscf.f (+2/-1)
Src/final_H_f_stress.F (+46/-25)
Src/initatom.f (+15/-9)
Src/m_cite.F90 (+23/-1)
Src/m_pulay.F90 (+7/-8)
Src/m_spin.F90 (+71/-65)
Src/mixer.F (+9/-9)
Src/moments.F (+0/-1)
Src/nlefsm.f (+615/-6)
Src/setup_H0.F (+73/-19)
Src/setup_hamiltonian.F (+101/-47)
Src/siesta_options.F90 (+2/-3)
Src/sparse_matrices.F (+9/-3)
Src/spinorbit.f (+4/-7)
Src/state_analysis.F (+2/-2)
Src/state_init.F (+14/-7)
Tests/FePt_soc/FePt_soc.fdf (+65/-0)
Tests/FePt_soc/FePt_soc.pseudos (+2/-0)
Tests/FePt_soc/makefile (+2/-0)
Tests/Makefile (+3/-7)
Tests/More_SOC_Examples/README (+10/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.fdf (+72/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.pseudos (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xx/README (+33/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xx/makefile (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.fdf (+74/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.pseudos (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/README (+33/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/makefile (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.fdf (+72/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.pseudos (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xz/README (+33/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xz/makefile (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.fdf (+70/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.pseudos (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/README (+33/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/makefile (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.fdf (+72/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.pseudos (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zy/README (+33/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zy/makefile (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.fdf (+68/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.pseudos (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/README (+33/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/makefile (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.fdf (+72/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.pseudos (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zz/README (+33/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zz/makefile (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.fdf (+64/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.pseudos (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/README (+33/-0)
Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/makefile (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.fdf (+64/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.pseudos (+1/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/README (+34/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/makefile (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.fdf (+59/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.pseudos (+1/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/README (+34/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/makefile (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.fdf (+64/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.pseudos (+1/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/README (+34/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/makefile (+2/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_zz/Pt2zz.fdf (+59/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_zz/Pt2zz.pseudos (+1/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_zz/README (+34/-0)
Tests/More_SOC_Examples/offsite_SOC_Pt2_zz/makefile (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xx/FePtxx.fdf (+72/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xx/FePtxx.pseudos (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xx/README (+33/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xx/makefile (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.fdf (+74/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.pseudos (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xx/offsite_SOC_FePt_xx/README (+33/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xx/offsite_SOC_FePt_xx/makefile (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xz/FePtxz.fdf (+68/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xz/FePtxz.pseudos (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xz/README (+33/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xz/makefile (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.fdf (+70/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.pseudos (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xz/offsite_SOC_FePt_xz/README (+33/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_xz/offsite_SOC_FePt_xz/makefile (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zy/FePtzy.fdf (+66/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zy/FePtzy.pseudos (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zy/README (+33/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zy/makefile (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.fdf (+68/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.pseudos (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zy/offsite_SOC_FePt_zy/README (+33/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zy/offsite_SOC_FePt_zy/makefile (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zz/FePtzz.fdf (+62/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zz/FePtzz.pseudos (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zz/README (+33/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zz/makefile (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.fdf (+64/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.pseudos (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zz/offsite_SOC_FePt_zz/README (+33/-0)
Tests/More_SOC_Examples/onsite_SOC_FePt_zz/offsite_SOC_FePt_zz/makefile (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_xx/Pt2xx.fdf (+62/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_xx/Pt2xx.pseudos (+1/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_xx/README (+34/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_xx/makefile (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_xz/Pt2xz.fdf (+57/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_xz/Pt2xz.pseudos (+1/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_xz/README (+34/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_xz/makefile (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_zy/Pt2zy.fdf (+62/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_zy/Pt2zy.pseudos (+1/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_zy/README (+34/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_zy/makefile (+2/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_zz/Pt2zz.fdf (+57/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_zz/Pt2zz.pseudos (+1/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_zz/README (+34/-0)
Tests/More_SOC_Examples/onsite_SOC_Pt2_zz/makefile (+2/-0)
Tests/Pseudos/Fe_SOC.psf (+0/-2831)
Tests/Pseudos/Fe_fept_SOC.psf (+2831/-0)
Tests/Pseudos/Pt_SOC.psf (+0/-3051)
Tests/Pseudos/Pt_fept_SOC.psf (+3051/-0)
Tests/Pseudos/Pt_pt2_SOC.psf (+3051/-0)
Tests/Pt_dimer_soc/Pt_dimer_soc.fdf (+61/-0)
Tests/Pt_dimer_soc/Pt_dimer_soc.pseudos (+1/-0)
Tests/Pt_dimer_soc/makefile (+2/-0)
Tests/Reference/FePt_soc.out (+687/-0)
Tests/Reference/Pt_dimer_soc.out (+567/-0)
Tests/Reference/SOC_Pt2_xx.out (+0/-609)
Tests/Reference/SOC_Pt2_xz.out (+0/-964)
Tests/Reference/SOC_Pt2_zy.out (+0/-922)
Tests/Reference/SOC_Pt2_zz.out (+0/-622)
Tests/Reference/ge_soc_bands.bands (+587/-0)
Tests/Reference/ge_soc_bands.out (+513/-0)
Tests/SOC_FePt_xx/README (+0/-33)
Tests/SOC_FePt_xx/SOC_FePt_xx.fdf (+0/-71)
Tests/SOC_FePt_xx/SOC_FePt_xx.pseudos (+0/-2)
Tests/SOC_FePt_xx/makefile (+0/-2)
Tests/SOC_FePt_xz/README (+0/-33)
Tests/SOC_FePt_xz/SOC_FePt_xz.fdf (+0/-71)
Tests/SOC_FePt_xz/SOC_FePt_xz.pseudos (+0/-2)
Tests/SOC_FePt_xz/makefile (+0/-2)
Tests/SOC_FePt_zy/README (+0/-33)
Tests/SOC_FePt_zy/SOC_FePt_zy.fdf (+0/-72)
Tests/SOC_FePt_zy/SOC_FePt_zy.pseudos (+0/-2)
Tests/SOC_FePt_zy/makefile (+0/-2)
Tests/SOC_FePt_zz/README (+0/-33)
Tests/SOC_FePt_zz/SOC_FePt_zz.fdf (+0/-72)
Tests/SOC_FePt_zz/SOC_FePt_zz.pseudos (+0/-2)
Tests/SOC_FePt_zz/makefile (+0/-2)
Tests/SOC_Pt2_xx/README (+0/-34)
Tests/SOC_Pt2_xx/SOC_Pt2_xx.fdf (+0/-57)
Tests/SOC_Pt2_xx/SOC_Pt2_xx.pseudos (+0/-1)
Tests/SOC_Pt2_xx/makefile (+0/-2)
Tests/SOC_Pt2_xz/README (+0/-34)
Tests/SOC_Pt2_xz/SOC_Pt2_xz.fdf (+0/-57)
Tests/SOC_Pt2_xz/SOC_Pt2_xz.pseudos (+0/-1)
Tests/SOC_Pt2_xz/makefile (+0/-2)
Tests/SOC_Pt2_zy/README (+0/-34)
Tests/SOC_Pt2_zy/SOC_Pt2_zy.fdf (+0/-57)
Tests/SOC_Pt2_zy/SOC_Pt2_zy.pseudos (+0/-1)
Tests/SOC_Pt2_zy/makefile (+0/-2)
Tests/SOC_Pt2_zz/README (+0/-34)
Tests/SOC_Pt2_zz/SOC_Pt2_zz.fdf (+0/-57)
Tests/SOC_Pt2_zz/SOC_Pt2_zz.pseudos (+0/-1)
Tests/SOC_Pt2_zz/makefile (+0/-2)
Tests/ge_soc_bands/README (+9/-0)
Tests/ge_soc_bands/ge_soc_bands.fdf (+49/-0)
Tests/ge_soc_bands/ge_soc_bands.pseudos (+1/-0)
Tests/ge_soc_bands/makefile (+6/-0)
Util/Denchar/Src/Makefile (+52/-49)
Util/Gen-basis/gen-basis.F (+2/-1)
Util/TS/TBtrans/Makefile (+53/-50)
version.info (+1/-1)
To merge this branch: bzr merge lp:~albertog/siesta/merge-OSSO
Reviewer Review Type Date Requested Status
Ramon Cuadrado (community) Approve
Nick Papior Pending
Roberto Robles Pending
Review via email: mp+343765@code.launchpad.net

This proposal supersedes a proposal from 2018-04-18.

This proposal has been superseded by a proposal from 2018-04-27.

Commit message

Commit message to be written.

Description of the change

Version almost ready to be merged.

I have kept changes to the minimum with respect to trunk, and 're-fixed' all outstanding issues that were kept active to enable comparison with previous OSSO versions.

Please suggest shorter-running tests for the SOC features.

To post a comment you must log in.
Revision history for this message
Nick Papior (nickpapior) wrote : Posted in a previous version of this proposal

There are changes in parts of the code which are not relevant.

Specifically the cold smearing method has been removed! Possibly due to a faulty merge.

Also there were changes to TD-DFT.

I would like a clean-up of comments which is scattered all-over.

Lastly, the use of the spin type should be used throughout (we might as well do it now).

My personal opinion would be to:
spin%SO_offsite change to spin%SO_off

spin%SO_offsite should *only* be true for SO calculations AND off site version. Otherwise false.
This allows easier if-statements throughout the code.

review: Needs Fixing
Revision history for this message
Nick Papior (nickpapior) wrote : Posted in a previous version of this proposal

Great work Alberto!

I have amended comments again.

If you want, I can have a go on a PR for this branch?

review: Needs Fixing
Revision history for this message
Alberto Garcia (albertog) wrote : Posted in a previous version of this proposal
Download full text (24.4 KiB)

Ok. Dfscf and rhoofd are going to be changed later.

On Fri, Apr 20, 2018, 11:59 Nick Papior <email address hidden> wrote:

> Review: Needs Fixing
>
> Great work Alberto!
>
> I have amended comments again.
>
> If you want, I can have a go on a PR for this branch?
>
> Diff comments:
>
> > === modified file 'Docs/siesta.tex'
> > --- Docs/siesta.tex 2018-04-17 13:07:32 +0000
> > +++ Docs/siesta.tex 2018-04-20 09:43:43 +0000
> > @@ -3721,10 +3728,12 @@
> >
> > \option[spin-orbit]%
> > \fdfindex*{Spin:spin-orbit}%
> > - Perform a calculation with spin-orbit coupling. This requires the
> > + Performs calculations including the spin--orbit coupling. By
> default the
> > + off--site SO option is set to \fdftrue. To perform an on--site SO
> calculations
> > + this option has to be {\bf spin-orbit+onsite}. This requires the
>
> No \bf, \textbf{...} ;)
>
> > pseudopotentials to be relativistic.
> >
> > - See Sect.~\ref{sec:spin-orbit}.
> > + See Sect.~\ref{sec:spin-orbit} for further specific spin--orbit
> options.
> >
> > \end{fdfoptions}
> >
> > @@ -3775,96 +3784,148 @@
> > \siesta\ includes the posibility to perform fully relativistic
> > calculations by means of the inclusion in the total Hamiltonian not
> > only the Darwin and velocity correction terms~(Scalar--Relativistic
> > -calculations), but also the spin-orbit~(SO) contribution. The
> > -implementation is based on the on-site SO approximation, where only
> > -the intra-SO contribution of each atom is taken into account. See
> > -\fdf{Spin} on how to turn on the spin-orbit coupling.
> > +calculations), but also the spin--orbit~(SO) contribution. There are
> > +two approaches regarding the SO formalism: on--site and off--site.
> > +Within the on--site approximation only the intra--atomic SO
> contribution is taken
> > +into account. In the off--site scheme additional neighboring
> > +interactions are also included in the SO term. By default, the
> off--site SO
> > +formalism is switched on, being necessary to change the \fdf{Spin} flag
> > +in the input file if the on--site approximation wants to be used. See
> > +\fdf{Spin} on how to handle the spin--orbit coupling.
> >
> > -The current implementation in \siesta\ has been implemented by
> > -Dr. Ram\'on Cuadrado based on the original on-site SO formalism and
> > -implementation developed by Prof. Jaime Ferrer, \textit{et al}~(L
> > +The on--site spin-orbit scheme in this version of \siesta\ has been
> implemented by
> > +Dr. Ram\'on Cuadrado based on the original on--site SO formalism and
> > +implementation developed by Prof. Jaime Ferrer and his collaborators
> \textit{et al}~(L
> > Fern\'andez--Seivane, M Oliveira, S Sanvito, and J Ferrer, Journal of
> > -Physics: Condensed Matter, 2006 vol. 18 pp. 7999; L
> > -Fern\'andez--Seivane and Jaime Ferrer, Phys. Rev. Lett. 99, 2007,
> > -183401).
> > -
> > -The inclusion of the SO term in the Hamiltonian~(and in the Density
> > -Matrix) will involve the increase of non-zero elements in their
> > -off-diagonal parts, i.e., for some $\mu\nu$ orbitals,
> > -H$^{\sigma\sigma'}_{\mu\nu}$(DM$^{\sigma\sigma'}_{\mu\nu}$)
> > +Physics: Condensed Matter, {\bf 18...

Revision history for this message
Alberto Garcia (albertog) wrote :

Please re-check physical results in view of the fix of the neglect of the highest-l SO component in the pseudopotential.

Revision history for this message
Nick Papior (nickpapior) wrote :

Very good Alberto.

I have re-assessed the comments and I only have two more points:

1) The WriteOrbMoms seems like a "bad" option name.

2) I can make a PR for clarifying H_so in sparse_matrices. I think having the classes and names of the variables to coincide with the type to be good (H_so_on_2D, H_so_off_2D) for instance?

Revision history for this message
Ramon Cuadrado (ramon-cuadrado) wrote :

Hi Alberto, all,

    Just finished some FePt and Pt2 tests (not Z-matrix) and it seems that for trunk-688--merge-OSSO-698 every test gives right results! I mean, anisotropy energies, MMs, forces and rotational tests are ok. Maybe Roberto wants to perform an additional test.

    The code does not finish properly. Just stops after write "Target enthalpy (eV/cell)" or Mulliken pop which I guess that will be fixed in the final merge...

    One more thing, I am not sure if the makefile within "offsite_SOC_" works fine. Just for info.

Best,

Ramón

review: Approve
lp:~albertog/siesta/merge-OSSO updated
699. By Alberto Garcia

Make comments more concise in compute_energies and clarify signs

700. By Alberto Garcia

Put so_strength in m_spin. Clarify handling of TRSym

To avoid dispersion, the artificial 'spin-orbit-strength' is now
stored in the 'spin' derived type.

The user is now only allowed to change TRSym if the type of
calculation permits it.

Revision history for this message
Alberto Garcia (albertog) wrote :

> Very good Alberto.
>
> I have re-assessed the comments and I only have two more points:
>
> 1) The WriteOrbMoms seems like a "bad" option name.

I agree. We can change that in 4.1 and propagate.

>
> 2) I can make a PR for clarifying H_so in sparse_matrices. I think having the
> classes and names of the variables to coincide with the type to be good
> (H_so_on_2D, H_so_off_2D) for instance?

Please go ahead. At some point I would like the offSO H to be a real array with the same
conventions as the rest, to clarify the code throughout.

Revision history for this message
Alberto Garcia (albertog) wrote :

> Hi Alberto, all,
>
> Just finished some FePt and Pt2 tests (not Z-matrix) and it seems that for
> trunk-688--merge-OSSO-698 every test gives right results! I mean, anisotropy
> energies, MMs, forces and rotational tests are ok. Maybe Roberto wants to
> perform an additional test.

So you find no changes stemming from the fixing of the wrong-highest-l pseudo SO contribution?

>
> The code does not finish properly. Just stops after write "Target enthalpy
> (eV/cell)" or Mulliken pop which I guess that will be fixed in the final
> merge...

We need to look at this. Please provide fdf file and psf's.

>

Revision history for this message
Ramon Cuadrado (ramon-cuadrado) wrote :

> > Hi Alberto, all,
> >
> > Just finished some FePt and Pt2 tests (not Z-matrix) and it seems that
> for
> > trunk-688--merge-OSSO-698 every test gives right results! I mean, anisotropy
> > energies, MMs, forces and rotational tests are ok. Maybe Roberto wants to
> > perform an additional test.
>
> So you find no changes stemming from the fixing of the wrong-highest-l pseudo
> SO contribution?

  No changes.

>
> >
> > The code does not finish properly. Just stops after write "Target
> enthalpy
> > (eV/cell)" or Mulliken pop which I guess that will be fixed in the final
> > merge...
>
> We need to look at this. Please provide fdf file and psf's.

The PPs and the fdf’s are thosein the Test directory for FePt and Pt2...

>
> >

Revision history for this message
Roberto Robles (roberto-robles) wrote :

El 23/04/18 a las 11:35, Ramon Cuadrado escribió:
>>> Hi Alberto, all,
>>>
>>> Just finished some FePt and Pt2 tests (not Z-matrix) and it seems that
>> for
>>> trunk-688--merge-OSSO-698 every test gives right results! I mean, anisotropy
>>> energies, MMs, forces and rotational tests are ok. Maybe Roberto wants to
>>> perform an additional test.
>> So you find no changes stemming from the fixing of the wrong-highest-l pseudo
>> SO contribution?
> No changes.
>
>
>>> The code does not finish properly. Just stops after write "Target
>> enthalpy
>>> (eV/cell)" or Mulliken pop which I guess that will be fixed in the final
>>> merge...
>> We need to look at this. Please provide fdf file and psf's.
> The PPs and the fdf’s are thosein the Test directory for FePt and Pt2...
Is this the bug with state_analysis.F compiled with an intel compiler?
This is a very annoying problem, up to three people has contacted me
with that problem. If we can not fix it it should be stated in the
manual in the instructions for compiling, since usually people recycle
their arch.make instead of modifying the supplied intel.make

Roberto

>

lp:~albertog/siesta/merge-OSSO updated
701. By Nick Papior

Convert H0_offsiteSO to H_so_off_2D as a class object. Cosmetics

-- Create H_so_off_2D object to hold the offsite SO Hamiltonian

-- Pass H_so_off explicitly to nlefsm_SO_off (new name)

-- Fixed some possible inconsistencies in the conversion between
   complex and real/imaginary part without kind specifications.

-- Clarified usage in setup_hamiltonian. Now the structure has been
   re-assigned as prior to the OSSO implementation.

702. By Alberto Garcia

Re-implement spin-orbit-strength feature at the atom level

The 'offsite' flavor of SOC does not separate 'ion' and 'SO'
contributions to the forces, so the previous implementation of the SO
factor feature gave wrong forces. It has been re-implemented for now
by modifying the SO parts of the semilocal potentials read from a
\code{.psf} file. Care must be taken when re-using any \code{.ion} files
produced. Recall that this is only for debugging and experimental
purposes.

703. By Alberto Garcia

Add Ge SOC bands example

704. By Alberto Garcia

Sync to trunk-689: spin-in-scf doc; remove print_initial_spin

705. By Alberto Garcia

Add Pt dimer soc example

706. By Alberto Garcia

Add FePt bulk soc example

707. By Alberto Garcia

Move detailed SOC tests to Tests/More_SOC_Examples

The recently added fast 'soc' examples can serve to test the
installation. The more detailed (and much slower) tests have
been moved to a new directory under Tests.

Tests/Makefile has new target 'tests_soc'.

708. By Alberto Garcia

Update SOC offsite notes in Docs

709. By Alberto Garcia

Sync to trunk-691: CML dicRefs, Harris 'conv', occ. of basis states, tests

710. By Alberto Garcia

Fix compilation of some Util programs

711. By Alberto Garcia

Sync to trunk-692: update imports in pexsi_local_dos

712. By Alberto Garcia

Remove possibly outdated Reference outputs for long tests

713. By Alberto Garcia

Update SOC_offsite notes in Docs

Also, remove comment in siesta.tex regarding structural optimization
with the on-site approximation.

(Thanks to Roberto Robles for input)

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Docs/Contributors.txt'
2--- Docs/Contributors.txt 2016-09-28 07:49:18 +0000
3+++ Docs/Contributors.txt 2018-04-27 22:12:28 +0000
4@@ -30,7 +30,8 @@
5 Thomas Archer
6 Luis C. Balbas
7 Xavier Blase
8-Ramon Cuadrado
9+Jorge I. Cerda,
10+Ramon Cuadrado,
11 Michele Ceriotti
12 Raul de la Cruz
13 Gabriel Fabricius
14
15=== added file 'Docs/SOC_offsite_notes.txt'
16--- Docs/SOC_offsite_notes.txt 1970-01-01 00:00:00 +0000
17+++ Docs/SOC_offsite_notes.txt 2018-04-27 22:12:28 +0000
18@@ -0,0 +1,25 @@
19+Notes to the new 'offsite spin-orbit' implementation by Ramon Cuadrado.
20+
21+Reference:
22+
23+R. Cuadrado and J. I. Cerda, J. Phys.: Condens. Matter 24, 086005,
24+(2012) (DOI:10.1088/0953-8984/24/8/086005)).
25+
26+The only basic change from the 'onsite' implementation is in the
27+construction of the SO hamiltonian, which involves the full set of lj
28+KB projectors. These are constructed by new code in 'atom', and
29+processed in the new routine 'nlefsm_SO_off', which has roughly the
30+same structure as 'nlefsm', but constructs at the same time the 'ion'
31+and 'SO' pieces from the relativistic projectors.
32+
33+This routine calls 'calc_Vj_offsiteSO', where VSO and Vion and the
34+corresponding forces are computed using the Clebsch–Gordan
35+coefficients needed to change from the basis |l,m,sigma> to |j,mj>.
36+
37+The conventions for structure and signs in H and the DM are the same
38+as in the existing 'onsite' implementation, so there are no changes in
39+the diagonalization routines, or in the analysis routines and tools.
40+
41+Eventually, the 'offsite' qualifier might be removed, as this is a
42+full spin-orbit implementation.
43+
44
45=== modified file 'Docs/siesta.tex'
46--- Docs/siesta.tex 2018-04-24 10:24:02 +0000
47+++ Docs/siesta.tex 2018-04-27 22:12:28 +0000
48@@ -214,7 +214,8 @@
49 Thomas Archer,
50 Luis C. Balbas,
51 Xavier Blase,
52-Ramon Cuadrado,
53+Jorge I. Cerd\'a,
54+Ram\'on Cuadrado,
55 Michele Ceriotti,
56 Raul de la Cruz,
57 Gabriel Fabricius,
58@@ -2241,6 +2242,12 @@
59 The default is \emph{one} KB projector from each angular momentum,
60 constructed from the nodeless eigenfunction.
61
62+For full spin-orbit calculations, the program generates $lj$
63+projectors using the $l+1/2$ and $l-1/2$ components of the
64+(relativistic) pseudopotentials. In this case the specification of the
65+reference energies for projectors is not changed: only $l$ is
66+relevant.
67+
68 \end{fdfentry}
69
70
71@@ -3251,7 +3258,7 @@
72 coordinates rigidly to have them positive, by using
73 \fdf{AtomicCoordinatesOrigin}. See the
74 \program{Sies2arc}\index{Sies2arc@\textsc{Sies2arc}} utility in the
75- \program{Util/} directory for generating \sysfile*{.arc} files for CERIUS animation.
76+ \program{Util/} directory for generating \sysfile*{arc} files for CERIUS animation.
77
78 \end{fdflogicalF}
79
80@@ -3481,8 +3488,9 @@
81 symmetry is valid in the absence of external magnetic fields or
82 non-collinear/spin-orbit interaction.
83
84-This flag should be used with care, as the code will produce wrong
85-results if there is no support for the appropriate symmetrization.
86+This flag is only honored for spinless or collinear-spin calculations,
87+as the code will produce wrong results if there is no support for the
88+appropriate symmetrization.
89
90 The default value is \fdftrue unless: a) the option \fdf{Spin!Spiral}
91 is used. In this case time-reversal-symmetry is broken explicitly. b)
92@@ -3721,10 +3729,12 @@
93
94 \option[spin-orbit]%
95 \fdfindex*{Spin:spin-orbit}%
96- Perform a calculation with spin-orbit coupling. This requires the
97+ Performs calculations including the spin-orbit coupling. By default the
98+ off-site SO option is set to \fdftrue. To perform an on-site SO calculations
99+ this option has to be \fdf*{spin-orbit+onsite}. This requires the
100 pseudopotentials to be relativistic.
101
102- See Sect.~\ref{sec:spin-orbit}.
103+ See Sect.~\ref{sec:spin-orbit} for further specific spin-orbit options.
104
105 \end{fdfoptions}
106
107@@ -3769,96 +3779,128 @@
108 \end{fdflogicalF}
109
110
111-\subsection{Spin--Orbit coupling}
112+\subsection{Spin-Orbit coupling}
113 \label{sec:spin-orbit}
114
115 \siesta\ includes the posibility to perform fully relativistic
116 calculations by means of the inclusion in the total Hamiltonian not
117 only the Darwin and velocity correction terms~(Scalar--Relativistic
118-calculations), but also the spin-orbit~(SO) contribution. The
119-implementation is based on the on-site SO approximation, where only
120-the intra-SO contribution of each atom is taken into account. See
121-\fdf{Spin} on how to turn on the spin-orbit coupling.
122+calculations), but also the spin-orbit~(SO) contribution. There are
123+two approaches regarding the SO formalism: on-site and off-site.
124+Within the on-site approximation only the intra-atomic SO
125+contribution is taken into account. In the off-site scheme additional
126+neighboring interactions are also included in the SO term. By default,
127+the off-site SO formalism is switched on, being necessary to change
128+the \fdf{Spin} flag in the input file if the on-site approximation
129+wants to be used. See \fdf{Spin} on how to handle the spin-orbit
130+coupling.
131
132-The current implementation in \siesta\ has been implemented by
133+The on-site spin-orbit scheme in this version of \siesta\ has been implemented by
134 Dr. Ram\'on Cuadrado based on the original on-site SO formalism and
135-implementation developed by Prof. Jaime Ferrer, \textit{et al}~(L
136+implementation developed by Prof. Jaime Ferrer and his collaborators \textit{et al}~(L
137 Fern\'andez--Seivane, M Oliveira, S Sanvito, and J Ferrer, Journal of
138-Physics: Condensed Matter, 2006 vol. 18 pp. 7999; L
139-Fern\'andez--Seivane and Jaime Ferrer, Phys. Rev. Lett. 99, 2007,
140-183401).
141-
142-The inclusion of the SO term in the Hamiltonian~(and in the Density
143-Matrix) will involve the increase of non-zero elements in their
144-off-diagonal parts, i.e., for some $\mu\nu$ orbitals,
145-H$^{\sigma\sigma'}_{\mu\nu}$(DM$^{\sigma\sigma'}_{\mu\nu}$)
146-[$\sigma,\sigma'$=$\uparrow,\downarrow$] will be $\neq$0. This is
147+Physics: Condensed Matter, \textbf{18}, 7999 (2006); L Fern\'andez--Seivane
148+and Jaime Ferrer, Phys. Rev. Lett. \textbf{99}, 183401 (2007)).
149+
150+The off-site scheme has been implemented by
151+Dr. Ram\'on Cuadrado and Dr. Jorge I. Cerd\'a based on their initial
152+work~(R. Cuadrado and J. I. Cerd\'a ``Fully relativistic pseudopotential
153+formalism under an atomic orbital basis: spin-orbit splittings and
154+magnetic anisotropies'', J. Phys.: Condens. Matter \textbf{24}, 086005 (2012);
155+``In-plane/out-of-plane disorder influence on the magnetic anisotropy of
156+Fe$_{1-y}$Mn$_y$Pt-L1(0) bulk alloy'', R. Cuadrado, Kai Liu, Timothy
157+J. Klemmer and R. W. Chantrell, Applied Physics Letters, \textbf{108},
158+123102 (2016)).
159+
160+The inclusion of the SO term in the Hamiltonian (and in the Density
161+Matrix) causes an increase in the number of non-zero elements in their
162+off-diagonal parts, i.e., for some $(\mu,\nu)$ pair of basis
163+orbitals, $\mathbf H^{\sigma\sigma'}_{\mu\nu}$ ($\mathbf{DM}^{\sigma\sigma'}_{\mu\nu}$)
164+[$\sigma,\sigma'=\uparrow,\downarrow$] will be $\neq0$. This is
165 mainly due to the fact that the $\mathbf L\cdot\mathbf S$ operator
166-will promote the mixing between different spin-up/down components. The
167-terms responsible of this matrices expansion are the
168-exchange-correlation potential and the SO. The remaining terms such as
169-the kinetic energy or Hartree contribution do not depend of the spin
170-orientations and hence will be only added to the total
171-Hamiltonian~(and DM) to their diagonal parts.
172-
173-The current SO formalism enables the possibility of several types of calculations:
174+will promote the mixing between different spin-up/down components.
175+In addition, these $\mathbf H^{\sigma\sigma'}_{\mu\nu}$ (and
176+$\mathbf{DM}^{\sigma\sigma'}_{\mu\nu}$) elements will be complex, in contrast
177+with typical polarized/non-polarized calculations where these
178+matrices are purely real. Since the spin-up and spin-down manifolds
179+are essentially mixed, the solver has to deal with matrices whose
180+dimensions are twice as large as for the collinear (unmixed) spin
181+problem. Due to this, we advise to take special
182+attention to the memory needed to perform a spin-orbit calculation.
183+
184+
185+Unless explicitly advised the following type of calculation can be carried out
186+regardless of whether on-site or off-site approximation is employed:
187 \begin{itemize}
188 %
189 \item Selfconsistent calculations for gamma point as well as for
190- bulks~(Not yet implemented for optimizations).
191- %
192- \item Magnetic Anisotropy Energy~(MAE) can be easily calculated. From
193- first principles calculations, MAE is obtained after subtract the
194- total selfconsistent energy in two different orientations, usually the
195- total energy associated with easy axis from the hard axis. In \siesta\
196- it is possible to perform several self-consistent calculations for
197- different magnetization orientations using the specific block
198- \fdf{DM.InitSpin} in the fdf file. In doing so one will be able to
199- include the initial orientation angles of the magnetization for each
200- atom, as well as an initial value of their net magnetic moments.
201- %
202- \item By means of Mulliken analysis, after the self-consistent
203+ bulks.
204+ %
205+ \item Structure optimizations %% only supported by the off-site SO
206+ %% formalism *** Why ?
207+ %
208+ %%% *** Incompatible... \item LDA+U calculations~(See Sect.\ref{sec:lda+u} for further info).
209+ %
210+ \item Magnetic Anisotropy Energy~(MAE) can be easily
211+ calculated. From first principles it is obtained after subtracting
212+ the total selfconsistent energy calculated for two different
213+ magnetic orientations. In \siesta\ it is possible to perform
214+ calculations with different initial magnetic orderings
215+ by means of the use of the block \fdf{DM.InitSpin} in the fdf
216+ file. In doing so one will be able to include the initial
217+ orientation angles of the magnetization for each atom, as well as
218+ an initial value of its net magnetic moments.
219+ %
220+ \item By means of Mulliken analysis, after the selfconsistent
221 procedure, local spin and orbital moments can be calculated by means
222 of the flags \fdf{WriteMullikenPop} and \fdf{WriteOrbMom}.
223+ %
224 \end{itemize}
225
226-Note: Due to the small SO energy value contribution to the total
227-energy, the level of precision requiered to perform a proper fully
228-relativistic calculation during the selfconsistent process is quite
229-demanding. The following values must be carefully converged and
230-checked for each specific system to assure that the results are
231-accurate enough: \fdf{SCF.H!Tolerance} during the
232-selfconsistency~(typically <10$^{-5}$eV), \fdf{ElectronicTemperature},
233-\textbf{k}-point sampling and high values of
234-\fdf{MeshCutoff}~(specifically for extended solids). In general, one
235-can say that a good calculation will have high number of k--points,
236-low \fdf{ElectronicTemperature}, extremely small \fdf{SCF.H!Tolerance}
237-and high values of \fdf{MeshCutoff}. We encourage the user to test
238-carefully these options for each system. An additional point to take
239-into account when the spin--orbit contribution is included is the
240-mixing scheme employed. You are encouraged to use \fdf{SCF.Mix}
241-\fdf*{hamiltonian} instead of the density matrix, due to the fact that
242-the convergence speed increases considerably for the first case. In
243-addition, the pseudopotentials have to be well generated and tested
244-for each specific system and they have to be generated in their fully
245-relativistic form and use the non-linear core corrections.
246-
247+Note: Due to the small SO contribution to the total energy, the level
248+of precision required to perform a proper fully relativistic
249+calculation during the selfconsistent process is quite demanding. The
250+following values must be carefully converged and checked for each
251+specific system to assure that the results are accurate enough:
252+\fdf{SCF.H!Tolerance} during the selfconsistency (typically between
253+$10^{-3}\,\mathrm{eV}$ -- $10^{-4}\,\mathrm{eV}$),
254+\fdf{ElectronicTemperature}, \textbf{k}--point sampling and high
255+values of \fdf{MeshCutoff}~(specifically for extended solids). In
256+general, one can say that a good calculation will have high number of
257+\textbf{k}--points, low \fdf{ElectronicTemperature}, extremely small
258+\fdf{SCF.H!Tolerance} and high values of \fdf{MeshCutoff}. We
259+encourage the user to test carefully these options for each system. An
260+additional point to take into account is the mixing scheme
261+employed. You are encouraged to use \fdf{SCF.Mix:hamiltonian}
262+(currently is set up by default) instead of density matrix mixing,
263+since it speeds up the convergence. The pseudopotentials have to be
264+properly generated and tested for each specific system and they have
265+to be in their fully relativistic form, together with the non-linear
266+core corrections. Finally it is worth to mention that the
267+selfconsistent convergence for some non-highly symmetric
268+magnetizations directions with respect to the physical symmetry axis
269+could still be difficult.
270+
271 \begin{fdfentry}{Spin!OrbitStrength}[real]<1.0>
272
273- It allows to vary the strength of the spin-orbit interaction from
274- zero to any positive value, including the physical value. This flag
275- is only active when \fdf{Spin} is set to \fdf*{spin-orbit}.
276-
277+ It allows to vary the strength of the
278+ spin-orbit interaction from zero to any positive value. It can be
279+ used for both the on-site and off-site SOC flavors, but only for
280+ debugging and testing purposes, as the only physical value is 1.0.
281+ Note that this feature is implemented by modifying the SO parts of the
282+ semilocal potentials read from a \code{.psf} file. Care must be
283+ taken when re-using any \code{.ion} files produced.
284+
285 \end{fdfentry}
286
287 \begin{fdflogicalF}{WriteOrbMom}
288
289- If \fdftrue, a table is provided in the main output file, which
290+ If \fdftrue, a table is provided in the output file that
291 includes an estimation of the vector orbital magnetic
292- moments, in units of the Bohr magneton, projected onto each orbital
293- and also onto each atom. The estimation for the orbital moments is
294- based on a two-center approximation, and makes use of the Mulliken
295- population analysis.
296+ moments, in units of the Bohr magneton, projected
297+ onto each orbital and also onto each atom. The estimation for the
298+ orbital moments is based on a two-center approximation, and makes use
299+ of the Mulliken population analysis.
300
301 If \fdf{MullikenInScf} is \fdftrue, this information is printed at
302 every scf step.
303@@ -3866,6 +3908,7 @@
304 \end{fdflogicalF}
305
306
307+
308 \subsection{The self-consistent-field loop}
309
310 \textbf{IMPORTANT NOTE: Convergence of the Kohn-Sham energy and forces}
311@@ -4988,7 +5031,7 @@
312 \index{reading saved data!density matrix}
313
314 Instructs to read the density matrix stored in file
315- \sysfile{.DM} by a previous run.
316+ \sysfile{DM} by a previous run.
317
318 \siesta\ will continue even if \sysfile*{DM} is not found.
319
320@@ -9014,8 +9057,8 @@
321 Enable an experimental timer which is based on wall time on the master
322 node and is aware of the tree-structure of the timed sections. At the
323 end of the program, a report is generated in the output file, and a
324-{\tt time.json} file in JSON format is also written. \index{JSON
325- timing report@{\bf JSON timing report}} This file can be used by
326+\file{time.json} file in JSON format is also written. \index{JSON
327+ timing report@\textbf{JSON timing report}} This file can be used by
328 third-party scripts to process timing data.
329
330 \note, if used with the PEXSI solver (see Sec.~\ref{SolverPEXSI})
331@@ -10567,9 +10610,9 @@
332
333 \begin{fdflogicalF}{TDED.Saverho}
334
335-If \fdftrue\ the instantaneous time-dependent density is saved to
336-\texttt{ <istep>}.\texttt{TDRho}\index{TDRho@{\bf TDRho}} after every
337-\fdf{TDED.Nsaverho} number of steps.
338+ If \fdftrue\ the instantaneous time-dependent density is saved to
339+ \file{<istep>.TDRho} after every \fdf{TDED.Nsaverho} number of
340+ steps.
341
342 \end{fdflogicalF}
343
344
345=== modified file 'Src/Makefile'
346--- Src/Makefile 2018-04-24 10:24:02 +0000
347+++ Src/Makefile 2018-04-27 22:12:28 +0000
348@@ -635,10 +635,11 @@
349 compute_dm.o: normalize_dm.o ordern.o parallel.o precision.o siesta_geom.o
350 compute_dm.o: siesta_options.o sparse_matrices.o sys.o units.o
351 compute_ebs_shift.o: m_mpi_utils.o parallel.o precision.o
352-compute_energies.o: atomlist.o class_SpData1D.o class_SpData2D.o dhscf.o
353-compute_energies.o: files.o m_dipol.o m_energies.o m_mpi_utils.o m_ntm.o
354-compute_energies.o: m_rhog.o m_spin.o precision.o siesta_geom.o
355-compute_energies.o: siesta_options.o sparse_matrices.o
356+compute_energies.o: atomlist.o class_SpData1D.o class_SpData2D.o
357+compute_energies.o: class_SpData2D.o dhscf.o files.o m_dipol.o m_energies.o
358+compute_energies.o: m_mpi_utils.o m_ntm.o m_rhog.o m_spin.o parallel.o
359+compute_energies.o: precision.o siesta_geom.o siesta_options.o
360+compute_energies.o: sparse_matrices.o
361 compute_max_diff.o: m_mpi_utils.o precision.o
362 compute_norm.o: m_mpi_utils.o m_spin.o precision.o sparse_matrices.o
363 compute_pw_matrix.o: alloc.o m_planewavematrix.o m_planewavematrixvar.o
364@@ -725,15 +726,15 @@
365 fft.o: alloc.o fft1d.o m_timer.o mesh.o parallel.o parallelsubs.o precision.o
366 fft.o: sys.o
367 fft1d.o: parallel.o precision.o sys.o
368-final_H_f_stress.o: alloc.o atomlist.o class_SpData2D.o compute_max_diff.o
369-final_H_f_stress.o: dnaefs.o files.o grdsam.o kinefsm.o ldau.o ldau_specs.o
370-final_H_f_stress.o: m_dipol.o m_energies.o m_forces.o m_gamma.o m_hsx.o
371-final_H_f_stress.o: m_mpi_utils.o m_ncdf_siesta.o m_ntm.o m_spin.o m_steps.o
372-final_H_f_stress.o: m_stress.o m_ts_global_vars.o m_ts_io.o m_ts_kpoints.o
373-final_H_f_stress.o: m_ts_options.o metaforce.o molecularmechanics.o naefs.o
374-final_H_f_stress.o: nlefsm.o overfsm.o parallel.o siesta_geom.o
375-final_H_f_stress.o: siesta_options.o sparse_matrices.o spinorbit.o sys.o
376-final_H_f_stress.o: units.o
377+final_H_f_stress.o: alloc.o atomlist.o class_SpData2D.o class_SpData2D.o
378+final_H_f_stress.o: compute_max_diff.o dnaefs.o files.o grdsam.o kinefsm.o
379+final_H_f_stress.o: ldau.o ldau_specs.o m_dipol.o m_energies.o m_forces.o
380+final_H_f_stress.o: m_gamma.o m_hsx.o m_mpi_utils.o m_ncdf_siesta.o m_ntm.o
381+final_H_f_stress.o: m_spin.o m_steps.o m_stress.o m_ts_global_vars.o m_ts_io.o
382+final_H_f_stress.o: m_ts_kpoints.o m_ts_options.o metaforce.o
383+final_H_f_stress.o: molecularmechanics.o naefs.o nlefsm.o overfsm.o parallel.o
384+final_H_f_stress.o: siesta_geom.o siesta_options.o sparse_matrices.o
385+final_H_f_stress.o: spinorbit.o sys.o units.o
386 find_kgrid.o: alloc.o minvec.o parallel.o precision.o units.o
387 fire_optim.o: alloc.o m_fire.o m_mpi_utils.o parallel.o precision.o
388 fire_optim.o: siesta_options.o units.o
389@@ -932,7 +933,7 @@
390 m_sparsity_handling.o: class_SpData2D.o class_Sparsity.o geom_helper.o
391 m_sparsity_handling.o: intrinsic_missing.o m_interpolate.o m_region.o
392 m_sparsity_handling.o: precision.o
393-m_spin.o: alloc.o parallel.o precision.o sys.o units.o
394+m_spin.o: alloc.o files.o m_cite.o parallel.o precision.o sys.o units.o
395 m_stress.o: precision.o
396 m_supercell.o: atom_graph.o class_OrbitalDistribution.o class_SpData2D.o
397 m_supercell.o: intrinsic_missing.o parallel.o parallelsubs.o precision.o
398@@ -1135,7 +1136,7 @@
399 new_matel.o: alloc.o errorf.o interpolation.o matel_registry.o parallel.o
400 new_matel.o: precision.o radfft.o spher_harm.o sys.o
401 nlefsm.o: alloc.o atm_types.o atmfuncs.o atomlist.o chemical.o mneighb.o
402-nlefsm.o: new_matel.o parallel.o parallelsubs.o precision.o
403+nlefsm.o: new_matel.o parallel.o parallelsubs.o precision.o sparse_matrices.o
404 normalize_dm.o: atomlist.o m_mpi_utils.o m_spin.o parallel.o precision.o
405 normalize_dm.o: siesta_options.o sparse_matrices.o sys.o
406 obc.o: alloc.o precision.o
407@@ -1227,15 +1228,17 @@
408 setatomnodes.o: alloc.o parallel.o precision.o spatial.o sys.o
409 setspatial.o: alloc.o parallel.o precision.o spatial.o
410 setup_H0.o: alloc.o atmfuncs.o atomlist.o class_SpData1D.o class_SpData2D.o
411-setup_H0.o: dhscf.o dnaefs.o kinefsm.o m_energies.o m_mpi_utils.o m_ntm.o
412-setup_H0.o: m_spin.o metaforce.o molecularmechanics.o naefs.o nlefsm.o
413-setup_H0.o: siesta_geom.o siesta_options.o sparse_matrices.o spinorbit.o
414+setup_H0.o: class_SpData2D.o dhscf.o dnaefs.o kinefsm.o m_energies.o
415+setup_H0.o: m_mpi_utils.o m_ntm.o m_spin.o metaforce.o molecularmechanics.o
416+setup_H0.o: naefs.o nlefsm.o siesta_geom.o siesta_options.o sparse_matrices.o
417+setup_H0.o: spinorbit.o
418 setup_hamiltonian.o: alloc.o atmfuncs.o atomlist.o class_SpData1D.o
419-setup_hamiltonian.o: class_SpData2D.o dhscf.o files.o ldau.o ldau_specs.o
420-setup_hamiltonian.o: m_dipol.o m_energies.o m_gamma.o m_hsx.o m_mpi_utils.o
421-setup_hamiltonian.o: m_ntm.o m_partial_charges.o m_rhog.o m_spin.o m_steps.o
422-setup_hamiltonian.o: m_stress.o metaforce.o molecularmechanics.o parallel.o
423-setup_hamiltonian.o: siesta_geom.o siesta_options.o sparse_matrices.o sys.o
424+setup_hamiltonian.o: class_SpData2D.o class_SpData2D.o dhscf.o files.o ldau.o
425+setup_hamiltonian.o: ldau_specs.o m_dipol.o m_energies.o m_gamma.o m_hsx.o
426+setup_hamiltonian.o: m_mpi_utils.o m_ntm.o m_partial_charges.o m_rhog.o
427+setup_hamiltonian.o: m_spin.o m_steps.o m_stress.o metaforce.o
428+setup_hamiltonian.o: molecularmechanics.o parallel.o siesta_geom.o
429+setup_hamiltonian.o: siesta_options.o sparse_matrices.o sys.o
430 setup_ordern_indexes.o: alloc.o domain_decom.o parallel.o spatial.o
431 shaper.o: atmfuncs.o mneighb.o precision.o
432 show_distribution.o: atomlist.o parallel.o parallelsubs.o siesta_geom.o sys.o
433@@ -1305,26 +1308,27 @@
434 siesta_tddft.o: wavefunctions.o
435 sparse_matrices.o: alloc.o class_Fstack_Pair_Geometry_SpData2D.o
436 sparse_matrices.o: class_OrbitalDistribution.o class_SpData1D.o
437-sparse_matrices.o: class_SpData2D.o class_Sparsity.o precision.o
438+sparse_matrices.o: class_SpData2D.o class_SpData2D.o class_Sparsity.o
439+sparse_matrices.o: precision.o
440 spatial.o: precision.o
441 spher_harm.o: alloc.o precision.o sys.o
442 spinorbit.o: atm_types.o atmfuncs.o atmparams.o basis_types.o m_mpi_utils.o
443-spinorbit.o: parallel.o parallelsubs.o precision.o pseudopotential.o sys.o
444+spinorbit.o: parallel.o parallelsubs.o precision.o pseudopotential.o
445 state_analysis.o: atomlist.o born_charge.o flook_siesta.o m_energies.o
446 state_analysis.o: m_fixed.o m_forces.o m_ntm.o m_spin.o m_stress.o
447 state_analysis.o: m_wallclock.o parallel.o remove_intramol_pressure.o
448 state_analysis.o: siesta_cml.o siesta_geom.o siesta_options.o sparse_matrices.o
449 state_analysis.o: units.o write_subs.o zmatrix.o
450 state_init.o: alloc.o atomlist.o class_Data2D.o class_SpData1D.o
451-state_init.o: class_SpData2D.o class_Sparsity.o create_Sparsity_SC.o
452-state_init.o: domain_decom.o files.o hsparse.o iodm_netcdf.o iodmhs_netcdf.o
453-state_init.o: iotdxv.o ioxv.o kpoint_grid.o ldau_specs.o m_chess.o m_energies.o
454-state_init.o: m_eo.o m_gamma.o m_mixing.o m_mixing_scf.o m_mpi_utils.o
455-state_init.o: m_new_dm.o m_os.o m_pivot_methods.o m_rmaxh.o m_sparse.o
456-state_init.o: m_sparsity_handling.o m_spin.o m_steps.o m_supercell.o
457-state_init.o: m_test_io.o m_ts_charge.o m_ts_electype.o m_ts_global_vars.o
458-state_init.o: m_ts_io.o m_ts_kpoints.o m_ts_options.o m_ts_sparse.o
459-state_init.o: m_ts_tri_init.o normalize_dm.o overlap.o parallel.o
460+state_init.o: class_SpData2D.o class_SpData2D.o class_Sparsity.o
461+state_init.o: create_Sparsity_SC.o domain_decom.o files.o hsparse.o
462+state_init.o: iodm_netcdf.o iodmhs_netcdf.o iotdxv.o ioxv.o kpoint_grid.o
463+state_init.o: ldau_specs.o m_chess.o m_energies.o m_eo.o m_gamma.o m_mixing.o
464+state_init.o: m_mixing_scf.o m_mpi_utils.o m_new_dm.o m_os.o m_pivot_methods.o
465+state_init.o: m_rmaxh.o m_sparse.o m_sparsity_handling.o m_spin.o m_steps.o
466+state_init.o: m_supercell.o m_test_io.o m_ts_charge.o m_ts_electype.o
467+state_init.o: m_ts_global_vars.o m_ts_io.o m_ts_kpoints.o m_ts_options.o
468+state_init.o: m_ts_sparse.o m_ts_tri_init.o normalize_dm.o overlap.o parallel.o
469 state_init.o: proximity_check.o siesta_cml.o siesta_dicts.o siesta_geom.o
470 state_init.o: siesta_options.o sparse_matrices.o sys.o units.o write_subs.o
471 state_init.o: zmatrix.o
472
473=== modified file 'Src/atm_types.f'
474--- Src/atm_types.f 2018-04-07 19:24:04 +0000
475+++ Src/atm_types.f 2018-04-27 22:12:28 +0000
476@@ -23,12 +23,12 @@
477 integer, parameter, public :: maxnorbs = 100
478 ! Maximum number of nlm orbitals
479 !
480- integer, parameter, public :: maxn_pjnl = 10
481+ integer, parameter, public :: maxn_pjnl = 20
482 ! Maximum number of projectors (not counting different "m" copies)
483 integer, parameter, public :: maxn_orbnl = 200
484 ! Maximum number of nl orbitals (not counting different "m" copies)
485 ! Now very large to accommodate filteret basis sets
486- integer, parameter, public :: maxnprojs = 50
487+ integer, parameter, public :: maxnprojs = 100
488 ! Maximum number of nlm projectors
489 !
490
491@@ -66,9 +66,11 @@
492 ! 1 to the total number of projectors at that l.
493 !
494 !
495+ logical :: lj_projs = .false.
496 integer :: n_pjnl=0 ! num of "nl" projs
497 integer :: lmax_projs=0 ! l cutoff for projs
498 integer, dimension(maxn_pjnl) :: pjnl_l ! l of each nl proj
499+ real(dp), dimension(maxn_pjnl) :: pjnl_j ! j of each nl proj
500 integer, dimension(maxn_pjnl) :: pjnl_n ! n of each nl proj
501 real(dp), dimension(maxn_pjnl)
502 $ :: pjnl_ekb ! energy of
503@@ -92,9 +94,10 @@
504 integer, dimension(maxnprojs) :: pj_index
505 integer, dimension(maxnprojs) :: pj_n
506 integer, dimension(maxnprojs) :: pj_l
507+ real(dp), dimension(maxnprojs) :: pj_j
508 integer, dimension(maxnprojs) :: pj_m
509 integer, dimension(maxnprojs) :: pj_gindex
510-!
511+!----------------------------
512 ! LDA+U Projectors
513 ! Here we follow the scheme used for the KB projectors
514 !
515
516=== modified file 'Src/atmfuncs.f'
517--- Src/atmfuncs.f 2016-04-29 07:31:13 +0000
518+++ Src/atmfuncs.f 2018-04-27 22:12:28 +0000
519@@ -20,6 +20,8 @@
520 use atm_types
521 use radial, only: rad_get, rad_func
522 use spher_harm, only: rlylm
523+
524+
525
526 implicit none
527 !
528
529=== modified file 'Src/atmparams.f'
530--- Src/atmparams.f 2016-01-25 16:00:16 +0000
531+++ Src/atmparams.f 2018-04-27 22:12:28 +0000
532@@ -21,7 +21,11 @@
533 C INTEGER NKBMX : Maximum number of Kleinman-Bylander projectors
534 C for each angular momentum
535
536- integer, parameter, public :: nkbmx = 2
537+C For the off-site SO calculation plus semicore states
538+C there will be at least 4 KBs for each l angular momentum
539+C (for each l shell we have J = l +/- 1/2 )
540+ integer, parameter, public :: nkbmx = 4
541+
542
543 C INTEGER NSMX : Maximum number of semicore shells for each angular
544 C momentum present in the atom ( for normal atom nsmx=0)
545
546=== modified file 'Src/atom.F'
547--- Src/atom.F 2018-04-26 13:16:13 +0000
548+++ Src/atom.F 2018-04-27 22:12:28 +0000
549@@ -97,7 +97,7 @@
550 . rco,lambda_in,atm_label,npolorb,semic,
551 . nsemic,cnfigmx,charge_in,smass,basistype,
552 . ISIN,RINN,VCTE,qcoe,qyuk,qwid,
553- . split_norm,filtercut_in,basp, spp)
554+ . split_norm,filtercut_in,basp,spp,lj_projs)
555
556 use atm_types, only: species_info
557
558@@ -105,6 +105,7 @@
559
560 type(basis_def_t), pointer :: basp
561 type(species_info), intent(inout) :: spp
562+ logical, intent(in) :: lj_projs
563
564 integer, intent(in) :: izin
565 ! Atomic number (if IZ is negative it will be regarded as a set of
566@@ -242,6 +243,7 @@
567 real(dp)
568 . rofi(nrmax), drdi(nrmax), s(nrmax),
569 . vps(nrmax,0:lmaxd), rphi(nrmax,0:lmaxd,nsemx),
570+ . vps_u(nrmax,0:lmaxd),
571 . vlocal(nrmax), vxc(nrmax), ve(nrmax),
572 . rho(nrmax), chcore(nrmax), rho_PAO(nrmax), auxrho(nrmax),
573 . vePAO(nrmax), qPAO(0:lmaxd,nsemx), chlocal(nrmax),
574@@ -329,7 +331,7 @@
575 !
576 ! Reading pseudopotentials
577 !
578- call read_vps(lmxo, lmxkb, nrval,a,b,rofi,drdi,s,vps,
579+ call read_vps(lmxo, lmxkb, nrval,a,b,rofi,drdi,s,vps,vps_u,
580 . rho, chcore, zval, chgvps, nicore, irel, icorr,basp)
581
582 do ir=1,nrval
583@@ -569,8 +571,8 @@
584 ! Calculation of the Kleinman-Bylander projector functions
585 !
586 call KBgen(is, a,b,rofi,drdi,s,
587- . vps, vlocal, ve, nrval, Zval, lmxkb,
588- . nkbl, erefkb, nkb, spp)
589+ . vps, vps_u, vlocal, ve, nrval, Zval, lmxkb,
590+ . nkbl, erefkb, nkb, spp, lj_projs)
591
592 elseif(flting.lt.0.0d0) then
593 !
594@@ -1856,7 +1858,7 @@
595
596
597 subroutine KBproj(ikb,rofi,drdi,vps,vlocal,nrwf,l,rphi,
598- . dkbcos,ekb,proj,nrc)
599+ . dkbcos,ekb,proj,nrc,rphi2,vii)
600 C
601 C This routine calculates the Kleinman-Bylander projector
602 C with angular momentum l.
603@@ -1872,6 +1874,7 @@
604 . rphi(*), vlocal(*)
605 real(dp), intent(out) :: proj(*), dkbcos, ekb
606 integer, intent(out) :: nrc
607+ real(dp), intent(inout) :: rphi2(:,:), vii(:)
608 C
609 C Internal variables
610 C
611@@ -1880,8 +1883,6 @@
612 . dnrm, vl, vphi, avgv, r, phi, dknrm,
613 . dincv, rc, sum, vij(nkbmx)
614
615- real(dp), save :: rphi2(nrmax,nkbmx), vii(nkbmx)
616-
617 integer ir, jkb
618
619 real(dp), parameter :: eps=1.0d-6
620@@ -2702,7 +2703,7 @@
621
622 !
623 subroutine read_vps(lmxo, lmxkb,
624- . nrval,a,b,rofi,drdi,s,vps,
625+ . nrval,a,b,rofi,drdi,s,vps, vps_u,
626 . rho, chcore, zval, chgvps,
627 . nicore, irel, icorr,basp)
628
629@@ -2718,14 +2719,14 @@
630
631 real(dp)
632 . rofi(nrmax), drdi(nrmax), s(nrmax), vps(nrmax,0:lmaxd),
633+ . vps_u(nrmax,0:lmaxd),
634 . rho(nrmax), chcore(nrmax)
635
636 real(dp)
637 . a, b, zval
638-
639 integer nrval, lmxo, lmxkb
640-
641 character nicore*4, irel*3, icorr*2
642+ integer :: nup_end
643 C
644 C Internal variables
645 C
646@@ -2736,12 +2737,14 @@
647 . ea, rpb, chgvps
648
649 integer
650- . nr, nodd, lmax, linput, npotd, npotu, ndown, l, ir, i
651+ . nr, nodd, lmax, linput, npotd, npotu, ndown, l, ir, i, nup
652
653 character method(6)*10,text*70
654
655 type(pseudopotential_t), pointer :: vp
656
657+ real(dp) :: so_strength
658+
659 vp => basp%pseudopotential
660
661 icorr = vp%icorr
662@@ -2792,12 +2795,8 @@
663 write(6,'(7a)')
664 . 'read_vps: ',method(1),(method(i),i=3,6)
665
666-C We are going to find the charge configuration
667-C used for the pseudopotential generation using the information given in
668-C the 'text' variable.
669-
670+ !Total charge density used for the pseudopotential generation
671 chgvps = vp%gen_zval
672-
673 write(6,'(a,f10.5)') 'Total valence charge: ', chgvps
674
675 if (nicore.ne.'nc ') then
676@@ -2842,9 +2841,9 @@
677 enddo
678
679
680-! Ionic pseudopotentials (Only 'down' used)
681+! Ionic pseudopotentials (down and up)
682
683- do 20 ndown=1,lmax+1
684+ do ndown=1,lmax+1
685 l = vp%ldown(ndown)
686 if (l.ne.ndown-1) then
687 write(6,'(a)')
688@@ -2858,40 +2857,51 @@
689 enddo
690 vps(1,l) = vps(2,l) ! AG
691
692- 20 continue
693-
694+ enddo
695+
696+ vps_u = 0.0_dp
697+ ! For backward compatibility with original OSSO branch,
698+ ! put 'keep-npotu-bug T' in fdf file
699+ ! To be removed altogether for releases
700+ if (fdf_get('keep-npotu-bug',.false.)) then
701+ nup_end = min(lmax,npotu-1)
702+ write(6,'(a)') 'atom: *** Buggy code in highest-l ' //
703+ $ 'SO component setup enabled ***'
704+ else
705+ nup_end = npotu
706+ endif
707+
708+ ! Allow an overall factor for the SO part (for debugging only!)
709+ ! Note that (notably for the lj-based SO implementation) this
710+ ! trick is based on the availability of a semilocal pseudo. Care
711+ ! should also be taken with the onward use of any .ion files
712+ ! produced.
713+
714+ so_strength = fdf_get('spin-orbit-strength', 1.0_dp)
715+ if (so_strength /= 1.0_dp) then
716+ write(6,'(a,f10.6)') 'atom: *** SO enhancement factor: ',
717+ $ so_strength
718+ endif
719+
720+ do nup=1,nup_end
721+ l = vp%lup(nup)
722+ vp%vup(nup,1:nrval) = so_strength * vp%vup(nup,1:nrval)
723+ vps_u(1:nrval,l) = vp%vup(nup,1:nrval)
724+ do ir=2,nrval
725+ vps_u(ir,l)=vps_u(ir,l)/rofi(ir)
726+ enddo
727+ vps_u(1,l) = vps_u(2,l)
728+ enddo
729
730 ! Core and valence charge density
731
732 chcore(1:nrval) = vp%chcore(1:nrval)
733 rho(1:nrval) = vp%chval(1:nrval)
734-C
735-C Obtain an ionic-pseudopotential if core correction for Hartree
736-C potential
737-!
738-! AG: OBSOLETE, as the program will stop in this case.
739-
740- if ((nicore.eq.'pche').or.(nicore.eq.'fche')) then
741- call vhrtre(chcore,ve,rofi,drdi,s,nrval,a)
742- do l=0,lmax
743- do ir=2,nrval
744- vps(ir,l)=vps(ir,l)+ve(ir)
745- enddo
746- vps(1,l) = vps(2,l) ! AG
747- enddo
748- endif
749-
750- return
751-
752- 5000 continue
753- write(6,*)
754- . 'ERROR: You are using an old pseudopotential file.',
755- . ' Siesta needs a newer version.'
756- call die
757-
758+
759 end subroutine read_vps
760 !
761- subroutine comKB(is,a,b,rofi,proj,l,ikb,rc,ekb,nrc,spp)
762+ subroutine comKB(is,a,b,rofi,proj,l,lj_projs,jk,
763+ $ ikb,rc,ekb,nrc,spp)
764 C
765 C Creates the common block with all the information about the
766 C Kleinman-Bylander projectors.
767@@ -2906,6 +2916,8 @@
768 integer, intent(in) :: l, nrc,is, ikb
769 real(dp), intent(in) :: rc, ekb, proj(nrmax), a, b,
770 . rofi(nrmax)
771+ logical, intent(in) :: lj_projs
772+ integer, intent(in) :: jk
773 type(species_info), intent(inout) :: spp
774
775 character(len=40) filename
776@@ -2932,10 +2944,17 @@
777
778 spp%pjnl_n(n) = ikb
779 spp%pjnl_l(n) = l
780+ if (lj_projs) then
781+ spp%pjnl_j(n) = l + (2*jk-3)*0.5_dp ! l -/+ 1/2
782+ if (l == 0 ) spp%pjnl_j(n) = 0.5_dp ! special case: only jk=1
783+ else
784+ spp%pjnl_j(n) = 0.0_dp
785+ endif
786 do m = -l, l
787 ntot = ntot + 1
788 spp%pj_index(ntot) = n
789 spp%pj_l(ntot) = l
790+ spp%pj_j(ntot) = spp%pjnl_j(n)
791 spp%pj_m(ntot) = m
792 enddo
793 spp%nprojs = ntot
794@@ -2983,8 +3002,8 @@
795 end subroutine comkb
796 !
797 subroutine KBgen(is, a,b,rofi,drdi,s,
798- . vps, vlocal, ve, nrval, Zval, lmxkb,
799- . nkbl, erefkb, nkb, spp)
800+ . vps, vps_u, vlocal, ve, nrval, Zval, lmxkb,
801+ . nkbl, erefkb, nkb, spp, lj_projs)
802
803 use basis_specs, only: restricted_grid
804 use atom_options, only: new_kb_reference_orbitals
805@@ -3002,28 +3021,34 @@
806
807 implicit none
808
809- real(dp)
810- . a, b, rofi(nrmax), vps(nrmax,0:lmaxd),
811+ real(dp), intent(in) ::
812+ . a, b, rofi(nrmax), vps(nrmax,0:lmaxd), vps_u(nrmax,0:lmaxd),
813 . drdi(nrmax), s(nrmax), ve(nrmax),vlocal(nrmax),
814 . Zval, erefkb(nkbmx,0:lmaxd)
815
816- integer
817+ integer, intent(in) ::
818 . nrval, lmxkb, nkb, is, nkbl(0:lmaxd)
819
820 type(species_info), intent(inout) :: spp
821+ real(dp), allocatable :: rphi2(:,:,:), vii(:,:)
822+ real(dp), allocatable :: rphi(:,:,:)
823+ real(dp), allocatable :: eref(:,:)
824+
825+ logical, intent(in) :: lj_projs
826 C
827 C Internal variables
828 C
829 integer
830 . l,nprin, nnodes, ighost, nrwf, ikb, ir,
831- . nrc, nrlimit, n_pjnl, nkbs_tot
832- real(dp)
833- . rc(nkbmx,0:lmaxd), dkbcos(nkbmx,0:lmaxd),
834- . ekb(nkbmx,0:lmaxd)
835+ . nrc, nrlimit, n_pjnl, nkbs_tot, jk, nj
836+ real(dp) :: rc, dkbcos, ekb
837
838 real(dp)
839- . rphi(nrmax,nkbmx), rmax, dnrm,
840- . proj(nrmax)
841+ . rmax, dnrm,
842+ . proj(nrmax), vp(nrmax)
843+
844+ character(len=2) :: jstr
845+ logical :: multiple_projectors
846
847 C The atomic wavefunctions and/or its energy derivatives are
848 C calculated only inside a sphere of radius Rmax. To define the
849@@ -3056,13 +3081,20 @@
850
851 spp%lmax_projs = lmxkb
852
853- ! Generalize this for lj projectors
854 nkbs_tot = 0
855 n_pjnl = 0
856 do l = 0, lmxkb
857- n_pjnl = n_pjnl + nkbl(l)
858- nkbs_tot = nkbs_tot + nkbl(l)*(2*l+1)
859+ do ikb = 1, nkbl(l)
860+ n_pjnl = n_pjnl + 1
861+ nkbs_tot = nkbs_tot + (2*l+1)
862+ if (lj_projs .and. l>0) then ! j=l+1/2 and j=l-1/2 shells
863+ n_pjnl = n_pjnl + 1
864+ nkbs_tot = nkbs_tot + (2*l+1)
865+ endif
866+ enddo
867 enddo
868+
869+ spp%lj_projs = lj_projs
870
871 ! Eventually will make the arrays allocatable
872 if (n_pjnl > maxn_pjnl) then
873@@ -3076,88 +3108,128 @@
874 ! zero out for build-up in comkb
875 spp%n_pjnl = 0
876 spp%nprojs = 0
877+
878+ write(6,'(/,a)')'KBgen: Kleinman-Bylander projectors: '
879+
880+ multiple_projectors = .false.
881+
882+ if (lj_projs) then
883+ nj = 2
884+ else
885+ nj = 1
886+ endif
887
888+ ! Some output related to ghosts might be changed
889+ ! Note ordering of projectors
890+ ! Independent projector stacks for different j's
891+ allocate (rphi2(nrmax,nkbmx,nj), vii(nkbmx,nj))
892+ ! For the derivative option, we need a previous projector
893+ ! and the previous reference energy
894+ allocate (rphi(nrmax,nkbmx,nj))
895+ allocate (eref(nkbmx,nj))
896 do l=0,lmxkb
897- do ir=1,nrmax
898- do ikb=1,nkbmx
899- rphi(ir,ikb)=0.0d0
900- enddo
901- proj(ir)=0.0d0
902- enddo
903+ rphi(:,:,:) = 0.0_dp
904 do ikb= 1, nkbl(l)
905-C
906-C Atomic wavefunctions and eigenvalues
907-C for the construction of the KB projectors
908-C
909-C If the reference energies have not been specifed, the eigenstates
910-C with the condition of being zero at r(nrval) will be used.
911-C
912+ do jk = 1, nj ! j-, j+
913+
914+ if (jk == 2 .and. l==0) CYCLE ! only one proj for l=0
915+ if (lj_projs .and. l>0 ) then
916+ ! Set up the appropriate potential and label
917+ if (jk == 1) then
918+ ! V(l-j/2) = Vdn - (l+1)/2 Vup = Vion - (l+1)/2 Vso
919+ vp(:) = vps(:,l) - 0.5_dp*(l+1)*vps_u(:,l)
920+ jstr = 'j-'
921+ else
922+ ! V(l+1/2) = Vdn + l/2 Vup = Vion + l/2 Vso
923+ vp(:) = vps(:,l) + 0.5_dp*l*vps_u(:,l)
924+ jstr = 'j+'
925+ endif
926+ else
927+ vp(:) = vps(:,l)
928+ jstr = ' '
929+ endif
930+ proj(:) = 0.0_dp
931+
932+! Atomic wavefunctions and eigenvalues
933+! for the construction of the KB projectors
934+
935+ ! We use the same user-entered reference energies for both j's
936+
937 if (erefkb(ikb,l).ge.1.0d3) then
938+ ! If the reference energies have not been specifed, the
939+ ! eigenstates with the condition of being zero at r(nrval)
940+ ! will be used.
941 nnodes=ikb
942 nprin=l+1
943-
944- call schro_eq(Zval,rofi,vps(1,l),ve,s,drdi,
945+ ! use eref to avoid overwriting erefkb(,) for next j
946+ call schro_eq(Zval,rofi,vp,ve,s,drdi,
947 . nrlimit,l,a,b,nnodes,nprin,
948- . erefkb(ikb,l),rphi(1,ikb))
949+ . eref(ikb,jk),rphi(1,ikb,jk))
950 C Normalization of the eigenstates inside a sphere of radius Rmax
951 dnrm=0.0d0
952 do ir=1,nrwf
953- dnrm=dnrm+drdi(ir)*rphi(ir,ikb)**2
954+ dnrm=dnrm+drdi(ir)*rphi(ir,ikb,jk)**2
955 enddo
956 dnrm=sqrt(dnrm)
957 do ir=1,nrwf
958- rphi(ir,ikb)=rphi(ir,ikb)/dnrm
959+ rphi(ir,ikb,jk)=rphi(ir,ikb,jk)/dnrm
960 enddo
961 C
962 elseif((erefkb(ikb,l).le.-1.0d3).and.
963 . (ikb.gt.1) ) then
964-C If the energy is specified to be 1000 Ry, the energy derivative
965-C of the previous wavefunction will be used
966-C
967- call energ_deriv(a,rofi,rphi(1,ikb-1),vps(1,l),
968- . ve,drdi,nrwf,l,erefkb(ikb-1,l),
969- . rphi(1,ikb),nrval)
970- erefkb(ikb,l)=0.0d0
971-C
972+ ! If the energy is specified to be 1000 Ry, the energy
973+ ! derivative of the previous wavefunction will be used
974+ call energ_deriv(a,rofi,rphi(1,ikb-1,jk),vp(1),
975+ . ve,drdi,nrwf,l,eref(ikb-1,jk),
976+ . rphi(1,ikb,jk),nrval)
977+ eref(ikb,jk)=0.0_dp
978+
979 else
980-C If the reference energies have been specified, we just use them
981-C
982- call rphi_vs_e(a,b,rofi,vps(1,l),
983+ ! If the reference energies have been specified, we just
984+ ! use them
985+ call rphi_vs_e(a,b,rofi,vp(1),
986 . ve,nrval,l,erefkb(ikb,l),
987- . rphi(1,ikb),Rmax)
988-C
989+ . rphi(1,ikb,jk),Rmax)
990+ eref(ikb,jk) = erefkb(ikb,l)
991 endif
992-C
993-C Ghost analysis
994-C
995+
996+ ! Ghost analysis
997+
998 if (nkbl(l).eq.1) then
999- call ghost(Zval,rofi,vps(:,l),vlocal,
1000+ call ghost(Zval,rofi,vp(:),vlocal,
1001 . ve,s,drdi,nrlimit,l,a,b,nrwf,
1002- . erefkb(ikb,l),rphi(:,ikb),ighost)
1003+ . eref(ikb,jk),rphi(:,ikb,jk),ighost)
1004 else
1005- if (ikb.eq.1)
1006- . write(6,'(a,i3,/a)')
1007- . 'KBgen: More than one KB projector for l=',l,
1008- . 'KBgen: ghost states analysis will be not performed'
1009+ multiple_projectors = .true.
1010 endif
1011-C
1012-C KB Projectors
1013-C
1014- call KBproj(ikb,rofi,drdi,vps(1,l),vlocal,nrwf,l,
1015- . rphi(1,ikb),dkbcos(ikb,l),ekb(ikb,l),proj,nrc)
1016-
1017-C
1018- rc(ikb,l)=rofi(nrc)
1019-C
1020-C Common block with the information about the KB projectors
1021-C
1022- call comKB(is,a,b,rofi,proj,
1023- . l,ikb,rc(ikb,l),ekb(ikb,l),nrc, spp)
1024-C
1025-
1026- enddo
1027- enddo
1028+
1029+ ! The projector stack and vii are passed as arguments
1030+ ! to enable the needed loop ordering
1031+ call KBproj(ikb,rofi,drdi,vp,vlocal,nrwf,l,
1032+ . rphi(1,ikb,jk),dkbcos,ekb,proj,nrc,
1033+ . rphi2(:,:,jk),vii(:,jk))
1034+
1035+ rc = rofi(nrc)
1036+
1037+ ! Store KB projectors in data structure
1038+
1039+ call comKB(is,a,b,rofi,proj,l,lj_projs,jk,
1040+ . ikb,rc,ekb,nrc, spp)
1041+
1042+ write(6,'(a2,1x,a,i2,4(3x,a,f10.6))') jstr,
1043+ . 'l=',l, 'rc=',rc, 'el=',eref(ikb,jk),
1044+ . 'Ekb=',ekb,'kbcos=',dkbcos
1045+
1046+ enddo ! jk
1047+ enddo ! ikb:1,nkbl
1048+ enddo ! l
1049+ deallocate(rphi,rphi2,vii,eref)
1050
1051+ if (multiple_projectors) then
1052+ write(6,'(a,/a)')
1053+ . 'KBgen: More than one KB projector for some l shell(s)',
1054+ . 'KBgen: ghost-state analysis will not be performed'
1055+ endif
1056 if (ighost.eq.1) then
1057 write(6,"(2a)")'KBgen: WARNING: ',
1058 . 'Ghost states have been detected'
1059@@ -3169,34 +3241,14 @@
1060 write(6,"(a)") " KBgen: *** Warning Ignored by User"
1061 ighost = 0
1062 else
1063- call die
1064+ call die("Ghost states detected")
1065 endif
1066 endif
1067
1068- write(6,'(/,a)')'KBgen: Kleinman-Bylander projectors: '
1069- do l=0,lmxkb
1070- do ikb=1, nkbl(l)
1071- write(6,'(3x,a,i2,4(3x,a,f10.6))')
1072- . 'l=',l, 'rc=',rc(ikb,l), 'el=',erefkb(ikb,l),
1073- . 'Ekb=',ekb(ikb,l),'kbcos=',dkbcos(ikb,l)
1074- enddo
1075- enddo
1076-C
1077-C Total number of Kleinman-Bylander projectors
1078-C
1079- nkb=0
1080- do l=0,lmxkb
1081- do ikb=1,nkbl(l)
1082- nkb=nkb+(2*l+1)
1083- enddo
1084- enddo
1085- write(6,'(/,a, i4)')
1086- .'KBgen: Total number of Kleinman-Bylander projectors: ', nkb
1087- if (nkb /= spp%nprojs) then
1088- print *, "spp%nprojs: ", spp%nprojs
1089- call die("Mismatch nkb spp%nprojs")
1090- endif
1091-C
1092+ write(6,'(/,a, i4)')
1093+ .'KBgen: Total number of Kleinman-Bylander projectors: ',
1094+ $ spp%nprojs
1095+
1096 end subroutine KBgen
1097 !
1098 subroutine Basis_gen(Zval,is, iz, a,b,rofi,drdi,s,
1099
1100=== modified file 'Src/bands.F'
1101--- Src/bands.F 2018-04-25 11:33:32 +0000
1102+++ Src/bands.F 2018-04-27 22:12:28 +0000
1103@@ -366,7 +366,7 @@
1104 use atmfuncs, only : symfio, cnfigfio, labelfis, nofis
1105 use writewave, only : wfs_filename
1106
1107- use m_spin, only: NoMagn, SPpol, NonCol, SpOrb
1108+ use m_spin, only: spin
1109
1110 use m_diag_option, only: ParallelOverK, Serial
1111 use m_diag, only: diag_init
1112@@ -459,7 +459,7 @@
1113 endif
1114
1115 C Find the band energies
1116- if (NoMagn .or. SPpol) then
1117+ if ( spin%none .or. spin%Col ) then
1118 C fixspin and qs are not used in diagk, since getD=.false. ...
1119 qs(1) = 0.0_dp
1120 qs(2) = 0.0_dp
1121@@ -488,7 +488,7 @@
1122 ParallelOverK = SaveParallelOverK
1123 if ( ParallelOverK ) Serial = .true.
1124
1125- elseif ( NonCol ) then
1126+ elseif ( spin%NCol ) then
1127 if (getPSI) then
1128 if (node==0) then
1129 write(6,*) "No WFS for non-colinear spin, yet..."
1130@@ -503,7 +503,7 @@
1131 . Haux, Saux, psi, Haux, Saux, aux,
1132 . no_u, occtol, 1, no_u )
1133
1134- elseif ( SpOrb ) then
1135+ elseif ( spin%SO ) then
1136 if (getPSI) then
1137 if (node==0) then
1138 write(6,*) "No WFS for spin-orbit, yet..."
1139
1140=== modified file 'Src/basis_io.F'
1141--- Src/basis_io.F 2017-12-22 10:26:20 +0000
1142+++ Src/basis_io.F 2018-04-27 22:12:28 +0000
1143@@ -401,8 +401,14 @@
1144 ! KBs
1145 read(lun,*)
1146 do i=1,spp%n_pjnl
1147- read(lun,*)
1148+ if (spp%lj_projs) then
1149+ read(lun,*)
1150+ $ spp%pjnl_l(i), spp%pjnl_j(i), spp%pjnl_n(i),
1151+ $ spp%pjnl_ekb(i)
1152+ else
1153+ read(lun,*)
1154 $ spp%pjnl_l(i), spp%pjnl_n(i), spp%pjnl_ekb(i)
1155+ endif
1156 call radial_read_ascii(spp%pjnl(i),lun,
1157 $ yp1=0.0_dp,ypn=huge(1.0_dp))
1158 enddo
1159@@ -417,6 +423,7 @@
1160 nk = nk+1
1161 spp%pj_n(nk) = spp%pjnl_n(i)
1162 spp%pj_l(nk) = spp%pjnl_l(i)
1163+ spp%pj_j(nk) = spp%pjnl_j(i)
1164 spp%pj_m(nk) = m
1165 spp%pj_index(nk) = i
1166 enddo
1167@@ -450,6 +457,7 @@
1168 integer, intent(in) :: unit
1169
1170 character(len=78) line
1171+ integer :: iostat
1172
1173 read(unit,'(a)') line
1174 if (trim(line) .eq. '<preamble>') then
1175@@ -465,7 +473,12 @@
1176 read(unit,*) p%mass
1177 read(unit,*) p%self_energy
1178 read(unit,*) p%lmax_basis, p%n_orbnl
1179- read(unit,*) p%lmax_projs, p%n_pjnl
1180+ read(unit,fmt=*,iostat=iostat) p%lmax_projs, p%n_pjnl, p%lj_projs
1181+ if (iostat /=0 ) then
1182+ backspace(unit)
1183+ read(unit,*) p%lmax_projs, p%n_pjnl
1184+ p%lj_projs = .false.
1185+ endif
1186
1187 allocate(p%orbnl(p%n_orbnl))
1188 allocate(p%pjnl(p%n_pjnl))
1189@@ -817,9 +830,16 @@
1190 do i=1,spp%n_pjnl
1191 zeta = spp%pjnl_n(i)
1192 l = spp%pjnl_l(i)
1193- write(lun,'(2i3,f22.16,2x,a)')
1194+ if (spp%lj_projs) then
1195+ write(lun,'(i3,f4.1,i3,f22.16,2x,a)')
1196+ $ spp%pjnl_l(i), spp%pjnl_j(i), spp%pjnl_n(i),
1197+ $ spp%pjnl_ekb(i),
1198+ $ " #kb l, j, n (sequence number), Reference energy"
1199+ else
1200+ write(lun,'(2i3,f22.16,2x,a)')
1201 $ spp%pjnl_l(i), spp%pjnl_n(i), spp%pjnl_ekb(i),
1202 $ " #kb l, n (sequence number), Reference energy"
1203+ endif
1204 call radial_dump_ascii(spp%pjnl(i),lun)
1205
1206 if (write_ion_plot_files) then
1207@@ -949,8 +969,14 @@
1208 write(unit,'(g22.12,4x,a)') p%self_energy, "# Self energy "
1209 write(unit,'(2i4,22x,a)') p%lmax_basis, p%n_orbnl,
1210 $ "# Lmax for basis, no. of nl orbitals "
1211- write(unit,'(2i4,22x,a)') p%lmax_projs, p%n_pjnl,
1212- $ "# Lmax for projectors, no. of nl KB projectors "
1213+ if (p%lj_projs) then
1214+ write(unit,'(2i4,1x,l1,20x,a)') p%lmax_projs, p%n_pjnl,
1215+ $ p%lj_projs,
1216+ $ "# Lmax for projectors, no. of nl KB projectors, LJ projs?"
1217+ else
1218+ write(unit,'(2i4,22x,a)') p%lmax_projs, p%n_pjnl,
1219+ $ "# Lmax for projectors, no. of nl KB projectors"
1220+ endif
1221
1222 end subroutine write_header
1223
1224
1225=== modified file 'Src/broadcast_basis.F'
1226--- Src/broadcast_basis.F 2016-06-28 05:57:03 +0000
1227+++ Src/broadcast_basis.F 2018-04-27 22:12:28 +0000
1228@@ -104,10 +104,14 @@
1229 $ 0,MPI_Comm_World,MPIerror)
1230 call MPI_Bcast(spp%lmax_projs,1,MPI_integer,
1231 $ 0,MPI_Comm_World,MPIerror)
1232+ call MPI_Bcast(spp%lj_projs,1,MPI_logical,
1233+ $ 0,MPI_Comm_World,MPIerror)
1234 call MPI_Bcast(spp%pjnl_l,maxn_pjnl,MPI_integer,
1235 $ 0,MPI_Comm_World,MPIerror)
1236 call MPI_Bcast(spp%pjnl_n,maxn_pjnl,MPI_integer,
1237 $ 0,MPI_Comm_World,MPIerror)
1238+ call MPI_Bcast(spp%pjnl_j,maxn_pjnl,MPI_double_precision,
1239+ $ 0,MPI_Comm_World,MPIerror)
1240 call MPI_Bcast(spp%pjnl_ekb,maxn_pjnl,MPI_double_precision,
1241 $ 0,MPI_Comm_World,MPIerror)
1242
1243@@ -134,6 +138,8 @@
1244 $ 0,MPI_Comm_World,MPIerror)
1245 call MPI_Bcast(spp%pj_l,maxnprojs,MPI_integer,
1246 $ 0,MPI_Comm_World,MPIerror)
1247+ call MPI_Bcast(spp%pj_j,maxnprojs,MPI_double_precision,
1248+ $ 0,MPI_Comm_World,MPIerror)
1249 call MPI_Bcast(spp%pj_m,maxnprojs,MPI_integer,
1250 $ 0,MPI_Comm_World,MPIerror)
1251
1252
1253=== modified file 'Src/compute_energies.F90'
1254--- Src/compute_energies.F90 2017-12-21 15:49:49 +0000
1255+++ Src/compute_energies.F90 2018-04-27 22:12:28 +0000
1256@@ -47,8 +47,10 @@
1257 lastkb, no_s, rmaxv, indxua, iphorb, lasto, &
1258 rmaxo, no_l
1259 use m_ntm, only: ntm
1260- use m_spin, only: NoMagn, SPpol, NonCol, SpOrb
1261- use m_spin, only: nspin, h_spin_dim, spinor_dim
1262+
1263+ use m_spin, only: spin
1264+ use parallel, only: IONode
1265+
1266 use m_dipol, only: dipol
1267 use siesta_geom, only: na_u, na_s, xa, isa
1268 use m_rhog, only: rhog
1269@@ -58,22 +60,20 @@
1270
1271 integer, intent(in) :: iscf
1272
1273- integer :: ihmat, ifa, istr, ispin, io
1274+ integer :: ispin, io
1275 #ifdef MPI
1276 real(dp) :: buffer1
1277 #endif
1278
1279- real(dp) :: const
1280- real(dp) :: dummy_stress(3,3), dummy_fa(1,1)
1281- real(dp) :: dummy_E, g2max, dummy_H(1,1)
1282 logical :: mixDM
1283
1284+
1285 mixDM = (.not. (mixH .or. mix_charge))
1286
1287 ! Compute the band-structure energy
1288
1289 call compute_EBS()
1290-
1291+
1292 ! These energies were calculated in the latest call to
1293 ! setup_hamiltonian, using as ingredient D_in
1294
1295@@ -126,36 +126,89 @@
1296
1297 subroutine compute_EBS()
1298
1299+ real(dp) :: Ebs_SO(4)
1300+ complex(dp) :: Ebs_Daux(2,2), Ebs_Haux(2,2)
1301+
1302+ integer :: i, j, ind
1303+
1304 Ebs = 0.0_dp
1305-! const factor takes into account that there are two nondiagonal
1306-! elements in non-collinear spin density matrix, stored as
1307-! ispin=1 => D11; ispin=2 => D22, ispin=3 => Real(D12);
1308-! ispin=4 => Imag(D12)
1309-
1310- if ( SpOrb ) then
1311- do io = 1,maxnh
1312- Ebs = Ebs + H(io,1) * ( Dscf(io,1) ) &
1313- + H(io,2) * ( Dscf(io,2) ) &
1314- + H(io,3) * ( Dscf(io,7) ) &
1315- + H(io,4) * ( Dscf(io,8) ) &
1316- - H(io,5) * ( Dscf(io,5) ) &
1317- - H(io,6) * ( Dscf(io,6) ) &
1318- + H(io,7) * ( Dscf(io,3) ) &
1319- + H(io,8) * ( Dscf(io,4) )
1320+
1321+! Modifed for Off-Site Spin-orbit coupling by R. Cuadrado, Feb. 2018
1322+!
1323+!*****************************************************************************
1324+! Note about Ebs and E_Harris calculation for the Spin-Orbit:
1325+!*****************************************************************************
1326+!
1327+! E_bs and E_Harris are calculated by means of the following
1328+! complex matrix multiplication:
1329+!
1330+! E_bs = Re { Tr[ H * DM ] }
1331+! E_Harris = Re { Tr[ H * (DM-DM_old) ] }
1332+!
1333+! In the following: DM/H(1,1) --> up/up <--> uu
1334+! DM/H(2,2) --> down/down <--> dd
1335+! DM/H(1,2) --> up/down <--> ud
1336+! DM/H(2,1) --> down/up <--> du
1337+!
1338+! Using DM/H components, E_bs would be sum(E_bs(1:4)), where
1339+!
1340+! E_bs(1)=Re{sum_ij(H_ij(1,1)*D_ji(1,1))}=Re{sum_ij(H_ij^uu*(DM_ij^uu)^*)}
1341+! E_bs(2)=Re{sum_ij(H_ij(2,2)*D_ji(2,2))}=Re{sum_ij(H_ij^dd*(DM_ij^dd)^*)}
1342+! E_bs(3)=Re{sum_ij(H_ij(1,2)*D_ji(2,1))}=Re{sum_ij(H_ij^ud*(DM_ij^ud)^*)}
1343+! E_bs(4)=Re{sum_ij(H_ij(2,1)*D_ji(1,2))}=Re{sum_ij(H_ij^du*(DM_ij^du)^*)}
1344+!
1345+! since, due to overall hermiticity, DM_ij^ab = (DM_ji^ba)^*
1346+!
1347+! The trace operation is then an extended dot product over the "ij"
1348+! sparse index, which can also be conveniently done in parallel, as
1349+! each processor handles the same indexes in H and the DM. Only a
1350+! global reduction is needed at the end.
1351+
1352+! Same comments are valid for the E_Harris calculation.
1353+!
1354+!*****************************************************************************
1355+!
1356+ if ( spin%SO ) then
1357+
1358+ Ebs_SO = 0.0_dp
1359+ Ebs_Daux = dcmplx(0.0_dp, 0.0_dp)
1360+ Ebs_Haux = dcmplx(0.0_dp, 0.0_dp)
1361+
1362+ do io = 1, maxnh
1363+
1364+ Ebs_Haux(1,1) = dcmplx(H(io,1),H(io,5))
1365+ Ebs_Haux(2,2) = dcmplx(H(io,2),H(io,6))
1366+ Ebs_Haux(1,2) = dcmplx(H(io,3),-H(io,4))
1367+ Ebs_Haux(2,1) = dcmplx(H(io,7),H(io,8))
1368+
1369+ Ebs_Daux(1,1) = dcmplx(Dscf(io,1),Dscf(io,5))
1370+ Ebs_Daux(2,2) = dcmplx(Dscf(io,2),Dscf(io,6))
1371+ Ebs_Daux(1,2) = dcmplx(Dscf(io,3),-Dscf(io,4))
1372+ Ebs_Daux(2,1) = dcmplx(Dscf(io,7),Dscf(io,8))
1373+
1374+
1375+ Ebs_SO(1) = Ebs_SO(1) + real( Ebs_Haux(1,1)*dconjg(Ebs_Daux(1,1)) )
1376+ Ebs_SO(2) = Ebs_SO(2) + real( Ebs_Haux(2,2)*dconjg(Ebs_Daux(2,2)) )
1377+ Ebs_SO(3) = Ebs_SO(3) + real( Ebs_Haux(1,2)*dconjg(Ebs_Daux(1,2)) )
1378+ Ebs_SO(4) = Ebs_SO(4) + real( Ebs_Haux(2,1)*dconjg(Ebs_Daux(2,1)) )
1379+
1380 enddo
1381- else if ( NonCol ) then
1382+
1383+ Ebs = sum ( Ebs_SO )
1384+
1385+ else if ( spin%NCol ) then
1386 do io = 1,maxnh
1387 Ebs = Ebs + H(io,1) * ( Dscf(io,1) ) &
1388 + H(io,2) * ( Dscf(io,2) ) &
1389 + 2.0_dp * H(io,3) * ( Dscf(io,3) ) &
1390 + 2.0_dp * H(io,4) * ( Dscf(io,4) )
1391 enddo
1392- else if ( SPpol ) then
1393+ else if ( spin%Col ) then
1394 do io = 1,maxnh
1395 Ebs = Ebs + H(io,1) * Dscf(io,1) &
1396 + H(io,2) * Dscf(io,2)
1397 enddo
1398- else if ( NoMagn ) then
1399+ else if ( spin%none ) then
1400 do io = 1,maxnh
1401 Ebs = Ebs + H(io,1) * Dscf(io,1)
1402 enddo
1403@@ -170,36 +223,65 @@
1404
1405 subroutine compute_DEharr()
1406
1407+ real(dp) :: DEharr_SO(4)
1408+ complex(dp) :: DEharr_Daux(2,2), DEharr_Haux(2,2), DEharr_Daux_old(2,2)
1409+
1410 DEharr = 0.0_dp
1411- ! const factor takes into account that there are two nondiagonal
1412- ! elements in non-collinear spin density matrix, stored as
1413- ! ispin=1 => D11; ispin=2 => D22, ispin=3 => Real(D12);
1414- ! ispin=4 => Imag(D12)
1415-
1416- if ( SpOrb ) then
1417- do io = 1,maxnh
1418- DEharr = DEharr + H(io,1) * ( Dscf(io,1) - Dold(io,1) ) &
1419- + H(io,2) * ( Dscf(io,2) - Dold(io,2) ) &
1420- + H(io,3) * ( Dscf(io,7) - Dold(io,7) ) &
1421- + H(io,4) * ( Dscf(io,8) - Dold(io,8) ) &
1422- - H(io,5) * ( Dscf(io,5) - Dold(io,5) ) &
1423- - H(io,6) * ( Dscf(io,6) - Dold(io,6) ) &
1424- + H(io,7) * ( Dscf(io,3) - Dold(io,3) ) &
1425- + H(io,8) * ( Dscf(io,4) - Dold(io,4) )
1426- enddo
1427- else if ( NonCol ) then
1428+
1429+ if ( spin%SO ) then
1430+
1431+ DEharr_SO = 0.0_dp
1432+ DEharr_Daux = dcmplx(0.0_dp, 0.0_dp)
1433+ DEharr_Daux_old = dcmplx(0.0_dp, 0.0_dp)
1434+ DEharr_Haux = dcmplx(0.0_dp, 0.0_dp)
1435+
1436+ do io = 1, maxnh
1437+
1438+ DEharr_Haux(1,1) = dcmplx( H(io,1),H(io,5) )
1439+ DEharr_Haux(2,2) = dcmplx( H(io,2),H(io,6) )
1440+ DEharr_Haux(1,2) = dcmplx( H(io,3),-H(io,4) )
1441+ DEharr_Haux(2,1) = dcmplx( H(io,7),H(io,8) )
1442+
1443+ DEharr_Daux(1,1) = dcmplx( Dscf(io,1),Dscf(io,5) )
1444+ DEharr_Daux(2,2) = dcmplx( Dscf(io,2),Dscf(io,6) )
1445+ DEharr_Daux(1,2) = dcmplx( Dscf(io,3),-Dscf(io,4) )
1446+ DEharr_Daux(2,1) = dcmplx( Dscf(io,7),Dscf(io,8) )
1447+
1448+ DEharr_Daux_old(1,1) = dcmplx( Dold(io,1),Dold(io,5) )
1449+ DEharr_Daux_old(2,2) = dcmplx( Dold(io,2),Dold(io,6) )
1450+ DEharr_Daux_old(1,2) = dcmplx( Dold(io,3),-Dold(io,4) )
1451+ DEharr_Daux_old(2,1) = dcmplx( Dold(io,7),Dold(io,8) )
1452+
1453+
1454+ DEharr_SO(1) = DEharr_SO(1) &
1455+ + real( DEharr_Haux(1,1)*dconjg(DEharr_Daux(1,1)-DEharr_Daux_old(1,1)) )
1456+
1457+ DEharr_SO(2) = DEharr_SO(2) &
1458+ + real( DEharr_Haux(2,2)*dconjg(DEharr_Daux(2,2)-DEharr_Daux_old(2,2)) )
1459+
1460+ DEharr_SO(3) = DEharr_SO(3) &
1461+ + real( DEharr_Haux(1,2)*dconjg(DEharr_Daux(1,2)-DEharr_Daux_old(1,2)) )
1462+
1463+ DEharr_SO(4) = DEharr_SO(4) &
1464+ + real( DEharr_Haux(2,1)*dconjg(DEharr_Daux(2,1)-DEharr_Daux_old(2,1)) )
1465+
1466+ enddo
1467+
1468+ DEharr = sum ( DEharr_SO )
1469+
1470+ else if ( spin%NCol ) then
1471 do io = 1,maxnh
1472 DEharr = DEharr + H(io,1) * ( Dscf(io,1) - Dold(io,1) ) &
1473 + H(io,2) * ( Dscf(io,2) - Dold(io,2) ) &
1474 + 2.0_dp * H(io,3) * ( Dscf(io,3) - Dold(io,3) ) &
1475 + 2.0_dp * H(io,4) * ( Dscf(io,4) - Dold(io,4) )
1476 enddo
1477- elseif (SPpol) then
1478+ elseif ( spin%Col ) then
1479 do io = 1,maxnh
1480 DEharr = DEharr + H(io,1) * ( Dscf(io,1) - Dold(io,1) ) &
1481 + H(io,2) * ( Dscf(io,2) - Dold(io,2) )
1482 enddo
1483- elseif (NoMagn) then
1484+ elseif ( spin%none ) then
1485 do io = 1,maxnh
1486 DEharr = DEharr + H(io,1) * ( Dscf(io,1) - Dold(io,1) )
1487 enddo
1488@@ -217,11 +299,21 @@
1489 use files, only : filesOut_t ! derived type for output file names
1490 use class_dSpData1D, only : val
1491 use class_dSpData2D, only : val
1492- use sparse_matrices, only: H_kin_1D, H_vkb_1D, H_so_2D
1493+ use class_zSpData2D, only : val
1494+ use sparse_matrices, only: H_kin_1D, H_vkb_1D
1495+ use sparse_matrices, only: H_so_on_2D, H_so_off_2D
1496+
1497
1498 type(filesOut_t) :: filesOut ! blank output file names
1499- real(dp), pointer :: H_vkb(:), H_kin(:), H_so(:,:)
1500-
1501+ real(dp), pointer :: H_vkb(:), H_kin(:), H_so_on(:,:)
1502+ complex(dp), pointer :: H_so_off(:,:)
1503+
1504+
1505+ complex(dp) :: Hc, Dc
1506+ real(dp) :: dummy_stress(3,3), dummy_fa(1,1)
1507+ real(dp) :: dummy_E, g2max, dummy_H(1,1)
1508+ integer :: ihmat, ifa, istr
1509+
1510 ! Compute E_KS(DM_out)
1511
1512 g2max = g2cut
1513@@ -233,7 +325,7 @@
1514
1515 ! Remove unwanted arguments...
1516
1517- call dhscf( nspin, no_s, iaorb, iphorb, no_l, &
1518+ call dhscf( spin%Grid, no_s, iaorb, iphorb, no_l, &
1519 no_u, na_u, na_s, isa, xa, indxua, &
1520 ntm, ifa, istr, ihmat, filesOut, &
1521 maxnh, numh, listhptr, listh, Dscf, Datm, &
1522@@ -250,7 +342,7 @@
1523
1524 Ekin = 0.0_dp
1525 Enl = 0.0_dp
1526- do ispin = 1, spinor_dim
1527+ do ispin = 1, spin%spinor
1528 do io = 1,maxnh
1529 Ekin = Ekin + H_kin(io) * Dscf(io,ispin)
1530 Enl = Enl + H_vkb(io) * Dscf(io,ispin)
1531@@ -266,21 +358,48 @@
1532 #endif
1533
1534 Eso = 0._dp
1535- if ( SpOrb ) then
1536+
1537+ if ( spin%SO_offsite ) then
1538+ H_so_off => val(H_so_off_2D)
1539+
1540+ ! The computation of the trace is different here, as H_so_off has
1541+ ! a different structure from H and the DM.
1542+ do io = 1, maxnh
1543+
1544+!-------- Eso(u,u)
1545+ Dc = cmplx(Dscf(io,1),Dscf(io,5), dp)
1546+ Eso = Eso + real( H_so_off(io,1)*Dc, dp)
1547+!-------- Eso(d,d)
1548+ Dc = cmplx(Dscf(io,2),Dscf(io,6), dp)
1549+ Eso = Eso + real( H_so_off(io,2)*Dc, dp)
1550+!-------- Eso(u,d)
1551+ Dc = cmplx(Dscf(io,3),Dscf(io,4), dp)
1552+ Eso = Eso + real( H_so_off(io,4)*Dc, dp)
1553+!-------- Eso(d,u)
1554+ Dc = cmplx(Dscf(io,7),-Dscf(io,8), dp)
1555+ Eso = Eso + real( H_so_off(io,3)*Dc, dp)
1556+
1557+ end do
1558+
1559+ else if ( spin%SO_onsite ) then
1560 ! Sadly some compilers (g95), does
1561 ! not allow bounds for pointer assignments :(
1562- H_so => val(H_so_2D)
1563+ H_so_on => val(H_so_on_2D)
1564 do io = 1,maxnh
1565- Eso = Eso + H_so(io,1)*Dscf(io,7) + H_so(io,2)*Dscf(io,8) &
1566- + H_so(io,5)*Dscf(io,3) + H_so(io,6)*Dscf(io,4) &
1567- - H_so(io,3)*Dscf(io,5) - H_so(io,4)*Dscf(io,6)
1568- end do
1569+ Eso = Eso + H_so_on(io,1)*Dscf(io,7) + H_so_on(io,2)*Dscf(io,8) &
1570+ + H_so_on(io,5)*Dscf(io,3) + H_so_on(io,6)*Dscf(io,4) &
1571+ - H_so_on(io,3)*Dscf(io,5) - H_so_on(io,4)*Dscf(io,6)
1572+ end do
1573+
1574+ end if
1575+
1576 #ifdef MPI
1577+ if (spin%SO) then
1578 ! Global reduction of Eso
1579 call globalize_sum( Eso, buffer1 )
1580 Eso = buffer1
1581+ endif
1582 #endif
1583- end if
1584
1585 ! E0 = Ena + Ekin + Enl + Eso - Eions
1586
1587
1588=== modified file 'Src/dfscf.f'
1589--- Src/dfscf.f 2018-04-22 00:13:43 +0000
1590+++ Src/dfscf.f 2018-04-27 22:12:28 +0000
1591@@ -20,6 +20,7 @@
1592 C Adds the SCF contribution to atomic forces and stress.
1593 C Written by P.Ordejon, J.M.Soler, and J.Gale.
1594 C Last modification by J.M.Soler, October 2000.
1595+C Modifed for Off-Site Spin-orbit coupling by R. Cuadrado, Feb. 2018
1596 C *********************** INPUT **************************************
1597 C integer ifa : Are forces required? (1=yes,0=no)
1598 C integer istr : Is stress required? (1=yes,0=no)
1599@@ -334,7 +335,7 @@
1600
1601 C Factor two for nondiagonal elements for non-collinear spin (and SO)
1602 if ( nspin == 4 ) then
1603- V(1:nsp,3:4) = 2.0_dp * V(1:nsp,3:4)
1604+ V(1:nsp,3:4) = 2.0_dp * V(1:nsp,3:4)
1605 end if
1606
1607 C Loop on first orbital of mesh point
1608
1609=== modified file 'Src/final_H_f_stress.F'
1610--- Src/final_H_f_stress.F 2017-11-23 14:17:27 +0000
1611+++ Src/final_H_f_stress.F 2018-04-27 22:12:28 +0000
1612@@ -21,8 +21,9 @@
1613 use siesta_options, only: recompute_H_after_scf
1614 use sparse_matrices, only: numh, listh, listhptr
1615 use sparse_matrices, only: H, S, Dscf, Escf, maxnh, xijo
1616- use sparse_matrices, only: H_ldau_2D
1617+ use sparse_matrices, only: H_ldau_2D, H_so_off_2D
1618 use class_dSpData2D, only: val
1619+ use class_zSpData2D, only: val
1620
1621 use siesta_geom
1622 use atomlist, only: no_u, iaorb, iphkb, qtot, indxuo, datm,
1623@@ -30,7 +31,7 @@
1624 & rmaxo, no_l, iza
1625 use metaforce, only: lMetaForce, meta
1626 use molecularmechanics, only : twobody
1627- use m_nlefsm, only: nlefsm
1628+ use m_nlefsm, only: nlefsm, nlefsm_SO_off
1629 use m_overfsm, only: overfsm
1630 use m_kinefsm, only: kinefsm
1631 use m_naefs, only: naefs
1632@@ -46,8 +47,8 @@
1633 use m_energies
1634 use m_steps, only: istp
1635 use m_ntm
1636- use m_spin, only: spin
1637- use spinorbit, only: spinorb
1638+ use m_spin, only: spin
1639+ use spinorbit, only: spinorb
1640 use m_dipol
1641 use m_forces, only: fa
1642 use alloc, only: re_alloc, de_alloc
1643@@ -91,6 +92,8 @@
1644 real(dp), pointer :: H_tmp(:,:) => null()
1645 real(dp), pointer :: S_tmp(:) => null()
1646 real(dp), pointer :: H_ldau(:,:)
1647+ complex(dp), pointer :: H_so_off(:,:)
1648+
1649 #ifdef FINAL_CHECK_HS
1650 real(dp) :: diff_H, diff_S
1651 #endif
1652@@ -98,6 +101,7 @@
1653 real(dp) :: stresstmp(3,3)
1654 real(dp), pointer :: fatmp(:,:)
1655 real(dp) :: buffer1
1656+ integer :: MPIerror
1657 #endif
1658 character(len=label_length+13) :: fname
1659 integer :: io_istep, io_ia1
1660@@ -106,6 +110,8 @@
1661 type(dict) :: dic_save
1662 #endif
1663 #endif
1664+
1665+
1666 !------------------------------------------------------------------------- BEGIN
1667
1668 ! Initialize Hamiltonian ........................................
1669@@ -158,28 +164,42 @@
1670 ! ..................
1671
1672 ! Non-local-pseudop: energy, forces, stress and matrix elements .......
1673- call nlefsm( scell, na_u, na_s, isa, xa, indxua,
1674- & maxnh, maxnh, lasto, lastkb, iphorb, iphKB,
1675- & numh, listhptr, listh, numh, listhptr, listh,
1676- & spin%spinor, Dscf, Enl, fal, stressl, H_tmp,
1677- & matrix_elements_only=.false. )
1678-
1679-#ifdef MPI
1680-! Global reduction of energy terms
1681- call globalize_sum(Enl,buffer1)
1682- Enl = buffer1
1683-#endif
1684-
1685-! If in the future the spin-orbit routine is able to compute
1686-! forces and stresses, then "last" will be needed. If we are not
1687-! computing forces and stresses, calling it in the first iteration
1688-! should be enough
1689-!
1690- if ( spin%SO ) then
1691+
1692+ Eso = 0.0_dp
1693+
1694+ if ( .not.spin%SO_offsite ) then
1695+ call nlefsm( scell, na_u, na_s, isa, xa, indxua,
1696+ & maxnh, maxnh, lasto, lastkb, iphorb, iphKB,
1697+ & numh, listhptr, listh, numh, listhptr, listh,
1698+ & spin%spinor, Dscf, Enl, fal, stressl, H_tmp,
1699+ & matrix_elements_only=.false. )
1700+
1701+#ifdef MPI
1702+! Global reduction of energy terms
1703+ call globalize_sum(Enl,buffer1)
1704+ Enl = buffer1
1705+#endif
1706+ else
1707+ H_so_off => val(H_so_off_2D)
1708+ call nlefsm_SO_off(scell, na_u, na_s, isa, xa, indxua,
1709+ & maxnh, maxnh, lasto, lastkb, iphorb, iphKB,
1710+ & numh, listhptr, listh, numh, listhptr, listh,
1711+ & spin%Grid,
1712+ & Enl, Eso, fal,
1713+ & stressl, H_tmp, H_so_off,
1714+ & matrix_elements_only=.false.)
1715+#ifdef MPI
1716+! Global reduction of energy terms
1717+ call globalize_sum(Enl,buffer1)
1718+ Enl = buffer1
1719+ call globalize_sum(Eso,buffer1)
1720+ Eso = buffer1
1721+#endif
1722+ endif
1723+
1724+ if ( spin%SO_onsite ) then
1725 call spinorb(no_u,no_l,iaorb,iphorb,isa,indxuo,
1726 & maxnh,numh,listhptr,listh,Dscf,H_tmp(:,3:),Eso)
1727- else
1728- Eso = 0._dp
1729 endif
1730
1731 ! Non-SCF part of total energy
1732@@ -276,7 +296,8 @@
1733 & diff_S
1734 end if
1735 #endif
1736-
1737+
1738+ ! TODO I am not sure this works with SO_offsite?
1739 if (recompute_H_after_scf) then
1740 if (ionode) then
1741 write(6,"(a)") ":!: Updating H after scf cycle" //
1742
1743=== modified file 'Src/initatom.f'
1744--- Src/initatom.f 2018-04-07 19:24:04 +0000
1745+++ Src/initatom.f 2018-04-27 22:12:28 +0000
1746@@ -50,10 +50,10 @@
1747 use ldau_specs, only: ldau_proj_gen
1748 use ldau_specs, only: populate_species_info_ldau
1749 use pseudopotential, only: pseudo_read
1750-
1751+
1752 use chemical
1753
1754- use m_spin, only: SpOrb
1755+ use m_spin, only: spin
1756
1757 use atm_types, only: species, species_info, nspecies
1758
1759@@ -63,6 +63,7 @@
1760 integer :: is
1761 logical :: user_basis, user_basis_netcdf
1762 logical :: req_init_setup
1763+ logical :: lj_projs
1764
1765 type(basis_def_t), pointer :: basp
1766 type(species_info), pointer :: spp
1767@@ -106,12 +107,13 @@
1768 call elec_corr_setup()
1769 else if (user_basis) then
1770
1771- if ( SpOrb ) then
1772+ if ( spin%SO_onsite ) then
1773 ! We still need to read the pseudopotential information
1774- write(6,'(a)') ' initatom: Spin configuration = spin-orbit'
1775+ ! because the .ion files do not contain V_so information
1776+ write(6,'(a)') ' initatom: spin-orbit-onsite with user-basis'
1777+ write(6,'(a)') ' initatom: Still need to read the psf files.'
1778 do is = 1 , nsp
1779 basp => basis_parameters(is)
1780-
1781 basp%label = species_label(is)
1782 call pseudo_read(basp%label,basp%pseudopotential)
1783 end do
1784@@ -132,6 +134,8 @@
1785 nspecies = nsp ! For atm_types module
1786 call setup_atom_tables(nsp)
1787
1788+ lj_projs = (spin%SO_offsite)
1789+
1790 allocate(species(nspecies))
1791 do is = 1,nsp
1792 call write_basis_specs(6,is)
1793@@ -151,7 +155,8 @@
1794 & qyuk(0:lmaxd,1:nsemx,is),
1795 & qwid(0:lmaxd,1:nsemx,is),
1796 & split_norm(0:lmaxd,1:nsemx,is),
1797- & filtercut(0:lmaxd,1:nsemx,is), basp, spp)
1798+ & filtercut(0:lmaxd,1:nsemx,is), basp, spp,
1799+ $ lj_projs)
1800 ! Generate the projectors for the LDA+U simulations (if requested)
1801 call ldau_proj_gen(is)
1802 enddo
1803@@ -165,11 +170,12 @@
1804 call elec_corr_setup()
1805 ns = nsp ! Set number of species for main program
1806
1807+ call dump_basis_ascii()
1808+ call dump_basis_netcdf()
1809+ call dump_basis_xml()
1810+
1811 endif
1812
1813- call dump_basis_ascii()
1814- call dump_basis_netcdf()
1815- call dump_basis_xml()
1816
1817 if (.not. user_basis .and. .not. user_basis_netcdf) then
1818 call deallocate_spec_arrays()
1819
1820=== modified file 'Src/m_cite.F90'
1821--- Src/m_cite.F90 2016-12-29 10:36:10 +0000
1822+++ Src/m_cite.F90 2018-04-27 22:12:28 +0000
1823@@ -74,7 +74,7 @@
1824 ! Increment this after having added a new
1825 ! citation!
1826 ! OTHERWISE YOU WILL EXPERIENCE A SEG-FAULT.
1827- integer, parameter :: N_citations = 7
1828+ integer, parameter :: N_citations = 9
1829
1830 private
1831
1832@@ -242,7 +242,29 @@
1833 cit%issue = "30"
1834 cit%cite_key = "Lin2014"
1835 ID = 7
1836+
1837+ case ( "10.1088/0953-8984/24/8/086005" )
1838+ ! Off-Site Spin-Orbit
1839+ cit%comment = "Off-Site Spin-Orbit Implementation"
1840+ cit%doi = "10.1088/0953-8984/24/8/086005"
1841+ cit%journal = "Journal of Physics: Condensed Matter"
1842+ cit%year = 2012
1843+ cit%volume = "24"
1844+ cit%issue = "8"
1845+ cit%cite_key = "Cuadrado2012"
1846+ ID = 8
1847
1848+ case ( "10.1088/0953-8984/18/34/012")
1849+ ! On-Site Spin-Orbit
1850+ cit%comment = "On-Site Spin-Orbit Implementation"
1851+ cit%doi = "10.1088/0953-8984/18/34/012"
1852+ cit%journal = "Journal of Physics: Condensed Matter"
1853+ cit%year = 2006
1854+ cit%volume = "18"
1855+ cit%issue = "0"
1856+ cit%cite_key = "FernandezSeivane2006"
1857+ ID = 9
1858+
1859 end select
1860
1861 ! probably we should error out...
1862
1863=== modified file 'Src/m_pulay.F90'
1864--- Src/m_pulay.F90 2016-06-04 20:06:11 +0000
1865+++ Src/m_pulay.F90 2018-04-27 22:12:28 +0000
1866@@ -8,7 +8,7 @@
1867 module m_pulay
1868
1869 use precision, only: dp
1870- use m_spin, only: h_spin_dim, SpOrb
1871+ use m_spin, only: spin
1872 implicit none
1873
1874 private
1875@@ -48,7 +48,7 @@
1876 if (maxsav .le. 0) then
1877 ! No need for auxiliary arrays
1878 else
1879- nauxpul = sum(numh(1:no_l)) * h_spin_dim * maxsav
1880+ nauxpul = sum(numh(1:no_l)) * spin%H * maxsav
1881 !
1882 call re_alloc(auxpul,1,nauxpul,1,2,name="auxpul", &
1883 routine="pulay")
1884@@ -370,8 +370,8 @@
1885 ! B(i,i) = dot_product(Res(i)*Res(i))
1886 b(i,i) = 0.0_dp
1887 ssum=0.0_dp
1888-! CC RC Added for on-site SO
1889- if ( .not. SpOrb ) then
1890+
1891+ if ( .not. spin%SO ) then
1892 do is=1,nspin
1893 do ii=1,no_l
1894 do jj=1,numd(ii)
1895@@ -380,7 +380,7 @@
1896 enddo
1897 enddo
1898 enddo
1899- elseif ( SpOrb ) then
1900+ elseif ( spin%SO ) then
1901 do ii=1,no_l
1902 do jj=1,numd(ii)
1903 ind = listdptr(ii) + jj
1904@@ -393,7 +393,6 @@
1905 enddo
1906 enddo
1907 endif
1908-! CC RC
1909
1910 b(i,i)=ssum
1911 !
1912@@ -414,7 +413,7 @@
1913
1914 b(i,j)=0.0_dp
1915 ssum=0.0_dp
1916- if ( .not. SpOrb ) then
1917+ if ( .not. spin%SO ) then
1918 do is=1,nspin
1919 do ii=1,no_l
1920 do jj=1,numd(ii)
1921@@ -423,7 +422,7 @@
1922 enddo
1923 enddo
1924 enddo
1925- elseif ( SpOrb ) then
1926+ elseif ( spin%SO ) then
1927 do ii=1,no_l
1928 do jj=1,numd(ii)
1929 ind = listdptr(ii) + jj
1930
1931=== modified file 'Src/m_spin.F90'
1932--- Src/m_spin.F90 2018-02-27 21:05:45 +0000
1933+++ Src/m_spin.F90 2018-04-27 22:12:28 +0000
1934@@ -7,13 +7,16 @@
1935 ! ---
1936 module t_spin
1937
1938+ use precision, only: dp
1939+
1940 implicit none
1941-
1942+ private
1943+
1944 !> Type containing a simulations spin configuration
1945 !!
1946 !! Thus this type contains _all_ relevant information
1947 !! regarding the spin-configuration.
1948- type tSpin
1949+ type, public :: tSpin
1950
1951 !> Dimensionality of the Hamiltonian
1952 integer :: H = 1
1953@@ -37,8 +40,9 @@
1954 !> Spin-orbit coupling
1955 logical :: SO = .false.
1956
1957- !> If .true. the spin-orbit is using the off-site implementation (else the on-site)
1958- logical :: SO_off = .false.
1959+ !> Flavors of off-site implementation
1960+ logical :: SO_offsite = .false.
1961+ logical :: SO_onsite = .false.
1962
1963 ! Perhaps one could argue that one may
1964 ! associate a symmetry to the spin which
1965@@ -110,6 +114,10 @@
1966 use fdf, only : fdf_get, leqi, fdf_deprecated
1967 use alloc, only: re_alloc
1968
1969+ use m_cite, only: add_citation
1970+ use files, only: slabel
1971+ use parallel, only: IONode
1972+
1973 character(len=32) :: opt
1974
1975 ! Create pointer assignments...
1976@@ -127,14 +135,14 @@
1977 ! Time reversal symmetry
1978 TrSym = .true.
1979
1980- ! All components of the 'spin' variable
1981- ! is initially correct...
1982+ ! Initialize all components of the 'spin' variable
1983 spin%none = .false.
1984 spin%Col = .false.
1985 spin%NCol = .false.
1986 spin%SO = .false.
1987- spin%SO_off = .false.
1988-
1989+ spin%SO_offsite = .false.
1990+ spin%SO_onsite = .false.
1991+
1992 ! Read in old flags (discouraged)
1993 spin%Col = fdf_get('SpinPolarized',.false.)
1994 spin%NCol = fdf_get('NonCollinearSpin',.false.)
1995@@ -149,7 +157,7 @@
1996 if ( spin%SO ) then
1997 opt = 'spin-orbit'
1998 else if ( spin%NCol ) then
1999- opt = 'non-colinear'
2000+ opt = 'non-collinear'
2001 else if ( spin%Col ) then
2002 opt = 'collinear'
2003 else
2004@@ -173,52 +181,41 @@
2005
2006 spin%Col = .true.
2007
2008- else if ( leqi(opt, 'non-collinear') .or. leqi(opt, 'non-colinear') .or. &
2009+ else if ( leqi(opt, 'non-collinear') .or. leqi(opt, 'non-colinear') .or. &
2010 leqi(opt, 'NC') .or. leqi(opt, 'N-C') ) then
2011
2012 spin%NCol = .true.
2013
2014 else if ( leqi(opt, 'spin-orbit') .or. leqi(opt, 'S-O') .or. &
2015- leqi(opt, 'SOC') .or. leqi(opt, 'SO') ) then
2016- ! Spin-orbit is the same as using the off-site implementation
2017-
2018- spin%SO = .true.
2019- spin%SO_off = .true.
2020-
2021- else if ( leqi(opt, 'spin-orbit+off') .or. leqi(opt, 'S-O+off') .or. &
2022- leqi(opt, 'SOC+off') .or. leqi(opt, 'SO+off') ) then
2023-
2024- spin%SO = .true.
2025- spin%SO_off = .true.
2026-
2027- else if ( leqi(opt, 'spin-orbit+on') .or. leqi(opt, 'S-O+on') .or. &
2028- leqi(opt, 'SOC+on') .or. leqi(opt, 'SO+on') ) then
2029-
2030- spin%SO = .true.
2031- spin%SO_off = .false.
2032+ leqi(opt, 'SOC') .or. leqi(opt, 'SO') .or. &
2033+ leqi(opt, 'spin-orbit+offsite') .or. leqi(opt, 'S-O+offsite') .or. &
2034+ leqi(opt, 'SOC+offsite') .or. leqi(opt, 'SO+offsite') ) then
2035+ ! Spin-orbit defaults to the off-site implementation
2036+
2037+ spin%SO = .true.
2038+ spin%SO_offsite = .true.
2039+
2040+ else if ( leqi(opt, 'spin-orbit+onsite') .or. leqi(opt, 'S-O+onsite') .or. &
2041+ leqi(opt, 'SOC+onsite') .or. leqi(opt, 'SO+onsite') ) then
2042+
2043+ spin%SO = .true.
2044+ spin%SO_onsite = .true.
2045
2046 else
2047 write(*,*) 'Unknown spin flag: ', trim(opt)
2048 call die('Spin: unknown flag, please assert the correct input.')
2049 end if
2050
2051- ! TODO once off-site is fully implemented
2052- ! this should be removed to enable the off-site code
2053- ! fully!
2054- spin%SO_off = .false.
2055-
2056- ! Note that, in what follows,
2057- ! spinor_dim = min(h_spin_dim,2)
2058- ! e_spin_dim = min(h_spin_dim,4)
2059- ! nspin = min(h_spin_dim,4) ! Relevant for dhscf, local DM
2060- ! should probably be called nspin_grid
2061- !
2062- ! so everything can be determined if h_spin_dim is known.
2063- ! It is tempting to go back to the old 'nspin' overloading,
2064- ! making 'nspin' mean again 'h_spin_dim'.
2065- ! But this has to be done carefully, as some routines expect
2066- ! an argument 'nspin' which really means 'spinor_dim' (like diagon),
2067- ! and others (such as dhscf) expect 'nspin' to mean 'nspin_grid'.
2068+ if ( spin%SO_offsite ) then
2069+ call add_citation("10.1088/0953-8984/24/8/086005")
2070+ end if
2071+ if ( spin%SO_onsite ) then
2072+ call add_citation("10.1088/0953-8984/18/34/012")
2073+ end if
2074+
2075+ ! These are useful for fine control beyond the old "nspin". Some routines expect
2076+ ! an argument 'nspin' which might really mean 'spin%spinor' (like diagon),
2077+ ! 'spin%Grid' (like dhscf), etc.
2078
2079 if ( spin%SO ) then
2080 ! Spin-orbit case
2081@@ -235,9 +232,10 @@
2082 spin%Col = .false.
2083 spin%NCol = .false.
2084 spin%SO = .true.
2085+ ! off/on MUST already be set!
2086
2087 ! should be moved...
2088- TRSym = .false.
2089+ TRSym = .false. ! Cannot be changed !
2090
2091 else if ( spin%NCol ) then
2092 ! Non-collinear case
2093@@ -250,13 +248,15 @@
2094 spin%spinor = 2
2095
2096 ! Flags
2097- spin%none = .false.
2098- spin%Col = .false.
2099- spin%NCol = .true.
2100- spin%SO = .false.
2101+ spin%none = .false.
2102+ spin%Col = .false.
2103+ spin%NCol = .true.
2104+ spin%SO = .false.
2105+ spin%SO_onsite = .false.
2106+ spin%SO_offsite = .false.
2107
2108 ! should be moved...
2109- TRSym = .false.
2110+ TRSym = .false. ! Cannot be changed !
2111
2112 else if ( spin%Col ) then
2113 ! Collinear case
2114@@ -269,13 +269,17 @@
2115 spin%spinor = 2
2116
2117 ! Flags
2118- spin%none = .false.
2119- spin%Col = .true.
2120- spin%NCol = .false.
2121- spin%SO = .false.
2122+ spin%none = .false.
2123+ spin%Col = .true.
2124+ spin%NCol = .false.
2125+ spin%SO = .false.
2126+ spin%SO_onsite = .false.
2127+ spin%SO_offsite = .false.
2128
2129 ! should be moved...
2130- TRSym = .true.
2131+ TRSym = .true.
2132+ ! Allow the user to choose not to have TRS
2133+ TRSym = fdf_get('TimeReversalSymmetry',TrSym)
2134
2135 else if ( spin%none ) then
2136 ! No spin configuration...
2137@@ -288,18 +292,20 @@
2138 spin%spinor = 1
2139
2140 ! Flags
2141- spin%none = .true.
2142- spin%Col = .false.
2143- spin%NCol = .false.
2144- spin%SO = .false.
2145+ spin%none = .true.
2146+ spin%Col = .false.
2147+ spin%NCol = .false.
2148+ spin%SO = .false.
2149+ spin%SO_onsite = .false.
2150+ spin%SO_offsite = .false.
2151
2152 ! should be moved...
2153- TRSym = .true.
2154+ TRSym = .true.
2155+ ! Allow the user to choose not to have TRS
2156+ TRSym = fdf_get('TimeReversalSymmetry',TrSym)
2157
2158 end if
2159
2160- ! Get true time reversal symmetry
2161- TRSym = fdf_get('TimeReversalSymmetry',TrSym)
2162
2163 contains
2164
2165@@ -331,10 +337,10 @@
2166 if ( .not. IONode ) return
2167
2168 if ( spin%SO ) then
2169- if ( spin%SO_off ) then
2170- opt = 'spin-orbit+off'
2171+ if ( spin%SO_offsite ) then
2172+ opt = 'spin-orbit+offsite'
2173 else
2174- opt = 'spin-orbit+on'
2175+ opt = 'spin-orbit+onsite'
2176 end if
2177 else if ( spin%NCol ) then
2178 opt = 'non-collinear'
2179
2180=== modified file 'Src/mixer.F'
2181--- Src/mixer.F 2018-04-17 13:06:00 +0000
2182+++ Src/mixer.F 2018-04-27 22:12:28 +0000
2183@@ -30,7 +30,7 @@
2184 use m_mixing_scf, only: scf_mix
2185 use m_mixing, only: mixing
2186
2187- use m_spin, only: h_spin_dim, SpOrb
2188+ use m_spin, only: spin
2189 use parallel, only: IONode
2190
2191 implicit none
2192@@ -60,7 +60,7 @@
2193
2194
2195 ! Create residual function to minimize
2196- allocate(F(maxnh,h_spin_dim))
2197+ allocate(F(maxnh,spin%H))
2198
2199 !$OMP parallel default(shared), private(dtmp,i)
2200
2201@@ -103,15 +103,15 @@
2202 ! Upon exit Xout contains the mixed quantity
2203 select case ( mix_spin )
2204 case ( MIX_SPIN_ALL )
2205- call mixing( scf_mix, maxnh, h_spin_dim, Xin, F, Xout)
2206+ call mixing( scf_mix, maxnh, spin%H, Xin, F, Xout)
2207 case ( MIX_SPIN_SPINOR )
2208- call mixing( scf_mix, maxnh, h_spin_dim, Xin, F, Xout,
2209+ call mixing( scf_mix, maxnh, spin%H, Xin, F, Xout,
2210 & nsub=2)
2211 case ( MIX_SPIN_SUM )
2212- call mixing( scf_mix, maxnh, h_spin_dim, Xin, F, Xout,
2213+ call mixing( scf_mix, maxnh, spin%H, Xin, F, Xout,
2214 & nsub=1)
2215 case ( MIX_SPIN_SUM_DIFF )
2216- call mixing( scf_mix, maxnh, h_spin_dim, Xin, F, Xout,
2217+ call mixing( scf_mix, maxnh, spin%H, Xin, F, Xout,
2218 & nsub=2)
2219 end select
2220
2221@@ -188,15 +188,15 @@
2222
2223 if (muldeb .and. (.not. MixH) ) then
2224 if (IONode) write (6,"(/a)") 'Using DM after mixing:'
2225- if ( SpOrb .and. orbmoms) then
2226+ if ( spin%SO .and. orbmoms) then
2227 call moments( 1, na_u, no_u, maxnh, numh, listhptr,
2228 . listh, S, Dscf, isa, lasto, iaorb, iphorb,
2229 . indxuo )
2230 endif
2231 ! Call this unconditionally
2232 call mulliken( mullipop, na_u, no_u, maxnh,
2233- & numh, listhptr, listh, S, Dscf, isa,
2234- & lasto, iaorb, iphorb )
2235+ & numh, listhptr, listh, S, Dscf, isa,
2236+ & lasto, iaorb, iphorb )
2237 endif
2238
2239 call timer( 'MIXER', 2 )
2240
2241=== modified file 'Src/moments.F'
2242--- Src/moments.F 2018-04-17 13:06:00 +0000
2243+++ Src/moments.F 2018-04-27 22:12:28 +0000
2244@@ -296,4 +296,3 @@
2245 deallocate(l_orb)
2246
2247 end subroutine moments
2248-
2249
2250=== modified file 'Src/nlefsm.f'
2251--- Src/nlefsm.f 2016-11-04 14:10:50 +0000
2252+++ Src/nlefsm.f 2018-04-27 22:12:28 +0000
2253@@ -7,9 +7,11 @@
2254 !
2255 module m_nlefsm
2256
2257+ use precision, only : dp
2258+
2259 implicit none
2260
2261- public :: nlefsm
2262+ public :: nlefsm, nlefsm_SO_off
2263
2264 private
2265
2266@@ -53,7 +55,7 @@
2267 C hamiltonian matrix
2268 C integer listh(maxnh) : Nonzero hamiltonian-matrix element column
2269 C indexes for each matrix row
2270-C integer nspin : Number of spin components of Dscf and H
2271+C integer nspin : Number of spinor components (really min(nspin,2))
2272 C If computing only matrix elements, it
2273 C can be set to 1.
2274 C logical matrix_elements_only:
2275@@ -301,8 +303,6 @@
2276 kg = kbproj_gindex(ks,koa)
2277 call new_MATEL( 'S', kg, ig, xki(1:3,ina),
2278 & Ski(ikb,nno), grSki(1:3,ikb,nno) )
2279- ! Maybe: Ski = epskb_sqrt * Ski
2280- ! grSki = epskb_sqrt * grSki
2281 enddo
2282
2283 enddo ! loop over orbitals
2284@@ -330,7 +330,7 @@
2285 jo = listh(ind)
2286 listed(jo) = .true.
2287 if (.not. matrix_elements_only) then
2288- do ispin = 1,nspin ! Both spins add up...
2289+ do ispin = 1, nspin ! Both spins add up... (nspin=spin%spinor here)
2290 Di(jo) = Di(jo) + Dscf(ind,ispin)
2291 enddo
2292 endif
2293@@ -381,7 +381,7 @@
2294 do j = 1,numh(iio)
2295 ind = listhptr(iio)+j
2296 jo = listh(ind)
2297- do ispin = 1,nspin
2298+ do ispin = 1,nspin ! Only diagonal parts
2299 H(ind,ispin) = H(ind,ispin) + Vi(jo)
2300 enddo
2301 Vi(jo) = 0.0d0 ! See initial zero-out at top
2302@@ -441,4 +441,613 @@
2303
2304 end subroutine nlefsm
2305
2306+C nlefsm_SO_off calculates the KB elements to the total Hamiltonian
2307+C (including the SO contribution)
2308+C when Off-Site Spin Orbit is included in the calculation
2309+ subroutine nlefsm_SO_off( scell, nua, na, isa, xa, indxua,
2310+ . maxnh, maxnd, lasto, lastkb, iphorb,
2311+ . iphKB, numd, listdptr, listd, numh,
2312+ . listhptr, listh, nspin, Enl, Enl_offsiteSO,
2313+ . fa, stress, H0 , H0_off,
2314+ & matrix_elements_only)
2315+
2316+
2317+C *********************************************************************
2318+C Calculates non-local (NL) pseudopotential contribution to total
2319+C energy, atomic forces, stress and hamiltonian matrix elements.
2320+C Energies in Ry. Lengths in Bohr.
2321+C Writen by J.Soler and P.Ordejon, June 1997.
2322+C Modified by R. Cuadrado and J. I. Cerda for the
2323+C off-site Spin-Orbit, January 2017.
2324+C **************************** INPUT **********************************
2325+C real*8 scell(3,3) : Supercell vectors SCELL(IXYZ,IVECT)
2326+C integer nua : Number of atoms in unit cell
2327+C integer na : Number of atoms in supercell
2328+C integer isa(na) : Species index of each atom
2329+C real*8 xa(3,na) : Atomic positions in cartesian coordinates
2330+C integer indxua(na) : Index of equivalent atom in unit cell
2331+C integer maxnh : First dimension of H and listh
2332+C integer maxnd : Maximum number of elements of the
2333+C density matrix
2334+C integer lasto(0:na) : Position of last orbital of each atom
2335+C integer lastkb(0:na) : Position of last KB projector of each atom
2336+C integer iphorb(no) : Orbital index of each orbital in its atom,
2337+C where no=lasto(na)
2338+C integer iphKB(nokb) : Index of each KB projector in its atom,
2339+C where nokb=lastkb(na)
2340+C integer numd(nuo) : Number of nonzero elements of each row of the
2341+C density matrix
2342+C integer listdptr(nuo) : Pointer to the start of each row (-1) of the
2343+C density matrix
2344+C integer listd(maxnd) : Nonzero hamiltonian-matrix element column
2345+C indexes for each matrix row
2346+C integer numh(nuo) : Number of nonzero elements of each row of the
2347+C hamiltonian matrix
2348+C integer listhptr(nuo) : Pointer to the start of each row (-1) of the
2349+C hamiltonian matrix
2350+C integer listh(maxnh) : Nonzero hamiltonian-matrix element column
2351+C indexes for each matrix row
2352+C integer nspin : Number of spin_grid components (really min(nspin,4))
2353+C If computing only matrix elements, it
2354+C can be set to 1.
2355+C logical matrix_elements_only:
2356+C integer Dscf(maxnd,nspin): Density matrix. Not touched if computing
2357+C only matrix elements.
2358+C ******************* INPUT and OUTPUT *********************************
2359+C real*8 fa(3,na) : NL forces (added to input fa)
2360+C real*8 stress(3,3) : NL stress (added to input stress)
2361+C real*8 H0(maxnh,nspin) : NL Hamiltonian (added to input H)
2362+C complex*16 H0_off(maxnh,nspin) : NL off-site Hamiltonian (added to input H)
2363+C **************************** OUTPUT *********************************
2364+C real*8 Enl : NL energy
2365+C *********************************************************************
2366+C
2367+C Modules
2368+C
2369+ use parallel, only : Node, Nodes
2370+ use parallelsubs, only : GetNodeOrbs, LocalToGlobalOrb
2371+ use parallelsubs, only : GlobalToLocalOrb
2372+ use atmfuncs, only : rcut, orb_gindex, kbproj_gindex
2373+ use atmfuncs, only : epskb
2374+ use neighbour, only : iana=>jan, r2ki=>r2ij, xki=>xij
2375+ use neighbour, only : mneighb, reset_neighbour_arrays
2376+ use alloc, only : re_alloc, de_alloc
2377+ use m_new_matel, only : new_matel
2378+ use atm_types, only: species_info, species
2379+ use sparse_matrices, only: Dscf, xijo
2380+
2381+ integer, intent(in) ::
2382+ . maxnh, na, maxnd, nspin, nua
2383+
2384+ integer, intent(in) ::
2385+ . indxua(na), iphKB(*), iphorb(*), isa(na),
2386+ . lasto(0:na), lastkb(0:na), listd(maxnd), listh(maxnh),
2387+ . numd(*), numh(*), listdptr(*), listhptr(*)
2388+
2389+ real(dp), intent(in) :: scell(3,3), xa(3,na)
2390+ real(dp), intent(inout) :: fa(3,nua), stress(3,3)
2391+ real(dp), intent(inout) :: H0(maxnh)
2392+ complex(dp), intent(inout) :: H0_off(maxnh,4)
2393+
2394+ real(dp), intent(out) :: Enl, Enl_offsiteSO
2395+ logical, intent(in) :: matrix_elements_only
2396+
2397+ real(dp) :: volcel
2398+ external :: timer, volcel
2399+
2400+C Internal variables ................................................
2401+C maxno = maximum number of basis orbitals overlapping a KB projector
2402+
2403+ integer, save :: maxno = 2000
2404+
2405+ integer
2406+ . ia, ikb, ina, ind, ino, indt,
2407+ . io, iio, ioa, is, ispin, ix, ig, kg,
2408+ . j, jno, jo, jx, ka, ko, koa, ks, kua,
2409+ . nkb, nna, nno, no, nuo, nuotot, maxkba
2410+
2411+ integer :: l, koa1, koa2, i
2412+
2413+ integer, dimension(:), pointer :: iano, iono
2414+
2415+ real(dp)
2416+ . Cijk, fik, rki, rmax, rmaxkb, rmaxo,
2417+ . volume, CVj, epsk(2), Vit
2418+
2419+ real(dp) :: r1(3), r2(3)
2420+
2421+ real(dp), dimension(:), pointer :: Di, Vi ! This is Vion
2422+ real(dp), dimension(:,:), pointer :: Ski, xno
2423+ real(dp), dimension(:,:,:), pointer :: grSki
2424+
2425+ complex(dp) :: V_sot(2,2), F_so(3,2,2)
2426+ complex(dp), pointer :: V_so(:,:,:), Ds(:,:,:)
2427+
2428+
2429+ logical :: within
2430+ logical, dimension(:), pointer :: listed, listedall
2431+
2432+ complex(dp) :: E_offsiteSO(4)
2433+
2434+ type(species_info), pointer :: spp
2435+
2436+ integer :: nd, ndn
2437+
2438+C ------------------------------------------------------------
2439+
2440+C Start time counte
2441+ call timer( 'nlefsm', 1 )
2442+
2443+C Find unit cell volume
2444+ volume = volcel( scell ) * nua / na
2445+
2446+C Find maximum range
2447+ rmaxo = 0.0d0
2448+ rmaxkb = 0.0d0
2449+ do ia = 1,na
2450+ is = isa(ia)
2451+ do ikb = lastkb(ia-1)+1,lastkb(ia)
2452+ ioa = iphKB(ikb)
2453+ rmaxkb = max( rmaxkb, rcut(is,ioa) )
2454+ enddo
2455+ do io = lasto(ia-1)+1,lasto(ia)
2456+ ioa = iphorb(io)
2457+ rmaxo = max( rmaxo, rcut(is,ioa) )
2458+ enddo
2459+ enddo
2460+ rmax = rmaxo + rmaxkb
2461+
2462+C Initialize arrays Di and Vi only once
2463+ no = lasto(na)
2464+ nuotot = lasto(nua)
2465+
2466+ call GetNodeOrbs(nuotot,Node,Nodes,nuo)
2467+
2468+C Allocate local memory
2469+
2470+ nullify( Vi ) ! This is Vion
2471+ call re_alloc( Vi, 1, no, 'Vi', 'nlefsm_SO_off' )
2472+ Vi(1:no) = 0.0_dp
2473+
2474+ nullify( listed )
2475+ call re_alloc( listed, 1, no, 'listed', 'nlefsm_SO_off' )
2476+ listed(1:no) = .false.
2477+ nullify( listedall )
2478+ call re_alloc( listedall, 1, no, 'listedall', 'nlefsm_SO_off' )
2479+ listedall(1:no) = .false.
2480+
2481+ allocate( V_so(2,2,no) )
2482+
2483+ if (.not. matrix_elements_only) then
2484+ nullify( Di )
2485+ call re_alloc( Di, 1, no, 'Di', 'nlefsm_SO_off' )
2486+ Di(1:no) = 0.0_dp
2487+ allocate( Ds(2,2,no) )
2488+ endif
2489+
2490+C Make list of all orbitals needed for this node
2491+
2492+ do io = 1,nuo
2493+ call LocalToGlobalOrb(io,Node,Nodes,iio)
2494+ listedall(iio) = .true.
2495+ do j = 1,numh(io)
2496+ jo = listh(listhptr(io)+j)
2497+ listedall(jo) = .true.
2498+ enddo
2499+ enddo
2500+
2501+C Find maximum number of KB projectors of one atom = maxkba
2502+ maxkba = 0
2503+ do ka = 1,na
2504+ nkb = lastkb(ka) - lastkb(ka-1)
2505+ maxkba = max(maxkba,nkb)
2506+ enddo
2507+
2508+C Allocate local arrays that depend on saved parameters
2509+ nullify( iano )
2510+ call re_alloc( iano, 1, maxno, 'iano', 'nlefsm_SO_off' )
2511+ nullify( iono )
2512+ call re_alloc( iono, 1, maxno, 'iono', 'nlefsm_SO_off' )
2513+ nullify( xno )
2514+ call re_alloc( xno, 1, 3, 1, maxno, 'xno', 'nlefsm_SO_off' )
2515+ nullify( Ski )
2516+ call re_alloc( Ski, 1, maxkba, 1, maxno, 'Ski','nlefsm_SO_off')
2517+ nullify( grSki )
2518+ call re_alloc( grSki, 1, 3, 1, maxkba, 1, maxno, 'grSki',
2519+ & 'nlefsm_SO_off' )
2520+
2521+C Initialize neighb subroutine
2522+ call mneighb( scell, rmax, na, xa, 0, 0, nna )
2523+
2524+ nd= 0; ndn= 0
2525+ Enl = 0.0d0; E_offsiteSO(1:4)=dcmplx(0.0d0,0.0d0)
2526+ Enl_offsiteSO = 0.0d0
2527+C Loop on atoms with KB projectors
2528+ do ka = 1,na ! Supercell atoms
2529+ kua = indxua(ka) ! Equivalent atom in the UC
2530+ ks = isa(ka) ! Specie index of atom ka
2531+ nkb = lastkb(ka) - lastkb(ka-1) ! number of KB projs of atom ka
2532+
2533+C Find neighbour atoms
2534+ call mneighb( scell, rmax, na, xa, ka, 0, nna )
2535+
2536+C Find neighbour orbitals
2537+ Ski(:,:) = 0.0_dp
2538+ nno = 0; ; iano(:)=0; iono(:)=0
2539+ do ina = 1,nna ! Neighbour atoms
2540+ ia = iana(ina) ! Atom index of ina (the neighbour to ka)
2541+ is = isa(ia) ! Specie index of atom ia
2542+ rki = sqrt(r2ki(ina)) ! Square distance
2543+
2544+ do io = lasto(ia-1)+1,lasto(ia) ! Orbitals of atom ia
2545+
2546+C Only calculate if needed locally
2547+
2548+ if (listedall(io)) then
2549+ ioa = iphorb(io) ! Orbital index of orbital io in
2550+C neighbour atom ina
2551+
2552+C Find if orbital is within range
2553+ within = .false.
2554+ do ko = lastkb(ka-1)+1,lastkb(ka)
2555+ koa = iphKB(ko)
2556+ if ( rki .lt. rcut(is,ioa)+rcut(ks,koa) )
2557+ & within = .true.
2558+ enddo
2559+
2560+C Find overlap between neighbour orbitals and KB projectors
2561+ if (within) then
2562+C Check maxno - if too small then increase array sizes
2563+ if (nno.eq.maxno) then
2564+ maxno = maxno + 100
2565+ call re_alloc( iano, 1, maxno, 'iano', 'nlefsm_SO_off',
2566+ & .true. )
2567+ call re_alloc( iono, 1, maxno, 'iono', 'nlefsm_SO_off',
2568+ & .true. )
2569+ call re_alloc( xno, 1, 3, 1, maxno,'xno','nlefsm_SO_off',
2570+ & .true. )
2571+ call re_alloc( Ski, 1, maxkba, 1, maxno, 'Ski',
2572+ & 'nlefsm_SO_off', .true. )
2573+ call re_alloc( grSki, 1, 3, 1, maxkba, 1, maxno,
2574+ & 'grSki', 'nlefsm_SO_off', .true. )
2575+ endif
2576+ nno = nno + 1 ! Number of neighbour orbitals
2577+ iono(nno) = io ! io orbital of atom ina (neighbour to ka)
2578+ iano(nno) = ia ! atom index of the neighbour ina
2579+ xno(1:3,nno) = xki(1:3,ina)
2580+ ikb = 0
2581+ do ko = lastkb(ka-1)+1,lastkb(ka) !Generic positions of kb's
2582+ ikb = ikb + 1
2583+ ioa = iphorb(io)
2584+ koa = iphKB(ko) ! koa = -ikb
2585+
2586+ if ( koa.ne.-ikb ) then
2587+ write(6,*) 'koa ERROR: koa,ikb=',koa,ikb
2588+ stop
2589+ endif
2590+ kg = kbproj_gindex(ks,koa)
2591+ ig = orb_gindex(is,ioa)
2592+ call new_MATEL( 'S', kg, ig, xki(1:3,ina),
2593+ & Ski(ikb,nno), grSki(1:3,ikb,nno) )
2594+ enddo
2595+ endif ! Within
2596+
2597+ endif
2598+ enddo ! neighbour AO
2599+ enddo ! neighbour atoms
2600+
2601+C----- Loop on neighbour orbitals
2602+ do ino = 1,nno
2603+ io = iono(ino)
2604+ ia = iano(ino)
2605+
2606+ call GlobalToLocalOrb(io,Node,Nodes,iio)
2607+
2608+ if (iio.gt.0) then
2609+C Valid orbital
2610+ if (ia .le. nua) then
2611+ if (.not. matrix_elements_only) then
2612+ !Scatter density matrix row of orbital io
2613+ Ds(1:2,1:2,1:no) = dcmplx(0.0d0,0.0d0)
2614+ do j = 1,numh(iio)
2615+ ind = listhptr(iio)+j ! jptr
2616+ jo = listh(ind) ! j
2617+ Di(jo) = 0.0_dp
2618+ do ispin = 1,min(2,nspin) ! Only diagonal parts
2619+ Di(jo) = Di(jo) + Dscf(ind,ispin)
2620+ enddo
2621+ Ds(1,1,jo) = dcmplx(Dscf(ind,1), Dscf(ind,5)) ! D(ju,iu)
2622+ Ds(2,2,jo) = dcmplx(Dscf(ind,2), Dscf(ind,6)) ! D(jd,id)
2623+ Ds(1,2,jo) = dcmplx(Dscf(ind,3), Dscf(ind,4)) ! D(ju,id)
2624+ Ds(2,1,jo) = dcmplx(Dscf(ind,7),-Dscf(ind,8)) ! D(jd,iu)
2625+ enddo
2626+ endif
2627+
2628+C-------- Scatter filter of desired matrix elements
2629+ do j = 1,numh(iio)
2630+ jo = listh(listhptr(iio)+j)
2631+ listed(jo) = .true.
2632+ enddo
2633+
2634+C Loading V_ion/V_so
2635+ Vi(1:no) = 0.0_dp
2636+ V_so(1:2,1:2,1:no) = dcmplx(0.0d0,0.0d0)
2637+
2638+C-------- Find matrix elements with other neighbour orbitals
2639+ do jno = 1,nno
2640+ jo = iono(jno)
2641+
2642+ if (listed(jo)) then
2643+
2644+C---------- Loop on KB projectors
2645+ ko = lastkb(ka-1)
2646+ KB_loop: do
2647+ koa = -iphKB(ko+1)
2648+ spp => species(ks)
2649+ l = spp%pj_l(koa)
2650+
2651+c----------- Compute Vion
2652+ if ( l.eq.0 ) then
2653+ epsk(1) = epskb(ks,koa)
2654+ Vit = epsk(1) * Ski(koa,ino) * Ski(koa,jno)
2655+ Vi(jo) = Vi(jo) + Vit
2656+ if (.not. matrix_elements_only) then
2657+ Enl = Enl + Di(jo) * Vit
2658+ CVj = epsk(1) * Ski(koa,jno)
2659+ Cijk = 2.0_dp * Di(jo) * CVj
2660+ do ix = 1,3
2661+ fik = Cijk * grSki(ix,koa,ino)
2662+ fa(ix,ia) = fa(ix,ia) - fik
2663+ fa(ix,kua) = fa(ix,kua) + fik
2664+ do jx = 1,3
2665+ stress(jx,ix) = stress(jx,ix) +
2666+ & xno(jx,ino) * fik / volume
2667+ enddo
2668+ enddo
2669+ endif
2670+ ko = ko + 1
2671+
2672+c----------- Compute Vion from j+/-1/2 and V_so
2673+ else
2674+ koa1 = -iphKB(ko+1)
2675+ koa2 = -iphKB(ko+2*(2*l+1))
2676+ epsk(1) = epskb(ks,koa1)
2677+ epsk(2) = epskb(ks,koa2)
2678+
2679+ call calc_Vj_offsiteSO( l, epsk, Ski(koa1:koa2,ino),
2680+ & Ski(koa1:koa2,jno), grSki(:,koa1:koa2,ino),
2681+ & grSki(:,koa1:koa2,jno), Vit, V_sot, F_so )
2682+ Vi(jo) = Vi(jo) + Vit
2683+ V_so(1:2,1:2,jo)= V_so(1:2,1:2,jo) + V_sot(1:2,1:2)
2684+
2685+c------------ Forces & SO contribution to E_NL
2686+ if (.not. matrix_elements_only) then
2687+ Enl = Enl + Di(jo) * Vit
2688+
2689+ E_offsiteSO(1) = E_offsiteSO(1) + V_sot(1,1)*Ds(1,1,jo) ! V(iu,ju)*D(ju,iu)
2690+ E_offsiteSO(2) = E_offsiteSO(2) + V_sot(2,2)*Ds(2,2,jo) ! V(id,jd)*D(jd,id)
2691+ E_offsiteSO(3) = E_offsiteSO(3) + V_sot(1,2)*Ds(2,1,jo) ! V(iu,jd)*D(jd,iu)
2692+ E_offsiteSO(4) = E_offsiteSO(4) + V_sot(2,1)*Ds(1,2,jo) ! V(id,ju)*D(ju,id)
2693+
2694+ ! These forces include both the 'ion' and 'SO' parts
2695+ do ix = 1,3
2696+ fik = 2.0_dp*dreal(Ds(1,1,jo)*F_so(ix,1,1) +
2697+ & Ds(2,2,jo)*F_so(ix,2,2) +
2698+ & Ds(2,1,jo)*F_so(ix,1,2) +
2699+ & Ds(1,2,jo)*F_so(ix,2,1) )
2700+ fa(ix,ia) = fa(ix,ia) - fik
2701+ fa(ix,kua) = fa(ix,kua) + fik
2702+ do jx = 1,3
2703+ stress(jx,ix) = stress(jx,ix) +
2704+ & xno(jx,ino) * fik / volume
2705+ enddo
2706+ enddo
2707+ endif
2708+ ko = ko+2*(2*l+1)
2709+ endif
2710+ if ( ko.ge.lastkb(ka) ) exit KB_loop
2711+ enddo KB_loop
2712+
2713+ endif ! listed
2714+ enddo ! jno orbitals
2715+
2716+C-------- Pick up contributions to H and restore Di and Vi
2717+ do j = 1,numh(iio)
2718+ ind = listhptr(iio)+j
2719+ jo = listh(ind)
2720+ H0(ind) = H0(ind) + Vi(jo)
2721+ H0_off(ind,1) = H0_off(ind,1) + V_so(1,1,jo)
2722+ H0_off(ind,2) = H0_off(ind,2) + V_so(2,2,jo)
2723+ H0_off(ind,3) = H0_off(ind,3) + V_so(1,2,jo)
2724+ H0_off(ind,4) = H0_off(ind,4) + V_so(2,1,jo)
2725+
2726+
2727+C Careful with this Vi()
2728+ Vi(jo) = 0.0d0
2729+ listed(jo) = .false.
2730+ enddo
2731+ endif ! Atom in UC?
2732+
2733+ endif ! iio .gt. 0
2734+ enddo ! ino AOs
2735+ enddo ! atoms with KB projectors loop
2736+
2737+ if (.not. matrix_elements_only) then
2738+ Enl_offsiteSO = sum( dreal(E_offsiteSO(1:4)) )
2739+ endif
2740+
2741+C Deallocate local memory
2742+
2743+ call reset_neighbour_arrays( )
2744+ call de_alloc( grSki, 'grSki', 'nlefsm_SO_off' )
2745+ call de_alloc( Ski, 'Ski', 'nlefsm_SO_off' )
2746+ call de_alloc( xno, 'xno', 'nlefsm_SO_off' )
2747+ call de_alloc( iono, 'iono', 'nlefsm_SO_off' )
2748+ call de_alloc( iano, 'iano', 'nlefsm_SO_off' )
2749+
2750+ call de_alloc( listedall, 'listedall', 'nlefsm_SO_off' )
2751+ call de_alloc( listed, 'listed', 'nlefsm_SO_off' )
2752+ call de_alloc( Vi, 'Vi', 'nlefsm_SO_off' )
2753+ deallocate( V_so )
2754+
2755+ if (.not. matrix_elements_only) then
2756+ call de_alloc( Di, 'Di', 'nlefsm_SO_off' )
2757+ deallocate( Ds )
2758+ endif
2759+
2760+ call timer( 'nlefsm', 2 )
2761+
2762+ end subroutine nlefsm_SO_off
2763+
2764+c-----------------------------------------------------------------------
2765+c
2766+!> Evaluates:
2767+!! <i|V_NL|j>, where V_NL= Sum_{j,mj} |V,j,mj><V,j,mj|
2768+c
2769+c-----------------------------------------------------------------------
2770+ subroutine calc_Vj_offsiteSO( l, epskb, Ski, Skj, grSki, grSkj,
2771+ & V_ion, V_so, F_so )
2772+
2773+ implicit none
2774+
2775+ integer , intent(in) :: l
2776+ real(dp) , intent(in) :: epskb(2)
2777+ real(dp) , intent(in) :: Ski(-l:l,2), Skj(-l:l,2)
2778+ real(dp) , intent(in) :: grSki(3,-l:l,2), grSkj(3,-l:l,2)
2779+ real(dp) , intent(out) :: V_ion
2780+ complex(dp) , intent(out) :: F_so(3,2,2)
2781+ complex(dp) , intent(out) :: V_so(2,2)
2782+
2783+
2784+ integer :: J, ij, imj, m, is
2785+ real(dp) :: aj, amj, al, a2l1, fac, facm,
2786+ & epskpm, V_iont, cp, cm, facpm
2787+
2788+ real(dp) :: cg(2*(2*l+1),2)
2789+ complex(dp):: u(-l:l,-l:l)
2790+ complex(dp):: SVi(2), SVj(2), grSVi(3,2)
2791+
2792+ external :: die
2793+c-----------------------------------------------------------------------
2794+
2795+c---- set constants and factors
2796+ al = dble(l)
2797+ a2l1 = dble( 2*l+1 )
2798+
2799+c---- load Clebsch-Gordan coefficients; cg(J,+-)
2800+ J = 0
2801+ cg(:,:) = 0.0_dp
2802+ do ij = 1, 2
2803+ aj = al + (2*ij-3)*0.5d0 ! j(ij=1)=l-1/2; j(ij=2)=l+1/2
2804+ facpm= (-1.0d0)**(aj-al-0.5d0) ! +/- sign
2805+ do imj = 1, nint(2*aj)+1 ! Degeneracy for j
2806+ amj = -aj + dfloat(imj-1) ! mj value
2807+ J = J+1 ! (j,mj) index
2808+
2809+ cp = sqrt( (al+0.5d0+amj)/a2l1 )
2810+ cm = sqrt( (al+0.5d0-amj)/a2l1 )
2811+ if ( ij.eq. 1 ) then
2812+ cg(J,1) = cm*facpm ! <j-|up>
2813+ cg(J,2) = cp ! <j-|down>
2814+ else
2815+ cg(J,1) = cp*facpm ! <j+|up>
2816+ cg(J,2) = cm ! <j+|down>
2817+ endif
2818+ enddo
2819+ enddo
2820+
2821+c---- Ski(M)= <l,M|i> ; Si(m)= <l,m|i> = u(m,-M)*Ski(-M) + u(m,M)*Ski(M)
2822+ fac = 1.0d0/sqrt(2.0d0)
2823+ u(:,:) = cmplx(0.0d0,0.0d0)
2824+ u(0,0)= cmplx(1.0d0,0.0d0)
2825+ do m = 1, l
2826+ facm = fac*(-1.0d0)**m
2827+ u(-m,+M) = cmplx(1.0d0,0.0d0)*fac
2828+ u(-m,-M) = cmplx(0.0d0,1.0d0)*fac ! J. Cerda
2829+ u(+m,+M) = cmplx(1.0d0,0.0d0)*facm
2830+ u(+m,-M) =-cmplx(0.0d0,1.0d0)*facm ! J. Cerda
2831+ enddo
2832+
2833+c---- Load V_so
2834+ V_so= cmplx(0.0d0,0.0d0); F_so= cmplx(0.0d0,0.0d0)
2835+ J = 0
2836+ do ij = 1, 2
2837+ aj = al + (2*ij-3)*0.5d0 ! j value
2838+ do imj = 1, nint(2*aj)+1 ! Degeneracy for j
2839+ amj = -aj + dfloat(imj-1) ! mj value
2840+ J = J+1 ! (j,mj) index
2841+
2842+ SVi(1:2)= cmplx(0.0d0,0.0d0); SVj(1:2)= cmplx(0.0d0,0.0d0)
2843+ grSVi(1:3,1:2)= cmplx(0.0d0,0.0d0)
2844+ do is = 1, 2 ! spin loop
2845+
2846+c select correct m
2847+ if ( is.eq.1 ) then
2848+ m = nint(amj-0.5d0) ! up => m=mj-1/2
2849+ else
2850+ m = nint(amj+0.5d0) ! down => m=mj+1/2
2851+ endif
2852+
2853+ if ( iabs(m).le.l ) then
2854+ SVi(is)= Ski(+M,ij)*u(+m,M)
2855+ SVj(is)= Skj(+M,ij)*u(+m,M)
2856+ grSVi(1:3,is)= grSki(1:3,+M,ij)*u(+m,M)
2857+ if ( m.ne.0 ) then
2858+ SVi(is)= SVi(is) + Ski(-M,ij)*u(+m,-M)
2859+ SVj(is)= SVj(is) + Skj(-M,ij)*u(+m,-M)
2860+ grSVi(1:3,is)= grSVi(1:3,is) +
2861+ & grSki(1:3,-M,ij)*u(+m,-M)
2862+ endif
2863+ SVi(is) = SVi(is) * cg(J,is)
2864+ SVj(is) = SVj(is) * cg(J,is)
2865+
2866+ grSVi(1:3,is) = grSVi(1:3,is) * cg(J,is)
2867+ endif
2868+ enddo ! is
2869+
2870+c up-up = <i,+|V,J><V,J|j,+>
2871+ V_so(1,1) = V_so(1,1) + SVi(1) * epskb(ij) * conjg(SVj(1))
2872+ F_so(:,1,1)= F_so(:,1,1)+ grSVi(:,1) * epskb(ij) * conjg(SVj(1))
2873+
2874+c down-down = <i,-|V,J><V,J|j,->
2875+ V_so(2,2) = V_so(2,2) + SVi(2) * epskb(ij) * conjg(SVj(2))
2876+ F_so(:,2,2)= F_so(:,2,2)+ grSVi(:,2) * epskb(ij) * conjg(SVj(2))
2877+
2878+c up-down = <i,+|V,J><V,J|j,->
2879+ V_so(1,2) = V_so(1,2) + SVi(1) * epskb(ij) * conjg(SVj(2))
2880+ F_so(:,1,2)= F_so(:,1,2)+ grSVi(:,1) * epskb(ij) * conjg(SVj(2))
2881+
2882+c down-up= <i,-|V,J><V,J|j,+>
2883+ V_so(2,1) = V_so(2,1) + SVi(2) * epskb(ij) * conjg(SVj(1))
2884+ F_so(:,2,1)= F_so(:,2,1)+ grSVi(:,2) * epskb(ij) * conjg(SVj(1))
2885+
2886+ enddo ! mj
2887+ enddo ! ij
2888+
2889+cc--- debugging
2890+ if ( cdabs(V_so(1,2)+conjg(V_so(2,1))).gt.1.0d-4 ) then
2891+ write(6,'(a,2f12.6)') 'V_so(1,2)=',V_so(1,2)
2892+ write(6,'(a,2f12.6)') 'V_so(2,1)=',V_so(2,1)
2893+ call die('calc_Vj_LS: ERROR')
2894+ endif
2895+
2896+c---- substract out V_ion
2897+ epskpm = sqrt( epskb(1)*epskb(2) )
2898+ epskpm = sign(epskpm,epskb(1))
2899+
2900+ V_ion = 0.0d0
2901+ do M = -l, l
2902+ V_iont = ( l**2 * Ski(M,1)*epskb(1)*Skj(M,1)
2903+ & + (l+1)**2 * Ski(M,2)*epskb(2)*Skj(M,2)
2904+ & + l*(l+1) * Ski(M,1)*epskpm *Skj(M,2)
2905+ & + l*(l+1) * Ski(M,2)*epskpm *Skj(M,1) )/(a2l1**2)
2906+ V_ion = V_ion + V_iont
2907+ enddo
2908+
2909+ V_so(1,1) = V_so(1,1) - cmplx(1.0d0,0.0d0)*V_ion
2910+ V_so(2,2) = V_so(2,2) - cmplx(1.0d0,0.0d0)*V_ion
2911+
2912+ return
2913+ end subroutine calc_Vj_offsiteSO
2914+
2915 end module m_nlefsm
2916
2917=== modified file 'Src/setup_H0.F'
2918--- Src/setup_H0.F 2017-06-23 19:49:18 +0000
2919+++ Src/setup_H0.F 2018-04-27 22:12:28 +0000
2920@@ -17,9 +17,12 @@
2921
2922 USE siesta_options, only: g2cut
2923 use sparse_matrices, only: H_kin_1D, H_vkb_1D
2924- use sparse_matrices, only: H_so_2D
2925+ use sparse_matrices, only: H_so_on_2D, H_so_off_2D
2926 use sparse_matrices, only: Dscf
2927
2928+ use m_nlefsm, only: nlefsm_SO_off
2929+ use m_spin, only: spin
2930+
2931 use sparse_matrices, only: listh, listhptr, numh, maxnh
2932 use siesta_geom
2933 use atmfuncs, only: uion
2934@@ -40,6 +43,7 @@
2935 use alloc, only: re_alloc, de_alloc
2936 use class_dSpData1D, only: val
2937 use class_dSpData2D, only: val
2938+ use class_zSpData2D, only: val
2939
2940 #ifdef MPI
2941 use m_mpi_utils, only: globalize_sum
2942@@ -52,7 +56,16 @@
2943 real(dp) :: dummy_E
2944 integer :: ia, is
2945
2946- real(dp), pointer :: H_val(:), H_so(:,:)
2947+ real(dp) :: dummy_Eso
2948+ integer :: ispin, i, j
2949+ complex(dp) :: Dc
2950+#ifdef MPI
2951+ real(dp) :: buffer1
2952+#endif
2953+
2954+ real(dp), pointer :: H_val(:), H_so_on(:,:)
2955+ complex(dp), pointer :: H_so_off(:,:)
2956+
2957
2958 #ifdef DEBUG
2959 call write_debug( ' PRE setup_H0' )
2960@@ -113,15 +126,59 @@
2961 !$OMP parallel workshare default(shared)
2962 H_val(:) = 0.0_dp
2963 !$OMP end parallel workshare
2964- call nlefsm(scell, na_u, na_s, isa, xa, indxua,
2965- & maxnh, maxnh, lasto, lastkb, iphorb, iphKB,
2966- & numh, listhptr, listh, numh, listhptr, listh,
2967- & 1,
2968- & dummy_dm, dummy_E, dummy_fa, dummy_stress,
2969- & H_val,
2970- & matrix_elements_only=.true.)
2971-
2972-
2973+
2974+ Eso = 0.0d0
2975+
2976+ if ( .not.spin%SO_offsite ) then
2977+ call nlefsm(scell, na_u, na_s, isa, xa, indxua,
2978+ & maxnh, maxnh, lasto, lastkb, iphorb, iphKB,
2979+ & numh, listhptr, listh, numh, listhptr, listh,
2980+ & 1,
2981+ & dummy_dm, dummy_E, dummy_fa, dummy_stress,
2982+ & H_val,
2983+ & matrix_elements_only=.true.)
2984+ else
2985+ H_so_off => val(H_so_off_2D)
2986+ H_so_off = dcmplx(0._dp, 0._dp)
2987+ call nlefsm_SO_off(scell, na_u, na_s, isa, xa, indxua,
2988+ & maxnh, maxnh, lasto, lastkb, iphorb, iphKB,
2989+ & numh, listhptr, listh, numh, listhptr, listh,
2990+ & spin%Grid,
2991+ & dummy_E, dummy_Eso, dummy_fa,
2992+ & dummy_stress, H_val, H_so_off,
2993+ & matrix_elements_only=.true.)
2994+
2995+
2996+!
2997+! Dc IS NOT the dense matrix, it is just a complex number
2998+! (per each io index) used as an artifact to multiply the
2999+! elements of the H_SO times the corresponding elements of
3000+! DM in a such way that the result gives Re{Tr[H_SO*DM]}.
3001+!
3002+
3003+ do i = 1, maxnh
3004+
3005+!-------- Eso(u,u)
3006+ Dc = cmplx(Dscf(i,1),Dscf(i,5), dp)
3007+ Eso = Eso + real( H_so_off(i,1)*Dc, dp)
3008+!-------- Eso(d,d)
3009+ Dc = cmplx(Dscf(i,2),Dscf(i,6),dp)
3010+ Eso = Eso + real( H_so_off(i,2)*Dc, dp)
3011+!-------- Eso(u,d)
3012+ Dc = cmplx(Dscf(i,3),Dscf(i,4), dp)
3013+ Eso = Eso + real( H_so_off(i,4)*Dc, dp)
3014+!-------- Eso(d,u)
3015+ Dc = cmplx(Dscf(i,7),-Dscf(i,8), dp)
3016+ Eso = Eso + real( H_so_off(i,3)*Dc, dp)
3017+
3018+ enddo
3019+
3020+#ifdef MPI
3021+! Global reduction of Eso
3022+ call globalize_sum(Eso,buffer1)
3023+ Eso = buffer1
3024+#endif
3025+ endif
3026 ! ..................
3027
3028 ! If in the future the spin-orbit routine is able to compute
3029@@ -129,17 +186,14 @@
3030 ! computing forces and stresses, calling it in the first iteration
3031 ! should be enough
3032 !
3033- if ( spin%SO ) then
3034- H_so => val(H_so_2D)
3035+ if ( spin%SO_onsite ) then
3036+ H_so_on => val(H_so_on_2D)
3037 !$OMP parallel workshare default(shared)
3038- H_so = 0._dp
3039+ H_so_on(:,:) = 0._dp
3040 !$OMP end parallel workshare
3041 call spinorb(no_u,no_l,iaorb,iphorb,isa,indxuo,
3042- & maxnh,numh,listhptr,listh,Dscf,H_so,Eso)
3043- else
3044- Eso = 0._dp
3045+ & maxnh,numh,listhptr,listh,Dscf,H_so_on,Eso)
3046 end if
3047-
3048
3049 C This will take care of possible changes to the mesh and atomic-related
3050 C mesh structures for geometry changes
3051@@ -150,7 +204,7 @@
3052 & mscell, G2max, ntm,
3053 & maxnh, numh, listhptr, listh, datm,
3054 & dummy_fa, dummy_stress)
3055-
3056+
3057 call timer('Setup_H0',2)
3058
3059 #ifdef DEBUG
3060
3061=== modified file 'Src/setup_hamiltonian.F'
3062--- Src/setup_hamiltonian.F 2018-03-30 23:16:29 +0000
3063+++ Src/setup_hamiltonian.F 2018-04-27 22:12:28 +0000
3064@@ -14,12 +14,14 @@
3065
3066 USE siesta_options
3067 use sparse_matrices, only: H_kin_1D, H_vkb_1D
3068- use sparse_matrices, only: H_ldau_2D, H_so_2D
3069+ use sparse_matrices, only: H_ldau_2D
3070+ use sparse_matrices, only: H_so_on_2D, H_so_off_2D
3071 use sparse_matrices, only: listh, listhptr, numh, maxnh
3072 use sparse_matrices, only: H, S, Hold
3073 use sparse_matrices, only: Dscf, Escf, xijo
3074 use class_dSpData1D, only: val
3075 use class_dSpData2D, only: val
3076+ use class_zSpData2D, only: val
3077
3078 use siesta_geom
3079 use atmfuncs, only: uion
3080@@ -40,7 +42,9 @@
3081 use parallel, only: Node
3082 use m_steps, only: istp
3083 use m_ntm
3084- use m_spin, only: spin
3085+
3086+ use m_spin, only: spin
3087+
3088 use m_dipol
3089 use alloc, only: re_alloc, de_alloc
3090 use m_gamma
3091@@ -68,7 +72,12 @@
3092 type(filesOut_t) :: filesOut ! blank output file names
3093 logical :: use_rhog_in
3094
3095- real(dp), pointer :: H_vkb(:), H_kin(:), H_ldau(:,:), H_so(:,:)
3096+ real(dp), pointer :: H_vkb(:), H_kin(:), H_ldau(:,:)
3097+ real(dp), pointer :: H_so_on(:,:)
3098+ complex(dp), pointer:: H_so_off(:,:)
3099+
3100+ complex(dp):: Dc
3101+ integer :: ind, i, j
3102
3103 !------------------------------------------------------------------------- BEGIN
3104
3105@@ -84,53 +93,53 @@
3106 do ispin = 1, spin%H
3107 do io = 1,maxnh
3108 Hold(io,ispin) = H(io,ispin)
3109- enddo
3110- enddo
3111+ end do
3112+ end do
3113 !$OMP end do
3114
3115 !$OMP single
3116 H_kin => val(H_kin_1D)
3117 H_vkb => val(H_vkb_1D)
3118- if ( spin%SO ) then
3119- ! Sadly some compilers (g95), does
3120- ! not allow bounds for pointer assignments :(
3121- H_so => val(H_so_2D)
3122+
3123+ if ( spin%SO_onsite ) then
3124+ ! Sadly some compilers (g95), does
3125+ ! not allow bounds for pointer assignments :(
3126+ H_so_on => val(H_so_on_2D)
3127+
3128+ else if ( spin%SO_offsite ) then
3129+ H_so_off => val(H_so_off_2D)
3130+
3131 end if
3132 !$OMP end single ! keep wait
3133
3134- ! We do not need to set the non-spinor components
3135- ! For non-colinear they are set down below,
3136- ! while for spin-orbit they are set to the H_so initial
3137- ! spin-orbit.
3138-
3139+ ! Initialize diagonal Hamiltonian
3140 do ispin = 1, spin%spinor
3141 !$OMP do
3142- do io = 1,maxnh
3143- H(io,ispin) = H_kin(io) + H_vkb(io)
3144- end do
3145+ do io = 1,maxnh
3146+ H(io,ispin) = H_kin(io) + H_vkb(io)
3147+ end do
3148 !$OMP end do nowait
3149 end do
3150
3151- if ( spin%NCol ) then
3152-
3153-!$OMP do collapse(2)
3154- do ispin = 3 , spin%H
3155- do io = 1, maxnh
3156- H(io,ispin) = 0._dp
3157- end do
3158- end do
3159-!$OMP end do nowait
3160-
3161- else if ( spin%SO ) then
3162-
3163-!$OMP do collapse(2)
3164- do ispin = 3 , spin%H
3165- do io = 1, maxnh
3166- H(io,ispin) = H_so(io,ispin-2)
3167- end do
3168- end do
3169-!$OMP end do nowait
3170-
3171+ if ( spin%SO_onsite ) then
3172+!$OMP do collapse(2)
3173+ do ispin = 3 , spin%H
3174+ do io = 1,maxnh
3175+ H(io,ispin) = H_so_on(io,ispin-2)
3176+ end do
3177+ end do
3178+!$OMP end do nowait
3179+
3180+ else
3181+
3182+!$OMP do collapse(2)
3183+ do ispin = 3 , spin%H
3184+ do io = 1,maxnh
3185+ H(io,ispin) = 0._dp
3186+ end do
3187+ end do
3188+!$OMP end do nowait
3189+
3190 end if
3191
3192 ! ..................
3193@@ -146,6 +155,7 @@
3194 !$OMP single
3195 Ekin = 0.0_dp
3196 Enl = 0.0_dp
3197+ Eso = 0.0_dp
3198 !$OMP end single ! keep wait
3199
3200 !$OMP do collapse(2), reduction(+:Ekin,Enl)
3201@@ -157,21 +167,46 @@
3202 end do
3203 !$OMP end do nowait
3204
3205-!$OMP single
3206- Eso = 0._dp
3207-!$OMP end single
3208- if ( spin%SO ) then
3209+!
3210+! Dc IS NOT the dense matrix, it is just a complex number
3211+! (per each io index) used as an artifact to multiply the
3212+! elements of the H_SO times the corresponding elements of
3213+! DM in a such way that the result gives Re{Tr[H_SO*DM]}.
3214+!
3215+
3216+ if ( spin%SO_offsite ) then
3217+ do io = 1, maxnh
3218+
3219+!-------- Eso(u,u)
3220+ Dc = cmplx(Dscf(io,1),Dscf(io,5), dp)
3221+ Eso = Eso + real( H_so_off(io,1)*Dc, dp)
3222+!-------- Eso(d,d)
3223+ Dc = cmplx(Dscf(io,2),Dscf(io,6), dp)
3224+ Eso = Eso + real( H_so_off(io,2)*Dc, dp)
3225+!-------- Eso(u,d)
3226+ Dc = cmplx(Dscf(io,3),Dscf(io,4), dp)
3227+ Eso = Eso + real( H_so_off(io,4)*Dc, dp)
3228+!-------- Eso(d,u)
3229+ Dc = cmplx(Dscf(io,7),-Dscf(io,8), dp)
3230+ Eso = Eso + real( H_so_off(io,3)*Dc, dp)
3231+
3232+ end do
3233+
3234+ else if ( spin%SO_onsite ) then
3235+
3236 !$OMP do reduction(+:Eso)
3237 do io = 1, maxnh
3238- Eso = Eso + H_so(io,1)*Dscf(io,7) + H_so(io,2)*Dscf(io,8)
3239- . + H_so(io,5)*Dscf(io,3) + H_so(io,6)*Dscf(io,4)
3240- . - H_so(io,3)*Dscf(io,5) - H_so(io,4)*Dscf(io,6)
3241+ Eso = Eso + H_so_on(io,1)*Dscf(io,7) +
3242+ & H_so_on(io,2)*Dscf(io,8)+ H_so_on(io,5)*Dscf(io,3) +
3243+ & H_so_on(io,6)*Dscf(io,4)- H_so_on(io,3)*Dscf(io,5) -
3244+ & H_so_on(io,4)*Dscf(io,6)
3245 end do
3246 !$OMP end do nowait
3247- end if
3248+
3249+ end if
3250
3251 !$OMP end parallel
3252-
3253+
3254 #ifdef MPI
3255 ! Global reduction of Ekin, Enl
3256 call globalize_sum(Ekin,buffer1)
3257@@ -191,7 +226,7 @@
3258 ! Hubbard term for LDA+U: energy, forces, stress and matrix elements ....
3259 if( switch_ldau ) then
3260 if ( spin%NCol ) then
3261- call die('LDA+U cannot be used with non-colinear spin.')
3262+ call die('LDA+U cannot be used with non-collinear spin.')
3263 end if
3264 if ( spin%SO ) then
3265 call die('LDA+U cannot be used with spin-orbit coupling.')
3266@@ -243,6 +278,25 @@
3267 . Exc, Dxc, dipol, stress, fal, stressl,
3268 . use_rhog_in)
3269
3270+ if ( spin%SO_offsite ) then
3271+
3272+! H(:, [5, 6]) are not updated in dhscf, see vmat for details.
3273+
3274+!------- H(u,u)
3275+ H(:,1) = H(:,1) + real(H_so_off(:,1), dp)
3276+ H(:,5) = dimag(H_so_off(:,1))
3277+!------- H(d,d)
3278+ H(:,2) = H(:,2) + real(H_so_off(:,2), dp)
3279+ H(:,6) = dimag(H_so_off(:,2))
3280+!------- H(u,d)
3281+ H(:,3) = H(:,3) + real(H_so_off(:,3), dp)
3282+ H(:,4) = H(:,4) +dimag(H_so_off(:,3))
3283+!------- H(d,u)
3284+ H(:,7) = H(:,7) + real(H_so_off(:,4), dp)
3285+ H(:,8) = H(:,8) -dimag(H_so_off(:,4))
3286+
3287+ endif
3288+
3289 ! This statement will apply to iscf = 1, for example, when
3290 ! we do not use rhog_in. Rhog here is always the charge used to
3291 ! build H, that is, rhog_in.
3292
3293=== modified file 'Src/siesta_options.F90'
3294--- Src/siesta_options.F90 2018-04-17 13:07:32 +0000
3295+++ Src/siesta_options.F90 2018-04-27 22:12:28 +0000
3296@@ -27,7 +27,6 @@
3297 ! -- pre 4.0 coordinate output logic -- to be implemented
3298 logical :: compat_pre_v4_dynamics ! General switch
3299
3300-
3301 logical :: mix_scf_first ! Mix first SCF step?
3302 logical :: mix_charge ! New: mix fourier components of rho
3303 logical :: mixH ! Mix H instead of DM
3304@@ -234,7 +233,7 @@
3305 real(dp) :: total_spin ! Total spin used in spin-polarized calculations
3306 real(dp) :: tt ! Target temperature. Read in redata. Used in dynamics rout.
3307 real(dp) :: wmix ! Mixing weight for DM in SCF iteration
3308- real(dp) :: wmixkick ! Mixing weight for DM in special 'kick' SCF steps
3309+ real(dp) :: wmixkick ! Mixing weight for DM in special 'kick' SCF steps
3310
3311 character(len=164) :: sname ! System name, used to initialise read
3312
3313@@ -250,5 +249,5 @@
3314 ! LUA-handle
3315 type(luaState) :: LUA
3316 #endif
3317-
3318+
3319 END MODULE siesta_options
3320
3321=== modified file 'Src/sparse_matrices.F'
3322--- Src/sparse_matrices.F 2016-08-18 10:36:36 +0000
3323+++ Src/sparse_matrices.F 2018-04-27 22:12:28 +0000
3324@@ -9,6 +9,7 @@
3325 use precision
3326 use class_dSpData1D
3327 use class_dSpData2D
3328+ use class_zSpData2D
3329 use class_Sparsity
3330 use class_OrbitalDistribution
3331 use class_Fstack_Pair_Geometry_dSpData2D
3332@@ -31,12 +32,16 @@
3333
3334 real(dp), public, pointer :: xijo(:,:)=>null()
3335
3336+ complex(dp), public, pointer :: H0_offsiteSO(:,:) => null()
3337
3338 ! Pieces of H that do not depend on the SCF density matrix
3339 ! Formerly there was a single array H0 for this
3340 type(dSpData1D), public, save :: H_vkb_1D, H_kin_1D
3341 ! LDA+U and spin-orbit coupling Hamiltonian
3342- type(dSpData2D), public, save :: H_ldau_2D, H_so_2D
3343+ type(dSpData2D), public, save :: H_ldau_2D, H_so_on_2D
3344+ ! Spin-orbit off-site
3345+ type(zSpData2D), public, save :: H_so_off_2D
3346+
3347
3348 ! New interface data
3349 type(Sparsity), public, save :: sparse_pattern
3350@@ -54,7 +59,7 @@
3351 CONTAINS
3352
3353 subroutine resetSparseMatrices( )
3354- use alloc, only : de_alloc
3355+ use alloc, only : de_alloc
3356
3357 implicit none
3358
3359@@ -65,7 +70,8 @@
3360 call delete( H_kin_1D )
3361 call delete( H_vkb_1D )
3362 call delete( H_ldau_2D )
3363- call delete( H_so_2D )
3364+ call delete( H_so_on_2D )
3365+ call delete( H_so_off_2D )
3366
3367 call delete( DM_2D ) ; nullify(Dscf)
3368 call delete( EDM_2D ) ; nullify(Escf)
3369
3370=== modified file 'Src/spinorbit.f'
3371--- Src/spinorbit.f 2017-10-26 10:42:57 +0000
3372+++ Src/spinorbit.f 2018-04-27 22:12:28 +0000
3373@@ -38,7 +38,6 @@
3374 use precision, only: dp
3375 use atmfuncs
3376 use atm_types
3377- use fdf, only: fdf_get
3378 use parallel, only: Node, Nodes
3379 use parallelsubs, only: LocalToGlobalOrb
3380
3381@@ -53,7 +52,6 @@
3382 ! indexing technology)
3383
3384 logical, save :: vso_setup = .false.
3385- real(dp), save :: so_strength = 1.0_dp
3386
3387 integer, pointer, save :: nr(:)
3388 real(dp), pointer, save :: vso(:,:,:)
3389@@ -73,7 +71,6 @@
3390 use atmparams, only: lmaxd
3391 use parallel, only: Node
3392 use m_mpi_utils, only: broadcast
3393- use sys, only: die
3394
3395 integer :: is, mx_nrval, li, ir, iup
3396 real(dp) :: a, b, rpb, ea
3397@@ -132,7 +129,8 @@
3398 enddo
3399 write(6,"(/)")
3400 if (.not. there_are_so_potentials) then
3401- call die("No spin-orbit components for any species!!")
3402+ write(6,"(a)") "*** WARNING: No spin-orbit components " //
3403+ $ "for any species... "
3404 endif
3405 endif
3406
3407@@ -140,8 +138,6 @@
3408 call broadcast(r)
3409 call broadcast(drdi)
3410
3411- so_strength = fdf_get('SpinOrbitStrength',1.0_dp)
3412-
3413 end subroutine init_vso
3414
3415 !------------------------------------------------
3416@@ -174,6 +170,7 @@
3417 C *********************************************************************
3418 C
3419 use m_mpi_utils, only: globalize_sum
3420+
3421 implicit none
3422
3423 C Arguments
3424@@ -238,7 +235,7 @@
3425
3426 call int_so_rad(is, li, joa, ioa, int_rad)
3427 call int_so_ang(li, mj, mi, int_ang(:))
3428- Hso_ji(:)=so_strength*int_rad*int_ang(:)
3429+ Hso_ji(:) = int_rad * int_ang(:)
3430
3431 H(ind,3) = H(ind,3) + Hso_ji(2)
3432 H(ind,4) = H(ind,4) + Hso_ji(3)
3433
3434=== modified file 'Src/state_analysis.F'
3435--- Src/state_analysis.F 2018-04-19 08:46:09 +0000
3436+++ Src/state_analysis.F 2018-04-27 22:12:28 +0000
3437@@ -22,7 +22,7 @@
3438 & CartesianForce_to_ZmatForce
3439 use atomlist, only : iaorb, iphorb, amass, no_u, lasto
3440 use atomlist, only : indxuo
3441- use m_spin, only : nspin, SpOrb
3442+ use m_spin, only : spin
3443 use m_fixed, only : fixed
3444 use sparse_matrices
3445 use siesta_geom
3446@@ -167,7 +167,7 @@
3447 endif
3448
3449 ! Population and moment analysis
3450- if ( SpOrb .and. orbmoms) then
3451+ if ( spin%SO .and. orbmoms) then
3452 call moments( 1, na_u, no_u, maxnh, numh, listhptr,
3453 . listh, S, Dscf, isa, lasto, iaorb, iphorb,
3454 . indxuo )
3455
3456=== modified file 'Src/state_init.F'
3457--- Src/state_init.F 2018-04-15 14:49:37 +0000
3458+++ Src/state_init.F 2018-04-27 22:12:28 +0000
3459@@ -27,7 +27,8 @@
3460 use sparse_matrices, only: S , S_1D
3461
3462 use sparse_matrices, only: H_kin_1D, H_vkb_1D
3463- use sparse_matrices, only: H_ldau_2D, H_so_2D
3464+ use sparse_matrices, only: H_ldau_2D
3465+ use sparse_matrices, only: H_so_on_2D, H_so_off_2D
3466
3467 use sparse_matrices, only: sparse_pattern
3468 use sparse_matrices, only: block_dist, single_dist
3469@@ -98,6 +99,7 @@
3470 use class_Sparsity
3471 use class_dSpData1D
3472 use class_dSpData2D
3473+ use class_zSpData2D
3474 use class_dData2D
3475 #ifdef TEST_IO
3476 use m_test_io
3477@@ -138,7 +140,6 @@
3478 type(dData2D) :: tmp_2D
3479 real(dp) :: dummy_qspin(8)
3480
3481-
3482 !------------------------------------------------------------------- BEGIN
3483 call timer( 'IterGeom', 1 )
3484 #ifdef DEBUG
3485@@ -339,6 +340,7 @@
3486 ! be higher than 1, hence we need to create "fake"
3487 ! containers and let the new<class> delete the old
3488 ! sparsity pattern
3489+
3490 nullify(numh,listhptr,listh)
3491 allocate(numh(no_l),listhptr(no_l))
3492 ! We do not need to allocate listh
3493@@ -562,11 +564,15 @@
3494 end if
3495 end if
3496
3497- if ( spin%SO ) then
3498- write(oname,"(a,i0)") "H_so at geom step ", istep
3499- call newdSpData2D(sparse_pattern,spin%H - 2,
3500- & block_dist,H_so_2D,name=oname)
3501- end if
3502+ if ( spin%SO_onsite ) then
3503+ write(oname,"(a,i0)") "H_so (onsite) at geom step ", istep
3504+ call newdSpData2D(sparse_pattern,spin%H - 2,
3505+ & block_dist,H_so_on_2D,name=oname)
3506+ else if ( spin%SO_offsite ) then
3507+ write(oname,"(a,i0)") "H_so (offsite) at geom step ", istep
3508+ call newzSpData2D(sparse_pattern,4,
3509+ & block_dist,H_so_off_2D,name=oname)
3510+ endif
3511
3512 write(oname,"(a,i0)") "S at geom step ", istep
3513 call newdSpData1D(sparse_pattern,block_dist,S_1D,name=oname)
3514@@ -585,6 +591,7 @@
3515 ! Initialize density matrix
3516 ! The resizing of Dscf is done inside new_dm
3517 call new_DM(auxchanged, DM_history, DM_2D, EDM_2D)
3518+
3519 Dscf => val(DM_2D)
3520 Escf => val(EDM_2D)
3521 if (spin%H > 1) call print_spin(dummy_qspin)
3522
3523=== added directory 'Tests/FePt_soc'
3524=== added file 'Tests/FePt_soc/FePt_soc.fdf'
3525--- Tests/FePt_soc/FePt_soc.fdf 1970-01-01 00:00:00 +0000
3526+++ Tests/FePt_soc/FePt_soc.fdf 2018-04-27 22:12:28 +0000
3527@@ -0,0 +1,65 @@
3528+#
3529+# -- Caution: quality parameters set artificially low !
3530+#
3531+SystemName FePt distorted bulk structure -- soc test
3532+SystemLabel FePt_soc
3533+NumberOfAtoms 2
3534+NumberOfSpecies 2
3535+%block Chemical_Species_label
3536+ 1 26 Fe_fept_SOC
3537+ 2 78 Pt_fept_SOC
3538+%endblock Chemical_Species_label
3539+
3540+Spin SO
3541+
3542+%block DM.InitSpin
3543+ 1 +2. 90. 90.
3544+ 2 +1. 90. 90.
3545+%endblock DM.InitSpin
3546+
3547+LatticeConstant 1.0 Ang
3548+%block LatticeVectors
3549+ 2.793068700 0.000000000 0.000000000
3550+ 0.000000000 2.70 0.000000000
3551+ 0.000000000 0.000000000 3.792000000
3552+%endblock LatticeVectors
3553+
3554+AtomicCoordinatesFormat NotScaledCartesianAng
3555+%block AtomicCoordinatesAndAtomicSpecies
3556+ 1.396535500 1.45 0.000000000 1
3557+ 0.000000000 0.000000000 1.896000000 2
3558+%endblock AtomicCoordinatesAndAtomicSpecies
3559+
3560+%Block PAO.Basis
3561+ Fe_fept_SOC 2
3562+ n=4 0 2 P
3563+ 0.0 0.0
3564+ n=3 2 2
3565+ 0.0 0.0
3566+ Pt_fept_SOC 2
3567+ n=6 0 2 P
3568+ 0.0 0.0
3569+ n=5 2 2
3570+ 0.0 0.0
3571+%EndBlock PAO.Basis
3572+
3573+%block kgrid_Monkhorst_Pack
3574+ 3 0 0 0.0
3575+ 0 5 0 0.0
3576+ 0 0 5 0.0
3577+%endblock kgrid_Monkhorst_Pack
3578+
3579+xc.functional GGA
3580+xc.authors PBE
3581+MeshCutoff 400. Ry
3582+SolutionMethod diagon
3583+
3584+DM.Tolerance 1.0E-4
3585+MaxSCFIterations 6
3586+scf-must-converge F
3587+DM.MixingWeight 0.01
3588+DM.NumberPulay 4
3589+scf-mix-spin all
3590+
3591+MullikenInSCF T
3592+WriteForces T
3593
3594=== added file 'Tests/FePt_soc/FePt_soc.pseudos'
3595--- Tests/FePt_soc/FePt_soc.pseudos 1970-01-01 00:00:00 +0000
3596+++ Tests/FePt_soc/FePt_soc.pseudos 2018-04-27 22:12:28 +0000
3597@@ -0,0 +1,2 @@
3598+Fe_fept_SOC
3599+Pt_fept_SOC
3600
3601=== added file 'Tests/FePt_soc/makefile'
3602--- Tests/FePt_soc/makefile 1970-01-01 00:00:00 +0000
3603+++ Tests/FePt_soc/makefile 2018-04-27 22:12:28 +0000
3604@@ -0,0 +1,2 @@
3605+name=FePt_soc
3606+include ../test.mk
3607
3608=== modified file 'Tests/Makefile'
3609--- Tests/Makefile 2018-04-25 11:39:40 +0000
3610+++ Tests/Makefile 2018-04-27 22:12:28 +0000
3611@@ -28,7 +28,7 @@
3612 # for a serial run.
3613 #
3614 # It is also possible to have separate working directories,
3615-# by using the a "label". For example:
3616+# by using a "label". For example:
3617 #
3618 # make label=finer
3619 #
3620@@ -75,12 +75,8 @@
3621 # sih-pexsi-spin
3622 # TranSiesta-TBTrans
3623
3624-# These tests are extremely time consuming and
3625-# should only be runned sometimes
3626-# Currently they may be runned individually.
3627-# SOC_FePt_xx SOC_FePt_xz SOC_FePt_zy SOC_FePt_zz
3628-tests_soc = SOC_Pt2_xx SOC_Pt2_xz SOC_Pt2_zy SOC_Pt2_zz
3629-tests_soc += SOC_FePt_xx SOC_FePt_xz SOC_FePt_zy SOC_FePt_zz
3630+# SOC tests
3631+tests_soc = ge_soc_bands Pt_dimer_soc FePt_soc
3632
3633 # Tests only applicable for LUA
3634 tests_lua = lua_si111 lua_h2o
3635
3636=== added directory 'Tests/More_SOC_Examples'
3637=== added file 'Tests/More_SOC_Examples/README'
3638--- Tests/More_SOC_Examples/README 1970-01-01 00:00:00 +0000
3639+++ Tests/More_SOC_Examples/README 2018-04-27 22:12:28 +0000
3640@@ -0,0 +1,10 @@
3641+These are examples of computation of the Magnetic Anisotropy Energy (MAE)
3642+and other checks for two systems: a Pt dimer, and a FePt bulk structure.
3643+
3644+Note that to run the tests automatically you have to move a specific directory
3645+one level up in the hierarchy:
3646+
3647+ mv offsite_SOC_FePt_xz ..
3648+ cd ../offsite_SOC_FePt_xz
3649+ make
3650+
3651
3652=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx'
3653=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.fdf'
3654--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.fdf 1970-01-01 00:00:00 +0000
3655+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.fdf 2018-04-27 22:12:28 +0000
3656@@ -0,0 +1,72 @@
3657+SystemName FePt-L1_0
3658+SystemLabel FePtxx
3659+NumberOfAtoms 2
3660+NumberOfSpecies 2
3661+%block Chemical_Species_label
3662+ 1 26 Fe_fept_SOC
3663+ 2 78 Pt_fept_SOC
3664+%endblock Chemical_Species_label
3665+
3666+PAO.EnergyShift 100 meV
3667+PAO.SplitNorm 0.15
3668+PAO.OldStylePolOrbs F
3669+Restricted.Radial.Grid F
3670+%Block PAO.Basis
3671+ Fe_fept_SOC 2
3672+ n=4 0 2 P
3673+ 0.0 0.0
3674+ n=3 2 2
3675+ 0.0 0.0
3676+ Pt_fept_SOC 2
3677+ n=6 0 2 P
3678+ 0.0 0.0
3679+ n=5 2 2
3680+ 0.0 0.0
3681+%EndBlock PAO.Basis
3682+
3683+AtomicCoordinatesFormat NotScaledCartesianAng
3684+%block LatticeVectors
3685+ 3.792000000 0.000000000 0.000000000
3686+ 0.000000000 2.793068700 0.000000000
3687+ 0.000000000 0.000000000 2.793068700
3688+%endblock LatticeVectors
3689+LatticeConstant 1.0 Ang
3690+
3691+%block AtomicCoordinatesAndAtomicSpecies
3692+ 0.000000000 1.396535500 1.396535500 1
3693+ 1.896000000 0.000000000 0.000000000 2
3694+%endblock AtomicCoordinatesAndAtomicSpecies
3695+
3696+Spin SO
3697+
3698+%block DM.InitSpin
3699+ 1 +2. 90. 0.
3700+ 2 +1. 90. 0.
3701+%endblock DM.InitSpin
3702+
3703+
3704+%block kgrid_Monkhorst_Pack
3705+ 11 0 0 0.0
3706+ 0 21 0 0.0
3707+ 0 0 21 0.0
3708+%endblock kgrid_Monkhorst_Pack
3709+
3710+xc.functional GGA
3711+xc.authors PBE
3712+MeshCutoff 1400. Ry
3713+SolutionMethod diagon
3714+ElectronicTemperature 1 meV
3715+
3716+DM.Tolerance 1.0E-5
3717+MaxSCFIterations 600
3718+DM.MixingWeight 0.005
3719+DM.NumberPulay 8
3720+DM.UseSaveDM T
3721+DM.MixSCF1 F
3722+DM.NumberKick 25
3723+#Diag.DivideAndConquer F
3724+MixHamiltonian T
3725+
3726+MullikenInSCF T
3727+WriteForces T
3728+WriteCoorStep T
3729
3730=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.pseudos'
3731--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.pseudos 1970-01-01 00:00:00 +0000
3732+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.pseudos 2018-04-27 22:12:28 +0000
3733@@ -0,0 +1,2 @@
3734+Fe_fept_SOC
3735+Pt_fept_SOC
3736
3737=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/README'
3738--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/README 1970-01-01 00:00:00 +0000
3739+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/README 2018-04-27 22:12:28 +0000
3740@@ -0,0 +1,33 @@
3741+Ramon Cuadrado del Burgo - March 7, 2016
3742+
3743+ The present test performs fully-relativistic simulation of FePt-L1_0 structure
3744+placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
3745+By means of the calculation of the total selfconsistent energy it is possible to
3746+obtain the magnetic anisotropy energy (MAE) checking in addition that:
3747+
3748+ * X-alignment:
3749+
3750+ 1) The total SC energy for x-axis spin orientation corresponds to the
3751+ lower value: E_x < E_y = E_z => x-axis = Easy axis
3752+
3753+ 2) The total SC energy for y-axis and z-axis spin orientation have the
3754+ same value and they are larger than x-axis SC total energy:
3755+ E_y = E_z => y/z-axis = Hard axes
3756+
3757+ * Z-alignment:
3758+
3759+ 1) The total SC energy for z-axis spin orientation corresponds to the
3760+ lower value: E_z < E_x = E_y => z-axis = Easy axis
3761+
3762+ 2) The total SC energy for x-axis and y-axis spin orientation have the
3763+ same value and they are larger than z-axis SC total energy:
3764+ E_x = E_y => x/y-axis = Hard axes
3765+
3766+ For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
3767+configurations have to have the same values when the system is rotated in space:
3768+
3769+ a) E_x(X-alignment) = E_z(Z-alignment)
3770+ E_y(X-alignment) = E_x(Z-alignment)
3771+ E_z(X-alignment) = E_y(Z-alignment)
3772+
3773+ b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
3774
3775=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/makefile'
3776--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/makefile 1970-01-01 00:00:00 +0000
3777+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/makefile 2018-04-27 22:12:28 +0000
3778@@ -0,0 +1,2 @@
3779+name=FePtxx
3780+include ../test.mk
3781
3782=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx'
3783=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.fdf'
3784--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.fdf 1970-01-01 00:00:00 +0000
3785+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.fdf 2018-04-27 22:12:28 +0000
3786@@ -0,0 +1,74 @@
3787+SystemName SOC FePt X-alignment x
3788+SystemLabel FePtxx
3789+
3790+Spin SO
3791+%block DM.InitSpin
3792+ 1 +2. 90. 0.
3793+ 2 +1. 90. 0.
3794+%endblock DM.InitSpin
3795+
3796+NumberOfAtoms 2
3797+NumberOfSpecies 2
3798+%block Chemical_Species_label
3799+ 1 26 Fe
3800+ 2 78 Pt
3801+%endblock Chemical_Species_label
3802+
3803+PAO.EnergyShift 100 meV
3804+PAO.SplitNorm 0.15
3805+PAO.OldStylePolOrbs F
3806+Restricted.Radial.Grid F
3807+%Block PAO.Basis
3808+ Fe 2
3809+ n=4 0 2 P
3810+ 0.0 0.0
3811+ n=3 2 2
3812+ 0.0 0.0
3813+ Pt 2
3814+ n=6 0 2 P
3815+ 0.00000 0.00000
3816+ n=5 2 2
3817+ 0.00000 0.00000
3818+%EndBlock PAO.Basis
3819+
3820+AtomicCoordinatesFormat NotScaledCartesianAng
3821+LatticeConstant 1.0 Ang
3822+%block LatticeVectors
3823+ 3.792000000 0.000000000 0.000000000
3824+ 0.000000000 2.793068700 0.000000000
3825+ 0.000000000 0.000000000 2.793068700
3826+%endblock LatticeVectors
3827+
3828+%block AtomicCoordinatesAndAtomicSpecies
3829+ 0.000000000 1.396535500 1.396535500 1
3830+ 1.896000000 0.000000000 0.000000000 2
3831+%endblock AtomicCoordinatesAndAtomicSpecies
3832+
3833+%block kgrid_Monkhorst_Pack
3834+ 11 0 0 0.0
3835+ 0 21 0 0.0
3836+ 0 0 21 0.0
3837+%endblock kgrid_Monkhorst_Pack
3838+
3839+XC.functional GGA
3840+XC.authors PBE
3841+
3842+MeshCutoff 1400. Ry
3843+
3844+SolutionMethod diagon
3845+
3846+ElectronicTemperature 1 meV
3847+
3848+DM.Tolerance 1.0E-5
3849+
3850+MaxSCFIterations 1000
3851+
3852+DM.MixingWeight 0.005
3853+DM.NumberPulay 8
3854+DM.UseSaveDM T
3855+DM.NumberKick 25
3856+DM.MixSCF1 F
3857+
3858+WriteMullikenPop 1
3859+WriteForces T
3860+WriteCoorStep T
3861
3862=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.pseudos'
3863--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.pseudos 1970-01-01 00:00:00 +0000
3864+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.pseudos 2018-04-27 22:12:28 +0000
3865@@ -0,0 +1,2 @@
3866+Fe_SOC
3867+Pt_SOC
3868
3869=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/README'
3870--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/README 1970-01-01 00:00:00 +0000
3871+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/README 2018-04-27 22:12:28 +0000
3872@@ -0,0 +1,33 @@
3873+Ramon Cuadrado del Burgo - March 7, 2016
3874+
3875+ The present test performs fully-relativistic simulation of FePt-L1_0 structure
3876+placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
3877+By means of the calculation of the total selfconsistent energy it is possible to
3878+obtain the magnetic anisotropy energy (MAE) checking in addition that:
3879+
3880+ * X-alignment:
3881+
3882+ 1) The total SC energy for x-axis spin orientation corresponds to the
3883+ lower value: E_x < E_y = E_z => x-axis = Easy axis
3884+
3885+ 2) The total SC energy for y-axis and z-axis spin orientation have the
3886+ same value and they are larger than x-axis SC total energy:
3887+ E_y = E_z => y/z-axis = Hard axes
3888+
3889+ * Z-alignment:
3890+
3891+ 1) The total SC energy for z-axis spin orientation corresponds to the
3892+ lower value: E_z < E_x = E_y => z-axis = Easy axis
3893+
3894+ 2) The total SC energy for x-axis and y-axis spin orientation have the
3895+ same value and they are larger than z-axis SC total energy:
3896+ E_x = E_y => x/y-axis = Hard axes
3897+
3898+ For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
3899+configurations have to have the same values when the system is rotated in space:
3900+
3901+ a) E_x(X-alignment) = E_z(Z-alignment)
3902+ E_y(X-alignment) = E_x(Z-alignment)
3903+ E_z(X-alignment) = E_y(Z-alignment)
3904+
3905+ b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
3906
3907=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/makefile'
3908--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/makefile 1970-01-01 00:00:00 +0000
3909+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/makefile 2018-04-27 22:12:28 +0000
3910@@ -0,0 +1,2 @@
3911+name=FePtxx
3912+include ../test.mk
3913
3914=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz'
3915=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.fdf'
3916--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.fdf 1970-01-01 00:00:00 +0000
3917+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.fdf 2018-04-27 22:12:28 +0000
3918@@ -0,0 +1,72 @@
3919+SystemName FePt-L1_0
3920+SystemLabel FePtxz
3921+NumberOfAtoms 2
3922+NumberOfSpecies 2
3923+%block Chemical_Species_label
3924+ 1 26 Fe_fept_SOC
3925+ 2 78 Pt_fept_SOC
3926+%endblock Chemical_Species_label
3927+
3928+PAO.EnergyShift 100 meV
3929+PAO.SplitNorm 0.15
3930+PAO.OldStylePolOrbs F
3931+Restricted.Radial.Grid F
3932+%Block PAO.Basis
3933+ Fe_fept_SOC 2
3934+ n=4 0 2 P
3935+ 0.0 0.0
3936+ n=3 2 2
3937+ 0.0 0.0
3938+ Pt_fept_SOC 2
3939+ n=6 0 2 P
3940+ 0.0 0.0
3941+ n=5 2 2
3942+ 0.0 0.0
3943+%EndBlock PAO.Basis
3944+
3945+AtomicCoordinatesFormat NotScaledCartesianAng
3946+%block LatticeVectors
3947+ 3.792000000 0.000000000 0.000000000
3948+ 0.000000000 2.793068700 0.000000000
3949+ 0.000000000 0.000000000 2.793068700
3950+%endblock LatticeVectors
3951+LatticeConstant 1.0 Ang
3952+
3953+%block AtomicCoordinatesAndAtomicSpecies
3954+ 0.000000000 1.396535500 1.396535500 1
3955+ 1.896000000 0.000000000 0.000000000 2
3956+%endblock AtomicCoordinatesAndAtomicSpecies
3957+
3958+Spin SO
3959+
3960+#%block DM.InitSpin
3961+# 1 +2. 0. 0.
3962+# 2 +1. 0. 0.
3963+#%endblock DM.InitSpin
3964+
3965+
3966+%block kgrid_Monkhorst_Pack
3967+ 11 0 0 0.0
3968+ 0 21 0 0.0
3969+ 0 0 21 0.0
3970+%endblock kgrid_Monkhorst_Pack
3971+
3972+xc.functional GGA
3973+xc.authors PBE
3974+MeshCutoff 1400. Ry
3975+SolutionMethod diagon
3976+ElectronicTemperature 1 meV
3977+
3978+DM.Tolerance 1.0E-5
3979+MaxSCFIterations 600
3980+DM.MixingWeight 0.005
3981+DM.NumberPulay 8
3982+DM.UseSaveDM T
3983+DM.MixSCF1 F
3984+DM.NumberKick 25
3985+#Diag.DivideAndConquer F
3986+MixHamiltonian T
3987+
3988+MullikenInSCF T
3989+WriteForces T
3990+WriteCoorStep T
3991
3992=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.pseudos'
3993--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.pseudos 1970-01-01 00:00:00 +0000
3994+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.pseudos 2018-04-27 22:12:28 +0000
3995@@ -0,0 +1,2 @@
3996+Fe_fept_SOC
3997+Pt_fept_SOC
3998
3999=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/README'
4000--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/README 1970-01-01 00:00:00 +0000
4001+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/README 2018-04-27 22:12:28 +0000
4002@@ -0,0 +1,33 @@
4003+Ramon Cuadrado del Burgo - March 7, 2016
4004+
4005+ The present test performs fully-relativistic simulation of FePt-L1_0 structure
4006+placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
4007+By means of the calculation of the total selfconsistent energy it is possible to
4008+obtain the magnetic anisotropy energy (MAE) checking in addition that:
4009+
4010+ * X-alignment:
4011+
4012+ 1) The total SC energy for x-axis spin orientation corresponds to the
4013+ lower value: E_x < E_y = E_z => x-axis = Easy axis
4014+
4015+ 2) The total SC energy for y-axis and z-axis spin orientation have the
4016+ same value and they are larger than x-axis SC total energy:
4017+ E_y = E_z => y/z-axis = Hard axes
4018+
4019+ * Z-alignment:
4020+
4021+ 1) The total SC energy for z-axis spin orientation corresponds to the
4022+ lower value: E_z < E_x = E_y => z-axis = Easy axis
4023+
4024+ 2) The total SC energy for x-axis and y-axis spin orientation have the
4025+ same value and they are larger than z-axis SC total energy:
4026+ E_x = E_y => x/y-axis = Hard axes
4027+
4028+ For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
4029+configurations have to have the same values when the system is rotated in space:
4030+
4031+ a) E_x(X-alignment) = E_z(Z-alignment)
4032+ E_y(X-alignment) = E_x(Z-alignment)
4033+ E_z(X-alignment) = E_y(Z-alignment)
4034+
4035+ b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
4036
4037=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/makefile'
4038--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/makefile 1970-01-01 00:00:00 +0000
4039+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/makefile 2018-04-27 22:12:28 +0000
4040@@ -0,0 +1,2 @@
4041+name=FePtxz
4042+include ../test.mk
4043
4044=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz'
4045=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.fdf'
4046--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.fdf 1970-01-01 00:00:00 +0000
4047+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.fdf 2018-04-27 22:12:28 +0000
4048@@ -0,0 +1,70 @@
4049+SystemName SOC FePt X-alignment z
4050+SystemLabel FePtxz
4051+
4052+Spin SO
4053+
4054+NumberOfAtoms 2
4055+NumberOfSpecies 2
4056+%block Chemical_Species_label
4057+ 1 26 Fe
4058+ 2 78 Pt
4059+%endblock Chemical_Species_label
4060+
4061+PAO.EnergyShift 100 meV
4062+PAO.SplitNorm 0.15
4063+PAO.OldStylePolOrbs F
4064+Restricted.Radial.Grid F
4065+%Block PAO.Basis
4066+ Fe 2
4067+ n=4 0 2 P
4068+ 0.0 0.0
4069+ n=3 2 2
4070+ 0.0 0.0
4071+ Pt 2
4072+ n=6 0 2 P
4073+ 0.00000 0.00000
4074+ n=5 2 2
4075+ 0.00000 0.00000
4076+%EndBlock PAO.Basis
4077+
4078+AtomicCoordinatesFormat NotScaledCartesianAng
4079+LatticeConstant 1.0 Ang
4080+%block LatticeVectors
4081+ 3.792000000 0.000000000 0.000000000
4082+ 0.000000000 2.793068700 0.000000000
4083+ 0.000000000 0.000000000 2.793068700
4084+%endblock LatticeVectors
4085+
4086+%block AtomicCoordinatesAndAtomicSpecies
4087+ 0.000000000 1.396535500 1.396535500 1
4088+ 1.896000000 0.000000000 0.000000000 2
4089+%endblock AtomicCoordinatesAndAtomicSpecies
4090+
4091+%block kgrid_Monkhorst_Pack
4092+ 11 0 0 0.5
4093+ 0 21 0 0.0
4094+ 0 0 21 0.0
4095+%endblock kgrid_Monkhorst_Pack
4096+
4097+XC.functional GGA
4098+XC.authors PBE
4099+
4100+MeshCutoff 1400. Ry
4101+
4102+SolutionMethod diagon
4103+
4104+ElectronicTemperature 1 meV
4105+
4106+DM.Tolerance 1.0E-5
4107+
4108+MaxSCFIterations 1000
4109+
4110+DM.MixingWeight 0.005
4111+DM.NumberPulay 8
4112+DM.UseSaveDM T
4113+DM.NumberKick 25
4114+DM.MixSCF1 F
4115+
4116+WriteMullikenPop 1
4117+WriteForces T
4118+WriteCoorStep T
4119
4120=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.pseudos'
4121--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.pseudos 1970-01-01 00:00:00 +0000
4122+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.pseudos 2018-04-27 22:12:28 +0000
4123@@ -0,0 +1,2 @@
4124+Fe_SOC
4125+Pt_SOC
4126
4127=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/README'
4128--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/README 1970-01-01 00:00:00 +0000
4129+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/README 2018-04-27 22:12:28 +0000
4130@@ -0,0 +1,33 @@
4131+Ramon Cuadrado del Burgo - March 7, 2016
4132+
4133+ The present test performs fully-relativistic simulation of FePt-L1_0 structure
4134+placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
4135+By means of the calculation of the total selfconsistent energy it is possible to
4136+obtain the magnetic anisotropy energy (MAE) checking in addition that:
4137+
4138+ * X-alignment:
4139+
4140+ 1) The total SC energy for x-axis spin orientation corresponds to the
4141+ lower value: E_x < E_y = E_z => x-axis = Easy axis
4142+
4143+ 2) The total SC energy for y-axis and z-axis spin orientation have the
4144+ same value and they are larger than x-axis SC total energy:
4145+ E_y = E_z => y/z-axis = Hard axes
4146+
4147+ * Z-alignment:
4148+
4149+ 1) The total SC energy for z-axis spin orientation corresponds to the
4150+ lower value: E_z < E_x = E_y => z-axis = Easy axis
4151+
4152+ 2) The total SC energy for x-axis and y-axis spin orientation have the
4153+ same value and they are larger than z-axis SC total energy:
4154+ E_x = E_y => x/y-axis = Hard axes
4155+
4156+ For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
4157+configurations have to have the same values when the system is rotated in space:
4158+
4159+ a) E_x(X-alignment) = E_z(Z-alignment)
4160+ E_y(X-alignment) = E_x(Z-alignment)
4161+ E_z(X-alignment) = E_y(Z-alignment)
4162+
4163+ b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
4164
4165=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/makefile'
4166--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/makefile 1970-01-01 00:00:00 +0000
4167+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/makefile 2018-04-27 22:12:28 +0000
4168@@ -0,0 +1,2 @@
4169+name=FePtxz
4170+include ../test.mk
4171
4172=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy'
4173=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.fdf'
4174--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.fdf 1970-01-01 00:00:00 +0000
4175+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.fdf 2018-04-27 22:12:28 +0000
4176@@ -0,0 +1,72 @@
4177+SystemName FePt-L1_0
4178+SystemLabel FePtzy
4179+NumberOfAtoms 2
4180+NumberOfSpecies 2
4181+%block Chemical_Species_label
4182+ 1 26 Fe_fept_SOC
4183+ 2 78 Pt_fept_SOC
4184+%endblock Chemical_Species_label
4185+
4186+PAO.EnergyShift 100 meV
4187+PAO.SplitNorm 0.15
4188+PAO.OldStylePolOrbs F
4189+Restricted.Radial.Grid F
4190+%Block PAO.Basis
4191+ Fe_fept_SOC 2
4192+ n=4 0 2 P
4193+ 0.0 0.0
4194+ n=3 2 2
4195+ 0.0 0.0
4196+ Pt_fept_SOC 2
4197+ n=6 0 2 P
4198+ 0.0 0.0
4199+ n=5 2 2
4200+ 0.0 0.0
4201+%EndBlock PAO.Basis
4202+
4203+AtomicCoordinatesFormat NotScaledCartesianAng
4204+%block LatticeVectors
4205+ 2.793068700 0.000000000 0.000000000
4206+ 0.000000000 2.793068700 0.000000000
4207+ 0.000000000 0.000000000 3.792000000
4208+%endblock LatticeVectors
4209+LatticeConstant 1.0 Ang
4210+
4211+%block AtomicCoordinatesAndAtomicSpecies
4212+ 1.396535500 1.396535500 0.000000000 1
4213+ 0.000000000 0.000000000 1.896000000 2
4214+%endblock AtomicCoordinatesAndAtomicSpecies
4215+
4216+Spin SO
4217+
4218+%block DM.InitSpin
4219+ 1 +2. 90. 90.
4220+ 2 +1. 90. 90.
4221+%endblock DM.InitSpin
4222+
4223+
4224+%block kgrid_Monkhorst_Pack
4225+ 21 0 0 0.0
4226+ 0 21 0 0.0
4227+ 0 0 11 0.0
4228+%endblock kgrid_Monkhorst_Pack
4229+
4230+xc.functional GGA
4231+xc.authors PBE
4232+MeshCutoff 1400. Ry
4233+SolutionMethod diagon
4234+ElectronicTemperature 1 meV
4235+
4236+DM.Tolerance 1.0E-5
4237+MaxSCFIterations 600
4238+DM.MixingWeight 0.005
4239+DM.NumberPulay 8
4240+DM.UseSaveDM T
4241+DM.MixSCF1 F
4242+DM.NumberKick 25
4243+#Diag.DivideAndConquer F
4244+MixHamiltonian T
4245+
4246+MullikenInSCF T
4247+WriteForces T
4248+WriteCoorStep T
4249
4250=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.pseudos'
4251--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.pseudos 1970-01-01 00:00:00 +0000
4252+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.pseudos 2018-04-27 22:12:28 +0000
4253@@ -0,0 +1,2 @@
4254+Fe_fept_SOC
4255+Pt_fept_SOC
4256
4257=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/README'
4258--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/README 1970-01-01 00:00:00 +0000
4259+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/README 2018-04-27 22:12:28 +0000
4260@@ -0,0 +1,33 @@
4261+Ramon Cuadrado del Burgo - March 7, 2016
4262+
4263+ The present test performs fully-relativistic simulation of FePt-L1_0 structure
4264+placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
4265+By means of the calculation of the total selfconsistent energy it is possible to
4266+obtain the magnetic anisotropy energy (MAE) checking in addition that:
4267+
4268+ * X-alignment:
4269+
4270+ 1) The total SC energy for x-axis spin orientation corresponds to the
4271+ lower value: E_x < E_y = E_z => x-axis = Easy axis
4272+
4273+ 2) The total SC energy for y-axis and z-axis spin orientation have the
4274+ same value and they are larger than x-axis SC total energy:
4275+ E_y = E_z => y/z-axis = Hard axes
4276+
4277+ * Z-alignment:
4278+
4279+ 1) The total SC energy for z-axis spin orientation corresponds to the
4280+ lower value: E_z < E_x = E_y => z-axis = Easy axis
4281+
4282+ 2) The total SC energy for x-axis and y-axis spin orientation have the
4283+ same value and they are larger than z-axis SC total energy:
4284+ E_x = E_y => x/y-axis = Hard axes
4285+
4286+ For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
4287+configurations have to have the same values when the system is rotated in space:
4288+
4289+ a) E_x(X-alignment) = E_z(Z-alignment)
4290+ E_y(X-alignment) = E_x(Z-alignment)
4291+ E_z(X-alignment) = E_y(Z-alignment)
4292+
4293+ b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
4294
4295=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/makefile'
4296--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/makefile 1970-01-01 00:00:00 +0000
4297+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/makefile 2018-04-27 22:12:28 +0000
4298@@ -0,0 +1,2 @@
4299+name=FePtzy
4300+include ../test.mk
4301
4302=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy'
4303=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.fdf'
4304--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.fdf 1970-01-01 00:00:00 +0000
4305+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.fdf 2018-04-27 22:12:28 +0000
4306@@ -0,0 +1,68 @@
4307+SystemName FePt-L1_0
4308+SystemLabel FePtzy
4309+NumberOfAtoms 2
4310+NumberOfSpecies 2
4311+%block Chemical_Species_label
4312+ 1 26 Fe
4313+ 2 78 Pt
4314+%endblock Chemical_Species_label
4315+
4316+PAO.EnergyShift 100 meV
4317+PAO.SplitNorm 0.15
4318+PAO.OldStylePolOrbs F
4319+Restricted.Radial.Grid F
4320+%Block PAO.Basis
4321+ Fe 2
4322+ n=4 0 2 P
4323+ 0.0 0.0
4324+ n=3 2 2
4325+ 0.0 0.0
4326+ Pt 2
4327+ n=6 0 2 P
4328+ 0.0 0.0
4329+ n=5 2 2
4330+ 0.0 0.0
4331+%EndBlock PAO.Basis
4332+
4333+AtomicCoordinatesFormat NotScaledCartesianAng
4334+%block LatticeVectors
4335+ 2.793068700 0.000000000 0.000000000
4336+ 0.000000000 2.793068700 0.000000000
4337+ 0.000000000 0.000000000 3.792000000
4338+%endblock LatticeVectors
4339+LatticeConstant 1.0 Ang
4340+
4341+%block AtomicCoordinatesAndAtomicSpecies
4342+ 1.396535500 1.396535500 0.000000000 1
4343+ 0.000000000 0.000000000 1.896000000 2
4344+%endblock AtomicCoordinatesAndAtomicSpecies
4345+
4346+Spin SO
4347+%block DM.InitSpin
4348+ 1 +2. 90. 90.
4349+ 2 +1. 90. 90.
4350+%endblock DM.InitSpin
4351+
4352+%block kgrid_Monkhorst_Pack
4353+ 21 0 0 0.0
4354+ 0 21 0 0.0
4355+ 0 0 11 0.0
4356+%endblock kgrid_Monkhorst_Pack
4357+
4358+xc.functional GGA
4359+xc.authors PBE
4360+MeshCutoff 1400. Ry
4361+SolutionMethod diagon
4362+ElectronicTemperature 1 meV
4363+
4364+DM.Tolerance 1.0E-5
4365+MaxSCFIterations 600
4366+DM.MixingWeight 0.005
4367+DM.NumberPulay 8
4368+DM.UseSaveDM T
4369+DM.MixSCF1 F
4370+DM.NumberKick 25
4371+
4372+WriteMullikenPop 1
4373+WriteForces T
4374+WriteCoorStep T
4375
4376=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.pseudos'
4377--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.pseudos 1970-01-01 00:00:00 +0000
4378+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.pseudos 2018-04-27 22:12:28 +0000
4379@@ -0,0 +1,2 @@
4380+Fe_SOC
4381+Pt_SOC
4382
4383=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/README'
4384--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/README 1970-01-01 00:00:00 +0000
4385+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/README 2018-04-27 22:12:28 +0000
4386@@ -0,0 +1,33 @@
4387+Ramon Cuadrado del Burgo - March 7, 2016
4388+
4389+ The present test performs fully-relativistic simulation of FePt-L1_0 structure
4390+placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
4391+By means of the calculation of the total selfconsistent energy it is possible to
4392+obtain the magnetic anisotropy energy (MAE) checking in addition that:
4393+
4394+ * X-alignment:
4395+
4396+ 1) The total SC energy for x-axis spin orientation corresponds to the
4397+ lower value: E_x < E_y = E_z => x-axis = Easy axis
4398+
4399+ 2) The total SC energy for y-axis and z-axis spin orientation have the
4400+ same value and they are larger than x-axis SC total energy:
4401+ E_y = E_z => y/z-axis = Hard axes
4402+
4403+ * Z-alignment:
4404+
4405+ 1) The total SC energy for z-axis spin orientation corresponds to the
4406+ lower value: E_z < E_x = E_y => z-axis = Easy axis
4407+
4408+ 2) The total SC energy for x-axis and y-axis spin orientation have the
4409+ same value and they are larger than z-axis SC total energy:
4410+ E_x = E_y => x/y-axis = Hard axes
4411+
4412+ For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
4413+configurations have to have the same values when the system is rotated in space:
4414+
4415+ a) E_x(X-alignment) = E_z(Z-alignment)
4416+ E_y(X-alignment) = E_x(Z-alignment)
4417+ E_z(X-alignment) = E_y(Z-alignment)
4418+
4419+ b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
4420
4421=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/makefile'
4422--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/makefile 1970-01-01 00:00:00 +0000
4423+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/makefile 2018-04-27 22:12:28 +0000
4424@@ -0,0 +1,2 @@
4425+name=FePtzy
4426+include ../test.mk
4427
4428=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz'
4429=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.fdf'
4430--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.fdf 1970-01-01 00:00:00 +0000
4431+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.fdf 2018-04-27 22:12:28 +0000
4432@@ -0,0 +1,72 @@
4433+SystemName FePt-L1_0
4434+SystemLabel FePtzz
4435+NumberOfAtoms 2
4436+NumberOfSpecies 2
4437+%block Chemical_Species_label
4438+ 1 26 Fe_fept_SOC
4439+ 2 78 Pt_fept_SOC
4440+%endblock Chemical_Species_label
4441+
4442+PAO.EnergyShift 100 meV
4443+PAO.SplitNorm 0.15
4444+PAO.OldStylePolOrbs F
4445+Restricted.Radial.Grid F
4446+%Block PAO.Basis
4447+ Fe_fept_SOC 2
4448+ n=4 0 2 P
4449+ 0.0 0.0
4450+ n=3 2 2
4451+ 0.0 0.0
4452+ Pt_fept_SOC 2
4453+ n=6 0 2 P
4454+ 0.0 0.0
4455+ n=5 2 2
4456+ 0.0 0.0
4457+%EndBlock PAO.Basis
4458+
4459+AtomicCoordinatesFormat NotScaledCartesianAng
4460+%block LatticeVectors
4461+ 2.793068700 0.000000000 0.000000000
4462+ 0.000000000 2.793068700 0.000000000
4463+ 0.000000000 0.000000000 3.792000000
4464+%endblock LatticeVectors
4465+LatticeConstant 1.0 Ang
4466+
4467+%block AtomicCoordinatesAndAtomicSpecies
4468+ 1.396535500 1.396535500 0.000000000 1
4469+ 0.000000000 0.000000000 1.896000000 2
4470+%endblock AtomicCoordinatesAndAtomicSpecies
4471+
4472+Spin SO
4473+
4474+#%block DM.InitSpin
4475+# 1 +2. 90. 0.
4476+# 2 +1. 90. 0.
4477+#%endblock DM.InitSpin
4478+
4479+
4480+%block kgrid_Monkhorst_Pack
4481+ 21 0 0 0.0
4482+ 0 21 0 0.0
4483+ 0 0 11 0.0
4484+%endblock kgrid_Monkhorst_Pack
4485+
4486+xc.functional GGA
4487+xc.authors PBE
4488+MeshCutoff 1400. Ry
4489+SolutionMethod diagon
4490+ElectronicTemperature 1 meV
4491+
4492+DM.Tolerance 1.0E-5
4493+MaxSCFIterations 600
4494+DM.MixingWeight 0.005
4495+DM.NumberPulay 8
4496+DM.UseSaveDM T
4497+DM.MixSCF1 F
4498+DM.NumberKick 25
4499+#Diag.DivideAndConquer F
4500+MixHamiltonian T
4501+
4502+MullikenInSCF T
4503+WriteForces T
4504+WriteCoorStep T
4505
4506=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.pseudos'
4507--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.pseudos 1970-01-01 00:00:00 +0000
4508+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.pseudos 2018-04-27 22:12:28 +0000
4509@@ -0,0 +1,2 @@
4510+Fe_fept_SOC
4511+Pt_fept_SOC
4512
4513=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/README'
4514--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/README 1970-01-01 00:00:00 +0000
4515+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/README 2018-04-27 22:12:28 +0000
4516@@ -0,0 +1,33 @@
4517+Ramon Cuadrado del Burgo - March 7, 2016
4518+
4519+ The present test performs fully-relativistic simulation of FePt-L1_0 structure
4520+placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
4521+By means of the calculation of the total selfconsistent energy it is possible to
4522+obtain the magnetic anisotropy energy (MAE) checking in addition that:
4523+
4524+ * X-alignment:
4525+
4526+ 1) The total SC energy for x-axis spin orientation corresponds to the
4527+ lower value: E_x < E_y = E_z => x-axis = Easy axis
4528+
4529+ 2) The total SC energy for y-axis and z-axis spin orientation have the
4530+ same value and they are larger than x-axis SC total energy:
4531+ E_y = E_z => y/z-axis = Hard axes
4532+
4533+ * Z-alignment:
4534+
4535+ 1) The total SC energy for z-axis spin orientation corresponds to the
4536+ lower value: E_z < E_x = E_y => z-axis = Easy axis
4537+
4538+ 2) The total SC energy for x-axis and y-axis spin orientation have the
4539+ same value and they are larger than z-axis SC total energy:
4540+ E_x = E_y => x/y-axis = Hard axes
4541+
4542+ For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
4543+configurations have to have the same values when the system is rotated in space:
4544+
4545+ a) E_x(X-alignment) = E_z(Z-alignment)
4546+ E_y(X-alignment) = E_x(Z-alignment)
4547+ E_z(X-alignment) = E_y(Z-alignment)
4548+
4549+ b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
4550
4551=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/makefile'
4552--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/makefile 1970-01-01 00:00:00 +0000
4553+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/makefile 2018-04-27 22:12:28 +0000
4554@@ -0,0 +1,2 @@
4555+name=FePtzz
4556+include ../test.mk
4557
4558=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz'
4559=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.fdf'
4560--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.fdf 1970-01-01 00:00:00 +0000
4561+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.fdf 2018-04-27 22:12:28 +0000
4562@@ -0,0 +1,64 @@
4563+SystemName FePt-L1_0
4564+SystemLabel FePtzz
4565+NumberOfAtoms 2
4566+NumberOfSpecies 2
4567+%block Chemical_Species_label
4568+ 1 26 Fe
4569+ 2 78 Pt
4570+%endblock Chemical_Species_label
4571+
4572+PAO.EnergyShift 100 meV
4573+PAO.SplitNorm 0.15
4574+PAO.OldStylePolOrbs F
4575+Restricted.Radial.Grid F
4576+%Block PAO.Basis
4577+ Fe 2
4578+ n=4 0 2 P
4579+ 0.0 0.0
4580+ n=3 2 2
4581+ 0.0 0.0
4582+ Pt 2
4583+ n=6 0 2 P
4584+ 0.0 0.0
4585+ n=5 2 2
4586+ 0.0 0.0
4587+%EndBlock PAO.Basis
4588+
4589+AtomicCoordinatesFormat NotScaledCartesianAng
4590+%block LatticeVectors
4591+ 2.793068700 0.000000000 0.000000000
4592+ 0.000000000 2.793068700 0.000000000
4593+ 0.000000000 0.000000000 3.792000000
4594+%endblock LatticeVectors
4595+LatticeConstant 1.0 Ang
4596+
4597+%block AtomicCoordinatesAndAtomicSpecies
4598+ 1.396535500 1.396535500 0.000000000 1
4599+ 0.000000000 0.000000000 1.896000000 2
4600+%endblock AtomicCoordinatesAndAtomicSpecies
4601+
4602+Spin SO
4603+
4604+%block kgrid_Monkhorst_Pack
4605+ 21 0 0 0.0
4606+ 0 21 0 0.0
4607+ 0 0 11 0.0
4608+%endblock kgrid_Monkhorst_Pack
4609+
4610+xc.functional GGA
4611+xc.authors PBE
4612+MeshCutoff 1400. Ry
4613+SolutionMethod diagon
4614+ElectronicTemperature 1 meV
4615+
4616+DM.Tolerance 1.0E-5
4617+MaxSCFIterations 600
4618+DM.MixingWeight 0.005
4619+DM.NumberPulay 8
4620+DM.UseSaveDM T
4621+DM.MixSCF1 F
4622+DM.NumberKick 25
4623+
4624+WriteMullikenPop 1
4625+WriteForces T
4626+WriteCoorStep T
4627
4628=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.pseudos'
4629--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.pseudos 1970-01-01 00:00:00 +0000
4630+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.pseudos 2018-04-27 22:12:28 +0000
4631@@ -0,0 +1,2 @@
4632+Fe_SOC
4633+Pt_SOC
4634
4635=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/README'
4636--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/README 1970-01-01 00:00:00 +0000
4637+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/README 2018-04-27 22:12:28 +0000
4638@@ -0,0 +1,33 @@
4639+Ramon Cuadrado del Burgo - March 7, 2016
4640+
4641+ The present test performs fully-relativistic simulation of FePt-L1_0 structure
4642+placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
4643+By means of the calculation of the total selfconsistent energy it is possible to
4644+obtain the magnetic anisotropy energy (MAE) checking in addition that:
4645+
4646+ * X-alignment:
4647+
4648+ 1) The total SC energy for x-axis spin orientation corresponds to the
4649+ lower value: E_x < E_y = E_z => x-axis = Easy axis
4650+
4651+ 2) The total SC energy for y-axis and z-axis spin orientation have the
4652+ same value and they are larger than x-axis SC total energy:
4653+ E_y = E_z => y/z-axis = Hard axes
4654+
4655+ * Z-alignment:
4656+
4657+ 1) The total SC energy for z-axis spin orientation corresponds to the
4658+ lower value: E_z < E_x = E_y => z-axis = Easy axis
4659+
4660+ 2) The total SC energy for x-axis and y-axis spin orientation have the
4661+ same value and they are larger than z-axis SC total energy:
4662+ E_x = E_y => x/y-axis = Hard axes
4663+
4664+ For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
4665+configurations have to have the same values when the system is rotated in space:
4666+
4667+ a) E_x(X-alignment) = E_z(Z-alignment)
4668+ E_y(X-alignment) = E_x(Z-alignment)
4669+ E_z(X-alignment) = E_y(Z-alignment)
4670+
4671+ b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
4672
4673=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/makefile'
4674--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/makefile 1970-01-01 00:00:00 +0000
4675+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/makefile 2018-04-27 22:12:28 +0000
4676@@ -0,0 +1,2 @@
4677+name=FePtzz
4678+include ../test.mk
4679
4680=== added directory 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xx'
4681=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.fdf'
4682--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.fdf 1970-01-01 00:00:00 +0000
4683+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.fdf 2018-04-27 22:12:28 +0000
4684@@ -0,0 +1,64 @@
4685+SystemName Pt2 x-alignment x
4686+SystemLabel Pt2xx
4687+
4688+Spin SO
4689+
4690+%block DM.InitSpin
4691+ 1 +1. 90. 0.
4692+ 2 +1. 90. 0.
4693+%endblock DM.InitSpin
4694+
4695+NumberOfAtoms 2
4696+NumberOfSpecies 1
4697+%block Chemical_Species_label
4698+ 1 78 Pt_pt2_SOC
4699+%endblock Chemical_Species_label
4700+
4701+PAO.EnergyShift 100 meV
4702+PAO.SplitNorm 0.15
4703+PAO.OldStylePolOrbs F
4704+Restricted.Radial.Grid F
4705+%Block PAO.Basis
4706+Pt_pt2_SOC 2
4707+ n=6 0 2 P 1
4708+ 7.158 6.085
4709+ 1.000 1.000
4710+ n=5 2 2
4711+ 5.044 3.098
4712+ 1.000 1.000
4713+%EndBlock PAO.Basis
4714+
4715+AtomicCoordinatesFormat NotScaledCartesianAng
4716+LatticeConstant 20.0 Ang
4717+%block LatticeVectors
4718+ 1.00 .00 .00
4719+ .00 1.00 .00
4720+ .00 .00 1.00
4721+%endblock LatticeVectors
4722+
4723+%block AtomicCoordinatesAndAtomicSpecies
4724+ -1.19940 0.00000 0.00000 1
4725+ 1.19940 0.00000 0.00000 1
4726+%endblock AtomicCoordinatesAndAtomicSpecies
4727+
4728+XC.functional GGA
4729+XC.authors PBE
4730+
4731+MeshCutoff 500. Ry
4732+
4733+SolutionMethod diagon
4734+
4735+ElectronicTemperature 1 meV
4736+DM.Tolerance 1.0E-6
4737+MaxSCFIterations 1000
4738+DM.MixingWeight 0.005
4739+DM.MixSCF1 F
4740+MixHamiltonian T
4741+DM.NumberPulay 6
4742+DM.NumberKick 25
4743+DM.UseSaveDM T
4744+
4745+WriteMullikenPop 1
4746+WriteEigenvalues T
4747+WriteForces T
4748+WriteCoorStep T
4749
4750=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.pseudos'
4751--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.pseudos 1970-01-01 00:00:00 +0000
4752+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.pseudos 2018-04-27 22:12:28 +0000
4753@@ -0,0 +1,1 @@
4754+Pt_pt2_SOC
4755
4756=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/README'
4757--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/README 1970-01-01 00:00:00 +0000
4758+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/README 2018-04-27 22:12:28 +0000
4759@@ -0,0 +1,34 @@
4760+Ramon Cuadrado del Burgo - March 7, 2016
4761+
4762+ The present test performs fully-relativistic simulation of Pt2 dimer
4763+placed along X and Z axes, X-alignment and Z-alignment, respectively.
4764+By means of the calculation of the total selfconsistent energy it is
4765+possible to obtain the magnetic anisotropy energy (MAE) checking in
4766+addition that:
4767+
4768+ * X-alignment:
4769+
4770+ 1) The total SC energy for x-axis spin orientation corresponds to the
4771+ lower value: E_x < E_y = E_z => x-axis = Easy axis
4772+
4773+ 2) The total SC energy for y-axis and z-axis spin orientation have the
4774+ same value and they are larger than x-axis SC total energy:
4775+ E_y = E_z => y/z-axis = Hard axes
4776+
4777+ * Z-alignment:
4778+
4779+ 1) The total SC energy for z-axis spin orientation corresponds to the
4780+ lower value: E_z < E_x = E_y => z-axis = Easy axis
4781+
4782+ 2) The total SC energy for x-axis and y-axis spin orientation have the
4783+ same value and they are larger than z-axis SC total energy:
4784+ E_x = E_y => x/y-axis = Hard axes
4785+
4786+ For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
4787+configurations have to have the same values when the dimer is rotated in space:
4788+
4789+ a) E_x(X-alignment) = E_z(Z-alignment)
4790+ E_y(X-alignment) = E_x(Z-alignment)
4791+ E_z(X-alignment) = E_y(Z-alignment)
4792+
4793+ b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
4794
4795=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/makefile'
4796--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/makefile 1970-01-01 00:00:00 +0000
4797+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/makefile 2018-04-27 22:12:28 +0000
4798@@ -0,0 +1,2 @@
4799+name=Pt2xx
4800+include ../test.mk
4801
4802=== added directory 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xz'
4803=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.fdf'
4804--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.fdf 1970-01-01 00:00:00 +0000
4805+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.fdf 2018-04-27 22:12:28 +0000
4806@@ -0,0 +1,59 @@
4807+SystemName Pt2 x-alignment z
4808+SystemLabel Pt2xz
4809+
4810+Spin SO
4811+
4812+NumberOfAtoms 2
4813+NumberOfSpecies 1
4814+%block Chemical_Species_label
4815+ 1 78 Pt_pt2_SOC
4816+%endblock Chemical_Species_label
4817+
4818+PAO.EnergyShift 100 meV
4819+PAO.SplitNorm 0.15
4820+PAO.OldStylePolOrbs F
4821+Restricted.Radial.Grid F
4822+%Block PAO.Basis
4823+Pt_pt2_SOC 2
4824+ n=6 0 2 P 1
4825+ 7.158 6.085
4826+ 1.000 1.000
4827+ n=5 2 2
4828+ 5.044 3.098
4829+ 1.000 1.000
4830+%EndBlock PAO.Basis
4831+
4832+AtomicCoordinatesFormat NotScaledCartesianAng
4833+LatticeConstant 20.0 Ang
4834+%block LatticeVectors
4835+ 1.00 .00 .00
4836+ .00 1.00 .00
4837+ .00 .00 1.00
4838+%endblock LatticeVectors
4839+
4840+%block AtomicCoordinatesAndAtomicSpecies
4841+ -1.19940 0.00000 0.00000 1
4842+ 1.19940 0.00000 0.00000 1
4843+%endblock AtomicCoordinatesAndAtomicSpecies
4844+
4845+XC.functional GGA
4846+XC.authors PBE
4847+
4848+MeshCutoff 500. Ry
4849+
4850+SolutionMethod diagon
4851+
4852+ElectronicTemperature 1 meV
4853+DM.Tolerance 1.0E-6
4854+MaxSCFIterations 1000
4855+DM.MixingWeight 0.005
4856+DM.MixSCF1 F
4857+MixHamiltonian T
4858+DM.NumberPulay 6
4859+DM.NumberKick 25
4860+DM.UseSaveDM T
4861+
4862+WriteMullikenPop 1
4863+WriteEigenvalues T
4864+WriteForces T
4865+WriteCoorStep T
4866
4867=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.pseudos'
4868--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.pseudos 1970-01-01 00:00:00 +0000
4869+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.pseudos 2018-04-27 22:12:28 +0000
4870@@ -0,0 +1,1 @@
4871+Pt_pt2_SOC
4872
4873=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/README'
4874--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/README 1970-01-01 00:00:00 +0000
4875+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/README 2018-04-27 22:12:28 +0000
4876@@ -0,0 +1,34 @@
4877+Ramon Cuadrado del Burgo - March 7, 2016
4878+
4879+ The present test performs fully-relativistic simulation of Pt2 dimer
4880+placed along X and Z axes, X-alignment and Z-alignment, respectively.
4881+By means of the calculation of the total selfconsistent energy it is
4882+possible to obtain the magnetic anisotropy energy (MAE) checking in
4883+addition that:
4884+
4885+ * X-alignment:
4886+
4887+ 1) The total SC energy for x-axis spin orientation corresponds to the
4888+ lower value: E_x < E_y = E_z => x-axis = Easy axis
4889+
4890+ 2) The total SC energy for y-axis and z-axis spin orientation have the
4891+ same value and they are larger than x-axis SC total energy:
4892+ E_y = E_z => y/z-axis = Hard axes
4893+
4894+ * Z-alignment:
4895+
4896+ 1) The total SC energy for z-axis spin orientation corresponds to the
4897+ lower value: E_z < E_x = E_y => z-axis = Easy axis
4898+
4899+ 2) The total SC energy for x-axis and y-axis spin orientation have the
4900+ same value and they are larger than z-axis SC total energy:
4901+ E_x = E_y => x/y-axis = Hard axes
4902+
4903+ For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
4904+configurations have to have the same values when the dimer is rotated in space:
4905+
4906+ a) E_x(X-alignment) = E_z(Z-alignment)
4907+ E_y(X-alignment) = E_x(Z-alignment)
4908+ E_z(X-alignment) = E_y(Z-alignment)
4909+
4910+ b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
4911
4912=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/makefile'
4913--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/makefile 1970-01-01 00:00:00 +0000
4914+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/makefile 2018-04-27 22:12:28 +0000
4915@@ -0,0 +1,2 @@
4916+name=Pt2xz
4917+include ../test.mk
4918
4919=== added directory 'Tests/More_SOC_Examples/offsite_SOC_Pt2_zy'
4920=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.fdf'
4921--- Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.fdf 1970-01-01 00:00:00 +0000
4922+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.fdf 2018-04-27 22:12:28 +0000
4923@@ -0,0 +1,64 @@
4924+SystemName Pt2 z-alignment y
4925+SystemLabel Pt2zy
4926+
4927+Spin SO
4928+
4929+%block DM.InitSpin
4930+ 1 +1. 90. 90.
4931+ 2 +1. 90. 90.
4932+%endblock DM.InitSpin
4933+
4934+NumberOfAtoms 2
4935+NumberOfSpecies 1
4936+%block Chemical_Species_label
4937+ 1 78 Pt_pt2_SOC
4938+%endblock Chemical_Species_label
4939+
4940+PAO.EnergyShift 100 meV
4941+PAO.SplitNorm 0.15
4942+PAO.OldStylePolOrbs F
4943+Restricted.Radial.Grid F
4944+%Block PAO.Basis
4945+Pt_pt2_SOC 2
4946+ n=6 0 2 P 1
4947+ 7.158 6.085
4948+ 1.000 1.000
4949+ n=5 2 2
4950+ 5.044 3.098
4951+ 1.000 1.000
4952+%EndBlock PAO.Basis
4953+
4954+AtomicCoordinatesFormat NotScaledCartesianAng
4955+LatticeConstant 20.0 Ang
4956+%block LatticeVectors
4957+ 1.00 .00 .00
4958+ .00 1.00 .00
4959+ .00 .00 1.00
4960+%endblock LatticeVectors
4961+
4962+%block AtomicCoordinatesAndAtomicSpecies
4963+ 0.00000 0.00000 -1.19940 1
4964+ 0.00000 0.00000 1.19940 1
4965+%endblock AtomicCoordinatesAndAtomicSpecies
4966+
4967+XC.functional GGA
4968+XC.authors PBE
4969+
4970+MeshCutoff 500. Ry
4971+
4972+SolutionMethod diagon
4973+
4974+ElectronicTemperature 1 meV
4975+DM.Tolerance 1.0E-6
4976+MaxSCFIterations 1000
4977+DM.MixingWeight 0.005
4978+DM.MixSCF1 F
4979+MixHamiltonian T
4980+DM.NumberPulay 6
4981+DM.UseSaveDM T
4982+DM.NumberKick 25
4983+
4984+WriteMullikenPop 1
4985+WriteEigenvalues T
4986+WriteForces T
4987+WriteCoorStep T
4988
4989=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.pseudos'
4990--- Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.pseudos 1970-01-01 00:00:00 +0000
4991+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.pseudos 2018-04-27 22:12:28 +0000
4992@@ -0,0 +1,1 @@
4993+Pt_pt2_SOC
4994
4995=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/README'
4996--- Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/README 1970-01-01 00:00:00 +0000
4997+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/README 2018-04-27 22:12:28 +0000
4998@@ -0,0 +1,34 @@
4999+Ramon Cuadrado del Burgo - March 7, 2016
5000+
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches