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

Proposed by Alberto Garcia
Status: Merged
Merged at revision: 693
Proposed branch: lp:~albertog/siesta/merge-OSSO
Merge into: lp:siesta
Diff against target: 28543 lines (+15696/-10454)
185 files modified
Docs/Contributors.txt (+2/-1)
Docs/SOC_offsite_notes.txt (+33/-0)
Docs/siesta.tex (+121/-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 (+2/-1)
To merge this branch: bzr merge lp:~albertog/siesta/merge-OSSO
Reviewer Review Type Date Requested Status
Nick Papior Approve
Roberto Robles (community) Approve
Ramon Cuadrado (community) Approve
Review via email: mp+344793@code.launchpad.net

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

Commit message

Merge the 'offsite spin-orbit' implementation by Ramon Cuadrado.

Reference:

R. Cuadrado and J. I. Cerda, J. Phys.: Condens. Matter 24, 086005,
(2012) (DOI:10.1088/0953-8984/24/8/086005)).

The new 'offsite' implementation is now the default when

   Spin { SO, SOC, S+O }
   SpinOrbit T (deprecated)

is specified in the input fdf file. To request the 'onsite' approximation,
use

   Spin { SO+onsite, SOC+onsite, S+O+onsite}

The only basic change from the existing 'onsite' implementation is in
the construction of the SO hamiltonian, which involves the full set of
lj KB projectors. These are constructed by new code in 'atom', and
processed in the new routine 'nlefsm_SO_off', which has roughly the
same structure as 'nlefsm', but constructs at the same time the 'ion'
(nl) and 'SO' pieces from the relativistic projectors.

This routine calls 'calc_Vj_offsiteSO', where VSO and Vion and the
corresponding forces are computed using the Clebsch–Gordan
coefficients needed to change from the basis |l,m,sigma> to |j,mj>.

The conventions for structure and signs in H and the DM are the same
as in the existing 'onsite' implementation, so there are no changes in
the diagonalization routines, or in the analysis routines and tools.

Eventually, the 'offsite' qualifier might be removed, as this is a
full spin-orbit implementation.

Note that this merge focuses on the core electronic-structure
functionality of 'full' spin-orbit coupling, and does not provide any
spin-orbit enhancements to the analysis tools.

Description of the change

Some polishing, shorter-running tests for SOC, etc.

This should be mature enough to go to the trunk, as an implementation of the 'offsite' SOC.
Further enhancements to analysis tools, etc, should be worked on in the other series,

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 : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

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 : Posted in a previous version of this proposal

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
Revision history for this message
Alberto Garcia (albertog) wrote : Posted in a previous version of this proposal

> 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 : Posted in a previous version of this proposal

> 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 : Posted in a previous version of this proposal

> > 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 : Posted in a previous version of this proposal

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

>

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

Ok. Go ahead!

review: Approve
Revision history for this message
Roberto Robles (roberto-robles) :
review: Approve
Revision history for this message
Nick Papior (nickpapior) :
review: Approve
lp:~albertog/siesta/merge-OSSO updated
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)

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

Subscribers

People subscribed via source and target branches