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
=== modified file 'Docs/Contributors.txt'
--- Docs/Contributors.txt 2016-09-28 07:49:18 +0000
+++ Docs/Contributors.txt 2018-04-30 20:53:35 +0000
@@ -30,7 +30,8 @@
30Thomas Archer30Thomas Archer
31Luis C. Balbas31Luis C. Balbas
32Xavier Blase32Xavier Blase
33Ramon Cuadrado33Jorge I. Cerda,
34Ramon Cuadrado,
34Michele Ceriotti35Michele Ceriotti
35Raul de la Cruz36Raul de la Cruz
36Gabriel Fabricius37Gabriel Fabricius
3738
=== added file 'Docs/SOC_offsite_notes.txt'
--- Docs/SOC_offsite_notes.txt 1970-01-01 00:00:00 +0000
+++ Docs/SOC_offsite_notes.txt 2018-04-30 20:53:35 +0000
@@ -0,0 +1,33 @@
1Notes to the new 'offsite spin-orbit' implementation by Ramon Cuadrado.
2
3Reference:
4
5R. Cuadrado and J. I. Cerda,
6"Fully relativistic pseudopotential formalism under an atomic orbital
7basis: spin–orbit splittings and magnetic anisotropies",
8J. Phys.: Condens. Matter 24, 086005, (2012)
9(DOI:10.1088/0953-8984/24/8/086005)
10
11In this 'offsite' implementation the introduction of a fully
12relativistic Hamiltonian is done by using fully non-local operators
13for the pseudopotentials. In this way it is possible to avoid the
14'onsite' approximation needed to reduce the computational effort
15required when explicitly computing the LS term.
16
17The construction of a fully relativistic Hamiltonian involves the use
18of a full set of lj KB projectors. These are constructed by new code
19in 'atom', and processed in the new routine 'nlefsm_SO_off', which has
20roughly the same structure as 'nlefsm', but constructs at the same
21time the 'ion' and 'SO' pieces from the relativistic projectors.
22
23This routine calls 'calc_Vj_offsiteSO', where VSO and Vion and the
24corresponding forces are computed using the Clebsch–Gordan
25coefficients needed to change from the basis |l,m,sigma> to |j,mj>.
26
27The conventions for structure and signs in H and the DM are the same
28as in the existing 'onsite' implementation, so there are no changes in
29the diagonalization routines, or in the analysis routines and tools.
30
31Eventually, the 'offsite' qualifier might be removed, as this is a
32full spin-orbit implementation which involves a similar computational
33effort using less drastic approximations.
034
=== modified file 'Docs/siesta.tex'
--- Docs/siesta.tex 2018-04-24 10:24:02 +0000
+++ Docs/siesta.tex 2018-04-30 20:53:35 +0000
@@ -214,7 +214,8 @@
214Thomas Archer,214Thomas Archer,
215Luis C. Balbas,215Luis C. Balbas,
216Xavier Blase,216Xavier Blase,
217Ramon Cuadrado,217Jorge I. Cerd\'a,
218Ram\'on Cuadrado,
218Michele Ceriotti,219Michele Ceriotti,
219Raul de la Cruz,220Raul de la Cruz,
220Gabriel Fabricius,221Gabriel Fabricius,
@@ -2241,6 +2242,12 @@
2241The default is \emph{one} KB projector from each angular momentum,2242The default is \emph{one} KB projector from each angular momentum,
2242constructed from the nodeless eigenfunction.2243constructed from the nodeless eigenfunction.
22432244
2245For full spin-orbit calculations, the program generates $lj$
2246projectors using the $l+1/2$ and $l-1/2$ components of the
2247(relativistic) pseudopotentials. In this case the specification of the
2248reference energies for projectors is not changed: only $l$ is
2249relevant.
2250
2244\end{fdfentry} 2251\end{fdfentry}
22452252
22462253
@@ -3251,7 +3258,7 @@
3251 coordinates rigidly to have them positive, by using3258 coordinates rigidly to have them positive, by using
3252 \fdf{AtomicCoordinatesOrigin}. See the3259 \fdf{AtomicCoordinatesOrigin}. See the
3253 \program{Sies2arc}\index{Sies2arc@\textsc{Sies2arc}} utility in the3260 \program{Sies2arc}\index{Sies2arc@\textsc{Sies2arc}} utility in the
3254 \program{Util/} directory for generating \sysfile*{.arc} files for CERIUS animation.3261 \program{Util/} directory for generating \sysfile*{arc} files for CERIUS animation.
32553262
3256 \end{fdflogicalF}3263 \end{fdflogicalF}
32573264
@@ -3481,8 +3488,9 @@
3481symmetry is valid in the absence of external magnetic fields or3488symmetry is valid in the absence of external magnetic fields or
3482non-collinear/spin-orbit interaction.3489non-collinear/spin-orbit interaction.
34833490
3484This flag should be used with care, as the code will produce wrong3491This flag is only honored for spinless or collinear-spin calculations,
3485results if there is no support for the appropriate symmetrization.3492as the code will produce wrong results if there is no support for the
3493appropriate symmetrization.
34863494
3487The default value is \fdftrue unless: a) the option \fdf{Spin!Spiral} 3495The default value is \fdftrue unless: a) the option \fdf{Spin!Spiral}
3488is used. In this case time-reversal-symmetry is broken explicitly. b)3496is used. In this case time-reversal-symmetry is broken explicitly. b)
@@ -3721,10 +3729,12 @@
37213729
3722 \option[spin-orbit]%3730 \option[spin-orbit]%
3723 \fdfindex*{Spin:spin-orbit}%3731 \fdfindex*{Spin:spin-orbit}%
3724 Perform a calculation with spin-orbit coupling. This requires the3732 Performs calculations including the spin-orbit coupling. By default the
3733 off-site SO option is set to \fdftrue. To perform an on-site SO calculations
3734 this option has to be \fdf*{spin-orbit+onsite}. This requires the
3725 pseudopotentials to be relativistic.3735 pseudopotentials to be relativistic.
37263736
3727 See Sect.~\ref{sec:spin-orbit}.3737 See Sect.~\ref{sec:spin-orbit} for further specific spin-orbit options.
37283738
3729 \end{fdfoptions}3739 \end{fdfoptions}
37303740
@@ -3769,96 +3779,127 @@
3769\end{fdflogicalF}3779\end{fdflogicalF}
37703780
37713781
3772\subsection{Spin--Orbit coupling}3782\subsection{Spin-Orbit coupling}
3773\label{sec:spin-orbit}3783\label{sec:spin-orbit}
37743784
3775\siesta\ includes the posibility to perform fully relativistic3785\siesta\ includes the posibility to perform fully relativistic
3776calculations by means of the inclusion in the total Hamiltonian not3786calculations by means of the inclusion in the total Hamiltonian not
3777only the Darwin and velocity correction terms~(Scalar--Relativistic3787only the Darwin and velocity correction terms~(Scalar--Relativistic
3778calculations), but also the spin-orbit~(SO) contribution. The3788calculations), but also the spin-orbit~(SO) contribution. There are
3779implementation is based on the on-site SO approximation, where only3789two approaches regarding the SO formalism: on-site and off-site.
3780the intra-SO contribution of each atom is taken into account. See3790Within the on-site approximation only the intra-atomic SO
3781\fdf{Spin} on how to turn on the spin-orbit coupling.3791contribution is taken into account. In the off-site scheme additional
3792neighboring interactions are also included in the SO term. By default,
3793the off-site SO formalism is switched on, being necessary to change
3794the \fdf{Spin} flag in the input file if the on-site approximation
3795wants to be used. See \fdf{Spin} on how to handle the spin-orbit
3796coupling.
37823797
3783The current implementation in \siesta\ has been implemented by3798The on-site spin-orbit scheme in this version of \siesta\ has been implemented by
3784Dr. Ram\'on Cuadrado based on the original on-site SO formalism and3799Dr. Ram\'on Cuadrado based on the original on-site SO formalism and
3785implementation developed by Prof. Jaime Ferrer, \textit{et al}~(L3800implementation developed by Prof. Jaime Ferrer and his collaborators \textit{et al}~(L
3786Fern\'andez--Seivane, M Oliveira, S Sanvito, and J Ferrer, Journal of3801Fern\'andez--Seivane, M Oliveira, S Sanvito, and J Ferrer, Journal of
3787Physics: Condensed Matter, 2006 vol. 18 pp. 7999; L3802Physics: Condensed Matter, \textbf{18}, 7999 (2006); L Fern\'andez--Seivane
3788Fern\'andez--Seivane and Jaime Ferrer, Phys. Rev. Lett. 99, 2007,3803and Jaime Ferrer, Phys. Rev. Lett. \textbf{99}, 183401 (2007)).
3789183401).3804
37903805The off-site scheme has been implemented by
3791The inclusion of the SO term in the Hamiltonian~(and in the Density3806Dr. Ram\'on Cuadrado and Dr. Jorge I. Cerd\'a based on their initial
3792Matrix) will involve the increase of non-zero elements in their3807work~(R. Cuadrado and J. I. Cerd\'a ``Fully relativistic pseudopotential
3793off-diagonal parts, i.e., for some $\mu\nu$ orbitals,3808formalism under an atomic orbital basis: spin-orbit splittings and
3794H$^{\sigma\sigma'}_{\mu\nu}$(DM$^{\sigma\sigma'}_{\mu\nu}$)3809magnetic anisotropies'', J. Phys.: Condens. Matter \textbf{24}, 086005 (2012);
3795[$\sigma,\sigma'$=$\uparrow,\downarrow$] will be $\neq$0. This is3810``In-plane/out-of-plane disorder influence on the magnetic anisotropy of
3811Fe$_{1-y}$Mn$_y$Pt-L1(0) bulk alloy'', R. Cuadrado, Kai Liu, Timothy
3812J. Klemmer and R. W. Chantrell, Applied Physics Letters, \textbf{108},
3813123102 (2016)).
3814
3815The inclusion of the SO term in the Hamiltonian (and in the Density
3816Matrix) causes an increase in the number of non-zero elements in their
3817off-diagonal parts, i.e., for some $(\mu,\nu)$ pair of basis
3818orbitals, $\mathbf H^{\sigma\sigma'}_{\mu\nu}$ ($\mathbf{DM}^{\sigma\sigma'}_{\mu\nu}$)
3819[$\sigma,\sigma'=\uparrow,\downarrow$] will be $\neq0$. This is
3796mainly due to the fact that the $\mathbf L\cdot\mathbf S$ operator3820mainly due to the fact that the $\mathbf L\cdot\mathbf S$ operator
3797will promote the mixing between different spin-up/down components. The3821will promote the mixing between different spin-up/down components.
3798terms responsible of this matrices expansion are the3822In addition, these $\mathbf H^{\sigma\sigma'}_{\mu\nu}$ (and
3799exchange-correlation potential and the SO. The remaining terms such as3823$\mathbf{DM}^{\sigma\sigma'}_{\mu\nu}$) elements will be complex, in contrast
3800the kinetic energy or Hartree contribution do not depend of the spin3824with typical polarized/non-polarized calculations where these
3801orientations and hence will be only added to the total3825matrices are purely real. Since the spin-up and spin-down manifolds
3802Hamiltonian~(and DM) to their diagonal parts.3826are essentially mixed, the solver has to deal with matrices whose
38033827dimensions are twice as large as for the collinear (unmixed) spin
3804The current SO formalism enables the possibility of several types of calculations:3828problem. Due to this, we advise to take special
3829attention to the memory needed to perform a spin-orbit calculation.
3830
3831
3832Unless explicitly advised the following type of calculation can be carried out
3833regardless of whether on-site or off-site approximation is employed:
3805\begin{itemize}3834\begin{itemize}
3806 % 3835 %
3807 \item Selfconsistent calculations for gamma point as well as for3836 \item Selfconsistent calculations for gamma point as well as for
3808 bulks~(Not yet implemented for optimizations).3837 bulks.
3809 % 3838 %
3810 \item Magnetic Anisotropy Energy~(MAE) can be easily calculated. From3839 \item Structure optimizations
3811 first principles calculations, MAE is obtained after subtract the3840 %
3812 total selfconsistent energy in two different orientations, usually the3841 %%% *** Incompatible... \item LDA+U calculations~(See Sect.\ref{sec:lda+u} for further info).
3813 total energy associated with easy axis from the hard axis. In \siesta\3842 %
3814 it is possible to perform several self-consistent calculations for3843 \item Magnetic Anisotropy Energy~(MAE) can be easily
3815 different magnetization orientations using the specific block3844 calculated. From first principles it is obtained after subtracting
3816 \fdf{DM.InitSpin} in the fdf file. In doing so one will be able to3845 the total selfconsistent energy calculated for two different
3817 include the initial orientation angles of the magnetization for each3846 magnetic orientations. In \siesta\ it is possible to perform
3818 atom, as well as an initial value of their net magnetic moments.3847 calculations with different initial magnetic orderings
3819 % 3848 by means of the use of the block \fdf{DM.InitSpin} in the fdf
3820 \item By means of Mulliken analysis, after the self-consistent3849 file. In doing so one will be able to include the initial
3850 orientation angles of the magnetization for each atom, as well as
3851 an initial value of its net magnetic moments.
3852 %
3853 \item By means of Mulliken analysis, after the selfconsistent
3821 procedure, local spin and orbital moments can be calculated by means3854 procedure, local spin and orbital moments can be calculated by means
3822 of the flags \fdf{WriteMullikenPop} and \fdf{WriteOrbMom}.3855 of the flags \fdf{WriteMullikenPop} and \fdf{WriteOrbMom}.
3856 %
3823\end{itemize}3857\end{itemize}
38243858
3825Note: Due to the small SO energy value contribution to the total3859Note: Due to the small SO contribution to the total energy, the level
3826energy, the level of precision requiered to perform a proper fully3860of precision required to perform a proper fully relativistic
3827relativistic calculation during the selfconsistent process is quite3861calculation during the selfconsistent process is quite demanding. The
3828demanding. The following values must be carefully converged and3862following values must be carefully converged and checked for each
3829checked for each specific system to assure that the results are3863specific system to assure that the results are accurate enough:
3830accurate enough: \fdf{SCF.H!Tolerance} during the3864\fdf{SCF.H!Tolerance} during the selfconsistency (typically between
3831selfconsistency~(typically <10$^{-5}$eV), \fdf{ElectronicTemperature},3865$10^{-3}\,\mathrm{eV}$ -- $10^{-4}\,\mathrm{eV}$),
3832\textbf{k}-point sampling and high values of3866\fdf{ElectronicTemperature}, \textbf{k}--point sampling and high
3833\fdf{MeshCutoff}~(specifically for extended solids). In general, one3867values of \fdf{MeshCutoff}~(specifically for extended solids). In
3834can say that a good calculation will have high number of k--points,3868general, one can say that a good calculation will have high number of
3835low \fdf{ElectronicTemperature}, extremely small \fdf{SCF.H!Tolerance}3869\textbf{k}--points, low \fdf{ElectronicTemperature}, extremely small
3836and high values of \fdf{MeshCutoff}. We encourage the user to test3870\fdf{SCF.H!Tolerance} and high values of \fdf{MeshCutoff}. We
3837carefully these options for each system. An additional point to take3871encourage the user to test carefully these options for each system. An
3838into account when the spin--orbit contribution is included is the3872additional point to take into account is the mixing scheme
3839mixing scheme employed. You are encouraged to use \fdf{SCF.Mix}3873employed. You are encouraged to use \fdf{SCF.Mix:hamiltonian}
3840\fdf*{hamiltonian} instead of the density matrix, due to the fact that3874(currently is set up by default) instead of density matrix mixing,
3841the convergence speed increases considerably for the first case. In3875since it speeds up the convergence. The pseudopotentials have to be
3842addition, the pseudopotentials have to be well generated and tested3876properly generated and tested for each specific system and they have
3843for each specific system and they have to be generated in their fully3877to be in their fully relativistic form, together with the non-linear
3844relativistic form and use the non-linear core corrections.3878core corrections. Finally it is worth to mention that the
3845 3879selfconsistent convergence for some non-highly symmetric
3880magnetizations directions with respect to the physical symmetry axis
3881could still be difficult.
3882
3846\begin{fdfentry}{Spin!OrbitStrength}[real]<1.0>3883\begin{fdfentry}{Spin!OrbitStrength}[real]<1.0>
38473884
3848 It allows to vary the strength of the spin-orbit interaction from3885 It allows to vary the strength of the
3849 zero to any positive value, including the physical value. This flag3886 spin-orbit interaction from zero to any positive value. It can be
3850 is only active when \fdf{Spin} is set to \fdf*{spin-orbit}.3887 used for both the on-site and off-site SOC flavors, but only for
38513888 debugging and testing purposes, as the only physical value is 1.0.
3889 Note that this feature is implemented by modifying the SO parts of the
3890 semilocal potentials read from a \code{.psf} file. Care must be
3891 taken when re-using any \code{.ion} files produced.
3892
3852\end{fdfentry}3893\end{fdfentry}
38533894
3854\begin{fdflogicalF}{WriteOrbMom}3895\begin{fdflogicalF}{WriteOrbMom}
38553896
3856 If \fdftrue, a table is provided in the main output file, which3897 If \fdftrue, a table is provided in the output file that
3857 includes an estimation of the vector orbital magnetic3898 includes an estimation of the vector orbital magnetic
3858 moments, in units of the Bohr magneton, projected onto each orbital3899 moments, in units of the Bohr magneton, projected
3859 and also onto each atom. The estimation for the orbital moments is3900 onto each orbital and also onto each atom. The estimation for the
3860 based on a two-center approximation, and makes use of the Mulliken3901 orbital moments is based on a two-center approximation, and makes use
3861 population analysis.3902 of the Mulliken population analysis.
38623903
3863 If \fdf{MullikenInScf} is \fdftrue, this information is printed at3904 If \fdf{MullikenInScf} is \fdftrue, this information is printed at
3864 every scf step.3905 every scf step.
@@ -3866,6 +3907,7 @@
3866\end{fdflogicalF}3907\end{fdflogicalF}
38673908
38683909
3910
3869\subsection{The self-consistent-field loop}3911\subsection{The self-consistent-field loop}
38703912
3871\textbf{IMPORTANT NOTE: Convergence of the Kohn-Sham energy and forces}3913\textbf{IMPORTANT NOTE: Convergence of the Kohn-Sham energy and forces}
@@ -4988,7 +5030,7 @@
4988 \index{reading saved data!density matrix}5030 \index{reading saved data!density matrix}
4989 5031
4990 Instructs to read the density matrix stored in file5032 Instructs to read the density matrix stored in file
4991 \sysfile{.DM} by a previous run.5033 \sysfile{DM} by a previous run.
4992 5034
4993 \siesta\ will continue even if \sysfile*{DM} is not found.5035 \siesta\ will continue even if \sysfile*{DM} is not found.
49945036
@@ -9014,8 +9056,8 @@
9014Enable an experimental timer which is based on wall time on the master9056Enable an experimental timer which is based on wall time on the master
9015node and is aware of the tree-structure of the timed sections. At the9057node and is aware of the tree-structure of the timed sections. At the
9016end of the program, a report is generated in the output file, and a9058end of the program, a report is generated in the output file, and a
9017{\tt time.json} file in JSON format is also written. \index{JSON9059\file{time.json} file in JSON format is also written. \index{JSON
9018 timing report@{\bf JSON timing report}} This file can be used by9060 timing report@\textbf{JSON timing report}} This file can be used by
9019third-party scripts to process timing data.9061third-party scripts to process timing data.
90209062
9021 \note, if used with the PEXSI solver (see Sec.~\ref{SolverPEXSI})9063 \note, if used with the PEXSI solver (see Sec.~\ref{SolverPEXSI})
@@ -10567,9 +10609,9 @@
1056710609
10568\begin{fdflogicalF}{TDED.Saverho}10610\begin{fdflogicalF}{TDED.Saverho}
1056910611
10570If \fdftrue\ the instantaneous time-dependent density is saved to10612 If \fdftrue\ the instantaneous time-dependent density is saved to
10571\texttt{ <istep>}.\texttt{TDRho}\index{TDRho@{\bf TDRho}} after every10613 \file{<istep>.TDRho} after every \fdf{TDED.Nsaverho} number of
10572\fdf{TDED.Nsaverho} number of steps.10614 steps.
1057310615
10574\end{fdflogicalF}10616\end{fdflogicalF}
1057510617
1057610618
=== modified file 'Src/Makefile'
--- Src/Makefile 2018-04-24 10:24:02 +0000
+++ Src/Makefile 2018-04-30 20:53:35 +0000
@@ -635,10 +635,11 @@
635compute_dm.o: normalize_dm.o ordern.o parallel.o precision.o siesta_geom.o635compute_dm.o: normalize_dm.o ordern.o parallel.o precision.o siesta_geom.o
636compute_dm.o: siesta_options.o sparse_matrices.o sys.o units.o636compute_dm.o: siesta_options.o sparse_matrices.o sys.o units.o
637compute_ebs_shift.o: m_mpi_utils.o parallel.o precision.o637compute_ebs_shift.o: m_mpi_utils.o parallel.o precision.o
638compute_energies.o: atomlist.o class_SpData1D.o class_SpData2D.o dhscf.o638compute_energies.o: atomlist.o class_SpData1D.o class_SpData2D.o
639compute_energies.o: files.o m_dipol.o m_energies.o m_mpi_utils.o m_ntm.o639compute_energies.o: class_SpData2D.o dhscf.o files.o m_dipol.o m_energies.o
640compute_energies.o: m_rhog.o m_spin.o precision.o siesta_geom.o640compute_energies.o: m_mpi_utils.o m_ntm.o m_rhog.o m_spin.o parallel.o
641compute_energies.o: siesta_options.o sparse_matrices.o641compute_energies.o: precision.o siesta_geom.o siesta_options.o
642compute_energies.o: sparse_matrices.o
642compute_max_diff.o: m_mpi_utils.o precision.o643compute_max_diff.o: m_mpi_utils.o precision.o
643compute_norm.o: m_mpi_utils.o m_spin.o precision.o sparse_matrices.o644compute_norm.o: m_mpi_utils.o m_spin.o precision.o sparse_matrices.o
644compute_pw_matrix.o: alloc.o m_planewavematrix.o m_planewavematrixvar.o645compute_pw_matrix.o: alloc.o m_planewavematrix.o m_planewavematrixvar.o
@@ -725,15 +726,15 @@
725fft.o: alloc.o fft1d.o m_timer.o mesh.o parallel.o parallelsubs.o precision.o726fft.o: alloc.o fft1d.o m_timer.o mesh.o parallel.o parallelsubs.o precision.o
726fft.o: sys.o727fft.o: sys.o
727fft1d.o: parallel.o precision.o sys.o728fft1d.o: parallel.o precision.o sys.o
728final_H_f_stress.o: alloc.o atomlist.o class_SpData2D.o compute_max_diff.o729final_H_f_stress.o: alloc.o atomlist.o class_SpData2D.o class_SpData2D.o
729final_H_f_stress.o: dnaefs.o files.o grdsam.o kinefsm.o ldau.o ldau_specs.o730final_H_f_stress.o: compute_max_diff.o dnaefs.o files.o grdsam.o kinefsm.o
730final_H_f_stress.o: m_dipol.o m_energies.o m_forces.o m_gamma.o m_hsx.o731final_H_f_stress.o: ldau.o ldau_specs.o m_dipol.o m_energies.o m_forces.o
731final_H_f_stress.o: m_mpi_utils.o m_ncdf_siesta.o m_ntm.o m_spin.o m_steps.o732final_H_f_stress.o: m_gamma.o m_hsx.o m_mpi_utils.o m_ncdf_siesta.o m_ntm.o
732final_H_f_stress.o: m_stress.o m_ts_global_vars.o m_ts_io.o m_ts_kpoints.o733final_H_f_stress.o: m_spin.o m_steps.o m_stress.o m_ts_global_vars.o m_ts_io.o
733final_H_f_stress.o: m_ts_options.o metaforce.o molecularmechanics.o naefs.o734final_H_f_stress.o: m_ts_kpoints.o m_ts_options.o metaforce.o
734final_H_f_stress.o: nlefsm.o overfsm.o parallel.o siesta_geom.o735final_H_f_stress.o: molecularmechanics.o naefs.o nlefsm.o overfsm.o parallel.o
735final_H_f_stress.o: siesta_options.o sparse_matrices.o spinorbit.o sys.o736final_H_f_stress.o: siesta_geom.o siesta_options.o sparse_matrices.o
736final_H_f_stress.o: units.o737final_H_f_stress.o: spinorbit.o sys.o units.o
737find_kgrid.o: alloc.o minvec.o parallel.o precision.o units.o738find_kgrid.o: alloc.o minvec.o parallel.o precision.o units.o
738fire_optim.o: alloc.o m_fire.o m_mpi_utils.o parallel.o precision.o739fire_optim.o: alloc.o m_fire.o m_mpi_utils.o parallel.o precision.o
739fire_optim.o: siesta_options.o units.o740fire_optim.o: siesta_options.o units.o
@@ -932,7 +933,7 @@
932m_sparsity_handling.o: class_SpData2D.o class_Sparsity.o geom_helper.o933m_sparsity_handling.o: class_SpData2D.o class_Sparsity.o geom_helper.o
933m_sparsity_handling.o: intrinsic_missing.o m_interpolate.o m_region.o934m_sparsity_handling.o: intrinsic_missing.o m_interpolate.o m_region.o
934m_sparsity_handling.o: precision.o935m_sparsity_handling.o: precision.o
935m_spin.o: alloc.o parallel.o precision.o sys.o units.o936m_spin.o: alloc.o files.o m_cite.o parallel.o precision.o sys.o units.o
936m_stress.o: precision.o937m_stress.o: precision.o
937m_supercell.o: atom_graph.o class_OrbitalDistribution.o class_SpData2D.o938m_supercell.o: atom_graph.o class_OrbitalDistribution.o class_SpData2D.o
938m_supercell.o: intrinsic_missing.o parallel.o parallelsubs.o precision.o939m_supercell.o: intrinsic_missing.o parallel.o parallelsubs.o precision.o
@@ -1135,7 +1136,7 @@
1135new_matel.o: alloc.o errorf.o interpolation.o matel_registry.o parallel.o1136new_matel.o: alloc.o errorf.o interpolation.o matel_registry.o parallel.o
1136new_matel.o: precision.o radfft.o spher_harm.o sys.o1137new_matel.o: precision.o radfft.o spher_harm.o sys.o
1137nlefsm.o: alloc.o atm_types.o atmfuncs.o atomlist.o chemical.o mneighb.o1138nlefsm.o: alloc.o atm_types.o atmfuncs.o atomlist.o chemical.o mneighb.o
1138nlefsm.o: new_matel.o parallel.o parallelsubs.o precision.o1139nlefsm.o: new_matel.o parallel.o parallelsubs.o precision.o sparse_matrices.o
1139normalize_dm.o: atomlist.o m_mpi_utils.o m_spin.o parallel.o precision.o1140normalize_dm.o: atomlist.o m_mpi_utils.o m_spin.o parallel.o precision.o
1140normalize_dm.o: siesta_options.o sparse_matrices.o sys.o1141normalize_dm.o: siesta_options.o sparse_matrices.o sys.o
1141obc.o: alloc.o precision.o1142obc.o: alloc.o precision.o
@@ -1227,15 +1228,17 @@
1227setatomnodes.o: alloc.o parallel.o precision.o spatial.o sys.o1228setatomnodes.o: alloc.o parallel.o precision.o spatial.o sys.o
1228setspatial.o: alloc.o parallel.o precision.o spatial.o1229setspatial.o: alloc.o parallel.o precision.o spatial.o
1229setup_H0.o: alloc.o atmfuncs.o atomlist.o class_SpData1D.o class_SpData2D.o1230setup_H0.o: alloc.o atmfuncs.o atomlist.o class_SpData1D.o class_SpData2D.o
1230setup_H0.o: dhscf.o dnaefs.o kinefsm.o m_energies.o m_mpi_utils.o m_ntm.o1231setup_H0.o: class_SpData2D.o dhscf.o dnaefs.o kinefsm.o m_energies.o
1231setup_H0.o: m_spin.o metaforce.o molecularmechanics.o naefs.o nlefsm.o1232setup_H0.o: m_mpi_utils.o m_ntm.o m_spin.o metaforce.o molecularmechanics.o
1232setup_H0.o: siesta_geom.o siesta_options.o sparse_matrices.o spinorbit.o1233setup_H0.o: naefs.o nlefsm.o siesta_geom.o siesta_options.o sparse_matrices.o
1234setup_H0.o: spinorbit.o
1233setup_hamiltonian.o: alloc.o atmfuncs.o atomlist.o class_SpData1D.o1235setup_hamiltonian.o: alloc.o atmfuncs.o atomlist.o class_SpData1D.o
1234setup_hamiltonian.o: class_SpData2D.o dhscf.o files.o ldau.o ldau_specs.o1236setup_hamiltonian.o: class_SpData2D.o class_SpData2D.o dhscf.o files.o ldau.o
1235setup_hamiltonian.o: m_dipol.o m_energies.o m_gamma.o m_hsx.o m_mpi_utils.o1237setup_hamiltonian.o: ldau_specs.o m_dipol.o m_energies.o m_gamma.o m_hsx.o
1236setup_hamiltonian.o: m_ntm.o m_partial_charges.o m_rhog.o m_spin.o m_steps.o1238setup_hamiltonian.o: m_mpi_utils.o m_ntm.o m_partial_charges.o m_rhog.o
1237setup_hamiltonian.o: m_stress.o metaforce.o molecularmechanics.o parallel.o1239setup_hamiltonian.o: m_spin.o m_steps.o m_stress.o metaforce.o
1238setup_hamiltonian.o: siesta_geom.o siesta_options.o sparse_matrices.o sys.o1240setup_hamiltonian.o: molecularmechanics.o parallel.o siesta_geom.o
1241setup_hamiltonian.o: siesta_options.o sparse_matrices.o sys.o
1239setup_ordern_indexes.o: alloc.o domain_decom.o parallel.o spatial.o1242setup_ordern_indexes.o: alloc.o domain_decom.o parallel.o spatial.o
1240shaper.o: atmfuncs.o mneighb.o precision.o1243shaper.o: atmfuncs.o mneighb.o precision.o
1241show_distribution.o: atomlist.o parallel.o parallelsubs.o siesta_geom.o sys.o1244show_distribution.o: atomlist.o parallel.o parallelsubs.o siesta_geom.o sys.o
@@ -1305,26 +1308,27 @@
1305siesta_tddft.o: wavefunctions.o1308siesta_tddft.o: wavefunctions.o
1306sparse_matrices.o: alloc.o class_Fstack_Pair_Geometry_SpData2D.o1309sparse_matrices.o: alloc.o class_Fstack_Pair_Geometry_SpData2D.o
1307sparse_matrices.o: class_OrbitalDistribution.o class_SpData1D.o1310sparse_matrices.o: class_OrbitalDistribution.o class_SpData1D.o
1308sparse_matrices.o: class_SpData2D.o class_Sparsity.o precision.o1311sparse_matrices.o: class_SpData2D.o class_SpData2D.o class_Sparsity.o
1312sparse_matrices.o: precision.o
1309spatial.o: precision.o1313spatial.o: precision.o
1310spher_harm.o: alloc.o precision.o sys.o1314spher_harm.o: alloc.o precision.o sys.o
1311spinorbit.o: atm_types.o atmfuncs.o atmparams.o basis_types.o m_mpi_utils.o1315spinorbit.o: atm_types.o atmfuncs.o atmparams.o basis_types.o m_mpi_utils.o
1312spinorbit.o: parallel.o parallelsubs.o precision.o pseudopotential.o sys.o1316spinorbit.o: parallel.o parallelsubs.o precision.o pseudopotential.o
1313state_analysis.o: atomlist.o born_charge.o flook_siesta.o m_energies.o1317state_analysis.o: atomlist.o born_charge.o flook_siesta.o m_energies.o
1314state_analysis.o: m_fixed.o m_forces.o m_ntm.o m_spin.o m_stress.o1318state_analysis.o: m_fixed.o m_forces.o m_ntm.o m_spin.o m_stress.o
1315state_analysis.o: m_wallclock.o parallel.o remove_intramol_pressure.o1319state_analysis.o: m_wallclock.o parallel.o remove_intramol_pressure.o
1316state_analysis.o: siesta_cml.o siesta_geom.o siesta_options.o sparse_matrices.o1320state_analysis.o: siesta_cml.o siesta_geom.o siesta_options.o sparse_matrices.o
1317state_analysis.o: units.o write_subs.o zmatrix.o1321state_analysis.o: units.o write_subs.o zmatrix.o
1318state_init.o: alloc.o atomlist.o class_Data2D.o class_SpData1D.o1322state_init.o: alloc.o atomlist.o class_Data2D.o class_SpData1D.o
1319state_init.o: class_SpData2D.o class_Sparsity.o create_Sparsity_SC.o1323state_init.o: class_SpData2D.o class_SpData2D.o class_Sparsity.o
1320state_init.o: domain_decom.o files.o hsparse.o iodm_netcdf.o iodmhs_netcdf.o1324state_init.o: create_Sparsity_SC.o domain_decom.o files.o hsparse.o
1321state_init.o: iotdxv.o ioxv.o kpoint_grid.o ldau_specs.o m_chess.o m_energies.o1325state_init.o: iodm_netcdf.o iodmhs_netcdf.o iotdxv.o ioxv.o kpoint_grid.o
1322state_init.o: m_eo.o m_gamma.o m_mixing.o m_mixing_scf.o m_mpi_utils.o1326state_init.o: ldau_specs.o m_chess.o m_energies.o m_eo.o m_gamma.o m_mixing.o
1323state_init.o: m_new_dm.o m_os.o m_pivot_methods.o m_rmaxh.o m_sparse.o1327state_init.o: m_mixing_scf.o m_mpi_utils.o m_new_dm.o m_os.o m_pivot_methods.o
1324state_init.o: m_sparsity_handling.o m_spin.o m_steps.o m_supercell.o1328state_init.o: m_rmaxh.o m_sparse.o m_sparsity_handling.o m_spin.o m_steps.o
1325state_init.o: m_test_io.o m_ts_charge.o m_ts_electype.o m_ts_global_vars.o1329state_init.o: m_supercell.o m_test_io.o m_ts_charge.o m_ts_electype.o
1326state_init.o: m_ts_io.o m_ts_kpoints.o m_ts_options.o m_ts_sparse.o1330state_init.o: m_ts_global_vars.o m_ts_io.o m_ts_kpoints.o m_ts_options.o
1327state_init.o: m_ts_tri_init.o normalize_dm.o overlap.o parallel.o1331state_init.o: m_ts_sparse.o m_ts_tri_init.o normalize_dm.o overlap.o parallel.o
1328state_init.o: proximity_check.o siesta_cml.o siesta_dicts.o siesta_geom.o1332state_init.o: proximity_check.o siesta_cml.o siesta_dicts.o siesta_geom.o
1329state_init.o: siesta_options.o sparse_matrices.o sys.o units.o write_subs.o1333state_init.o: siesta_options.o sparse_matrices.o sys.o units.o write_subs.o
1330state_init.o: zmatrix.o1334state_init.o: zmatrix.o
13311335
=== modified file 'Src/atm_types.f'
--- Src/atm_types.f 2018-04-07 19:24:04 +0000
+++ Src/atm_types.f 2018-04-30 20:53:35 +0000
@@ -23,12 +23,12 @@
23 integer, parameter, public :: maxnorbs = 10023 integer, parameter, public :: maxnorbs = 100
24! Maximum number of nlm orbitals24! Maximum number of nlm orbitals
25!25!
26 integer, parameter, public :: maxn_pjnl = 1026 integer, parameter, public :: maxn_pjnl = 20
27! Maximum number of projectors (not counting different "m" copies)27! Maximum number of projectors (not counting different "m" copies)
28 integer, parameter, public :: maxn_orbnl = 20028 integer, parameter, public :: maxn_orbnl = 200
29! Maximum number of nl orbitals (not counting different "m" copies)29! Maximum number of nl orbitals (not counting different "m" copies)
30! Now very large to accommodate filteret basis sets30! Now very large to accommodate filteret basis sets
31 integer, parameter, public :: maxnprojs = 5031 integer, parameter, public :: maxnprojs = 100
32! Maximum number of nlm projectors32! Maximum number of nlm projectors
33!33!
3434
@@ -66,9 +66,11 @@
66! 1 to the total number of projectors at that l.66! 1 to the total number of projectors at that l.
67! 67!
68!68!
69 logical :: lj_projs = .false.
69 integer :: n_pjnl=0 ! num of "nl" projs70 integer :: n_pjnl=0 ! num of "nl" projs
70 integer :: lmax_projs=0 ! l cutoff for projs71 integer :: lmax_projs=0 ! l cutoff for projs
71 integer, dimension(maxn_pjnl) :: pjnl_l ! l of each nl proj72 integer, dimension(maxn_pjnl) :: pjnl_l ! l of each nl proj
73 real(dp), dimension(maxn_pjnl) :: pjnl_j ! j of each nl proj
72 integer, dimension(maxn_pjnl) :: pjnl_n ! n of each nl proj74 integer, dimension(maxn_pjnl) :: pjnl_n ! n of each nl proj
73 real(dp), dimension(maxn_pjnl)75 real(dp), dimension(maxn_pjnl)
74 $ :: pjnl_ekb ! energy of76 $ :: pjnl_ekb ! energy of
@@ -92,9 +94,10 @@
92 integer, dimension(maxnprojs) :: pj_index94 integer, dimension(maxnprojs) :: pj_index
93 integer, dimension(maxnprojs) :: pj_n95 integer, dimension(maxnprojs) :: pj_n
94 integer, dimension(maxnprojs) :: pj_l96 integer, dimension(maxnprojs) :: pj_l
97 real(dp), dimension(maxnprojs) :: pj_j
95 integer, dimension(maxnprojs) :: pj_m98 integer, dimension(maxnprojs) :: pj_m
96 integer, dimension(maxnprojs) :: pj_gindex99 integer, dimension(maxnprojs) :: pj_gindex
97!100!----------------------------
98! LDA+U Projectors101! LDA+U Projectors
99! Here we follow the scheme used for the KB projectors102! Here we follow the scheme used for the KB projectors
100! 103!
101104
=== modified file 'Src/atmfuncs.f'
--- Src/atmfuncs.f 2016-04-29 07:31:13 +0000
+++ Src/atmfuncs.f 2018-04-30 20:53:35 +0000
@@ -20,6 +20,8 @@
20 use atm_types20 use atm_types
21 use radial, only: rad_get, rad_func21 use radial, only: rad_get, rad_func
22 use spher_harm, only: rlylm22 use spher_harm, only: rlylm
23
24
2325
24 implicit none 26 implicit none
25!27!
2628
=== modified file 'Src/atmparams.f'
--- Src/atmparams.f 2016-01-25 16:00:16 +0000
+++ Src/atmparams.f 2018-04-30 20:53:35 +0000
@@ -21,7 +21,11 @@
21C INTEGER NKBMX : Maximum number of Kleinman-Bylander projectors21C INTEGER NKBMX : Maximum number of Kleinman-Bylander projectors
22C for each angular momentum22C for each angular momentum
2323
24 integer, parameter, public :: nkbmx = 2 24C For the off-site SO calculation plus semicore states
25C there will be at least 4 KBs for each l angular momentum
26C (for each l shell we have J = l +/- 1/2 )
27 integer, parameter, public :: nkbmx = 4
28
2529
26C INTEGER NSMX : Maximum number of semicore shells for each angular30C INTEGER NSMX : Maximum number of semicore shells for each angular
27C momentum present in the atom ( for normal atom nsmx=0)31C momentum present in the atom ( for normal atom nsmx=0)
2832
=== modified file 'Src/atom.F'
--- Src/atom.F 2018-04-26 13:16:13 +0000
+++ Src/atom.F 2018-04-30 20:53:35 +0000
@@ -97,7 +97,7 @@
97 . rco,lambda_in,atm_label,npolorb,semic,97 . rco,lambda_in,atm_label,npolorb,semic,
98 . nsemic,cnfigmx,charge_in,smass,basistype, 98 . nsemic,cnfigmx,charge_in,smass,basistype,
99 . ISIN,RINN,VCTE,qcoe,qyuk,qwid,99 . ISIN,RINN,VCTE,qcoe,qyuk,qwid,
100 . split_norm,filtercut_in,basp, spp)100 . split_norm,filtercut_in,basp,spp,lj_projs)
101101
102 use atm_types, only: species_info102 use atm_types, only: species_info
103 103
@@ -105,6 +105,7 @@
105105
106 type(basis_def_t), pointer :: basp106 type(basis_def_t), pointer :: basp
107 type(species_info), intent(inout) :: spp107 type(species_info), intent(inout) :: spp
108 logical, intent(in) :: lj_projs
108109
109 integer, intent(in) :: izin 110 integer, intent(in) :: izin
110! Atomic number (if IZ is negative it will be regarded as a set of 111! Atomic number (if IZ is negative it will be regarded as a set of
@@ -242,6 +243,7 @@
242 real(dp)243 real(dp)
243 . rofi(nrmax), drdi(nrmax), s(nrmax),244 . rofi(nrmax), drdi(nrmax), s(nrmax),
244 . vps(nrmax,0:lmaxd), rphi(nrmax,0:lmaxd,nsemx),245 . vps(nrmax,0:lmaxd), rphi(nrmax,0:lmaxd,nsemx),
246 . vps_u(nrmax,0:lmaxd),
245 . vlocal(nrmax), vxc(nrmax), ve(nrmax),247 . vlocal(nrmax), vxc(nrmax), ve(nrmax),
246 . rho(nrmax), chcore(nrmax), rho_PAO(nrmax), auxrho(nrmax),248 . rho(nrmax), chcore(nrmax), rho_PAO(nrmax), auxrho(nrmax),
247 . vePAO(nrmax), qPAO(0:lmaxd,nsemx), chlocal(nrmax),249 . vePAO(nrmax), qPAO(0:lmaxd,nsemx), chlocal(nrmax),
@@ -329,7 +331,7 @@
329!331!
330! Reading pseudopotentials332! Reading pseudopotentials
331! 333!
332 call read_vps(lmxo, lmxkb, nrval,a,b,rofi,drdi,s,vps,334 call read_vps(lmxo, lmxkb, nrval,a,b,rofi,drdi,s,vps,vps_u,
333 . rho, chcore, zval, chgvps, nicore, irel, icorr,basp) 335 . rho, chcore, zval, chgvps, nicore, irel, icorr,basp)
334336
335 do ir=1,nrval337 do ir=1,nrval
@@ -569,8 +571,8 @@
569! Calculation of the Kleinman-Bylander projector functions571! Calculation of the Kleinman-Bylander projector functions
570! 572!
571 call KBgen(is, a,b,rofi,drdi,s,573 call KBgen(is, a,b,rofi,drdi,s,
572 . vps, vlocal, ve, nrval, Zval, lmxkb, 574 . vps, vps_u, vlocal, ve, nrval, Zval, lmxkb,
573 . nkbl, erefkb, nkb, spp) 575 . nkbl, erefkb, nkb, spp, lj_projs)
574576
575 elseif(flting.lt.0.0d0) then 577 elseif(flting.lt.0.0d0) then
576!578!
@@ -1856,7 +1858,7 @@
18561858
18571859
1858 subroutine KBproj(ikb,rofi,drdi,vps,vlocal,nrwf,l,rphi,1860 subroutine KBproj(ikb,rofi,drdi,vps,vlocal,nrwf,l,rphi,
1859 . dkbcos,ekb,proj,nrc) 1861 . dkbcos,ekb,proj,nrc,rphi2,vii)
1860C1862C
1861C This routine calculates the Kleinman-Bylander projector1863C This routine calculates the Kleinman-Bylander projector
1862C with angular momentum l.1864C with angular momentum l.
@@ -1872,6 +1874,7 @@
1872 . rphi(*), vlocal(*)1874 . rphi(*), vlocal(*)
1873 real(dp), intent(out) :: proj(*), dkbcos, ekb1875 real(dp), intent(out) :: proj(*), dkbcos, ekb
1874 integer, intent(out) :: nrc1876 integer, intent(out) :: nrc
1877 real(dp), intent(inout) :: rphi2(:,:), vii(:)
1875C1878C
1876C Internal variables1879C Internal variables
1877C1880C
@@ -1880,8 +1883,6 @@
1880 . dnrm, vl, vphi, avgv, r, phi, dknrm,1883 . dnrm, vl, vphi, avgv, r, phi, dknrm,
1881 . dincv, rc, sum, vij(nkbmx)1884 . dincv, rc, sum, vij(nkbmx)
18821885
1883 real(dp), save :: rphi2(nrmax,nkbmx), vii(nkbmx)
1884
1885 integer ir, jkb1886 integer ir, jkb
18861887
1887 real(dp), parameter :: eps=1.0d-61888 real(dp), parameter :: eps=1.0d-6
@@ -2702,7 +2703,7 @@
27022703
2703!2704!
2704 subroutine read_vps(lmxo, lmxkb,2705 subroutine read_vps(lmxo, lmxkb,
2705 . nrval,a,b,rofi,drdi,s,vps,2706 . nrval,a,b,rofi,drdi,s,vps, vps_u,
2706 . rho, chcore, zval, chgvps,2707 . rho, chcore, zval, chgvps,
2707 . nicore, irel, icorr,basp)2708 . nicore, irel, icorr,basp)
27082709
@@ -2718,14 +2719,14 @@
2718 2719
2719 real(dp)2720 real(dp)
2720 . rofi(nrmax), drdi(nrmax), s(nrmax), vps(nrmax,0:lmaxd),2721 . rofi(nrmax), drdi(nrmax), s(nrmax), vps(nrmax,0:lmaxd),
2722 . vps_u(nrmax,0:lmaxd),
2721 . rho(nrmax), chcore(nrmax) 2723 . rho(nrmax), chcore(nrmax)
27222724
2723 real(dp)2725 real(dp)
2724 . a, b, zval2726 . a, b, zval
2725
2726 integer nrval, lmxo, lmxkb 2727 integer nrval, lmxo, lmxkb
2727
2728 character nicore*4, irel*3, icorr*22728 character nicore*4, irel*3, icorr*2
2729 integer :: nup_end
2729C2730C
2730C Internal variables2731C Internal variables
2731C2732C
@@ -2736,12 +2737,14 @@
2736 . ea, rpb, chgvps2737 . ea, rpb, chgvps
27372738
2738 integer 2739 integer
2739 . nr, nodd, lmax, linput, npotd, npotu, ndown, l, ir, i2740 . nr, nodd, lmax, linput, npotd, npotu, ndown, l, ir, i, nup
27402741
2741 character method(6)*10,text*702742 character method(6)*10,text*70
27422743
2743 type(pseudopotential_t), pointer :: vp2744 type(pseudopotential_t), pointer :: vp
27442745
2746 real(dp) :: so_strength
2747
2745 vp => basp%pseudopotential2748 vp => basp%pseudopotential
27462749
2747 icorr = vp%icorr2750 icorr = vp%icorr
@@ -2792,12 +2795,8 @@
2792 write(6,'(7a)') 2795 write(6,'(7a)')
2793 . 'read_vps: ',method(1),(method(i),i=3,6)2796 . 'read_vps: ',method(1),(method(i),i=3,6)
2794 2797
2795C We are going to find the charge configuration2798 !Total charge density used for the pseudopotential generation
2796C used for the pseudopotential generation using the information given in
2797C the 'text' variable.
2798
2799 chgvps = vp%gen_zval2799 chgvps = vp%gen_zval
2800
2801 write(6,'(a,f10.5)') 'Total valence charge: ', chgvps2800 write(6,'(a,f10.5)') 'Total valence charge: ', chgvps
28022801
2803 if (nicore.ne.'nc ') then2802 if (nicore.ne.'nc ') then
@@ -2842,9 +2841,9 @@
2842 enddo 2841 enddo
28432842
28442843
2845! Ionic pseudopotentials (Only 'down' used)2844! Ionic pseudopotentials (down and up)
28462845
2847 do 20 ndown=1,lmax+12846 do ndown=1,lmax+1
2848 l = vp%ldown(ndown) 2847 l = vp%ldown(ndown)
2849 if (l.ne.ndown-1) then2848 if (l.ne.ndown-1) then
2850 write(6,'(a)')2849 write(6,'(a)')
@@ -2858,40 +2857,51 @@
2858 enddo2857 enddo
2859 vps(1,l) = vps(2,l) ! AG2858 vps(1,l) = vps(2,l) ! AG
28602859
2861 20 continue2860 enddo
28622861
2862 vps_u = 0.0_dp
2863 ! For backward compatibility with original OSSO branch,
2864 ! put 'keep-npotu-bug T' in fdf file
2865 ! To be removed altogether for releases
2866 if (fdf_get('keep-npotu-bug',.false.)) then
2867 nup_end = min(lmax,npotu-1)
2868 write(6,'(a)') 'atom: *** Buggy code in highest-l ' //
2869 $ 'SO component setup enabled ***'
2870 else
2871 nup_end = npotu
2872 endif
2873
2874 ! Allow an overall factor for the SO part (for debugging only!)
2875 ! Note that (notably for the lj-based SO implementation) this
2876 ! trick is based on the availability of a semilocal pseudo. Care
2877 ! should also be taken with the onward use of any .ion files
2878 ! produced.
2879
2880 so_strength = fdf_get('spin-orbit-strength', 1.0_dp)
2881 if (so_strength /= 1.0_dp) then
2882 write(6,'(a,f10.6)') 'atom: *** SO enhancement factor: ',
2883 $ so_strength
2884 endif
2885
2886 do nup=1,nup_end
2887 l = vp%lup(nup)
2888 vp%vup(nup,1:nrval) = so_strength * vp%vup(nup,1:nrval)
2889 vps_u(1:nrval,l) = vp%vup(nup,1:nrval)
2890 do ir=2,nrval
2891 vps_u(ir,l)=vps_u(ir,l)/rofi(ir)
2892 enddo
2893 vps_u(1,l) = vps_u(2,l)
2894 enddo
28632895
2864! Core and valence charge density2896! Core and valence charge density
28652897
2866 chcore(1:nrval) = vp%chcore(1:nrval)2898 chcore(1:nrval) = vp%chcore(1:nrval)
2867 rho(1:nrval) = vp%chval(1:nrval)2899 rho(1:nrval) = vp%chval(1:nrval)
2868C2900
2869C Obtain an ionic-pseudopotential if core correction for Hartree
2870C potential
2871!
2872! AG: OBSOLETE, as the program will stop in this case.
2873
2874 if ((nicore.eq.'pche').or.(nicore.eq.'fche')) then
2875 call vhrtre(chcore,ve,rofi,drdi,s,nrval,a)
2876 do l=0,lmax
2877 do ir=2,nrval
2878 vps(ir,l)=vps(ir,l)+ve(ir)
2879 enddo
2880 vps(1,l) = vps(2,l) ! AG
2881 enddo
2882 endif
2883
2884 return
2885
2886 5000 continue
2887 write(6,*)
2888 . 'ERROR: You are using an old pseudopotential file.',
2889 . ' Siesta needs a newer version.'
2890 call die
2891
2892 end subroutine read_vps2901 end subroutine read_vps
2893!2902!
2894 subroutine comKB(is,a,b,rofi,proj,l,ikb,rc,ekb,nrc,spp)2903 subroutine comKB(is,a,b,rofi,proj,l,lj_projs,jk,
2904 $ ikb,rc,ekb,nrc,spp)
2895C2905C
2896C Creates the common block with all the information about the 2906C Creates the common block with all the information about the
2897C Kleinman-Bylander projectors.2907C Kleinman-Bylander projectors.
@@ -2906,6 +2916,8 @@
2906 integer, intent(in) :: l, nrc,is, ikb 2916 integer, intent(in) :: l, nrc,is, ikb
2907 real(dp), intent(in) :: rc, ekb, proj(nrmax), a, b,2917 real(dp), intent(in) :: rc, ekb, proj(nrmax), a, b,
2908 . rofi(nrmax)2918 . rofi(nrmax)
2919 logical, intent(in) :: lj_projs
2920 integer, intent(in) :: jk
2909 type(species_info), intent(inout) :: spp2921 type(species_info), intent(inout) :: spp
2910 2922
2911 character(len=40) filename2923 character(len=40) filename
@@ -2932,10 +2944,17 @@
2932 2944
2933 spp%pjnl_n(n) = ikb2945 spp%pjnl_n(n) = ikb
2934 spp%pjnl_l(n) = l2946 spp%pjnl_l(n) = l
2947 if (lj_projs) then
2948 spp%pjnl_j(n) = l + (2*jk-3)*0.5_dp ! l -/+ 1/2
2949 if (l == 0 ) spp%pjnl_j(n) = 0.5_dp ! special case: only jk=1
2950 else
2951 spp%pjnl_j(n) = 0.0_dp
2952 endif
2935 do m = -l, l2953 do m = -l, l
2936 ntot = ntot + 12954 ntot = ntot + 1
2937 spp%pj_index(ntot) = n2955 spp%pj_index(ntot) = n
2938 spp%pj_l(ntot) = l2956 spp%pj_l(ntot) = l
2957 spp%pj_j(ntot) = spp%pjnl_j(n)
2939 spp%pj_m(ntot) = m2958 spp%pj_m(ntot) = m
2940 enddo2959 enddo
2941 spp%nprojs = ntot2960 spp%nprojs = ntot
@@ -2983,8 +3002,8 @@
2983 end subroutine comkb3002 end subroutine comkb
2984!3003!
2985 subroutine KBgen(is, a,b,rofi,drdi,s, 3004 subroutine KBgen(is, a,b,rofi,drdi,s,
2986 . vps, vlocal, ve, nrval, Zval, lmxkb, 3005 . vps, vps_u, vlocal, ve, nrval, Zval, lmxkb,
2987 . nkbl, erefkb, nkb, spp)3006 . nkbl, erefkb, nkb, spp, lj_projs)
29883007
2989 use basis_specs, only: restricted_grid3008 use basis_specs, only: restricted_grid
2990 use atom_options, only: new_kb_reference_orbitals3009 use atom_options, only: new_kb_reference_orbitals
@@ -3002,28 +3021,34 @@
30023021
3003 implicit none3022 implicit none
30043023
3005 real(dp) 3024 real(dp), intent(in) ::
3006 . a, b, rofi(nrmax), vps(nrmax,0:lmaxd),3025 . a, b, rofi(nrmax), vps(nrmax,0:lmaxd), vps_u(nrmax,0:lmaxd),
3007 . drdi(nrmax), s(nrmax), ve(nrmax),vlocal(nrmax),3026 . drdi(nrmax), s(nrmax), ve(nrmax),vlocal(nrmax),
3008 . Zval, erefkb(nkbmx,0:lmaxd)3027 . Zval, erefkb(nkbmx,0:lmaxd)
30093028
3010 integer3029 integer, intent(in) ::
3011 . nrval, lmxkb, nkb, is, nkbl(0:lmaxd)3030 . nrval, lmxkb, nkb, is, nkbl(0:lmaxd)
30123031
3013 type(species_info), intent(inout) :: spp3032 type(species_info), intent(inout) :: spp
3033 real(dp), allocatable :: rphi2(:,:,:), vii(:,:)
3034 real(dp), allocatable :: rphi(:,:,:)
3035 real(dp), allocatable :: eref(:,:)
3036
3037 logical, intent(in) :: lj_projs
3014C3038C
3015C Internal variables3039C Internal variables
3016C3040C
3017 integer 3041 integer
3018 . l,nprin, nnodes, ighost, nrwf, ikb, ir,3042 . l,nprin, nnodes, ighost, nrwf, ikb, ir,
3019 . nrc, nrlimit, n_pjnl, nkbs_tot3043 . nrc, nrlimit, n_pjnl, nkbs_tot, jk, nj
3020 real(dp)3044 real(dp) :: rc, dkbcos, ekb
3021 . rc(nkbmx,0:lmaxd), dkbcos(nkbmx,0:lmaxd),
3022 . ekb(nkbmx,0:lmaxd)
3023 3045
3024 real(dp)3046 real(dp)
3025 . rphi(nrmax,nkbmx), rmax, dnrm, 3047 . rmax, dnrm,
3026 . proj(nrmax)3048 . proj(nrmax), vp(nrmax)
3049
3050 character(len=2) :: jstr
3051 logical :: multiple_projectors
3027 3052
3028C The atomic wavefunctions and/or its energy derivatives are3053C The atomic wavefunctions and/or its energy derivatives are
3029C calculated only inside a sphere of radius Rmax. To define the3054C calculated only inside a sphere of radius Rmax. To define the
@@ -3056,13 +3081,20 @@
30563081
3057 spp%lmax_projs = lmxkb3082 spp%lmax_projs = lmxkb
3058 3083
3059 ! Generalize this for lj projectors
3060 nkbs_tot = 03084 nkbs_tot = 0
3061 n_pjnl = 03085 n_pjnl = 0
3062 do l = 0, lmxkb3086 do l = 0, lmxkb
3063 n_pjnl = n_pjnl + nkbl(l)3087 do ikb = 1, nkbl(l)
3064 nkbs_tot = nkbs_tot + nkbl(l)*(2*l+1)3088 n_pjnl = n_pjnl + 1
3089 nkbs_tot = nkbs_tot + (2*l+1)
3090 if (lj_projs .and. l>0) then ! j=l+1/2 and j=l-1/2 shells
3091 n_pjnl = n_pjnl + 1
3092 nkbs_tot = nkbs_tot + (2*l+1)
3093 endif
3094 enddo
3065 enddo3095 enddo
3096
3097 spp%lj_projs = lj_projs
3066 3098
3067 ! Eventually will make the arrays allocatable3099 ! Eventually will make the arrays allocatable
3068 if (n_pjnl > maxn_pjnl) then3100 if (n_pjnl > maxn_pjnl) then
@@ -3076,88 +3108,128 @@
3076 ! zero out for build-up in comkb3108 ! zero out for build-up in comkb
3077 spp%n_pjnl = 0 3109 spp%n_pjnl = 0
3078 spp%nprojs = 03110 spp%nprojs = 0
3111
3112 write(6,'(/,a)')'KBgen: Kleinman-Bylander projectors: '
3113
3114 multiple_projectors = .false.
3115
3116 if (lj_projs) then
3117 nj = 2
3118 else
3119 nj = 1
3120 endif
3079 3121
3122 ! Some output related to ghosts might be changed
3123 ! Note ordering of projectors
3124 ! Independent projector stacks for different j's
3125 allocate (rphi2(nrmax,nkbmx,nj), vii(nkbmx,nj))
3126 ! For the derivative option, we need a previous projector
3127 ! and the previous reference energy
3128 allocate (rphi(nrmax,nkbmx,nj))
3129 allocate (eref(nkbmx,nj))
3080 do l=0,lmxkb3130 do l=0,lmxkb
3081 do ir=1,nrmax3131 rphi(:,:,:) = 0.0_dp
3082 do ikb=1,nkbmx
3083 rphi(ir,ikb)=0.0d0
3084 enddo
3085 proj(ir)=0.0d0
3086 enddo
3087 do ikb= 1, nkbl(l)3132 do ikb= 1, nkbl(l)
3088C3133 do jk = 1, nj ! j-, j+
3089C Atomic wavefunctions and eigenvalues3134
3090C for the construction of the KB projectors3135 if (jk == 2 .and. l==0) CYCLE ! only one proj for l=0
3091C3136 if (lj_projs .and. l>0 ) then
3092C If the reference energies have not been specifed, the eigenstates3137 ! Set up the appropriate potential and label
3093C with the condition of being zero at r(nrval) will be used.3138 if (jk == 1) then
3094C 3139 ! V(l-j/2) = Vdn - (l+1)/2 Vup = Vion - (l+1)/2 Vso
3140 vp(:) = vps(:,l) - 0.5_dp*(l+1)*vps_u(:,l)
3141 jstr = 'j-'
3142 else
3143 ! V(l+1/2) = Vdn + l/2 Vup = Vion + l/2 Vso
3144 vp(:) = vps(:,l) + 0.5_dp*l*vps_u(:,l)
3145 jstr = 'j+'
3146 endif
3147 else
3148 vp(:) = vps(:,l)
3149 jstr = ' '
3150 endif
3151 proj(:) = 0.0_dp
3152
3153! Atomic wavefunctions and eigenvalues
3154! for the construction of the KB projectors
3155
3156 ! We use the same user-entered reference energies for both j's
3157
3095 if (erefkb(ikb,l).ge.1.0d3) then 3158 if (erefkb(ikb,l).ge.1.0d3) then
3159 ! If the reference energies have not been specifed, the
3160 ! eigenstates with the condition of being zero at r(nrval)
3161 ! will be used.
3096 nnodes=ikb3162 nnodes=ikb
3097 nprin=l+13163 nprin=l+1
30983164 ! use eref to avoid overwriting erefkb(,) for next j
3099 call schro_eq(Zval,rofi,vps(1,l),ve,s,drdi,3165 call schro_eq(Zval,rofi,vp,ve,s,drdi,
3100 . nrlimit,l,a,b,nnodes,nprin,3166 . nrlimit,l,a,b,nnodes,nprin,
3101 . erefkb(ikb,l),rphi(1,ikb)) 3167 . eref(ikb,jk),rphi(1,ikb,jk))
3102C Normalization of the eigenstates inside a sphere of radius Rmax3168C Normalization of the eigenstates inside a sphere of radius Rmax
3103 dnrm=0.0d03169 dnrm=0.0d0
3104 do ir=1,nrwf3170 do ir=1,nrwf
3105 dnrm=dnrm+drdi(ir)*rphi(ir,ikb)**23171 dnrm=dnrm+drdi(ir)*rphi(ir,ikb,jk)**2
3106 enddo 3172 enddo
3107 dnrm=sqrt(dnrm)3173 dnrm=sqrt(dnrm)
3108 do ir=1,nrwf3174 do ir=1,nrwf
3109 rphi(ir,ikb)=rphi(ir,ikb)/dnrm3175 rphi(ir,ikb,jk)=rphi(ir,ikb,jk)/dnrm
3110 enddo 3176 enddo
3111C3177C
3112 elseif((erefkb(ikb,l).le.-1.0d3).and.3178 elseif((erefkb(ikb,l).le.-1.0d3).and.
3113 . (ikb.gt.1) ) then 3179 . (ikb.gt.1) ) then
3114C If the energy is specified to be 1000 Ry, the energy derivative3180 ! If the energy is specified to be 1000 Ry, the energy
3115C of the previous wavefunction will be used3181 ! derivative of the previous wavefunction will be used
3116C3182 call energ_deriv(a,rofi,rphi(1,ikb-1,jk),vp(1),
3117 call energ_deriv(a,rofi,rphi(1,ikb-1),vps(1,l),3183 . ve,drdi,nrwf,l,eref(ikb-1,jk),
3118 . ve,drdi,nrwf,l,erefkb(ikb-1,l),3184 . rphi(1,ikb,jk),nrval)
3119 . rphi(1,ikb),nrval)3185 eref(ikb,jk)=0.0_dp
3120 erefkb(ikb,l)=0.0d03186
3121C
3122 else 3187 else
3123C If the reference energies have been specified, we just use them3188 ! If the reference energies have been specified, we just
3124C3189 ! use them
3125 call rphi_vs_e(a,b,rofi,vps(1,l),3190 call rphi_vs_e(a,b,rofi,vp(1),
3126 . ve,nrval,l,erefkb(ikb,l),3191 . ve,nrval,l,erefkb(ikb,l),
3127 . rphi(1,ikb),Rmax)3192 . rphi(1,ikb,jk),Rmax)
3128C3193 eref(ikb,jk) = erefkb(ikb,l)
3129 endif 3194 endif
3130C3195
3131C Ghost analysis3196 ! Ghost analysis
3132C 3197
3133 if (nkbl(l).eq.1) then3198 if (nkbl(l).eq.1) then
3134 call ghost(Zval,rofi,vps(:,l),vlocal,3199 call ghost(Zval,rofi,vp(:),vlocal,
3135 . ve,s,drdi,nrlimit,l,a,b,nrwf,3200 . ve,s,drdi,nrlimit,l,a,b,nrwf,
3136 . erefkb(ikb,l),rphi(:,ikb),ighost)3201 . eref(ikb,jk),rphi(:,ikb,jk),ighost)
3137 else 3202 else
3138 if (ikb.eq.1)3203 multiple_projectors = .true.
3139 . write(6,'(a,i3,/a)')
3140 . 'KBgen: More than one KB projector for l=',l,
3141 . 'KBgen: ghost states analysis will be not performed'
3142 endif3204 endif
3143C3205
3144C KB Projectors3206 ! The projector stack and vii are passed as arguments
3145C3207 ! to enable the needed loop ordering
3146 call KBproj(ikb,rofi,drdi,vps(1,l),vlocal,nrwf,l,3208 call KBproj(ikb,rofi,drdi,vp,vlocal,nrwf,l,
3147 . rphi(1,ikb),dkbcos(ikb,l),ekb(ikb,l),proj,nrc)3209 . rphi(1,ikb,jk),dkbcos,ekb,proj,nrc,
31483210 . rphi2(:,:,jk),vii(:,jk))
3149C3211
3150 rc(ikb,l)=rofi(nrc)3212 rc = rofi(nrc)
3151C3213
3152C Common block with the information about the KB projectors3214 ! Store KB projectors in data structure
3153C3215
3154 call comKB(is,a,b,rofi,proj,3216 call comKB(is,a,b,rofi,proj,l,lj_projs,jk,
3155 . l,ikb,rc(ikb,l),ekb(ikb,l),nrc, spp)3217 . ikb,rc,ekb,nrc, spp)
3156C3218
31573219 write(6,'(a2,1x,a,i2,4(3x,a,f10.6))') jstr,
3158 enddo 3220 . 'l=',l, 'rc=',rc, 'el=',eref(ikb,jk),
3159 enddo 3221 . 'Ekb=',ekb,'kbcos=',dkbcos
3222
3223 enddo ! jk
3224 enddo ! ikb:1,nkbl
3225 enddo ! l
3226 deallocate(rphi,rphi2,vii,eref)
3160 3227
3228 if (multiple_projectors) then
3229 write(6,'(a,/a)')
3230 . 'KBgen: More than one KB projector for some l shell(s)',
3231 . 'KBgen: ghost-state analysis will not be performed'
3232 endif
3161 if (ighost.eq.1) then3233 if (ighost.eq.1) then
3162 write(6,"(2a)")'KBgen: WARNING: ',3234 write(6,"(2a)")'KBgen: WARNING: ',
3163 . 'Ghost states have been detected'3235 . 'Ghost states have been detected'
@@ -3169,34 +3241,14 @@
3169 write(6,"(a)") " KBgen: *** Warning Ignored by User"3241 write(6,"(a)") " KBgen: *** Warning Ignored by User"
3170 ighost = 03242 ighost = 0
3171 else3243 else
3172 call die3244 call die("Ghost states detected")
3173 endif3245 endif
3174 endif3246 endif
31753247
3176 write(6,'(/,a)')'KBgen: Kleinman-Bylander projectors: '3248 write(6,'(/,a, i4)')
3177 do l=0,lmxkb3249 .'KBgen: Total number of Kleinman-Bylander projectors: ',
3178 do ikb=1, nkbl(l)3250 $ spp%nprojs
3179 write(6,'(3x,a,i2,4(3x,a,f10.6))')3251
3180 . 'l=',l, 'rc=',rc(ikb,l), 'el=',erefkb(ikb,l),
3181 . 'Ekb=',ekb(ikb,l),'kbcos=',dkbcos(ikb,l)
3182 enddo
3183 enddo
3184C
3185C Total number of Kleinman-Bylander projectors
3186C
3187 nkb=0
3188 do l=0,lmxkb
3189 do ikb=1,nkbl(l)
3190 nkb=nkb+(2*l+1)
3191 enddo
3192 enddo
3193 write(6,'(/,a, i4)')
3194 .'KBgen: Total number of Kleinman-Bylander projectors: ', nkb
3195 if (nkb /= spp%nprojs) then
3196 print *, "spp%nprojs: ", spp%nprojs
3197 call die("Mismatch nkb spp%nprojs")
3198 endif
3199C
3200 end subroutine KBgen3252 end subroutine KBgen
3201!3253!
3202 subroutine Basis_gen(Zval,is, iz, a,b,rofi,drdi,s,3254 subroutine Basis_gen(Zval,is, iz, a,b,rofi,drdi,s,
32033255
=== modified file 'Src/bands.F'
--- Src/bands.F 2018-04-25 11:33:32 +0000
+++ Src/bands.F 2018-04-30 20:53:35 +0000
@@ -366,7 +366,7 @@
366 use atmfuncs, only : symfio, cnfigfio, labelfis, nofis366 use atmfuncs, only : symfio, cnfigfio, labelfis, nofis
367 use writewave, only : wfs_filename367 use writewave, only : wfs_filename
368368
369 use m_spin, only: NoMagn, SPpol, NonCol, SpOrb369 use m_spin, only: spin
370370
371 use m_diag_option, only: ParallelOverK, Serial371 use m_diag_option, only: ParallelOverK, Serial
372 use m_diag, only: diag_init372 use m_diag, only: diag_init
@@ -459,7 +459,7 @@
459 endif459 endif
460460
461C Find the band energies461C Find the band energies
462 if (NoMagn .or. SPpol) then462 if ( spin%none .or. spin%Col ) then
463C fixspin and qs are not used in diagk, since getD=.false. ...463C fixspin and qs are not used in diagk, since getD=.false. ...
464 qs(1) = 0.0_dp464 qs(1) = 0.0_dp
465 qs(2) = 0.0_dp465 qs(2) = 0.0_dp
@@ -488,7 +488,7 @@
488 ParallelOverK = SaveParallelOverK488 ParallelOverK = SaveParallelOverK
489 if ( ParallelOverK ) Serial = .true.489 if ( ParallelOverK ) Serial = .true.
490490
491 elseif ( NonCol ) then491 elseif ( spin%NCol ) then
492 if (getPSI) then492 if (getPSI) then
493 if (node==0) then493 if (node==0) then
494 write(6,*) "No WFS for non-colinear spin, yet..."494 write(6,*) "No WFS for non-colinear spin, yet..."
@@ -503,7 +503,7 @@
503 . Haux, Saux, psi, Haux, Saux, aux,503 . Haux, Saux, psi, Haux, Saux, aux,
504 . no_u, occtol, 1, no_u )504 . no_u, occtol, 1, no_u )
505505
506 elseif ( SpOrb ) then506 elseif ( spin%SO ) then
507 if (getPSI) then507 if (getPSI) then
508 if (node==0) then508 if (node==0) then
509 write(6,*) "No WFS for spin-orbit, yet..."509 write(6,*) "No WFS for spin-orbit, yet..."
510510
=== modified file 'Src/basis_io.F'
--- Src/basis_io.F 2017-12-22 10:26:20 +0000
+++ Src/basis_io.F 2018-04-30 20:53:35 +0000
@@ -401,8 +401,14 @@
401! KBs401! KBs
402 read(lun,*)402 read(lun,*)
403 do i=1,spp%n_pjnl403 do i=1,spp%n_pjnl
404 read(lun,*)404 if (spp%lj_projs) then
405 read(lun,*)
406 $ spp%pjnl_l(i), spp%pjnl_j(i), spp%pjnl_n(i),
407 $ spp%pjnl_ekb(i)
408 else
409 read(lun,*)
405 $ spp%pjnl_l(i), spp%pjnl_n(i), spp%pjnl_ekb(i)410 $ spp%pjnl_l(i), spp%pjnl_n(i), spp%pjnl_ekb(i)
411 endif
406 call radial_read_ascii(spp%pjnl(i),lun,412 call radial_read_ascii(spp%pjnl(i),lun,
407 $ yp1=0.0_dp,ypn=huge(1.0_dp))413 $ yp1=0.0_dp,ypn=huge(1.0_dp))
408 enddo414 enddo
@@ -417,6 +423,7 @@
417 nk = nk+1423 nk = nk+1
418 spp%pj_n(nk) = spp%pjnl_n(i)424 spp%pj_n(nk) = spp%pjnl_n(i)
419 spp%pj_l(nk) = spp%pjnl_l(i)425 spp%pj_l(nk) = spp%pjnl_l(i)
426 spp%pj_j(nk) = spp%pjnl_j(i)
420 spp%pj_m(nk) = m427 spp%pj_m(nk) = m
421 spp%pj_index(nk) = i428 spp%pj_index(nk) = i
422 enddo429 enddo
@@ -450,6 +457,7 @@
450 integer, intent(in) :: unit457 integer, intent(in) :: unit
451 458
452 character(len=78) line459 character(len=78) line
460 integer :: iostat
453461
454 read(unit,'(a)') line462 read(unit,'(a)') line
455 if (trim(line) .eq. '<preamble>') then463 if (trim(line) .eq. '<preamble>') then
@@ -465,7 +473,12 @@
465 read(unit,*) p%mass473 read(unit,*) p%mass
466 read(unit,*) p%self_energy474 read(unit,*) p%self_energy
467 read(unit,*) p%lmax_basis, p%n_orbnl475 read(unit,*) p%lmax_basis, p%n_orbnl
468 read(unit,*) p%lmax_projs, p%n_pjnl476 read(unit,fmt=*,iostat=iostat) p%lmax_projs, p%n_pjnl, p%lj_projs
477 if (iostat /=0 ) then
478 backspace(unit)
479 read(unit,*) p%lmax_projs, p%n_pjnl
480 p%lj_projs = .false.
481 endif
469482
470 allocate(p%orbnl(p%n_orbnl))483 allocate(p%orbnl(p%n_orbnl))
471 allocate(p%pjnl(p%n_pjnl))484 allocate(p%pjnl(p%n_pjnl))
@@ -817,9 +830,16 @@
817 do i=1,spp%n_pjnl830 do i=1,spp%n_pjnl
818 zeta = spp%pjnl_n(i)831 zeta = spp%pjnl_n(i)
819 l = spp%pjnl_l(i)832 l = spp%pjnl_l(i)
820 write(lun,'(2i3,f22.16,2x,a)')833 if (spp%lj_projs) then
834 write(lun,'(i3,f4.1,i3,f22.16,2x,a)')
835 $ spp%pjnl_l(i), spp%pjnl_j(i), spp%pjnl_n(i),
836 $ spp%pjnl_ekb(i),
837 $ " #kb l, j, n (sequence number), Reference energy"
838 else
839 write(lun,'(2i3,f22.16,2x,a)')
821 $ spp%pjnl_l(i), spp%pjnl_n(i), spp%pjnl_ekb(i),840 $ spp%pjnl_l(i), spp%pjnl_n(i), spp%pjnl_ekb(i),
822 $ " #kb l, n (sequence number), Reference energy"841 $ " #kb l, n (sequence number), Reference energy"
842 endif
823 call radial_dump_ascii(spp%pjnl(i),lun)843 call radial_dump_ascii(spp%pjnl(i),lun)
824844
825 if (write_ion_plot_files) then845 if (write_ion_plot_files) then
@@ -949,8 +969,14 @@
949 write(unit,'(g22.12,4x,a)') p%self_energy, "# Self energy "969 write(unit,'(g22.12,4x,a)') p%self_energy, "# Self energy "
950 write(unit,'(2i4,22x,a)') p%lmax_basis, p%n_orbnl,970 write(unit,'(2i4,22x,a)') p%lmax_basis, p%n_orbnl,
951 $ "# Lmax for basis, no. of nl orbitals "971 $ "# Lmax for basis, no. of nl orbitals "
952 write(unit,'(2i4,22x,a)') p%lmax_projs, p%n_pjnl,972 if (p%lj_projs) then
953 $ "# Lmax for projectors, no. of nl KB projectors "973 write(unit,'(2i4,1x,l1,20x,a)') p%lmax_projs, p%n_pjnl,
974 $ p%lj_projs,
975 $ "# Lmax for projectors, no. of nl KB projectors, LJ projs?"
976 else
977 write(unit,'(2i4,22x,a)') p%lmax_projs, p%n_pjnl,
978 $ "# Lmax for projectors, no. of nl KB projectors"
979 endif
954980
955 end subroutine write_header981 end subroutine write_header
956982
957983
=== modified file 'Src/broadcast_basis.F'
--- Src/broadcast_basis.F 2016-06-28 05:57:03 +0000
+++ Src/broadcast_basis.F 2018-04-30 20:53:35 +0000
@@ -104,10 +104,14 @@
104 $ 0,MPI_Comm_World,MPIerror)104 $ 0,MPI_Comm_World,MPIerror)
105 call MPI_Bcast(spp%lmax_projs,1,MPI_integer,105 call MPI_Bcast(spp%lmax_projs,1,MPI_integer,
106 $ 0,MPI_Comm_World,MPIerror)106 $ 0,MPI_Comm_World,MPIerror)
107 call MPI_Bcast(spp%lj_projs,1,MPI_logical,
108 $ 0,MPI_Comm_World,MPIerror)
107 call MPI_Bcast(spp%pjnl_l,maxn_pjnl,MPI_integer,109 call MPI_Bcast(spp%pjnl_l,maxn_pjnl,MPI_integer,
108 $ 0,MPI_Comm_World,MPIerror)110 $ 0,MPI_Comm_World,MPIerror)
109 call MPI_Bcast(spp%pjnl_n,maxn_pjnl,MPI_integer,111 call MPI_Bcast(spp%pjnl_n,maxn_pjnl,MPI_integer,
110 $ 0,MPI_Comm_World,MPIerror)112 $ 0,MPI_Comm_World,MPIerror)
113 call MPI_Bcast(spp%pjnl_j,maxn_pjnl,MPI_double_precision,
114 $ 0,MPI_Comm_World,MPIerror)
111 call MPI_Bcast(spp%pjnl_ekb,maxn_pjnl,MPI_double_precision,115 call MPI_Bcast(spp%pjnl_ekb,maxn_pjnl,MPI_double_precision,
112 $ 0,MPI_Comm_World,MPIerror)116 $ 0,MPI_Comm_World,MPIerror)
113117
@@ -134,6 +138,8 @@
134 $ 0,MPI_Comm_World,MPIerror)138 $ 0,MPI_Comm_World,MPIerror)
135 call MPI_Bcast(spp%pj_l,maxnprojs,MPI_integer,139 call MPI_Bcast(spp%pj_l,maxnprojs,MPI_integer,
136 $ 0,MPI_Comm_World,MPIerror)140 $ 0,MPI_Comm_World,MPIerror)
141 call MPI_Bcast(spp%pj_j,maxnprojs,MPI_double_precision,
142 $ 0,MPI_Comm_World,MPIerror)
137 call MPI_Bcast(spp%pj_m,maxnprojs,MPI_integer,143 call MPI_Bcast(spp%pj_m,maxnprojs,MPI_integer,
138 $ 0,MPI_Comm_World,MPIerror)144 $ 0,MPI_Comm_World,MPIerror)
139145
140146
=== modified file 'Src/compute_energies.F90'
--- Src/compute_energies.F90 2017-12-21 15:49:49 +0000
+++ Src/compute_energies.F90 2018-04-30 20:53:35 +0000
@@ -47,8 +47,10 @@
47 lastkb, no_s, rmaxv, indxua, iphorb, lasto, &47 lastkb, no_s, rmaxv, indxua, iphorb, lasto, &
48 rmaxo, no_l48 rmaxo, no_l
49 use m_ntm, only: ntm49 use m_ntm, only: ntm
50 use m_spin, only: NoMagn, SPpol, NonCol, SpOrb 50
51 use m_spin, only: nspin, h_spin_dim, spinor_dim51 use m_spin, only: spin
52 use parallel, only: IONode
53
52 use m_dipol, only: dipol54 use m_dipol, only: dipol
53 use siesta_geom, only: na_u, na_s, xa, isa55 use siesta_geom, only: na_u, na_s, xa, isa
54 use m_rhog, only: rhog56 use m_rhog, only: rhog
@@ -58,22 +60,20 @@
5860
59 integer, intent(in) :: iscf61 integer, intent(in) :: iscf
6062
61 integer :: ihmat, ifa, istr, ispin, io63 integer :: ispin, io
62#ifdef MPI64#ifdef MPI
63 real(dp) :: buffer165 real(dp) :: buffer1
64#endif66#endif
6567
66 real(dp) :: const
67 real(dp) :: dummy_stress(3,3), dummy_fa(1,1)
68 real(dp) :: dummy_E, g2max, dummy_H(1,1)
69 logical :: mixDM68 logical :: mixDM
7069
70
71 mixDM = (.not. (mixH .or. mix_charge))71 mixDM = (.not. (mixH .or. mix_charge))
7272
73! Compute the band-structure energy73! Compute the band-structure energy
7474
75 call compute_EBS()75 call compute_EBS()
76 76
77 ! These energies were calculated in the latest call to77 ! These energies were calculated in the latest call to
78 ! setup_hamiltonian, using as ingredient D_in 78 ! setup_hamiltonian, using as ingredient D_in
7979
@@ -126,36 +126,89 @@
126126
127 subroutine compute_EBS()127 subroutine compute_EBS()
128128
129 real(dp) :: Ebs_SO(4)
130 complex(dp) :: Ebs_Daux(2,2), Ebs_Haux(2,2)
131
132 integer :: i, j, ind
133
129 Ebs = 0.0_dp134 Ebs = 0.0_dp
130! const factor takes into account that there are two nondiagonal135
131! elements in non-collinear spin density matrix, stored as136! Modifed for Off-Site Spin-orbit coupling by R. Cuadrado, Feb. 2018
132! ispin=1 => D11; ispin=2 => D22, ispin=3 => Real(D12);137!
133! ispin=4 => Imag(D12)138!*****************************************************************************
134139! Note about Ebs and E_Harris calculation for the Spin-Orbit:
135 if ( SpOrb ) then140!*****************************************************************************
136 do io = 1,maxnh141!
137 Ebs = Ebs + H(io,1) * ( Dscf(io,1) ) &142! E_bs and E_Harris are calculated by means of the following
138 + H(io,2) * ( Dscf(io,2) ) &143! complex matrix multiplication:
139 + H(io,3) * ( Dscf(io,7) ) &144!
140 + H(io,4) * ( Dscf(io,8) ) &145! E_bs = Re { Tr[ H * DM ] }
141 - H(io,5) * ( Dscf(io,5) ) &146! E_Harris = Re { Tr[ H * (DM-DM_old) ] }
142 - H(io,6) * ( Dscf(io,6) ) &147!
143 + H(io,7) * ( Dscf(io,3) ) &148! In the following: DM/H(1,1) --> up/up <--> uu
144 + H(io,8) * ( Dscf(io,4) )149! DM/H(2,2) --> down/down <--> dd
150! DM/H(1,2) --> up/down <--> ud
151! DM/H(2,1) --> down/up <--> du
152!
153! Using DM/H components, E_bs would be sum(E_bs(1:4)), where
154!
155! E_bs(1)=Re{sum_ij(H_ij(1,1)*D_ji(1,1))}=Re{sum_ij(H_ij^uu*(DM_ij^uu)^*)}
156! E_bs(2)=Re{sum_ij(H_ij(2,2)*D_ji(2,2))}=Re{sum_ij(H_ij^dd*(DM_ij^dd)^*)}
157! E_bs(3)=Re{sum_ij(H_ij(1,2)*D_ji(2,1))}=Re{sum_ij(H_ij^ud*(DM_ij^ud)^*)}
158! E_bs(4)=Re{sum_ij(H_ij(2,1)*D_ji(1,2))}=Re{sum_ij(H_ij^du*(DM_ij^du)^*)}
159!
160! since, due to overall hermiticity, DM_ij^ab = (DM_ji^ba)^*
161!
162! The trace operation is then an extended dot product over the "ij"
163! sparse index, which can also be conveniently done in parallel, as
164! each processor handles the same indexes in H and the DM. Only a
165! global reduction is needed at the end.
166
167! Same comments are valid for the E_Harris calculation.
168!
169!*****************************************************************************
170!
171 if ( spin%SO ) then
172
173 Ebs_SO = 0.0_dp
174 Ebs_Daux = dcmplx(0.0_dp, 0.0_dp)
175 Ebs_Haux = dcmplx(0.0_dp, 0.0_dp)
176
177 do io = 1, maxnh
178
179 Ebs_Haux(1,1) = dcmplx(H(io,1),H(io,5))
180 Ebs_Haux(2,2) = dcmplx(H(io,2),H(io,6))
181 Ebs_Haux(1,2) = dcmplx(H(io,3),-H(io,4))
182 Ebs_Haux(2,1) = dcmplx(H(io,7),H(io,8))
183
184 Ebs_Daux(1,1) = dcmplx(Dscf(io,1),Dscf(io,5))
185 Ebs_Daux(2,2) = dcmplx(Dscf(io,2),Dscf(io,6))
186 Ebs_Daux(1,2) = dcmplx(Dscf(io,3),-Dscf(io,4))
187 Ebs_Daux(2,1) = dcmplx(Dscf(io,7),Dscf(io,8))
188
189
190 Ebs_SO(1) = Ebs_SO(1) + real( Ebs_Haux(1,1)*dconjg(Ebs_Daux(1,1)) )
191 Ebs_SO(2) = Ebs_SO(2) + real( Ebs_Haux(2,2)*dconjg(Ebs_Daux(2,2)) )
192 Ebs_SO(3) = Ebs_SO(3) + real( Ebs_Haux(1,2)*dconjg(Ebs_Daux(1,2)) )
193 Ebs_SO(4) = Ebs_SO(4) + real( Ebs_Haux(2,1)*dconjg(Ebs_Daux(2,1)) )
194
145 enddo195 enddo
146 else if ( NonCol ) then196
197 Ebs = sum ( Ebs_SO )
198
199 else if ( spin%NCol ) then
147 do io = 1,maxnh200 do io = 1,maxnh
148 Ebs = Ebs + H(io,1) * ( Dscf(io,1) ) &201 Ebs = Ebs + H(io,1) * ( Dscf(io,1) ) &
149 + H(io,2) * ( Dscf(io,2) ) &202 + H(io,2) * ( Dscf(io,2) ) &
150 + 2.0_dp * H(io,3) * ( Dscf(io,3) ) &203 + 2.0_dp * H(io,3) * ( Dscf(io,3) ) &
151 + 2.0_dp * H(io,4) * ( Dscf(io,4) )204 + 2.0_dp * H(io,4) * ( Dscf(io,4) )
152 enddo205 enddo
153 else if ( SPpol ) then206 else if ( spin%Col ) then
154 do io = 1,maxnh207 do io = 1,maxnh
155 Ebs = Ebs + H(io,1) * Dscf(io,1) &208 Ebs = Ebs + H(io,1) * Dscf(io,1) &
156 + H(io,2) * Dscf(io,2)209 + H(io,2) * Dscf(io,2)
157 enddo210 enddo
158 else if ( NoMagn ) then211 else if ( spin%none ) then
159 do io = 1,maxnh212 do io = 1,maxnh
160 Ebs = Ebs + H(io,1) * Dscf(io,1)213 Ebs = Ebs + H(io,1) * Dscf(io,1)
161 enddo214 enddo
@@ -170,36 +223,65 @@
170223
171 subroutine compute_DEharr()224 subroutine compute_DEharr()
172225
226 real(dp) :: DEharr_SO(4)
227 complex(dp) :: DEharr_Daux(2,2), DEharr_Haux(2,2), DEharr_Daux_old(2,2)
228
173 DEharr = 0.0_dp229 DEharr = 0.0_dp
174 ! const factor takes into account that there are two nondiagonal230
175 ! elements in non-collinear spin density matrix, stored as231 if ( spin%SO ) then
176 ! ispin=1 => D11; ispin=2 => D22, ispin=3 => Real(D12);232
177 ! ispin=4 => Imag(D12)233 DEharr_SO = 0.0_dp
178234 DEharr_Daux = dcmplx(0.0_dp, 0.0_dp)
179 if ( SpOrb ) then235 DEharr_Daux_old = dcmplx(0.0_dp, 0.0_dp)
180 do io = 1,maxnh236 DEharr_Haux = dcmplx(0.0_dp, 0.0_dp)
181 DEharr = DEharr + H(io,1) * ( Dscf(io,1) - Dold(io,1) ) &237
182 + H(io,2) * ( Dscf(io,2) - Dold(io,2) ) &238 do io = 1, maxnh
183 + H(io,3) * ( Dscf(io,7) - Dold(io,7) ) &239
184 + H(io,4) * ( Dscf(io,8) - Dold(io,8) ) &240 DEharr_Haux(1,1) = dcmplx( H(io,1),H(io,5) )
185 - H(io,5) * ( Dscf(io,5) - Dold(io,5) ) &241 DEharr_Haux(2,2) = dcmplx( H(io,2),H(io,6) )
186 - H(io,6) * ( Dscf(io,6) - Dold(io,6) ) &242 DEharr_Haux(1,2) = dcmplx( H(io,3),-H(io,4) )
187 + H(io,7) * ( Dscf(io,3) - Dold(io,3) ) &243 DEharr_Haux(2,1) = dcmplx( H(io,7),H(io,8) )
188 + H(io,8) * ( Dscf(io,4) - Dold(io,4) )244
189 enddo245 DEharr_Daux(1,1) = dcmplx( Dscf(io,1),Dscf(io,5) )
190 else if ( NonCol ) then246 DEharr_Daux(2,2) = dcmplx( Dscf(io,2),Dscf(io,6) )
247 DEharr_Daux(1,2) = dcmplx( Dscf(io,3),-Dscf(io,4) )
248 DEharr_Daux(2,1) = dcmplx( Dscf(io,7),Dscf(io,8) )
249
250 DEharr_Daux_old(1,1) = dcmplx( Dold(io,1),Dold(io,5) )
251 DEharr_Daux_old(2,2) = dcmplx( Dold(io,2),Dold(io,6) )
252 DEharr_Daux_old(1,2) = dcmplx( Dold(io,3),-Dold(io,4) )
253 DEharr_Daux_old(2,1) = dcmplx( Dold(io,7),Dold(io,8) )
254
255
256 DEharr_SO(1) = DEharr_SO(1) &
257 + real( DEharr_Haux(1,1)*dconjg(DEharr_Daux(1,1)-DEharr_Daux_old(1,1)) )
258
259 DEharr_SO(2) = DEharr_SO(2) &
260 + real( DEharr_Haux(2,2)*dconjg(DEharr_Daux(2,2)-DEharr_Daux_old(2,2)) )
261
262 DEharr_SO(3) = DEharr_SO(3) &
263 + real( DEharr_Haux(1,2)*dconjg(DEharr_Daux(1,2)-DEharr_Daux_old(1,2)) )
264
265 DEharr_SO(4) = DEharr_SO(4) &
266 + real( DEharr_Haux(2,1)*dconjg(DEharr_Daux(2,1)-DEharr_Daux_old(2,1)) )
267
268 enddo
269
270 DEharr = sum ( DEharr_SO )
271
272 else if ( spin%NCol ) then
191 do io = 1,maxnh273 do io = 1,maxnh
192 DEharr = DEharr + H(io,1) * ( Dscf(io,1) - Dold(io,1) ) &274 DEharr = DEharr + H(io,1) * ( Dscf(io,1) - Dold(io,1) ) &
193 + H(io,2) * ( Dscf(io,2) - Dold(io,2) ) &275 + H(io,2) * ( Dscf(io,2) - Dold(io,2) ) &
194 + 2.0_dp * H(io,3) * ( Dscf(io,3) - Dold(io,3) ) &276 + 2.0_dp * H(io,3) * ( Dscf(io,3) - Dold(io,3) ) &
195 + 2.0_dp * H(io,4) * ( Dscf(io,4) - Dold(io,4) )277 + 2.0_dp * H(io,4) * ( Dscf(io,4) - Dold(io,4) )
196 enddo278 enddo
197 elseif (SPpol) then279 elseif ( spin%Col ) then
198 do io = 1,maxnh280 do io = 1,maxnh
199 DEharr = DEharr + H(io,1) * ( Dscf(io,1) - Dold(io,1) ) &281 DEharr = DEharr + H(io,1) * ( Dscf(io,1) - Dold(io,1) ) &
200 + H(io,2) * ( Dscf(io,2) - Dold(io,2) )282 + H(io,2) * ( Dscf(io,2) - Dold(io,2) )
201 enddo283 enddo
202 elseif (NoMagn) then284 elseif ( spin%none ) then
203 do io = 1,maxnh285 do io = 1,maxnh
204 DEharr = DEharr + H(io,1) * ( Dscf(io,1) - Dold(io,1) )286 DEharr = DEharr + H(io,1) * ( Dscf(io,1) - Dold(io,1) )
205 enddo287 enddo
@@ -217,11 +299,21 @@
217 use files, only : filesOut_t ! derived type for output file names299 use files, only : filesOut_t ! derived type for output file names
218 use class_dSpData1D, only : val300 use class_dSpData1D, only : val
219 use class_dSpData2D, only : val301 use class_dSpData2D, only : val
220 use sparse_matrices, only: H_kin_1D, H_vkb_1D, H_so_2D302 use class_zSpData2D, only : val
303 use sparse_matrices, only: H_kin_1D, H_vkb_1D
304 use sparse_matrices, only: H_so_on_2D, H_so_off_2D
305
221306
222 type(filesOut_t) :: filesOut ! blank output file names307 type(filesOut_t) :: filesOut ! blank output file names
223 real(dp), pointer :: H_vkb(:), H_kin(:), H_so(:,:)308 real(dp), pointer :: H_vkb(:), H_kin(:), H_so_on(:,:)
224309 complex(dp), pointer :: H_so_off(:,:)
310
311
312 complex(dp) :: Hc, Dc
313 real(dp) :: dummy_stress(3,3), dummy_fa(1,1)
314 real(dp) :: dummy_E, g2max, dummy_H(1,1)
315 integer :: ihmat, ifa, istr
316
225 ! Compute E_KS(DM_out)317 ! Compute E_KS(DM_out)
226318
227 g2max = g2cut319 g2max = g2cut
@@ -233,7 +325,7 @@
233325
234 ! Remove unwanted arguments...326 ! Remove unwanted arguments...
235327
236 call dhscf( nspin, no_s, iaorb, iphorb, no_l, &328 call dhscf( spin%Grid, no_s, iaorb, iphorb, no_l, &
237 no_u, na_u, na_s, isa, xa, indxua, &329 no_u, na_u, na_s, isa, xa, indxua, &
238 ntm, ifa, istr, ihmat, filesOut, &330 ntm, ifa, istr, ihmat, filesOut, &
239 maxnh, numh, listhptr, listh, Dscf, Datm, &331 maxnh, numh, listhptr, listh, Dscf, Datm, &
@@ -250,7 +342,7 @@
250 342
251 Ekin = 0.0_dp343 Ekin = 0.0_dp
252 Enl = 0.0_dp344 Enl = 0.0_dp
253 do ispin = 1, spinor_dim345 do ispin = 1, spin%spinor
254 do io = 1,maxnh346 do io = 1,maxnh
255 Ekin = Ekin + H_kin(io) * Dscf(io,ispin)347 Ekin = Ekin + H_kin(io) * Dscf(io,ispin)
256 Enl = Enl + H_vkb(io) * Dscf(io,ispin)348 Enl = Enl + H_vkb(io) * Dscf(io,ispin)
@@ -266,21 +358,48 @@
266#endif358#endif
267359
268 Eso = 0._dp360 Eso = 0._dp
269 if ( SpOrb ) then361
362 if ( spin%SO_offsite ) then
363 H_so_off => val(H_so_off_2D)
364
365 ! The computation of the trace is different here, as H_so_off has
366 ! a different structure from H and the DM.
367 do io = 1, maxnh
368
369!-------- Eso(u,u)
370 Dc = cmplx(Dscf(io,1),Dscf(io,5), dp)
371 Eso = Eso + real( H_so_off(io,1)*Dc, dp)
372!-------- Eso(d,d)
373 Dc = cmplx(Dscf(io,2),Dscf(io,6), dp)
374 Eso = Eso + real( H_so_off(io,2)*Dc, dp)
375!-------- Eso(u,d)
376 Dc = cmplx(Dscf(io,3),Dscf(io,4), dp)
377 Eso = Eso + real( H_so_off(io,4)*Dc, dp)
378!-------- Eso(d,u)
379 Dc = cmplx(Dscf(io,7),-Dscf(io,8), dp)
380 Eso = Eso + real( H_so_off(io,3)*Dc, dp)
381
382 end do
383
384 else if ( spin%SO_onsite ) then
270 ! Sadly some compilers (g95), does385 ! Sadly some compilers (g95), does
271 ! not allow bounds for pointer assignments :(386 ! not allow bounds for pointer assignments :(
272 H_so => val(H_so_2D)387 H_so_on => val(H_so_on_2D)
273 do io = 1,maxnh388 do io = 1,maxnh
274 Eso = Eso + H_so(io,1)*Dscf(io,7) + H_so(io,2)*Dscf(io,8) &389 Eso = Eso + H_so_on(io,1)*Dscf(io,7) + H_so_on(io,2)*Dscf(io,8) &
275 + H_so(io,5)*Dscf(io,3) + H_so(io,6)*Dscf(io,4) &390 + H_so_on(io,5)*Dscf(io,3) + H_so_on(io,6)*Dscf(io,4) &
276 - H_so(io,3)*Dscf(io,5) - H_so(io,4)*Dscf(io,6)391 - H_so_on(io,3)*Dscf(io,5) - H_so_on(io,4)*Dscf(io,6)
277 end do392 end do
393
394 end if
395
278#ifdef MPI396#ifdef MPI
397 if (spin%SO) then
279 ! Global reduction of Eso398 ! Global reduction of Eso
280 call globalize_sum( Eso, buffer1 )399 call globalize_sum( Eso, buffer1 )
281 Eso = buffer1400 Eso = buffer1
401 endif
282#endif402#endif
283 end if
284 403
285 ! E0 = Ena + Ekin + Enl + Eso - Eions404 ! E0 = Ena + Ekin + Enl + Eso - Eions
286405
287406
=== modified file 'Src/dfscf.f'
--- Src/dfscf.f 2018-04-22 00:13:43 +0000
+++ Src/dfscf.f 2018-04-30 20:53:35 +0000
@@ -20,6 +20,7 @@
20C Adds the SCF contribution to atomic forces and stress.20C Adds the SCF contribution to atomic forces and stress.
21C Written by P.Ordejon, J.M.Soler, and J.Gale.21C Written by P.Ordejon, J.M.Soler, and J.Gale.
22C Last modification by J.M.Soler, October 2000.22C Last modification by J.M.Soler, October 2000.
23C Modifed for Off-Site Spin-orbit coupling by R. Cuadrado, Feb. 2018
23C *********************** INPUT **************************************24C *********************** INPUT **************************************
24C integer ifa : Are forces required? (1=yes,0=no)25C integer ifa : Are forces required? (1=yes,0=no)
25C integer istr : Is stress required? (1=yes,0=no)26C integer istr : Is stress required? (1=yes,0=no)
@@ -334,7 +335,7 @@
334335
335C Factor two for nondiagonal elements for non-collinear spin (and SO)336C Factor two for nondiagonal elements for non-collinear spin (and SO)
336 if ( nspin == 4 ) then337 if ( nspin == 4 ) then
337 V(1:nsp,3:4) = 2.0_dp * V(1:nsp,3:4)338 V(1:nsp,3:4) = 2.0_dp * V(1:nsp,3:4)
338 end if339 end if
339340
340C Loop on first orbital of mesh point341C Loop on first orbital of mesh point
341342
=== modified file 'Src/final_H_f_stress.F'
--- Src/final_H_f_stress.F 2017-11-23 14:17:27 +0000
+++ Src/final_H_f_stress.F 2018-04-30 20:53:35 +0000
@@ -21,8 +21,9 @@
21 use siesta_options, only: recompute_H_after_scf21 use siesta_options, only: recompute_H_after_scf
22 use sparse_matrices, only: numh, listh, listhptr22 use sparse_matrices, only: numh, listh, listhptr
23 use sparse_matrices, only: H, S, Dscf, Escf, maxnh, xijo23 use sparse_matrices, only: H, S, Dscf, Escf, maxnh, xijo
24 use sparse_matrices, only: H_ldau_2D24 use sparse_matrices, only: H_ldau_2D, H_so_off_2D
25 use class_dSpData2D, only: val25 use class_dSpData2D, only: val
26 use class_zSpData2D, only: val
2627
27 use siesta_geom28 use siesta_geom
28 use atomlist, only: no_u, iaorb, iphkb, qtot, indxuo, datm, 29 use atomlist, only: no_u, iaorb, iphkb, qtot, indxuo, datm,
@@ -30,7 +31,7 @@
30 & rmaxo, no_l, iza31 & rmaxo, no_l, iza
31 use metaforce, only: lMetaForce, meta32 use metaforce, only: lMetaForce, meta
32 use molecularmechanics, only : twobody33 use molecularmechanics, only : twobody
33 use m_nlefsm, only: nlefsm34 use m_nlefsm, only: nlefsm, nlefsm_SO_off
34 use m_overfsm, only: overfsm35 use m_overfsm, only: overfsm
35 use m_kinefsm, only: kinefsm36 use m_kinefsm, only: kinefsm
36 use m_naefs, only: naefs37 use m_naefs, only: naefs
@@ -46,8 +47,8 @@
46 use m_energies47 use m_energies
47 use m_steps, only: istp48 use m_steps, only: istp
48 use m_ntm49 use m_ntm
49 use m_spin, only: spin50 use m_spin, only: spin
50 use spinorbit, only: spinorb51 use spinorbit, only: spinorb
51 use m_dipol52 use m_dipol
52 use m_forces, only: fa53 use m_forces, only: fa
53 use alloc, only: re_alloc, de_alloc54 use alloc, only: re_alloc, de_alloc
@@ -91,6 +92,8 @@
91 real(dp), pointer :: H_tmp(:,:) => null()92 real(dp), pointer :: H_tmp(:,:) => null()
92 real(dp), pointer :: S_tmp(:) => null() 93 real(dp), pointer :: S_tmp(:) => null()
93 real(dp), pointer :: H_ldau(:,:)94 real(dp), pointer :: H_ldau(:,:)
95 complex(dp), pointer :: H_so_off(:,:)
96
94#ifdef FINAL_CHECK_HS97#ifdef FINAL_CHECK_HS
95 real(dp) :: diff_H, diff_S98 real(dp) :: diff_H, diff_S
96#endif99#endif
@@ -98,6 +101,7 @@
98 real(dp) :: stresstmp(3,3)101 real(dp) :: stresstmp(3,3)
99 real(dp), pointer :: fatmp(:,:)102 real(dp), pointer :: fatmp(:,:)
100 real(dp) :: buffer1103 real(dp) :: buffer1
104 integer :: MPIerror
101#endif105#endif
102 character(len=label_length+13) :: fname106 character(len=label_length+13) :: fname
103 integer :: io_istep, io_ia1107 integer :: io_istep, io_ia1
@@ -106,6 +110,8 @@
106 type(dict) :: dic_save110 type(dict) :: dic_save
107#endif111#endif
108#endif112#endif
113
114
109!------------------------------------------------------------------------- BEGIN115!------------------------------------------------------------------------- BEGIN
110116
111! Initialize Hamiltonian ........................................117! Initialize Hamiltonian ........................................
@@ -158,28 +164,42 @@
158! ..................164! ..................
159165
160! Non-local-pseudop: energy, forces, stress and matrix elements .......166! Non-local-pseudop: energy, forces, stress and matrix elements .......
161 call nlefsm( scell, na_u, na_s, isa, xa, indxua, 167
162 & maxnh, maxnh, lasto, lastkb, iphorb, iphKB, 168 Eso = 0.0_dp
163 & numh, listhptr, listh, numh, listhptr, listh, 169
164 & spin%spinor, Dscf, Enl, fal, stressl, H_tmp,170 if ( .not.spin%SO_offsite ) then
165 & matrix_elements_only=.false. ) 171 call nlefsm( scell, na_u, na_s, isa, xa, indxua,
166172 & maxnh, maxnh, lasto, lastkb, iphorb, iphKB,
167#ifdef MPI173 & numh, listhptr, listh, numh, listhptr, listh,
168! Global reduction of energy terms174 & spin%spinor, Dscf, Enl, fal, stressl, H_tmp,
169 call globalize_sum(Enl,buffer1)175 & matrix_elements_only=.false. )
170 Enl = buffer1176
171#endif177#ifdef MPI
172178! Global reduction of energy terms
173! If in the future the spin-orbit routine is able to compute179 call globalize_sum(Enl,buffer1)
174! forces and stresses, then "last" will be needed. If we are not180 Enl = buffer1
175! computing forces and stresses, calling it in the first iteration181#endif
176! should be enough182 else
177!183 H_so_off => val(H_so_off_2D)
178 if ( spin%SO ) then184 call nlefsm_SO_off(scell, na_u, na_s, isa, xa, indxua,
185 & maxnh, maxnh, lasto, lastkb, iphorb, iphKB,
186 & numh, listhptr, listh, numh, listhptr, listh,
187 & spin%Grid,
188 & Enl, Eso, fal,
189 & stressl, H_tmp, H_so_off,
190 & matrix_elements_only=.false.)
191#ifdef MPI
192! Global reduction of energy terms
193 call globalize_sum(Enl,buffer1)
194 Enl = buffer1
195 call globalize_sum(Eso,buffer1)
196 Eso = buffer1
197#endif
198 endif
199
200 if ( spin%SO_onsite ) then
179 call spinorb(no_u,no_l,iaorb,iphorb,isa,indxuo,201 call spinorb(no_u,no_l,iaorb,iphorb,isa,indxuo,
180 & maxnh,numh,listhptr,listh,Dscf,H_tmp(:,3:),Eso)202 & maxnh,numh,listhptr,listh,Dscf,H_tmp(:,3:),Eso)
181 else
182 Eso = 0._dp
183 endif203 endif
184 204
185! Non-SCF part of total energy205! Non-SCF part of total energy
@@ -276,7 +296,8 @@
276 & diff_S296 & diff_S
277 end if297 end if
278#endif298#endif
279 299
300 ! TODO I am not sure this works with SO_offsite?
280 if (recompute_H_after_scf) then301 if (recompute_H_after_scf) then
281 if (ionode) then302 if (ionode) then
282 write(6,"(a)") ":!: Updating H after scf cycle" //303 write(6,"(a)") ":!: Updating H after scf cycle" //
283304
=== modified file 'Src/initatom.f'
--- Src/initatom.f 2018-04-07 19:24:04 +0000
+++ Src/initatom.f 2018-04-30 20:53:35 +0000
@@ -50,10 +50,10 @@
50 use ldau_specs, only: ldau_proj_gen50 use ldau_specs, only: ldau_proj_gen
51 use ldau_specs, only: populate_species_info_ldau51 use ldau_specs, only: populate_species_info_ldau
52 use pseudopotential, only: pseudo_read52 use pseudopotential, only: pseudo_read
53 53
54 use chemical54 use chemical
5555
56 use m_spin, only: SpOrb56 use m_spin, only: spin
5757
58 use atm_types, only: species, species_info, nspecies58 use atm_types, only: species, species_info, nspecies
59 59
@@ -63,6 +63,7 @@
63 integer :: is63 integer :: is
64 logical :: user_basis, user_basis_netcdf64 logical :: user_basis, user_basis_netcdf
65 logical :: req_init_setup65 logical :: req_init_setup
66 logical :: lj_projs
6667
67 type(basis_def_t), pointer :: basp68 type(basis_def_t), pointer :: basp
68 type(species_info), pointer :: spp69 type(species_info), pointer :: spp
@@ -106,12 +107,13 @@
106 call elec_corr_setup()107 call elec_corr_setup()
107 else if (user_basis) then108 else if (user_basis) then
108109
109 if ( SpOrb ) then 110 if ( spin%SO_onsite ) then
110 ! We still need to read the pseudopotential information111 ! We still need to read the pseudopotential information
111 write(6,'(a)') ' initatom: Spin configuration = spin-orbit'112 ! because the .ion files do not contain V_so information
113 write(6,'(a)') ' initatom: spin-orbit-onsite with user-basis'
114 write(6,'(a)') ' initatom: Still need to read the psf files.'
112 do is = 1 , nsp115 do is = 1 , nsp
113 basp => basis_parameters(is)116 basp => basis_parameters(is)
114
115 basp%label = species_label(is)117 basp%label = species_label(is)
116 call pseudo_read(basp%label,basp%pseudopotential)118 call pseudo_read(basp%label,basp%pseudopotential)
117 end do119 end do
@@ -132,6 +134,8 @@
132 nspecies = nsp ! For atm_types module134 nspecies = nsp ! For atm_types module
133 call setup_atom_tables(nsp)135 call setup_atom_tables(nsp)
134136
137 lj_projs = (spin%SO_offsite)
138
135 allocate(species(nspecies))139 allocate(species(nspecies))
136 do is = 1,nsp140 do is = 1,nsp
137 call write_basis_specs(6,is)141 call write_basis_specs(6,is)
@@ -151,7 +155,8 @@
151 & qyuk(0:lmaxd,1:nsemx,is),155 & qyuk(0:lmaxd,1:nsemx,is),
152 & qwid(0:lmaxd,1:nsemx,is),156 & qwid(0:lmaxd,1:nsemx,is),
153 & split_norm(0:lmaxd,1:nsemx,is), 157 & split_norm(0:lmaxd,1:nsemx,is),
154 & filtercut(0:lmaxd,1:nsemx,is), basp, spp)158 & filtercut(0:lmaxd,1:nsemx,is), basp, spp,
159 $ lj_projs)
155! Generate the projectors for the LDA+U simulations (if requested)160! Generate the projectors for the LDA+U simulations (if requested)
156 call ldau_proj_gen(is)161 call ldau_proj_gen(is)
157 enddo 162 enddo
@@ -165,11 +170,12 @@
165 call elec_corr_setup()170 call elec_corr_setup()
166 ns = nsp ! Set number of species for main program171 ns = nsp ! Set number of species for main program
167172
173 call dump_basis_ascii()
174 call dump_basis_netcdf()
175 call dump_basis_xml()
176
168 endif177 endif
169178
170 call dump_basis_ascii()
171 call dump_basis_netcdf()
172 call dump_basis_xml()
173179
174 if (.not. user_basis .and. .not. user_basis_netcdf) then180 if (.not. user_basis .and. .not. user_basis_netcdf) then
175 call deallocate_spec_arrays()181 call deallocate_spec_arrays()
176182
=== modified file 'Src/m_cite.F90'
--- Src/m_cite.F90 2016-12-29 10:36:10 +0000
+++ Src/m_cite.F90 2018-04-30 20:53:35 +0000
@@ -74,7 +74,7 @@
74 ! Increment this after having added a new74 ! Increment this after having added a new
75 ! citation!75 ! citation!
76 ! OTHERWISE YOU WILL EXPERIENCE A SEG-FAULT.76 ! OTHERWISE YOU WILL EXPERIENCE A SEG-FAULT.
77 integer, parameter :: N_citations = 777 integer, parameter :: N_citations = 9
7878
79 private79 private
8080
@@ -242,7 +242,29 @@
242 cit%issue = "30"242 cit%issue = "30"
243 cit%cite_key = "Lin2014"243 cit%cite_key = "Lin2014"
244 ID = 7244 ID = 7
245
246 case ( "10.1088/0953-8984/24/8/086005" )
247 ! Off-Site Spin-Orbit
248 cit%comment = "Off-Site Spin-Orbit Implementation"
249 cit%doi = "10.1088/0953-8984/24/8/086005"
250 cit%journal = "Journal of Physics: Condensed Matter"
251 cit%year = 2012
252 cit%volume = "24"
253 cit%issue = "8"
254 cit%cite_key = "Cuadrado2012"
255 ID = 8
245 256
257 case ( "10.1088/0953-8984/18/34/012")
258 ! On-Site Spin-Orbit
259 cit%comment = "On-Site Spin-Orbit Implementation"
260 cit%doi = "10.1088/0953-8984/18/34/012"
261 cit%journal = "Journal of Physics: Condensed Matter"
262 cit%year = 2006
263 cit%volume = "18"
264 cit%issue = "0"
265 cit%cite_key = "FernandezSeivane2006"
266 ID = 9
267
246 end select268 end select
247269
248 ! probably we should error out...270 ! probably we should error out...
249271
=== modified file 'Src/m_pulay.F90'
--- Src/m_pulay.F90 2016-06-04 20:06:11 +0000
+++ Src/m_pulay.F90 2018-04-30 20:53:35 +0000
@@ -8,7 +8,7 @@
8module m_pulay8module m_pulay
99
10 use precision, only: dp10 use precision, only: dp
11 use m_spin, only: h_spin_dim, SpOrb11 use m_spin, only: spin
12 implicit none12 implicit none
1313
14 private14 private
@@ -48,7 +48,7 @@
48 if (maxsav .le. 0) then48 if (maxsav .le. 0) then
49 ! No need for auxiliary arrays49 ! No need for auxiliary arrays
50 else50 else
51 nauxpul = sum(numh(1:no_l)) * h_spin_dim * maxsav51 nauxpul = sum(numh(1:no_l)) * spin%H * maxsav
52 !52 !
53 call re_alloc(auxpul,1,nauxpul,1,2,name="auxpul", &53 call re_alloc(auxpul,1,nauxpul,1,2,name="auxpul", &
54 routine="pulay")54 routine="pulay")
@@ -370,8 +370,8 @@
370 ! B(i,i) = dot_product(Res(i)*Res(i))370 ! B(i,i) = dot_product(Res(i)*Res(i))
371 b(i,i) = 0.0_dp371 b(i,i) = 0.0_dp
372 ssum=0.0_dp372 ssum=0.0_dp
373! CC RC Added for on-site SO373
374 if ( .not. SpOrb ) then374 if ( .not. spin%SO ) then
375 do is=1,nspin375 do is=1,nspin
376 do ii=1,no_l376 do ii=1,no_l
377 do jj=1,numd(ii)377 do jj=1,numd(ii)
@@ -380,7 +380,7 @@
380 enddo380 enddo
381 enddo381 enddo
382 enddo382 enddo
383 elseif ( SpOrb ) then383 elseif ( spin%SO ) then
384 do ii=1,no_l384 do ii=1,no_l
385 do jj=1,numd(ii)385 do jj=1,numd(ii)
386 ind = listdptr(ii) + jj386 ind = listdptr(ii) + jj
@@ -393,7 +393,6 @@
393 enddo393 enddo
394 enddo394 enddo
395 endif395 endif
396! CC RC
397396
398 b(i,i)=ssum397 b(i,i)=ssum
399 !398 !
@@ -414,7 +413,7 @@
414413
415 b(i,j)=0.0_dp414 b(i,j)=0.0_dp
416 ssum=0.0_dp415 ssum=0.0_dp
417 if ( .not. SpOrb ) then416 if ( .not. spin%SO ) then
418 do is=1,nspin417 do is=1,nspin
419 do ii=1,no_l418 do ii=1,no_l
420 do jj=1,numd(ii)419 do jj=1,numd(ii)
@@ -423,7 +422,7 @@
423 enddo422 enddo
424 enddo423 enddo
425 enddo424 enddo
426 elseif ( SpOrb ) then425 elseif ( spin%SO ) then
427 do ii=1,no_l426 do ii=1,no_l
428 do jj=1,numd(ii)427 do jj=1,numd(ii)
429 ind = listdptr(ii) + jj428 ind = listdptr(ii) + jj
430429
=== modified file 'Src/m_spin.F90'
--- Src/m_spin.F90 2018-02-27 21:05:45 +0000
+++ Src/m_spin.F90 2018-04-30 20:53:35 +0000
@@ -7,13 +7,16 @@
7! ---7! ---
8module t_spin8module t_spin
99
10 use precision, only: dp
11
10 implicit none12 implicit none
1113 private
14
12 !> Type containing a simulations spin configuration15 !> Type containing a simulations spin configuration
13 !!16 !!
14 !! Thus this type contains _all_ relevant information17 !! Thus this type contains _all_ relevant information
15 !! regarding the spin-configuration.18 !! regarding the spin-configuration.
16 type tSpin19 type, public :: tSpin
1720
18 !> Dimensionality of the Hamiltonian21 !> Dimensionality of the Hamiltonian
19 integer :: H = 122 integer :: H = 1
@@ -37,8 +40,9 @@
37 !> Spin-orbit coupling40 !> Spin-orbit coupling
38 logical :: SO = .false.41 logical :: SO = .false.
3942
40 !> If .true. the spin-orbit is using the off-site implementation (else the on-site)43 !> Flavors of off-site implementation
41 logical :: SO_off = .false.44 logical :: SO_offsite = .false.
45 logical :: SO_onsite = .false.
4246
43 ! Perhaps one could argue that one may47 ! Perhaps one could argue that one may
44 ! associate a symmetry to the spin which48 ! associate a symmetry to the spin which
@@ -110,6 +114,10 @@
110 use fdf, only : fdf_get, leqi, fdf_deprecated114 use fdf, only : fdf_get, leqi, fdf_deprecated
111 use alloc, only: re_alloc115 use alloc, only: re_alloc
112116
117 use m_cite, only: add_citation
118 use files, only: slabel
119 use parallel, only: IONode
120
113 character(len=32) :: opt121 character(len=32) :: opt
114122
115 ! Create pointer assignments...123 ! Create pointer assignments...
@@ -127,14 +135,14 @@
127 ! Time reversal symmetry135 ! Time reversal symmetry
128 TrSym = .true.136 TrSym = .true.
129137
130 ! All components of the 'spin' variable138 ! Initialize all components of the 'spin' variable
131 ! is initially correct...
132 spin%none = .false.139 spin%none = .false.
133 spin%Col = .false.140 spin%Col = .false.
134 spin%NCol = .false.141 spin%NCol = .false.
135 spin%SO = .false.142 spin%SO = .false.
136 spin%SO_off = .false.143 spin%SO_offsite = .false.
137 144 spin%SO_onsite = .false.
145
138 ! Read in old flags (discouraged)146 ! Read in old flags (discouraged)
139 spin%Col = fdf_get('SpinPolarized',.false.)147 spin%Col = fdf_get('SpinPolarized',.false.)
140 spin%NCol = fdf_get('NonCollinearSpin',.false.)148 spin%NCol = fdf_get('NonCollinearSpin',.false.)
@@ -149,7 +157,7 @@
149 if ( spin%SO ) then157 if ( spin%SO ) then
150 opt = 'spin-orbit'158 opt = 'spin-orbit'
151 else if ( spin%NCol ) then159 else if ( spin%NCol ) then
152 opt = 'non-colinear'160 opt = 'non-collinear'
153 else if ( spin%Col ) then161 else if ( spin%Col ) then
154 opt = 'collinear'162 opt = 'collinear'
155 else163 else
@@ -173,52 +181,41 @@
173 181
174 spin%Col = .true.182 spin%Col = .true.
175 183
176 else if ( leqi(opt, 'non-collinear') .or. leqi(opt, 'non-colinear') .or. &184 else if ( leqi(opt, 'non-collinear') .or. leqi(opt, 'non-colinear') .or. &
177 leqi(opt, 'NC') .or. leqi(opt, 'N-C') ) then185 leqi(opt, 'NC') .or. leqi(opt, 'N-C') ) then
178 186
179 spin%NCol = .true.187 spin%NCol = .true.
180 188
181 else if ( leqi(opt, 'spin-orbit') .or. leqi(opt, 'S-O') .or. &189 else if ( leqi(opt, 'spin-orbit') .or. leqi(opt, 'S-O') .or. &
182 leqi(opt, 'SOC') .or. leqi(opt, 'SO') ) then190 leqi(opt, 'SOC') .or. leqi(opt, 'SO') .or. &
183 ! Spin-orbit is the same as using the off-site implementation191 leqi(opt, 'spin-orbit+offsite') .or. leqi(opt, 'S-O+offsite') .or. &
184 192 leqi(opt, 'SOC+offsite') .or. leqi(opt, 'SO+offsite') ) then
185 spin%SO = .true.193 ! Spin-orbit defaults to the off-site implementation
186 spin%SO_off = .true.194
187195 spin%SO = .true.
188 else if ( leqi(opt, 'spin-orbit+off') .or. leqi(opt, 'S-O+off') .or. &196 spin%SO_offsite = .true.
189 leqi(opt, 'SOC+off') .or. leqi(opt, 'SO+off') ) then197
190 198 else if ( leqi(opt, 'spin-orbit+onsite') .or. leqi(opt, 'S-O+onsite') .or. &
191 spin%SO = .true.199 leqi(opt, 'SOC+onsite') .or. leqi(opt, 'SO+onsite') ) then
192 spin%SO_off = .true.200
193201 spin%SO = .true.
194 else if ( leqi(opt, 'spin-orbit+on') .or. leqi(opt, 'S-O+on') .or. &202 spin%SO_onsite = .true.
195 leqi(opt, 'SOC+on') .or. leqi(opt, 'SO+on') ) then
196
197 spin%SO = .true.
198 spin%SO_off = .false.
199203
200 else204 else
201 write(*,*) 'Unknown spin flag: ', trim(opt)205 write(*,*) 'Unknown spin flag: ', trim(opt)
202 call die('Spin: unknown flag, please assert the correct input.')206 call die('Spin: unknown flag, please assert the correct input.')
203 end if207 end if
204208
205 ! TODO once off-site is fully implemented209 if ( spin%SO_offsite ) then
206 ! this should be removed to enable the off-site code210 call add_citation("10.1088/0953-8984/24/8/086005")
207 ! fully!211 end if
208 spin%SO_off = .false.212 if ( spin%SO_onsite ) then
209213 call add_citation("10.1088/0953-8984/18/34/012")
210 ! Note that, in what follows,214 end if
211 ! spinor_dim = min(h_spin_dim,2)215
212 ! e_spin_dim = min(h_spin_dim,4)216 ! These are useful for fine control beyond the old "nspin". Some routines expect
213 ! nspin = min(h_spin_dim,4) ! Relevant for dhscf, local DM217 ! an argument 'nspin' which might really mean 'spin%spinor' (like diagon),
214 ! should probably be called nspin_grid218 ! 'spin%Grid' (like dhscf), etc.
215 !
216 ! so everything can be determined if h_spin_dim is known.
217 ! It is tempting to go back to the old 'nspin' overloading,
218 ! making 'nspin' mean again 'h_spin_dim'.
219 ! But this has to be done carefully, as some routines expect
220 ! an argument 'nspin' which really means 'spinor_dim' (like diagon),
221 ! and others (such as dhscf) expect 'nspin' to mean 'nspin_grid'.
222219
223 if ( spin%SO ) then220 if ( spin%SO ) then
224 ! Spin-orbit case221 ! Spin-orbit case
@@ -235,9 +232,10 @@
235 spin%Col = .false.232 spin%Col = .false.
236 spin%NCol = .false.233 spin%NCol = .false.
237 spin%SO = .true.234 spin%SO = .true.
235 ! off/on MUST already be set!
238236
239 ! should be moved...237 ! should be moved...
240 TRSym = .false.238 TRSym = .false. ! Cannot be changed !
241239
242 else if ( spin%NCol ) then240 else if ( spin%NCol ) then
243 ! Non-collinear case241 ! Non-collinear case
@@ -250,13 +248,15 @@
250 spin%spinor = 2248 spin%spinor = 2
251249
252 ! Flags250 ! Flags
253 spin%none = .false.251 spin%none = .false.
254 spin%Col = .false.252 spin%Col = .false.
255 spin%NCol = .true.253 spin%NCol = .true.
256 spin%SO = .false.254 spin%SO = .false.
255 spin%SO_onsite = .false.
256 spin%SO_offsite = .false.
257257
258 ! should be moved...258 ! should be moved...
259 TRSym = .false.259 TRSym = .false. ! Cannot be changed !
260260
261 else if ( spin%Col ) then261 else if ( spin%Col ) then
262 ! Collinear case262 ! Collinear case
@@ -269,13 +269,17 @@
269 spin%spinor = 2269 spin%spinor = 2
270270
271 ! Flags271 ! Flags
272 spin%none = .false.272 spin%none = .false.
273 spin%Col = .true.273 spin%Col = .true.
274 spin%NCol = .false.274 spin%NCol = .false.
275 spin%SO = .false.275 spin%SO = .false.
276 spin%SO_onsite = .false.
277 spin%SO_offsite = .false.
276278
277 ! should be moved...279 ! should be moved...
278 TRSym = .true.280 TRSym = .true.
281 ! Allow the user to choose not to have TRS
282 TRSym = fdf_get('TimeReversalSymmetry',TrSym)
279283
280 else if ( spin%none ) then284 else if ( spin%none ) then
281 ! No spin configuration...285 ! No spin configuration...
@@ -288,18 +292,20 @@
288 spin%spinor = 1292 spin%spinor = 1
289293
290 ! Flags294 ! Flags
291 spin%none = .true.295 spin%none = .true.
292 spin%Col = .false.296 spin%Col = .false.
293 spin%NCol = .false.297 spin%NCol = .false.
294 spin%SO = .false.298 spin%SO = .false.
299 spin%SO_onsite = .false.
300 spin%SO_offsite = .false.
295301
296 ! should be moved...302 ! should be moved...
297 TRSym = .true.303 TRSym = .true.
304 ! Allow the user to choose not to have TRS
305 TRSym = fdf_get('TimeReversalSymmetry',TrSym)
298306
299 end if307 end if
300308
301 ! Get true time reversal symmetry
302 TRSym = fdf_get('TimeReversalSymmetry',TrSym)
303309
304 contains310 contains
305311
@@ -331,10 +337,10 @@
331 if ( .not. IONode ) return337 if ( .not. IONode ) return
332338
333 if ( spin%SO ) then339 if ( spin%SO ) then
334 if ( spin%SO_off ) then340 if ( spin%SO_offsite ) then
335 opt = 'spin-orbit+off'341 opt = 'spin-orbit+offsite'
336 else342 else
337 opt = 'spin-orbit+on'343 opt = 'spin-orbit+onsite'
338 end if344 end if
339 else if ( spin%NCol ) then345 else if ( spin%NCol ) then
340 opt = 'non-collinear'346 opt = 'non-collinear'
341347
=== modified file 'Src/mixer.F'
--- Src/mixer.F 2018-04-17 13:06:00 +0000
+++ Src/mixer.F 2018-04-30 20:53:35 +0000
@@ -30,7 +30,7 @@
30 use m_mixing_scf, only: scf_mix30 use m_mixing_scf, only: scf_mix
31 use m_mixing, only: mixing31 use m_mixing, only: mixing
32 32
33 use m_spin, only: h_spin_dim, SpOrb33 use m_spin, only: spin
34 use parallel, only: IONode34 use parallel, only: IONode
3535
36 implicit none36 implicit none
@@ -60,7 +60,7 @@
6060
6161
62 ! Create residual function to minimize62 ! Create residual function to minimize
63 allocate(F(maxnh,h_spin_dim))63 allocate(F(maxnh,spin%H))
6464
65!$OMP parallel default(shared), private(dtmp,i)65!$OMP parallel default(shared), private(dtmp,i)
6666
@@ -103,15 +103,15 @@
103 ! Upon exit Xout contains the mixed quantity103 ! Upon exit Xout contains the mixed quantity
104 select case ( mix_spin )104 select case ( mix_spin )
105 case ( MIX_SPIN_ALL )105 case ( MIX_SPIN_ALL )
106 call mixing( scf_mix, maxnh, h_spin_dim, Xin, F, Xout)106 call mixing( scf_mix, maxnh, spin%H, Xin, F, Xout)
107 case ( MIX_SPIN_SPINOR )107 case ( MIX_SPIN_SPINOR )
108 call mixing( scf_mix, maxnh, h_spin_dim, Xin, F, Xout,108 call mixing( scf_mix, maxnh, spin%H, Xin, F, Xout,
109 & nsub=2)109 & nsub=2)
110 case ( MIX_SPIN_SUM )110 case ( MIX_SPIN_SUM )
111 call mixing( scf_mix, maxnh, h_spin_dim, Xin, F, Xout,111 call mixing( scf_mix, maxnh, spin%H, Xin, F, Xout,
112 & nsub=1)112 & nsub=1)
113 case ( MIX_SPIN_SUM_DIFF )113 case ( MIX_SPIN_SUM_DIFF )
114 call mixing( scf_mix, maxnh, h_spin_dim, Xin, F, Xout,114 call mixing( scf_mix, maxnh, spin%H, Xin, F, Xout,
115 & nsub=2)115 & nsub=2)
116 end select116 end select
117117
@@ -188,15 +188,15 @@
188188
189 if (muldeb .and. (.not. MixH) ) then 189 if (muldeb .and. (.not. MixH) ) then
190 if (IONode) write (6,"(/a)") 'Using DM after mixing:'190 if (IONode) write (6,"(/a)") 'Using DM after mixing:'
191 if ( SpOrb .and. orbmoms) then191 if ( spin%SO .and. orbmoms) then
192 call moments( 1, na_u, no_u, maxnh, numh, listhptr,192 call moments( 1, na_u, no_u, maxnh, numh, listhptr,
193 . listh, S, Dscf, isa, lasto, iaorb, iphorb,193 . listh, S, Dscf, isa, lasto, iaorb, iphorb,
194 . indxuo )194 . indxuo )
195 endif195 endif
196 ! Call this unconditionally196 ! Call this unconditionally
197 call mulliken( mullipop, na_u, no_u, maxnh,197 call mulliken( mullipop, na_u, no_u, maxnh,
198 & numh, listhptr, listh, S, Dscf, isa,198 & numh, listhptr, listh, S, Dscf, isa,
199 & lasto, iaorb, iphorb )199 & lasto, iaorb, iphorb )
200 endif200 endif
201201
202 call timer( 'MIXER', 2 )202 call timer( 'MIXER', 2 )
203203
=== modified file 'Src/moments.F'
--- Src/moments.F 2018-04-17 13:06:00 +0000
+++ Src/moments.F 2018-04-30 20:53:35 +0000
@@ -296,4 +296,3 @@
296 deallocate(l_orb)296 deallocate(l_orb)
297297
298 end subroutine moments298 end subroutine moments
299
300299
=== modified file 'Src/nlefsm.f'
--- Src/nlefsm.f 2016-11-04 14:10:50 +0000
+++ Src/nlefsm.f 2018-04-30 20:53:35 +0000
@@ -7,9 +7,11 @@
7!7!
8 module m_nlefsm8 module m_nlefsm
99
10 use precision, only : dp
11
10 implicit none12 implicit none
1113
12 public :: nlefsm14 public :: nlefsm, nlefsm_SO_off
1315
14 private16 private
1517
@@ -53,7 +55,7 @@
53C hamiltonian matrix55C hamiltonian matrix
54C integer listh(maxnh) : Nonzero hamiltonian-matrix element column 56C integer listh(maxnh) : Nonzero hamiltonian-matrix element column
55C indexes for each matrix row57C indexes for each matrix row
56C integer nspin : Number of spin components of Dscf and H58C integer nspin : Number of spinor components (really min(nspin,2))
57C If computing only matrix elements, it59C If computing only matrix elements, it
58C can be set to 1.60C can be set to 1.
59C logical matrix_elements_only:61C logical matrix_elements_only:
@@ -301,8 +303,6 @@
301 kg = kbproj_gindex(ks,koa)303 kg = kbproj_gindex(ks,koa)
302 call new_MATEL( 'S', kg, ig, xki(1:3,ina),304 call new_MATEL( 'S', kg, ig, xki(1:3,ina),
303 & Ski(ikb,nno), grSki(1:3,ikb,nno) )305 & Ski(ikb,nno), grSki(1:3,ikb,nno) )
304 ! Maybe: Ski = epskb_sqrt * Ski
305 ! grSki = epskb_sqrt * grSki
306 enddo306 enddo
307307
308 enddo ! loop over orbitals308 enddo ! loop over orbitals
@@ -330,7 +330,7 @@
330 jo = listh(ind)330 jo = listh(ind)
331 listed(jo) = .true.331 listed(jo) = .true.
332 if (.not. matrix_elements_only) then332 if (.not. matrix_elements_only) then
333 do ispin = 1,nspin ! Both spins add up...333 do ispin = 1, nspin ! Both spins add up... (nspin=spin%spinor here)
334 Di(jo) = Di(jo) + Dscf(ind,ispin)334 Di(jo) = Di(jo) + Dscf(ind,ispin)
335 enddo335 enddo
336 endif336 endif
@@ -381,7 +381,7 @@
381 do j = 1,numh(iio)381 do j = 1,numh(iio)
382 ind = listhptr(iio)+j382 ind = listhptr(iio)+j
383 jo = listh(ind)383 jo = listh(ind)
384 do ispin = 1,nspin384 do ispin = 1,nspin ! Only diagonal parts
385 H(ind,ispin) = H(ind,ispin) + Vi(jo)385 H(ind,ispin) = H(ind,ispin) + Vi(jo)
386 enddo386 enddo
387 Vi(jo) = 0.0d0 ! See initial zero-out at top387 Vi(jo) = 0.0d0 ! See initial zero-out at top
@@ -441,4 +441,613 @@
441 441
442 end subroutine nlefsm442 end subroutine nlefsm
443443
444C nlefsm_SO_off calculates the KB elements to the total Hamiltonian
445C (including the SO contribution)
446C when Off-Site Spin Orbit is included in the calculation
447 subroutine nlefsm_SO_off( scell, nua, na, isa, xa, indxua,
448 . maxnh, maxnd, lasto, lastkb, iphorb,
449 . iphKB, numd, listdptr, listd, numh,
450 . listhptr, listh, nspin, Enl, Enl_offsiteSO,
451 . fa, stress, H0 , H0_off,
452 & matrix_elements_only)
453
454
455C *********************************************************************
456C Calculates non-local (NL) pseudopotential contribution to total
457C energy, atomic forces, stress and hamiltonian matrix elements.
458C Energies in Ry. Lengths in Bohr.
459C Writen by J.Soler and P.Ordejon, June 1997.
460C Modified by R. Cuadrado and J. I. Cerda for the
461C off-site Spin-Orbit, January 2017.
462C **************************** INPUT **********************************
463C real*8 scell(3,3) : Supercell vectors SCELL(IXYZ,IVECT)
464C integer nua : Number of atoms in unit cell
465C integer na : Number of atoms in supercell
466C integer isa(na) : Species index of each atom
467C real*8 xa(3,na) : Atomic positions in cartesian coordinates
468C integer indxua(na) : Index of equivalent atom in unit cell
469C integer maxnh : First dimension of H and listh
470C integer maxnd : Maximum number of elements of the
471C density matrix
472C integer lasto(0:na) : Position of last orbital of each atom
473C integer lastkb(0:na) : Position of last KB projector of each atom
474C integer iphorb(no) : Orbital index of each orbital in its atom,
475C where no=lasto(na)
476C integer iphKB(nokb) : Index of each KB projector in its atom,
477C where nokb=lastkb(na)
478C integer numd(nuo) : Number of nonzero elements of each row of the
479C density matrix
480C integer listdptr(nuo) : Pointer to the start of each row (-1) of the
481C density matrix
482C integer listd(maxnd) : Nonzero hamiltonian-matrix element column
483C indexes for each matrix row
484C integer numh(nuo) : Number of nonzero elements of each row of the
485C hamiltonian matrix
486C integer listhptr(nuo) : Pointer to the start of each row (-1) of the
487C hamiltonian matrix
488C integer listh(maxnh) : Nonzero hamiltonian-matrix element column
489C indexes for each matrix row
490C integer nspin : Number of spin_grid components (really min(nspin,4))
491C If computing only matrix elements, it
492C can be set to 1.
493C logical matrix_elements_only:
494C integer Dscf(maxnd,nspin): Density matrix. Not touched if computing
495C only matrix elements.
496C ******************* INPUT and OUTPUT *********************************
497C real*8 fa(3,na) : NL forces (added to input fa)
498C real*8 stress(3,3) : NL stress (added to input stress)
499C real*8 H0(maxnh,nspin) : NL Hamiltonian (added to input H)
500C complex*16 H0_off(maxnh,nspin) : NL off-site Hamiltonian (added to input H)
501C **************************** OUTPUT *********************************
502C real*8 Enl : NL energy
503C *********************************************************************
504C
505C Modules
506C
507 use parallel, only : Node, Nodes
508 use parallelsubs, only : GetNodeOrbs, LocalToGlobalOrb
509 use parallelsubs, only : GlobalToLocalOrb
510 use atmfuncs, only : rcut, orb_gindex, kbproj_gindex
511 use atmfuncs, only : epskb
512 use neighbour, only : iana=>jan, r2ki=>r2ij, xki=>xij
513 use neighbour, only : mneighb, reset_neighbour_arrays
514 use alloc, only : re_alloc, de_alloc
515 use m_new_matel, only : new_matel
516 use atm_types, only: species_info, species
517 use sparse_matrices, only: Dscf, xijo
518
519 integer, intent(in) ::
520 . maxnh, na, maxnd, nspin, nua
521
522 integer, intent(in) ::
523 . indxua(na), iphKB(*), iphorb(*), isa(na),
524 . lasto(0:na), lastkb(0:na), listd(maxnd), listh(maxnh),
525 . numd(*), numh(*), listdptr(*), listhptr(*)
526
527 real(dp), intent(in) :: scell(3,3), xa(3,na)
528 real(dp), intent(inout) :: fa(3,nua), stress(3,3)
529 real(dp), intent(inout) :: H0(maxnh)
530 complex(dp), intent(inout) :: H0_off(maxnh,4)
531
532 real(dp), intent(out) :: Enl, Enl_offsiteSO
533 logical, intent(in) :: matrix_elements_only
534
535 real(dp) :: volcel
536 external :: timer, volcel
537
538C Internal variables ................................................
539C maxno = maximum number of basis orbitals overlapping a KB projector
540
541 integer, save :: maxno = 2000
542
543 integer
544 . ia, ikb, ina, ind, ino, indt,
545 . io, iio, ioa, is, ispin, ix, ig, kg,
546 . j, jno, jo, jx, ka, ko, koa, ks, kua,
547 . nkb, nna, nno, no, nuo, nuotot, maxkba
548
549 integer :: l, koa1, koa2, i
550
551 integer, dimension(:), pointer :: iano, iono
552
553 real(dp)
554 . Cijk, fik, rki, rmax, rmaxkb, rmaxo,
555 . volume, CVj, epsk(2), Vit
556
557 real(dp) :: r1(3), r2(3)
558
559 real(dp), dimension(:), pointer :: Di, Vi ! This is Vion
560 real(dp), dimension(:,:), pointer :: Ski, xno
561 real(dp), dimension(:,:,:), pointer :: grSki
562
563 complex(dp) :: V_sot(2,2), F_so(3,2,2)
564 complex(dp), pointer :: V_so(:,:,:), Ds(:,:,:)
565
566
567 logical :: within
568 logical, dimension(:), pointer :: listed, listedall
569
570 complex(dp) :: E_offsiteSO(4)
571
572 type(species_info), pointer :: spp
573
574 integer :: nd, ndn
575
576C ------------------------------------------------------------
577
578C Start time counte
579 call timer( 'nlefsm', 1 )
580
581C Find unit cell volume
582 volume = volcel( scell ) * nua / na
583
584C Find maximum range
585 rmaxo = 0.0d0
586 rmaxkb = 0.0d0
587 do ia = 1,na
588 is = isa(ia)
589 do ikb = lastkb(ia-1)+1,lastkb(ia)
590 ioa = iphKB(ikb)
591 rmaxkb = max( rmaxkb, rcut(is,ioa) )
592 enddo
593 do io = lasto(ia-1)+1,lasto(ia)
594 ioa = iphorb(io)
595 rmaxo = max( rmaxo, rcut(is,ioa) )
596 enddo
597 enddo
598 rmax = rmaxo + rmaxkb
599
600C Initialize arrays Di and Vi only once
601 no = lasto(na)
602 nuotot = lasto(nua)
603
604 call GetNodeOrbs(nuotot,Node,Nodes,nuo)
605
606C Allocate local memory
607
608 nullify( Vi ) ! This is Vion
609 call re_alloc( Vi, 1, no, 'Vi', 'nlefsm_SO_off' )
610 Vi(1:no) = 0.0_dp
611
612 nullify( listed )
613 call re_alloc( listed, 1, no, 'listed', 'nlefsm_SO_off' )
614 listed(1:no) = .false.
615 nullify( listedall )
616 call re_alloc( listedall, 1, no, 'listedall', 'nlefsm_SO_off' )
617 listedall(1:no) = .false.
618
619 allocate( V_so(2,2,no) )
620
621 if (.not. matrix_elements_only) then
622 nullify( Di )
623 call re_alloc( Di, 1, no, 'Di', 'nlefsm_SO_off' )
624 Di(1:no) = 0.0_dp
625 allocate( Ds(2,2,no) )
626 endif
627
628C Make list of all orbitals needed for this node
629
630 do io = 1,nuo
631 call LocalToGlobalOrb(io,Node,Nodes,iio)
632 listedall(iio) = .true.
633 do j = 1,numh(io)
634 jo = listh(listhptr(io)+j)
635 listedall(jo) = .true.
636 enddo
637 enddo
638
639C Find maximum number of KB projectors of one atom = maxkba
640 maxkba = 0
641 do ka = 1,na
642 nkb = lastkb(ka) - lastkb(ka-1)
643 maxkba = max(maxkba,nkb)
644 enddo
645
646C Allocate local arrays that depend on saved parameters
647 nullify( iano )
648 call re_alloc( iano, 1, maxno, 'iano', 'nlefsm_SO_off' )
649 nullify( iono )
650 call re_alloc( iono, 1, maxno, 'iono', 'nlefsm_SO_off' )
651 nullify( xno )
652 call re_alloc( xno, 1, 3, 1, maxno, 'xno', 'nlefsm_SO_off' )
653 nullify( Ski )
654 call re_alloc( Ski, 1, maxkba, 1, maxno, 'Ski','nlefsm_SO_off')
655 nullify( grSki )
656 call re_alloc( grSki, 1, 3, 1, maxkba, 1, maxno, 'grSki',
657 & 'nlefsm_SO_off' )
658
659C Initialize neighb subroutine
660 call mneighb( scell, rmax, na, xa, 0, 0, nna )
661
662 nd= 0; ndn= 0
663 Enl = 0.0d0; E_offsiteSO(1:4)=dcmplx(0.0d0,0.0d0)
664 Enl_offsiteSO = 0.0d0
665C Loop on atoms with KB projectors
666 do ka = 1,na ! Supercell atoms
667 kua = indxua(ka) ! Equivalent atom in the UC
668 ks = isa(ka) ! Specie index of atom ka
669 nkb = lastkb(ka) - lastkb(ka-1) ! number of KB projs of atom ka
670
671C Find neighbour atoms
672 call mneighb( scell, rmax, na, xa, ka, 0, nna )
673
674C Find neighbour orbitals
675 Ski(:,:) = 0.0_dp
676 nno = 0; ; iano(:)=0; iono(:)=0
677 do ina = 1,nna ! Neighbour atoms
678 ia = iana(ina) ! Atom index of ina (the neighbour to ka)
679 is = isa(ia) ! Specie index of atom ia
680 rki = sqrt(r2ki(ina)) ! Square distance
681
682 do io = lasto(ia-1)+1,lasto(ia) ! Orbitals of atom ia
683
684C Only calculate if needed locally
685
686 if (listedall(io)) then
687 ioa = iphorb(io) ! Orbital index of orbital io in
688C neighbour atom ina
689
690C Find if orbital is within range
691 within = .false.
692 do ko = lastkb(ka-1)+1,lastkb(ka)
693 koa = iphKB(ko)
694 if ( rki .lt. rcut(is,ioa)+rcut(ks,koa) )
695 & within = .true.
696 enddo
697
698C Find overlap between neighbour orbitals and KB projectors
699 if (within) then
700C Check maxno - if too small then increase array sizes
701 if (nno.eq.maxno) then
702 maxno = maxno + 100
703 call re_alloc( iano, 1, maxno, 'iano', 'nlefsm_SO_off',
704 & .true. )
705 call re_alloc( iono, 1, maxno, 'iono', 'nlefsm_SO_off',
706 & .true. )
707 call re_alloc( xno, 1, 3, 1, maxno,'xno','nlefsm_SO_off',
708 & .true. )
709 call re_alloc( Ski, 1, maxkba, 1, maxno, 'Ski',
710 & 'nlefsm_SO_off', .true. )
711 call re_alloc( grSki, 1, 3, 1, maxkba, 1, maxno,
712 & 'grSki', 'nlefsm_SO_off', .true. )
713 endif
714 nno = nno + 1 ! Number of neighbour orbitals
715 iono(nno) = io ! io orbital of atom ina (neighbour to ka)
716 iano(nno) = ia ! atom index of the neighbour ina
717 xno(1:3,nno) = xki(1:3,ina)
718 ikb = 0
719 do ko = lastkb(ka-1)+1,lastkb(ka) !Generic positions of kb's
720 ikb = ikb + 1
721 ioa = iphorb(io)
722 koa = iphKB(ko) ! koa = -ikb
723
724 if ( koa.ne.-ikb ) then
725 write(6,*) 'koa ERROR: koa,ikb=',koa,ikb
726 stop
727 endif
728 kg = kbproj_gindex(ks,koa)
729 ig = orb_gindex(is,ioa)
730 call new_MATEL( 'S', kg, ig, xki(1:3,ina),
731 & Ski(ikb,nno), grSki(1:3,ikb,nno) )
732 enddo
733 endif ! Within
734
735 endif
736 enddo ! neighbour AO
737 enddo ! neighbour atoms
738
739C----- Loop on neighbour orbitals
740 do ino = 1,nno
741 io = iono(ino)
742 ia = iano(ino)
743
744 call GlobalToLocalOrb(io,Node,Nodes,iio)
745
746 if (iio.gt.0) then
747C Valid orbital
748 if (ia .le. nua) then
749 if (.not. matrix_elements_only) then
750 !Scatter density matrix row of orbital io
751 Ds(1:2,1:2,1:no) = dcmplx(0.0d0,0.0d0)
752 do j = 1,numh(iio)
753 ind = listhptr(iio)+j ! jptr
754 jo = listh(ind) ! j
755 Di(jo) = 0.0_dp
756 do ispin = 1,min(2,nspin) ! Only diagonal parts
757 Di(jo) = Di(jo) + Dscf(ind,ispin)
758 enddo
759 Ds(1,1,jo) = dcmplx(Dscf(ind,1), Dscf(ind,5)) ! D(ju,iu)
760 Ds(2,2,jo) = dcmplx(Dscf(ind,2), Dscf(ind,6)) ! D(jd,id)
761 Ds(1,2,jo) = dcmplx(Dscf(ind,3), Dscf(ind,4)) ! D(ju,id)
762 Ds(2,1,jo) = dcmplx(Dscf(ind,7),-Dscf(ind,8)) ! D(jd,iu)
763 enddo
764 endif
765
766C-------- Scatter filter of desired matrix elements
767 do j = 1,numh(iio)
768 jo = listh(listhptr(iio)+j)
769 listed(jo) = .true.
770 enddo
771
772C Loading V_ion/V_so
773 Vi(1:no) = 0.0_dp
774 V_so(1:2,1:2,1:no) = dcmplx(0.0d0,0.0d0)
775
776C-------- Find matrix elements with other neighbour orbitals
777 do jno = 1,nno
778 jo = iono(jno)
779
780 if (listed(jo)) then
781
782C---------- Loop on KB projectors
783 ko = lastkb(ka-1)
784 KB_loop: do
785 koa = -iphKB(ko+1)
786 spp => species(ks)
787 l = spp%pj_l(koa)
788
789c----------- Compute Vion
790 if ( l.eq.0 ) then
791 epsk(1) = epskb(ks,koa)
792 Vit = epsk(1) * Ski(koa,ino) * Ski(koa,jno)
793 Vi(jo) = Vi(jo) + Vit
794 if (.not. matrix_elements_only) then
795 Enl = Enl + Di(jo) * Vit
796 CVj = epsk(1) * Ski(koa,jno)
797 Cijk = 2.0_dp * Di(jo) * CVj
798 do ix = 1,3
799 fik = Cijk * grSki(ix,koa,ino)
800 fa(ix,ia) = fa(ix,ia) - fik
801 fa(ix,kua) = fa(ix,kua) + fik
802 do jx = 1,3
803 stress(jx,ix) = stress(jx,ix) +
804 & xno(jx,ino) * fik / volume
805 enddo
806 enddo
807 endif
808 ko = ko + 1
809
810c----------- Compute Vion from j+/-1/2 and V_so
811 else
812 koa1 = -iphKB(ko+1)
813 koa2 = -iphKB(ko+2*(2*l+1))
814 epsk(1) = epskb(ks,koa1)
815 epsk(2) = epskb(ks,koa2)
816
817 call calc_Vj_offsiteSO( l, epsk, Ski(koa1:koa2,ino),
818 & Ski(koa1:koa2,jno), grSki(:,koa1:koa2,ino),
819 & grSki(:,koa1:koa2,jno), Vit, V_sot, F_so )
820 Vi(jo) = Vi(jo) + Vit
821 V_so(1:2,1:2,jo)= V_so(1:2,1:2,jo) + V_sot(1:2,1:2)
822
823c------------ Forces & SO contribution to E_NL
824 if (.not. matrix_elements_only) then
825 Enl = Enl + Di(jo) * Vit
826
827 E_offsiteSO(1) = E_offsiteSO(1) + V_sot(1,1)*Ds(1,1,jo) ! V(iu,ju)*D(ju,iu)
828 E_offsiteSO(2) = E_offsiteSO(2) + V_sot(2,2)*Ds(2,2,jo) ! V(id,jd)*D(jd,id)
829 E_offsiteSO(3) = E_offsiteSO(3) + V_sot(1,2)*Ds(2,1,jo) ! V(iu,jd)*D(jd,iu)
830 E_offsiteSO(4) = E_offsiteSO(4) + V_sot(2,1)*Ds(1,2,jo) ! V(id,ju)*D(ju,id)
831
832 ! These forces include both the 'ion' and 'SO' parts
833 do ix = 1,3
834 fik = 2.0_dp*dreal(Ds(1,1,jo)*F_so(ix,1,1) +
835 & Ds(2,2,jo)*F_so(ix,2,2) +
836 & Ds(2,1,jo)*F_so(ix,1,2) +
837 & Ds(1,2,jo)*F_so(ix,2,1) )
838 fa(ix,ia) = fa(ix,ia) - fik
839 fa(ix,kua) = fa(ix,kua) + fik
840 do jx = 1,3
841 stress(jx,ix) = stress(jx,ix) +
842 & xno(jx,ino) * fik / volume
843 enddo
844 enddo
845 endif
846 ko = ko+2*(2*l+1)
847 endif
848 if ( ko.ge.lastkb(ka) ) exit KB_loop
849 enddo KB_loop
850
851 endif ! listed
852 enddo ! jno orbitals
853
854C-------- Pick up contributions to H and restore Di and Vi
855 do j = 1,numh(iio)
856 ind = listhptr(iio)+j
857 jo = listh(ind)
858 H0(ind) = H0(ind) + Vi(jo)
859 H0_off(ind,1) = H0_off(ind,1) + V_so(1,1,jo)
860 H0_off(ind,2) = H0_off(ind,2) + V_so(2,2,jo)
861 H0_off(ind,3) = H0_off(ind,3) + V_so(1,2,jo)
862 H0_off(ind,4) = H0_off(ind,4) + V_so(2,1,jo)
863
864
865C Careful with this Vi()
866 Vi(jo) = 0.0d0
867 listed(jo) = .false.
868 enddo
869 endif ! Atom in UC?
870
871 endif ! iio .gt. 0
872 enddo ! ino AOs
873 enddo ! atoms with KB projectors loop
874
875 if (.not. matrix_elements_only) then
876 Enl_offsiteSO = sum( dreal(E_offsiteSO(1:4)) )
877 endif
878
879C Deallocate local memory
880
881 call reset_neighbour_arrays( )
882 call de_alloc( grSki, 'grSki', 'nlefsm_SO_off' )
883 call de_alloc( Ski, 'Ski', 'nlefsm_SO_off' )
884 call de_alloc( xno, 'xno', 'nlefsm_SO_off' )
885 call de_alloc( iono, 'iono', 'nlefsm_SO_off' )
886 call de_alloc( iano, 'iano', 'nlefsm_SO_off' )
887
888 call de_alloc( listedall, 'listedall', 'nlefsm_SO_off' )
889 call de_alloc( listed, 'listed', 'nlefsm_SO_off' )
890 call de_alloc( Vi, 'Vi', 'nlefsm_SO_off' )
891 deallocate( V_so )
892
893 if (.not. matrix_elements_only) then
894 call de_alloc( Di, 'Di', 'nlefsm_SO_off' )
895 deallocate( Ds )
896 endif
897
898 call timer( 'nlefsm', 2 )
899
900 end subroutine nlefsm_SO_off
901
902c-----------------------------------------------------------------------
903c
904!> Evaluates:
905!! <i|V_NL|j>, where V_NL= Sum_{j,mj} |V,j,mj><V,j,mj|
906c
907c-----------------------------------------------------------------------
908 subroutine calc_Vj_offsiteSO( l, epskb, Ski, Skj, grSki, grSkj,
909 & V_ion, V_so, F_so )
910
911 implicit none
912
913 integer , intent(in) :: l
914 real(dp) , intent(in) :: epskb(2)
915 real(dp) , intent(in) :: Ski(-l:l,2), Skj(-l:l,2)
916 real(dp) , intent(in) :: grSki(3,-l:l,2), grSkj(3,-l:l,2)
917 real(dp) , intent(out) :: V_ion
918 complex(dp) , intent(out) :: F_so(3,2,2)
919 complex(dp) , intent(out) :: V_so(2,2)
920
921
922 integer :: J, ij, imj, m, is
923 real(dp) :: aj, amj, al, a2l1, fac, facm,
924 & epskpm, V_iont, cp, cm, facpm
925
926 real(dp) :: cg(2*(2*l+1),2)
927 complex(dp):: u(-l:l,-l:l)
928 complex(dp):: SVi(2), SVj(2), grSVi(3,2)
929
930 external :: die
931c-----------------------------------------------------------------------
932
933c---- set constants and factors
934 al = dble(l)
935 a2l1 = dble( 2*l+1 )
936
937c---- load Clebsch-Gordan coefficients; cg(J,+-)
938 J = 0
939 cg(:,:) = 0.0_dp
940 do ij = 1, 2
941 aj = al + (2*ij-3)*0.5d0 ! j(ij=1)=l-1/2; j(ij=2)=l+1/2
942 facpm= (-1.0d0)**(aj-al-0.5d0) ! +/- sign
943 do imj = 1, nint(2*aj)+1 ! Degeneracy for j
944 amj = -aj + dfloat(imj-1) ! mj value
945 J = J+1 ! (j,mj) index
946
947 cp = sqrt( (al+0.5d0+amj)/a2l1 )
948 cm = sqrt( (al+0.5d0-amj)/a2l1 )
949 if ( ij.eq. 1 ) then
950 cg(J,1) = cm*facpm ! <j-|up>
951 cg(J,2) = cp ! <j-|down>
952 else
953 cg(J,1) = cp*facpm ! <j+|up>
954 cg(J,2) = cm ! <j+|down>
955 endif
956 enddo
957 enddo
958
959c---- Ski(M)= <l,M|i> ; Si(m)= <l,m|i> = u(m,-M)*Ski(-M) + u(m,M)*Ski(M)
960 fac = 1.0d0/sqrt(2.0d0)
961 u(:,:) = cmplx(0.0d0,0.0d0)
962 u(0,0)= cmplx(1.0d0,0.0d0)
963 do m = 1, l
964 facm = fac*(-1.0d0)**m
965 u(-m,+M) = cmplx(1.0d0,0.0d0)*fac
966 u(-m,-M) = cmplx(0.0d0,1.0d0)*fac ! J. Cerda
967 u(+m,+M) = cmplx(1.0d0,0.0d0)*facm
968 u(+m,-M) =-cmplx(0.0d0,1.0d0)*facm ! J. Cerda
969 enddo
970
971c---- Load V_so
972 V_so= cmplx(0.0d0,0.0d0); F_so= cmplx(0.0d0,0.0d0)
973 J = 0
974 do ij = 1, 2
975 aj = al + (2*ij-3)*0.5d0 ! j value
976 do imj = 1, nint(2*aj)+1 ! Degeneracy for j
977 amj = -aj + dfloat(imj-1) ! mj value
978 J = J+1 ! (j,mj) index
979
980 SVi(1:2)= cmplx(0.0d0,0.0d0); SVj(1:2)= cmplx(0.0d0,0.0d0)
981 grSVi(1:3,1:2)= cmplx(0.0d0,0.0d0)
982 do is = 1, 2 ! spin loop
983
984c select correct m
985 if ( is.eq.1 ) then
986 m = nint(amj-0.5d0) ! up => m=mj-1/2
987 else
988 m = nint(amj+0.5d0) ! down => m=mj+1/2
989 endif
990
991 if ( iabs(m).le.l ) then
992 SVi(is)= Ski(+M,ij)*u(+m,M)
993 SVj(is)= Skj(+M,ij)*u(+m,M)
994 grSVi(1:3,is)= grSki(1:3,+M,ij)*u(+m,M)
995 if ( m.ne.0 ) then
996 SVi(is)= SVi(is) + Ski(-M,ij)*u(+m,-M)
997 SVj(is)= SVj(is) + Skj(-M,ij)*u(+m,-M)
998 grSVi(1:3,is)= grSVi(1:3,is) +
999 & grSki(1:3,-M,ij)*u(+m,-M)
1000 endif
1001 SVi(is) = SVi(is) * cg(J,is)
1002 SVj(is) = SVj(is) * cg(J,is)
1003
1004 grSVi(1:3,is) = grSVi(1:3,is) * cg(J,is)
1005 endif
1006 enddo ! is
1007
1008c up-up = <i,+|V,J><V,J|j,+>
1009 V_so(1,1) = V_so(1,1) + SVi(1) * epskb(ij) * conjg(SVj(1))
1010 F_so(:,1,1)= F_so(:,1,1)+ grSVi(:,1) * epskb(ij) * conjg(SVj(1))
1011
1012c down-down = <i,-|V,J><V,J|j,->
1013 V_so(2,2) = V_so(2,2) + SVi(2) * epskb(ij) * conjg(SVj(2))
1014 F_so(:,2,2)= F_so(:,2,2)+ grSVi(:,2) * epskb(ij) * conjg(SVj(2))
1015
1016c up-down = <i,+|V,J><V,J|j,->
1017 V_so(1,2) = V_so(1,2) + SVi(1) * epskb(ij) * conjg(SVj(2))
1018 F_so(:,1,2)= F_so(:,1,2)+ grSVi(:,1) * epskb(ij) * conjg(SVj(2))
1019
1020c down-up= <i,-|V,J><V,J|j,+>
1021 V_so(2,1) = V_so(2,1) + SVi(2) * epskb(ij) * conjg(SVj(1))
1022 F_so(:,2,1)= F_so(:,2,1)+ grSVi(:,2) * epskb(ij) * conjg(SVj(1))
1023
1024 enddo ! mj
1025 enddo ! ij
1026
1027cc--- debugging
1028 if ( cdabs(V_so(1,2)+conjg(V_so(2,1))).gt.1.0d-4 ) then
1029 write(6,'(a,2f12.6)') 'V_so(1,2)=',V_so(1,2)
1030 write(6,'(a,2f12.6)') 'V_so(2,1)=',V_so(2,1)
1031 call die('calc_Vj_LS: ERROR')
1032 endif
1033
1034c---- substract out V_ion
1035 epskpm = sqrt( epskb(1)*epskb(2) )
1036 epskpm = sign(epskpm,epskb(1))
1037
1038 V_ion = 0.0d0
1039 do M = -l, l
1040 V_iont = ( l**2 * Ski(M,1)*epskb(1)*Skj(M,1)
1041 & + (l+1)**2 * Ski(M,2)*epskb(2)*Skj(M,2)
1042 & + l*(l+1) * Ski(M,1)*epskpm *Skj(M,2)
1043 & + l*(l+1) * Ski(M,2)*epskpm *Skj(M,1) )/(a2l1**2)
1044 V_ion = V_ion + V_iont
1045 enddo
1046
1047 V_so(1,1) = V_so(1,1) - cmplx(1.0d0,0.0d0)*V_ion
1048 V_so(2,2) = V_so(2,2) - cmplx(1.0d0,0.0d0)*V_ion
1049
1050 return
1051 end subroutine calc_Vj_offsiteSO
1052
444 end module m_nlefsm1053 end module m_nlefsm
4451054
=== modified file 'Src/setup_H0.F'
--- Src/setup_H0.F 2017-06-23 19:49:18 +0000
+++ Src/setup_H0.F 2018-04-30 20:53:35 +0000
@@ -17,9 +17,12 @@
17 17
18 USE siesta_options, only: g2cut18 USE siesta_options, only: g2cut
19 use sparse_matrices, only: H_kin_1D, H_vkb_1D19 use sparse_matrices, only: H_kin_1D, H_vkb_1D
20 use sparse_matrices, only: H_so_2D20 use sparse_matrices, only: H_so_on_2D, H_so_off_2D
21 use sparse_matrices, only: Dscf21 use sparse_matrices, only: Dscf
2222
23 use m_nlefsm, only: nlefsm_SO_off
24 use m_spin, only: spin
25
23 use sparse_matrices, only: listh, listhptr, numh, maxnh26 use sparse_matrices, only: listh, listhptr, numh, maxnh
24 use siesta_geom27 use siesta_geom
25 use atmfuncs, only: uion28 use atmfuncs, only: uion
@@ -40,6 +43,7 @@
40 use alloc, only: re_alloc, de_alloc43 use alloc, only: re_alloc, de_alloc
41 use class_dSpData1D, only: val44 use class_dSpData1D, only: val
42 use class_dSpData2D, only: val45 use class_dSpData2D, only: val
46 use class_zSpData2D, only: val
4347
44#ifdef MPI48#ifdef MPI
45 use m_mpi_utils, only: globalize_sum49 use m_mpi_utils, only: globalize_sum
@@ -52,7 +56,16 @@
52 real(dp) :: dummy_E56 real(dp) :: dummy_E
53 integer :: ia, is57 integer :: ia, is
5458
55 real(dp), pointer :: H_val(:), H_so(:,:)59 real(dp) :: dummy_Eso
60 integer :: ispin, i, j
61 complex(dp) :: Dc
62#ifdef MPI
63 real(dp) :: buffer1
64#endif
65
66 real(dp), pointer :: H_val(:), H_so_on(:,:)
67 complex(dp), pointer :: H_so_off(:,:)
68
5669
57#ifdef DEBUG70#ifdef DEBUG
58 call write_debug( ' PRE setup_H0' )71 call write_debug( ' PRE setup_H0' )
@@ -113,15 +126,59 @@
113!$OMP parallel workshare default(shared)126!$OMP parallel workshare default(shared)
114 H_val(:) = 0.0_dp127 H_val(:) = 0.0_dp
115!$OMP end parallel workshare128!$OMP end parallel workshare
116 call nlefsm(scell, na_u, na_s, isa, xa, indxua, 129
117 & maxnh, maxnh, lasto, lastkb, iphorb, iphKB, 130 Eso = 0.0d0
118 & numh, listhptr, listh, numh, listhptr, listh, 131
119 & 1,132 if ( .not.spin%SO_offsite ) then
120 & dummy_dm, dummy_E, dummy_fa, dummy_stress,133 call nlefsm(scell, na_u, na_s, isa, xa, indxua,
121 & H_val,134 & maxnh, maxnh, lasto, lastkb, iphorb, iphKB,
122 & matrix_elements_only=.true.) 135 & numh, listhptr, listh, numh, listhptr, listh,
123136 & 1,
124137 & dummy_dm, dummy_E, dummy_fa, dummy_stress,
138 & H_val,
139 & matrix_elements_only=.true.)
140 else
141 H_so_off => val(H_so_off_2D)
142 H_so_off = dcmplx(0._dp, 0._dp)
143 call nlefsm_SO_off(scell, na_u, na_s, isa, xa, indxua,
144 & maxnh, maxnh, lasto, lastkb, iphorb, iphKB,
145 & numh, listhptr, listh, numh, listhptr, listh,
146 & spin%Grid,
147 & dummy_E, dummy_Eso, dummy_fa,
148 & dummy_stress, H_val, H_so_off,
149 & matrix_elements_only=.true.)
150
151
152!
153! Dc IS NOT the dense matrix, it is just a complex number
154! (per each io index) used as an artifact to multiply the
155! elements of the H_SO times the corresponding elements of
156! DM in a such way that the result gives Re{Tr[H_SO*DM]}.
157!
158
159 do i = 1, maxnh
160
161!-------- Eso(u,u)
162 Dc = cmplx(Dscf(i,1),Dscf(i,5), dp)
163 Eso = Eso + real( H_so_off(i,1)*Dc, dp)
164!-------- Eso(d,d)
165 Dc = cmplx(Dscf(i,2),Dscf(i,6),dp)
166 Eso = Eso + real( H_so_off(i,2)*Dc, dp)
167!-------- Eso(u,d)
168 Dc = cmplx(Dscf(i,3),Dscf(i,4), dp)
169 Eso = Eso + real( H_so_off(i,4)*Dc, dp)
170!-------- Eso(d,u)
171 Dc = cmplx(Dscf(i,7),-Dscf(i,8), dp)
172 Eso = Eso + real( H_so_off(i,3)*Dc, dp)
173
174 enddo
175
176#ifdef MPI
177! Global reduction of Eso
178 call globalize_sum(Eso,buffer1)
179 Eso = buffer1
180#endif
181 endif
125! ..................182! ..................
126183
127! If in the future the spin-orbit routine is able to compute184! If in the future the spin-orbit routine is able to compute
@@ -129,17 +186,14 @@
129! computing forces and stresses, calling it in the first iteration186! computing forces and stresses, calling it in the first iteration
130! should be enough187! should be enough
131!188!
132 if ( spin%SO ) then189 if ( spin%SO_onsite ) then
133 H_so => val(H_so_2D)190 H_so_on => val(H_so_on_2D)
134!$OMP parallel workshare default(shared)191!$OMP parallel workshare default(shared)
135 H_so = 0._dp192 H_so_on(:,:) = 0._dp
136!$OMP end parallel workshare193!$OMP end parallel workshare
137 call spinorb(no_u,no_l,iaorb,iphorb,isa,indxuo,194 call spinorb(no_u,no_l,iaorb,iphorb,isa,indxuo,
138 & maxnh,numh,listhptr,listh,Dscf,H_so,Eso)195 & maxnh,numh,listhptr,listh,Dscf,H_so_on,Eso)
139 else
140 Eso = 0._dp
141 end if196 end if
142
143197
144C This will take care of possible changes to the mesh and atomic-related198C This will take care of possible changes to the mesh and atomic-related
145C mesh structures for geometry changes199C mesh structures for geometry changes
@@ -150,7 +204,7 @@
150 & mscell, G2max, ntm,204 & mscell, G2max, ntm,
151 & maxnh, numh, listhptr, listh, datm,205 & maxnh, numh, listhptr, listh, datm,
152 & dummy_fa, dummy_stress)206 & dummy_fa, dummy_stress)
153 207
154 call timer('Setup_H0',2)208 call timer('Setup_H0',2)
155209
156#ifdef DEBUG210#ifdef DEBUG
157211
=== modified file 'Src/setup_hamiltonian.F'
--- Src/setup_hamiltonian.F 2018-03-30 23:16:29 +0000
+++ Src/setup_hamiltonian.F 2018-04-30 20:53:35 +0000
@@ -14,12 +14,14 @@
1414
15 USE siesta_options15 USE siesta_options
16 use sparse_matrices, only: H_kin_1D, H_vkb_1D16 use sparse_matrices, only: H_kin_1D, H_vkb_1D
17 use sparse_matrices, only: H_ldau_2D, H_so_2D17 use sparse_matrices, only: H_ldau_2D
18 use sparse_matrices, only: H_so_on_2D, H_so_off_2D
18 use sparse_matrices, only: listh, listhptr, numh, maxnh19 use sparse_matrices, only: listh, listhptr, numh, maxnh
19 use sparse_matrices, only: H, S, Hold20 use sparse_matrices, only: H, S, Hold
20 use sparse_matrices, only: Dscf, Escf, xijo21 use sparse_matrices, only: Dscf, Escf, xijo
21 use class_dSpData1D, only: val22 use class_dSpData1D, only: val
22 use class_dSpData2D, only: val23 use class_dSpData2D, only: val
24 use class_zSpData2D, only: val
2325
24 use siesta_geom26 use siesta_geom
25 use atmfuncs, only: uion27 use atmfuncs, only: uion
@@ -40,7 +42,9 @@
40 use parallel, only: Node42 use parallel, only: Node
41 use m_steps, only: istp43 use m_steps, only: istp
42 use m_ntm44 use m_ntm
43 use m_spin, only: spin45
46 use m_spin, only: spin
47
44 use m_dipol48 use m_dipol
45 use alloc, only: re_alloc, de_alloc49 use alloc, only: re_alloc, de_alloc
46 use m_gamma50 use m_gamma
@@ -68,7 +72,12 @@
68 type(filesOut_t) :: filesOut ! blank output file names72 type(filesOut_t) :: filesOut ! blank output file names
69 logical :: use_rhog_in73 logical :: use_rhog_in
7074
71 real(dp), pointer :: H_vkb(:), H_kin(:), H_ldau(:,:), H_so(:,:)75 real(dp), pointer :: H_vkb(:), H_kin(:), H_ldau(:,:)
76 real(dp), pointer :: H_so_on(:,:)
77 complex(dp), pointer:: H_so_off(:,:)
78
79 complex(dp):: Dc
80 integer :: ind, i, j
7281
73!------------------------------------------------------------------------- BEGIN82!------------------------------------------------------------------------- BEGIN
7483
@@ -84,53 +93,53 @@
84 do ispin = 1, spin%H93 do ispin = 1, spin%H
85 do io = 1,maxnh94 do io = 1,maxnh
86 Hold(io,ispin) = H(io,ispin)95 Hold(io,ispin) = H(io,ispin)
87 enddo96 end do
88 enddo97 end do
89!$OMP end do98!$OMP end do
9099
91!$OMP single100!$OMP single
92 H_kin => val(H_kin_1D)101 H_kin => val(H_kin_1D)
93 H_vkb => val(H_vkb_1D)102 H_vkb => val(H_vkb_1D)
94 if ( spin%SO ) then103
95 ! Sadly some compilers (g95), does104 if ( spin%SO_onsite ) then
96 ! not allow bounds for pointer assignments :(105 ! Sadly some compilers (g95), does
97 H_so => val(H_so_2D)106 ! not allow bounds for pointer assignments :(
107 H_so_on => val(H_so_on_2D)
108
109 else if ( spin%SO_offsite ) then
110 H_so_off => val(H_so_off_2D)
111
98 end if112 end if
99!$OMP end single ! keep wait113!$OMP end single ! keep wait
100114
101 ! We do not need to set the non-spinor components115 ! Initialize diagonal Hamiltonian
102 ! For non-colinear they are set down below,
103 ! while for spin-orbit they are set to the H_so initial
104 ! spin-orbit.
105
106 do ispin = 1, spin%spinor116 do ispin = 1, spin%spinor
107!$OMP do117!$OMP do
108 do io = 1,maxnh118 do io = 1,maxnh
109 H(io,ispin) = H_kin(io) + H_vkb(io)119 H(io,ispin) = H_kin(io) + H_vkb(io)
110 end do120 end do
111!$OMP end do nowait121!$OMP end do nowait
112 end do122 end do
113123
114 if ( spin%NCol ) then124 if ( spin%SO_onsite ) then
115125!$OMP do collapse(2)
116!$OMP do collapse(2)126 do ispin = 3 , spin%H
117 do ispin = 3 , spin%H127 do io = 1,maxnh
118 do io = 1, maxnh128 H(io,ispin) = H_so_on(io,ispin-2)
119 H(io,ispin) = 0._dp129 end do
120 end do130 end do
121 end do131!$OMP end do nowait
122!$OMP end do nowait132
123 133 else
124 else if ( spin%SO ) then134
125135!$OMP do collapse(2)
126!$OMP do collapse(2)136 do ispin = 3 , spin%H
127 do ispin = 3 , spin%H137 do io = 1,maxnh
128 do io = 1, maxnh138 H(io,ispin) = 0._dp
129 H(io,ispin) = H_so(io,ispin-2)139 end do
130 end do140 end do
131 end do141!$OMP end do nowait
132!$OMP end do nowait142
133
134 end if143 end if
135 144
136! ..................145! ..................
@@ -146,6 +155,7 @@
146!$OMP single155!$OMP single
147 Ekin = 0.0_dp156 Ekin = 0.0_dp
148 Enl = 0.0_dp157 Enl = 0.0_dp
158 Eso = 0.0_dp
149!$OMP end single ! keep wait159!$OMP end single ! keep wait
150 160
151!$OMP do collapse(2), reduction(+:Ekin,Enl)161!$OMP do collapse(2), reduction(+:Ekin,Enl)
@@ -157,21 +167,46 @@
157 end do167 end do
158!$OMP end do nowait168!$OMP end do nowait
159169
160!$OMP single170!
161 Eso = 0._dp171! Dc IS NOT the dense matrix, it is just a complex number
162!$OMP end single172! (per each io index) used as an artifact to multiply the
163 if ( spin%SO ) then173! elements of the H_SO times the corresponding elements of
174! DM in a such way that the result gives Re{Tr[H_SO*DM]}.
175!
176
177 if ( spin%SO_offsite ) then
178 do io = 1, maxnh
179
180!-------- Eso(u,u)
181 Dc = cmplx(Dscf(io,1),Dscf(io,5), dp)
182 Eso = Eso + real( H_so_off(io,1)*Dc, dp)
183!-------- Eso(d,d)
184 Dc = cmplx(Dscf(io,2),Dscf(io,6), dp)
185 Eso = Eso + real( H_so_off(io,2)*Dc, dp)
186!-------- Eso(u,d)
187 Dc = cmplx(Dscf(io,3),Dscf(io,4), dp)
188 Eso = Eso + real( H_so_off(io,4)*Dc, dp)
189!-------- Eso(d,u)
190 Dc = cmplx(Dscf(io,7),-Dscf(io,8), dp)
191 Eso = Eso + real( H_so_off(io,3)*Dc, dp)
192
193 end do
194
195 else if ( spin%SO_onsite ) then
196
164!$OMP do reduction(+:Eso)197!$OMP do reduction(+:Eso)
165 do io = 1, maxnh198 do io = 1, maxnh
166 Eso = Eso + H_so(io,1)*Dscf(io,7) + H_so(io,2)*Dscf(io,8)199 Eso = Eso + H_so_on(io,1)*Dscf(io,7) +
167 . + H_so(io,5)*Dscf(io,3) + H_so(io,6)*Dscf(io,4)200 & H_so_on(io,2)*Dscf(io,8)+ H_so_on(io,5)*Dscf(io,3) +
168 . - H_so(io,3)*Dscf(io,5) - H_so(io,4)*Dscf(io,6)201 & H_so_on(io,6)*Dscf(io,4)- H_so_on(io,3)*Dscf(io,5) -
202 & H_so_on(io,4)*Dscf(io,6)
169 end do203 end do
170!$OMP end do nowait204!$OMP end do nowait
171 end if205
206 end if
172207
173!$OMP end parallel208!$OMP end parallel
174 209
175#ifdef MPI210#ifdef MPI
176 ! Global reduction of Ekin, Enl211 ! Global reduction of Ekin, Enl
177 call globalize_sum(Ekin,buffer1)212 call globalize_sum(Ekin,buffer1)
@@ -191,7 +226,7 @@
191! Hubbard term for LDA+U: energy, forces, stress and matrix elements ....226! Hubbard term for LDA+U: energy, forces, stress and matrix elements ....
192 if( switch_ldau ) then227 if( switch_ldau ) then
193 if ( spin%NCol ) then228 if ( spin%NCol ) then
194 call die('LDA+U cannot be used with non-colinear spin.')229 call die('LDA+U cannot be used with non-collinear spin.')
195 end if230 end if
196 if ( spin%SO ) then231 if ( spin%SO ) then
197 call die('LDA+U cannot be used with spin-orbit coupling.')232 call die('LDA+U cannot be used with spin-orbit coupling.')
@@ -243,6 +278,25 @@
243 . Exc, Dxc, dipol, stress, fal, stressl,278 . Exc, Dxc, dipol, stress, fal, stressl,
244 . use_rhog_in)279 . use_rhog_in)
245280
281 if ( spin%SO_offsite ) then
282
283! H(:, [5, 6]) are not updated in dhscf, see vmat for details.
284
285!------- H(u,u)
286 H(:,1) = H(:,1) + real(H_so_off(:,1), dp)
287 H(:,5) = dimag(H_so_off(:,1))
288!------- H(d,d)
289 H(:,2) = H(:,2) + real(H_so_off(:,2), dp)
290 H(:,6) = dimag(H_so_off(:,2))
291!------- H(u,d)
292 H(:,3) = H(:,3) + real(H_so_off(:,3), dp)
293 H(:,4) = H(:,4) +dimag(H_so_off(:,3))
294!------- H(d,u)
295 H(:,7) = H(:,7) + real(H_so_off(:,4), dp)
296 H(:,8) = H(:,8) -dimag(H_so_off(:,4))
297
298 endif
299
246 ! This statement will apply to iscf = 1, for example, when300 ! This statement will apply to iscf = 1, for example, when
247 ! we do not use rhog_in. Rhog here is always the charge used to301 ! we do not use rhog_in. Rhog here is always the charge used to
248 ! build H, that is, rhog_in.302 ! build H, that is, rhog_in.
249303
=== modified file 'Src/siesta_options.F90'
--- Src/siesta_options.F90 2018-04-17 13:07:32 +0000
+++ Src/siesta_options.F90 2018-04-30 20:53:35 +0000
@@ -27,7 +27,6 @@
27 ! -- pre 4.0 coordinate output logic -- to be implemented27 ! -- pre 4.0 coordinate output logic -- to be implemented
28 logical :: compat_pre_v4_dynamics ! General switch28 logical :: compat_pre_v4_dynamics ! General switch
2929
30
31 logical :: mix_scf_first ! Mix first SCF step?30 logical :: mix_scf_first ! Mix first SCF step?
32 logical :: mix_charge ! New: mix fourier components of rho31 logical :: mix_charge ! New: mix fourier components of rho
33 logical :: mixH ! Mix H instead of DM32 logical :: mixH ! Mix H instead of DM
@@ -234,7 +233,7 @@
234 real(dp) :: total_spin ! Total spin used in spin-polarized calculations233 real(dp) :: total_spin ! Total spin used in spin-polarized calculations
235 real(dp) :: tt ! Target temperature. Read in redata. Used in dynamics rout.234 real(dp) :: tt ! Target temperature. Read in redata. Used in dynamics rout.
236 real(dp) :: wmix ! Mixing weight for DM in SCF iteration235 real(dp) :: wmix ! Mixing weight for DM in SCF iteration
237 real(dp) :: wmixkick ! Mixing weight for DM in special 'kick' SCF steps236 real(dp) :: wmixkick ! Mixing weight for DM in special 'kick' SCF steps
238237
239 character(len=164) :: sname ! System name, used to initialise read238 character(len=164) :: sname ! System name, used to initialise read
240239
@@ -250,5 +249,5 @@
250 ! LUA-handle249 ! LUA-handle
251 type(luaState) :: LUA250 type(luaState) :: LUA
252#endif251#endif
253 252
254END MODULE siesta_options253END MODULE siesta_options
255254
=== modified file 'Src/sparse_matrices.F'
--- Src/sparse_matrices.F 2016-08-18 10:36:36 +0000
+++ Src/sparse_matrices.F 2018-04-30 20:53:35 +0000
@@ -9,6 +9,7 @@
9 use precision9 use precision
10 use class_dSpData1D10 use class_dSpData1D
11 use class_dSpData2D11 use class_dSpData2D
12 use class_zSpData2D
12 use class_Sparsity13 use class_Sparsity
13 use class_OrbitalDistribution14 use class_OrbitalDistribution
14 use class_Fstack_Pair_Geometry_dSpData2D15 use class_Fstack_Pair_Geometry_dSpData2D
@@ -31,12 +32,16 @@
3132
32 real(dp), public, pointer :: xijo(:,:)=>null()33 real(dp), public, pointer :: xijo(:,:)=>null()
3334
35 complex(dp), public, pointer :: H0_offsiteSO(:,:) => null()
3436
35 ! Pieces of H that do not depend on the SCF density matrix37 ! Pieces of H that do not depend on the SCF density matrix
36 ! Formerly there was a single array H0 for this38 ! Formerly there was a single array H0 for this
37 type(dSpData1D), public, save :: H_vkb_1D, H_kin_1D39 type(dSpData1D), public, save :: H_vkb_1D, H_kin_1D
38 ! LDA+U and spin-orbit coupling Hamiltonian40 ! LDA+U and spin-orbit coupling Hamiltonian
39 type(dSpData2D), public, save :: H_ldau_2D, H_so_2D41 type(dSpData2D), public, save :: H_ldau_2D, H_so_on_2D
42 ! Spin-orbit off-site
43 type(zSpData2D), public, save :: H_so_off_2D
44
4045
41 ! New interface data46 ! New interface data
42 type(Sparsity), public, save :: sparse_pattern47 type(Sparsity), public, save :: sparse_pattern
@@ -54,7 +59,7 @@
54 CONTAINS59 CONTAINS
5560
56 subroutine resetSparseMatrices( )61 subroutine resetSparseMatrices( )
57 use alloc, only : de_alloc62 use alloc, only : de_alloc
5863
59 implicit none64 implicit none
6065
@@ -65,7 +70,8 @@
65 call delete( H_kin_1D )70 call delete( H_kin_1D )
66 call delete( H_vkb_1D )71 call delete( H_vkb_1D )
67 call delete( H_ldau_2D )72 call delete( H_ldau_2D )
68 call delete( H_so_2D )73 call delete( H_so_on_2D )
74 call delete( H_so_off_2D )
6975
70 call delete( DM_2D ) ; nullify(Dscf)76 call delete( DM_2D ) ; nullify(Dscf)
71 call delete( EDM_2D ) ; nullify(Escf)77 call delete( EDM_2D ) ; nullify(Escf)
7278
=== modified file 'Src/spinorbit.f'
--- Src/spinorbit.f 2017-10-26 10:42:57 +0000
+++ Src/spinorbit.f 2018-04-30 20:53:35 +0000
@@ -38,7 +38,6 @@
38 use precision, only: dp38 use precision, only: dp
39 use atmfuncs39 use atmfuncs
40 use atm_types40 use atm_types
41 use fdf, only: fdf_get
42 use parallel, only: Node, Nodes41 use parallel, only: Node, Nodes
43 use parallelsubs, only: LocalToGlobalOrb42 use parallelsubs, only: LocalToGlobalOrb
4443
@@ -53,7 +52,6 @@
53! indexing technology)52! indexing technology)
5453
55 logical, save :: vso_setup = .false.54 logical, save :: vso_setup = .false.
56 real(dp), save :: so_strength = 1.0_dp
5755
58 integer, pointer, save :: nr(:)56 integer, pointer, save :: nr(:)
59 real(dp), pointer, save :: vso(:,:,:)57 real(dp), pointer, save :: vso(:,:,:)
@@ -73,7 +71,6 @@
73 use atmparams, only: lmaxd71 use atmparams, only: lmaxd
74 use parallel, only: Node72 use parallel, only: Node
75 use m_mpi_utils, only: broadcast73 use m_mpi_utils, only: broadcast
76 use sys, only: die
7774
78 integer :: is, mx_nrval, li, ir, iup75 integer :: is, mx_nrval, li, ir, iup
79 real(dp) :: a, b, rpb, ea76 real(dp) :: a, b, rpb, ea
@@ -132,7 +129,8 @@
132 enddo129 enddo
133 write(6,"(/)")130 write(6,"(/)")
134 if (.not. there_are_so_potentials) then131 if (.not. there_are_so_potentials) then
135 call die("No spin-orbit components for any species!!")132 write(6,"(a)") "*** WARNING: No spin-orbit components " //
133 $ "for any species... "
136 endif134 endif
137 endif135 endif
138136
@@ -140,8 +138,6 @@
140 call broadcast(r)138 call broadcast(r)
141 call broadcast(drdi)139 call broadcast(drdi)
142 140
143 so_strength = fdf_get('SpinOrbitStrength',1.0_dp)
144
145 end subroutine init_vso141 end subroutine init_vso
146142
147!------------------------------------------------143!------------------------------------------------
@@ -174,6 +170,7 @@
174C *********************************************************************170C *********************************************************************
175C171C
176 use m_mpi_utils, only: globalize_sum172 use m_mpi_utils, only: globalize_sum
173
177 implicit none174 implicit none
178175
179C Arguments176C Arguments
@@ -238,7 +235,7 @@
238 235
239 call int_so_rad(is, li, joa, ioa, int_rad)236 call int_so_rad(is, li, joa, ioa, int_rad)
240 call int_so_ang(li, mj, mi, int_ang(:))237 call int_so_ang(li, mj, mi, int_ang(:))
241 Hso_ji(:)=so_strength*int_rad*int_ang(:)238 Hso_ji(:) = int_rad * int_ang(:)
242239
243 H(ind,3) = H(ind,3) + Hso_ji(2)240 H(ind,3) = H(ind,3) + Hso_ji(2)
244 H(ind,4) = H(ind,4) + Hso_ji(3)241 H(ind,4) = H(ind,4) + Hso_ji(3)
245242
=== modified file 'Src/state_analysis.F'
--- Src/state_analysis.F 2018-04-19 08:46:09 +0000
+++ Src/state_analysis.F 2018-04-30 20:53:35 +0000
@@ -22,7 +22,7 @@
22 & CartesianForce_to_ZmatForce22 & CartesianForce_to_ZmatForce
23 use atomlist, only : iaorb, iphorb, amass, no_u, lasto23 use atomlist, only : iaorb, iphorb, amass, no_u, lasto
24 use atomlist, only : indxuo24 use atomlist, only : indxuo
25 use m_spin, only : nspin, SpOrb25 use m_spin, only : spin
26 use m_fixed, only : fixed26 use m_fixed, only : fixed
27 use sparse_matrices27 use sparse_matrices
28 use siesta_geom28 use siesta_geom
@@ -167,7 +167,7 @@
167 endif167 endif
168168
169! Population and moment analysis 169! Population and moment analysis
170 if ( SpOrb .and. orbmoms) then170 if ( spin%SO .and. orbmoms) then
171 call moments( 1, na_u, no_u, maxnh, numh, listhptr,171 call moments( 1, na_u, no_u, maxnh, numh, listhptr,
172 . listh, S, Dscf, isa, lasto, iaorb, iphorb,172 . listh, S, Dscf, isa, lasto, iaorb, iphorb,
173 . indxuo )173 . indxuo )
174174
=== modified file 'Src/state_init.F'
--- Src/state_init.F 2018-04-15 14:49:37 +0000
+++ Src/state_init.F 2018-04-30 20:53:35 +0000
@@ -27,7 +27,8 @@
27 use sparse_matrices, only: S , S_1D27 use sparse_matrices, only: S , S_1D
2828
29 use sparse_matrices, only: H_kin_1D, H_vkb_1D29 use sparse_matrices, only: H_kin_1D, H_vkb_1D
30 use sparse_matrices, only: H_ldau_2D, H_so_2D30 use sparse_matrices, only: H_ldau_2D
31 use sparse_matrices, only: H_so_on_2D, H_so_off_2D
3132
32 use sparse_matrices, only: sparse_pattern33 use sparse_matrices, only: sparse_pattern
33 use sparse_matrices, only: block_dist, single_dist34 use sparse_matrices, only: block_dist, single_dist
@@ -98,6 +99,7 @@
98 use class_Sparsity99 use class_Sparsity
99 use class_dSpData1D100 use class_dSpData1D
100 use class_dSpData2D101 use class_dSpData2D
102 use class_zSpData2D
101 use class_dData2D103 use class_dData2D
102#ifdef TEST_IO104#ifdef TEST_IO
103 use m_test_io105 use m_test_io
@@ -138,7 +140,6 @@
138 type(dData2D) :: tmp_2D140 type(dData2D) :: tmp_2D
139 real(dp) :: dummy_qspin(8)141 real(dp) :: dummy_qspin(8)
140142
141
142!------------------------------------------------------------------- BEGIN143!------------------------------------------------------------------- BEGIN
143 call timer( 'IterGeom', 1 )144 call timer( 'IterGeom', 1 )
144#ifdef DEBUG145#ifdef DEBUG
@@ -339,6 +340,7 @@
339 ! be higher than 1, hence we need to create "fake"340 ! be higher than 1, hence we need to create "fake"
340 ! containers and let the new<class> delete the old341 ! containers and let the new<class> delete the old
341 ! sparsity pattern342 ! sparsity pattern
343
342 nullify(numh,listhptr,listh)344 nullify(numh,listhptr,listh)
343 allocate(numh(no_l),listhptr(no_l))345 allocate(numh(no_l),listhptr(no_l))
344 ! We do not need to allocate listh346 ! We do not need to allocate listh
@@ -562,11 +564,15 @@
562 end if564 end if
563 end if565 end if
564 566
565 if ( spin%SO ) then567 if ( spin%SO_onsite ) then
566 write(oname,"(a,i0)") "H_so at geom step ", istep568 write(oname,"(a,i0)") "H_so (onsite) at geom step ", istep
567 call newdSpData2D(sparse_pattern,spin%H - 2,569 call newdSpData2D(sparse_pattern,spin%H - 2,
568 & block_dist,H_so_2D,name=oname)570 & block_dist,H_so_on_2D,name=oname)
569 end if571 else if ( spin%SO_offsite ) then
572 write(oname,"(a,i0)") "H_so (offsite) at geom step ", istep
573 call newzSpData2D(sparse_pattern,4,
574 & block_dist,H_so_off_2D,name=oname)
575 endif
570576
571 write(oname,"(a,i0)") "S at geom step ", istep577 write(oname,"(a,i0)") "S at geom step ", istep
572 call newdSpData1D(sparse_pattern,block_dist,S_1D,name=oname)578 call newdSpData1D(sparse_pattern,block_dist,S_1D,name=oname)
@@ -585,6 +591,7 @@
585! Initialize density matrix591! Initialize density matrix
586 ! The resizing of Dscf is done inside new_dm592 ! The resizing of Dscf is done inside new_dm
587 call new_DM(auxchanged, DM_history, DM_2D, EDM_2D)593 call new_DM(auxchanged, DM_history, DM_2D, EDM_2D)
594
588 Dscf => val(DM_2D)595 Dscf => val(DM_2D)
589 Escf => val(EDM_2D)596 Escf => val(EDM_2D)
590 if (spin%H > 1) call print_spin(dummy_qspin)597 if (spin%H > 1) call print_spin(dummy_qspin)
591598
=== added directory 'Tests/FePt_soc'
=== added file 'Tests/FePt_soc/FePt_soc.fdf'
--- Tests/FePt_soc/FePt_soc.fdf 1970-01-01 00:00:00 +0000
+++ Tests/FePt_soc/FePt_soc.fdf 2018-04-30 20:53:35 +0000
@@ -0,0 +1,65 @@
1#
2# -- Caution: quality parameters set artificially low !
3#
4SystemName FePt distorted bulk structure -- soc test
5SystemLabel FePt_soc
6NumberOfAtoms 2
7NumberOfSpecies 2
8%block Chemical_Species_label
9 1 26 Fe_fept_SOC
10 2 78 Pt_fept_SOC
11%endblock Chemical_Species_label
12
13Spin SO
14
15%block DM.InitSpin
16 1 +2. 90. 90.
17 2 +1. 90. 90.
18%endblock DM.InitSpin
19
20LatticeConstant 1.0 Ang
21%block LatticeVectors
22 2.793068700 0.000000000 0.000000000
23 0.000000000 2.70 0.000000000
24 0.000000000 0.000000000 3.792000000
25%endblock LatticeVectors
26
27AtomicCoordinatesFormat NotScaledCartesianAng
28%block AtomicCoordinatesAndAtomicSpecies
29 1.396535500 1.45 0.000000000 1
30 0.000000000 0.000000000 1.896000000 2
31%endblock AtomicCoordinatesAndAtomicSpecies
32
33%Block PAO.Basis
34 Fe_fept_SOC 2
35 n=4 0 2 P
36 0.0 0.0
37 n=3 2 2
38 0.0 0.0
39 Pt_fept_SOC 2
40 n=6 0 2 P
41 0.0 0.0
42 n=5 2 2
43 0.0 0.0
44%EndBlock PAO.Basis
45
46%block kgrid_Monkhorst_Pack
47 3 0 0 0.0
48 0 5 0 0.0
49 0 0 5 0.0
50%endblock kgrid_Monkhorst_Pack
51
52xc.functional GGA
53xc.authors PBE
54MeshCutoff 400. Ry
55SolutionMethod diagon
56
57DM.Tolerance 1.0E-4
58MaxSCFIterations 6
59scf-must-converge F
60DM.MixingWeight 0.01
61DM.NumberPulay 4
62scf-mix-spin all
63
64MullikenInSCF T
65WriteForces T
066
=== added file 'Tests/FePt_soc/FePt_soc.pseudos'
--- Tests/FePt_soc/FePt_soc.pseudos 1970-01-01 00:00:00 +0000
+++ Tests/FePt_soc/FePt_soc.pseudos 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1Fe_fept_SOC
2Pt_fept_SOC
03
=== added file 'Tests/FePt_soc/makefile'
--- Tests/FePt_soc/makefile 1970-01-01 00:00:00 +0000
+++ Tests/FePt_soc/makefile 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1name=FePt_soc
2include ../test.mk
03
=== modified file 'Tests/Makefile'
--- Tests/Makefile 2018-04-25 11:39:40 +0000
+++ Tests/Makefile 2018-04-30 20:53:35 +0000
@@ -28,7 +28,7 @@
28# for a serial run.28# for a serial run.
29#29#
30# It is also possible to have separate working directories,30# It is also possible to have separate working directories,
31# by using the a "label". For example:31# by using a "label". For example:
32#32#
33# make label=finer 33# make label=finer
34# 34#
@@ -75,12 +75,8 @@
75# sih-pexsi-spin75# sih-pexsi-spin
76# TranSiesta-TBTrans76# TranSiesta-TBTrans
7777
78# These tests are extremely time consuming and78# SOC tests
79# should only be runned sometimes79tests_soc = ge_soc_bands Pt_dimer_soc FePt_soc
80# Currently they may be runned individually.
81# SOC_FePt_xx SOC_FePt_xz SOC_FePt_zy SOC_FePt_zz
82tests_soc = SOC_Pt2_xx SOC_Pt2_xz SOC_Pt2_zy SOC_Pt2_zz
83tests_soc += SOC_FePt_xx SOC_FePt_xz SOC_FePt_zy SOC_FePt_zz
8480
85# Tests only applicable for LUA81# Tests only applicable for LUA
86tests_lua = lua_si111 lua_h2o82tests_lua = lua_si111 lua_h2o
8783
=== added directory 'Tests/More_SOC_Examples'
=== added file 'Tests/More_SOC_Examples/README'
--- Tests/More_SOC_Examples/README 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/README 2018-04-30 20:53:35 +0000
@@ -0,0 +1,10 @@
1These are examples of computation of the Magnetic Anisotropy Energy (MAE)
2and other checks for two systems: a Pt dimer, and a FePt bulk structure.
3
4Note that to run the tests automatically you have to move a specific directory
5one level up in the hierarchy:
6
7 mv offsite_SOC_FePt_xz ..
8 cd ../offsite_SOC_FePt_xz
9 make
10
011
=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx'
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.fdf'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.fdf 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.fdf 2018-04-30 20:53:35 +0000
@@ -0,0 +1,72 @@
1SystemName FePt-L1_0
2SystemLabel FePtxx
3NumberOfAtoms 2
4NumberOfSpecies 2
5%block Chemical_Species_label
6 1 26 Fe_fept_SOC
7 2 78 Pt_fept_SOC
8%endblock Chemical_Species_label
9
10PAO.EnergyShift 100 meV
11PAO.SplitNorm 0.15
12PAO.OldStylePolOrbs F
13Restricted.Radial.Grid F
14%Block PAO.Basis
15 Fe_fept_SOC 2
16 n=4 0 2 P
17 0.0 0.0
18 n=3 2 2
19 0.0 0.0
20 Pt_fept_SOC 2
21 n=6 0 2 P
22 0.0 0.0
23 n=5 2 2
24 0.0 0.0
25%EndBlock PAO.Basis
26
27AtomicCoordinatesFormat NotScaledCartesianAng
28%block LatticeVectors
29 3.792000000 0.000000000 0.000000000
30 0.000000000 2.793068700 0.000000000
31 0.000000000 0.000000000 2.793068700
32%endblock LatticeVectors
33LatticeConstant 1.0 Ang
34
35%block AtomicCoordinatesAndAtomicSpecies
36 0.000000000 1.396535500 1.396535500 1
37 1.896000000 0.000000000 0.000000000 2
38%endblock AtomicCoordinatesAndAtomicSpecies
39
40Spin SO
41
42%block DM.InitSpin
43 1 +2. 90. 0.
44 2 +1. 90. 0.
45%endblock DM.InitSpin
46
47
48%block kgrid_Monkhorst_Pack
49 11 0 0 0.0
50 0 21 0 0.0
51 0 0 21 0.0
52%endblock kgrid_Monkhorst_Pack
53
54xc.functional GGA
55xc.authors PBE
56MeshCutoff 1400. Ry
57SolutionMethod diagon
58ElectronicTemperature 1 meV
59
60DM.Tolerance 1.0E-5
61MaxSCFIterations 600
62DM.MixingWeight 0.005
63DM.NumberPulay 8
64DM.UseSaveDM T
65DM.MixSCF1 F
66DM.NumberKick 25
67#Diag.DivideAndConquer F
68MixHamiltonian T
69
70MullikenInSCF T
71WriteForces T
72WriteCoorStep T
073
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.pseudos'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.pseudos 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/FePtxx.pseudos 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1Fe_fept_SOC
2Pt_fept_SOC
03
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/README'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/README 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/README 2018-04-30 20:53:35 +0000
@@ -0,0 +1,33 @@
1Ramon Cuadrado del Burgo - March 7, 2016
2
3 The present test performs fully-relativistic simulation of FePt-L1_0 structure
4placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
5By means of the calculation of the total selfconsistent energy it is possible to
6obtain the magnetic anisotropy energy (MAE) checking in addition that:
7
8 * X-alignment:
9
10 1) The total SC energy for x-axis spin orientation corresponds to the
11 lower value: E_x < E_y = E_z => x-axis = Easy axis
12
13 2) The total SC energy for y-axis and z-axis spin orientation have the
14 same value and they are larger than x-axis SC total energy:
15 E_y = E_z => y/z-axis = Hard axes
16
17 * Z-alignment:
18
19 1) The total SC energy for z-axis spin orientation corresponds to the
20 lower value: E_z < E_x = E_y => z-axis = Easy axis
21
22 2) The total SC energy for x-axis and y-axis spin orientation have the
23 same value and they are larger than z-axis SC total energy:
24 E_x = E_y => x/y-axis = Hard axes
25
26 For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
27configurations have to have the same values when the system is rotated in space:
28
29 a) E_x(X-alignment) = E_z(Z-alignment)
30 E_y(X-alignment) = E_x(Z-alignment)
31 E_z(X-alignment) = E_y(Z-alignment)
32
33 b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
034
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/makefile'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/makefile 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/makefile 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1name=FePtxx
2include ../test.mk
03
=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx'
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.fdf'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.fdf 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.fdf 2018-04-30 20:53:35 +0000
@@ -0,0 +1,74 @@
1SystemName SOC FePt X-alignment x
2SystemLabel FePtxx
3
4Spin SO
5%block DM.InitSpin
6 1 +2. 90. 0.
7 2 +1. 90. 0.
8%endblock DM.InitSpin
9
10NumberOfAtoms 2
11NumberOfSpecies 2
12%block Chemical_Species_label
13 1 26 Fe
14 2 78 Pt
15%endblock Chemical_Species_label
16
17PAO.EnergyShift 100 meV
18PAO.SplitNorm 0.15
19PAO.OldStylePolOrbs F
20Restricted.Radial.Grid F
21%Block PAO.Basis
22 Fe 2
23 n=4 0 2 P
24 0.0 0.0
25 n=3 2 2
26 0.0 0.0
27 Pt 2
28 n=6 0 2 P
29 0.00000 0.00000
30 n=5 2 2
31 0.00000 0.00000
32%EndBlock PAO.Basis
33
34AtomicCoordinatesFormat NotScaledCartesianAng
35LatticeConstant 1.0 Ang
36%block LatticeVectors
37 3.792000000 0.000000000 0.000000000
38 0.000000000 2.793068700 0.000000000
39 0.000000000 0.000000000 2.793068700
40%endblock LatticeVectors
41
42%block AtomicCoordinatesAndAtomicSpecies
43 0.000000000 1.396535500 1.396535500 1
44 1.896000000 0.000000000 0.000000000 2
45%endblock AtomicCoordinatesAndAtomicSpecies
46
47%block kgrid_Monkhorst_Pack
48 11 0 0 0.0
49 0 21 0 0.0
50 0 0 21 0.0
51%endblock kgrid_Monkhorst_Pack
52
53XC.functional GGA
54XC.authors PBE
55
56MeshCutoff 1400. Ry
57
58SolutionMethod diagon
59
60ElectronicTemperature 1 meV
61
62DM.Tolerance 1.0E-5
63
64MaxSCFIterations 1000
65
66DM.MixingWeight 0.005
67DM.NumberPulay 8
68DM.UseSaveDM T
69DM.NumberKick 25
70DM.MixSCF1 F
71
72WriteMullikenPop 1
73WriteForces T
74WriteCoorStep T
075
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.pseudos'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.pseudos 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/FePtxx.pseudos 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1Fe_SOC
2Pt_SOC
03
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/README'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/README 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/README 2018-04-30 20:53:35 +0000
@@ -0,0 +1,33 @@
1Ramon Cuadrado del Burgo - March 7, 2016
2
3 The present test performs fully-relativistic simulation of FePt-L1_0 structure
4placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
5By means of the calculation of the total selfconsistent energy it is possible to
6obtain the magnetic anisotropy energy (MAE) checking in addition that:
7
8 * X-alignment:
9
10 1) The total SC energy for x-axis spin orientation corresponds to the
11 lower value: E_x < E_y = E_z => x-axis = Easy axis
12
13 2) The total SC energy for y-axis and z-axis spin orientation have the
14 same value and they are larger than x-axis SC total energy:
15 E_y = E_z => y/z-axis = Hard axes
16
17 * Z-alignment:
18
19 1) The total SC energy for z-axis spin orientation corresponds to the
20 lower value: E_z < E_x = E_y => z-axis = Easy axis
21
22 2) The total SC energy for x-axis and y-axis spin orientation have the
23 same value and they are larger than z-axis SC total energy:
24 E_x = E_y => x/y-axis = Hard axes
25
26 For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
27configurations have to have the same values when the system is rotated in space:
28
29 a) E_x(X-alignment) = E_z(Z-alignment)
30 E_y(X-alignment) = E_x(Z-alignment)
31 E_z(X-alignment) = E_y(Z-alignment)
32
33 b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
034
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/makefile'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/makefile 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xx/offsite_SOC_FePt_xx/makefile 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1name=FePtxx
2include ../test.mk
03
=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz'
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.fdf'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.fdf 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.fdf 2018-04-30 20:53:35 +0000
@@ -0,0 +1,72 @@
1SystemName FePt-L1_0
2SystemLabel FePtxz
3NumberOfAtoms 2
4NumberOfSpecies 2
5%block Chemical_Species_label
6 1 26 Fe_fept_SOC
7 2 78 Pt_fept_SOC
8%endblock Chemical_Species_label
9
10PAO.EnergyShift 100 meV
11PAO.SplitNorm 0.15
12PAO.OldStylePolOrbs F
13Restricted.Radial.Grid F
14%Block PAO.Basis
15 Fe_fept_SOC 2
16 n=4 0 2 P
17 0.0 0.0
18 n=3 2 2
19 0.0 0.0
20 Pt_fept_SOC 2
21 n=6 0 2 P
22 0.0 0.0
23 n=5 2 2
24 0.0 0.0
25%EndBlock PAO.Basis
26
27AtomicCoordinatesFormat NotScaledCartesianAng
28%block LatticeVectors
29 3.792000000 0.000000000 0.000000000
30 0.000000000 2.793068700 0.000000000
31 0.000000000 0.000000000 2.793068700
32%endblock LatticeVectors
33LatticeConstant 1.0 Ang
34
35%block AtomicCoordinatesAndAtomicSpecies
36 0.000000000 1.396535500 1.396535500 1
37 1.896000000 0.000000000 0.000000000 2
38%endblock AtomicCoordinatesAndAtomicSpecies
39
40Spin SO
41
42#%block DM.InitSpin
43# 1 +2. 0. 0.
44# 2 +1. 0. 0.
45#%endblock DM.InitSpin
46
47
48%block kgrid_Monkhorst_Pack
49 11 0 0 0.0
50 0 21 0 0.0
51 0 0 21 0.0
52%endblock kgrid_Monkhorst_Pack
53
54xc.functional GGA
55xc.authors PBE
56MeshCutoff 1400. Ry
57SolutionMethod diagon
58ElectronicTemperature 1 meV
59
60DM.Tolerance 1.0E-5
61MaxSCFIterations 600
62DM.MixingWeight 0.005
63DM.NumberPulay 8
64DM.UseSaveDM T
65DM.MixSCF1 F
66DM.NumberKick 25
67#Diag.DivideAndConquer F
68MixHamiltonian T
69
70MullikenInSCF T
71WriteForces T
72WriteCoorStep T
073
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.pseudos'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.pseudos 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/FePtxz.pseudos 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1Fe_fept_SOC
2Pt_fept_SOC
03
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/README'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/README 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/README 2018-04-30 20:53:35 +0000
@@ -0,0 +1,33 @@
1Ramon Cuadrado del Burgo - March 7, 2016
2
3 The present test performs fully-relativistic simulation of FePt-L1_0 structure
4placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
5By means of the calculation of the total selfconsistent energy it is possible to
6obtain the magnetic anisotropy energy (MAE) checking in addition that:
7
8 * X-alignment:
9
10 1) The total SC energy for x-axis spin orientation corresponds to the
11 lower value: E_x < E_y = E_z => x-axis = Easy axis
12
13 2) The total SC energy for y-axis and z-axis spin orientation have the
14 same value and they are larger than x-axis SC total energy:
15 E_y = E_z => y/z-axis = Hard axes
16
17 * Z-alignment:
18
19 1) The total SC energy for z-axis spin orientation corresponds to the
20 lower value: E_z < E_x = E_y => z-axis = Easy axis
21
22 2) The total SC energy for x-axis and y-axis spin orientation have the
23 same value and they are larger than z-axis SC total energy:
24 E_x = E_y => x/y-axis = Hard axes
25
26 For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
27configurations have to have the same values when the system is rotated in space:
28
29 a) E_x(X-alignment) = E_z(Z-alignment)
30 E_y(X-alignment) = E_x(Z-alignment)
31 E_z(X-alignment) = E_y(Z-alignment)
32
33 b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
034
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/makefile'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/makefile 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/makefile 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1name=FePtxz
2include ../test.mk
03
=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz'
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.fdf'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.fdf 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.fdf 2018-04-30 20:53:35 +0000
@@ -0,0 +1,70 @@
1SystemName SOC FePt X-alignment z
2SystemLabel FePtxz
3
4Spin SO
5
6NumberOfAtoms 2
7NumberOfSpecies 2
8%block Chemical_Species_label
9 1 26 Fe
10 2 78 Pt
11%endblock Chemical_Species_label
12
13PAO.EnergyShift 100 meV
14PAO.SplitNorm 0.15
15PAO.OldStylePolOrbs F
16Restricted.Radial.Grid F
17%Block PAO.Basis
18 Fe 2
19 n=4 0 2 P
20 0.0 0.0
21 n=3 2 2
22 0.0 0.0
23 Pt 2
24 n=6 0 2 P
25 0.00000 0.00000
26 n=5 2 2
27 0.00000 0.00000
28%EndBlock PAO.Basis
29
30AtomicCoordinatesFormat NotScaledCartesianAng
31LatticeConstant 1.0 Ang
32%block LatticeVectors
33 3.792000000 0.000000000 0.000000000
34 0.000000000 2.793068700 0.000000000
35 0.000000000 0.000000000 2.793068700
36%endblock LatticeVectors
37
38%block AtomicCoordinatesAndAtomicSpecies
39 0.000000000 1.396535500 1.396535500 1
40 1.896000000 0.000000000 0.000000000 2
41%endblock AtomicCoordinatesAndAtomicSpecies
42
43%block kgrid_Monkhorst_Pack
44 11 0 0 0.5
45 0 21 0 0.0
46 0 0 21 0.0
47%endblock kgrid_Monkhorst_Pack
48
49XC.functional GGA
50XC.authors PBE
51
52MeshCutoff 1400. Ry
53
54SolutionMethod diagon
55
56ElectronicTemperature 1 meV
57
58DM.Tolerance 1.0E-5
59
60MaxSCFIterations 1000
61
62DM.MixingWeight 0.005
63DM.NumberPulay 8
64DM.UseSaveDM T
65DM.NumberKick 25
66DM.MixSCF1 F
67
68WriteMullikenPop 1
69WriteForces T
70WriteCoorStep T
071
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.pseudos'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.pseudos 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/FePtxz.pseudos 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1Fe_SOC
2Pt_SOC
03
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/README'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/README 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/README 2018-04-30 20:53:35 +0000
@@ -0,0 +1,33 @@
1Ramon Cuadrado del Burgo - March 7, 2016
2
3 The present test performs fully-relativistic simulation of FePt-L1_0 structure
4placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
5By means of the calculation of the total selfconsistent energy it is possible to
6obtain the magnetic anisotropy energy (MAE) checking in addition that:
7
8 * X-alignment:
9
10 1) The total SC energy for x-axis spin orientation corresponds to the
11 lower value: E_x < E_y = E_z => x-axis = Easy axis
12
13 2) The total SC energy for y-axis and z-axis spin orientation have the
14 same value and they are larger than x-axis SC total energy:
15 E_y = E_z => y/z-axis = Hard axes
16
17 * Z-alignment:
18
19 1) The total SC energy for z-axis spin orientation corresponds to the
20 lower value: E_z < E_x = E_y => z-axis = Easy axis
21
22 2) The total SC energy for x-axis and y-axis spin orientation have the
23 same value and they are larger than z-axis SC total energy:
24 E_x = E_y => x/y-axis = Hard axes
25
26 For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
27configurations have to have the same values when the system is rotated in space:
28
29 a) E_x(X-alignment) = E_z(Z-alignment)
30 E_y(X-alignment) = E_x(Z-alignment)
31 E_z(X-alignment) = E_y(Z-alignment)
32
33 b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
034
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/makefile'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/makefile 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_xz/offsite_SOC_FePt_xz/makefile 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1name=FePtxz
2include ../test.mk
03
=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy'
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.fdf'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.fdf 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.fdf 2018-04-30 20:53:35 +0000
@@ -0,0 +1,72 @@
1SystemName FePt-L1_0
2SystemLabel FePtzy
3NumberOfAtoms 2
4NumberOfSpecies 2
5%block Chemical_Species_label
6 1 26 Fe_fept_SOC
7 2 78 Pt_fept_SOC
8%endblock Chemical_Species_label
9
10PAO.EnergyShift 100 meV
11PAO.SplitNorm 0.15
12PAO.OldStylePolOrbs F
13Restricted.Radial.Grid F
14%Block PAO.Basis
15 Fe_fept_SOC 2
16 n=4 0 2 P
17 0.0 0.0
18 n=3 2 2
19 0.0 0.0
20 Pt_fept_SOC 2
21 n=6 0 2 P
22 0.0 0.0
23 n=5 2 2
24 0.0 0.0
25%EndBlock PAO.Basis
26
27AtomicCoordinatesFormat NotScaledCartesianAng
28%block LatticeVectors
29 2.793068700 0.000000000 0.000000000
30 0.000000000 2.793068700 0.000000000
31 0.000000000 0.000000000 3.792000000
32%endblock LatticeVectors
33LatticeConstant 1.0 Ang
34
35%block AtomicCoordinatesAndAtomicSpecies
36 1.396535500 1.396535500 0.000000000 1
37 0.000000000 0.000000000 1.896000000 2
38%endblock AtomicCoordinatesAndAtomicSpecies
39
40Spin SO
41
42%block DM.InitSpin
43 1 +2. 90. 90.
44 2 +1. 90. 90.
45%endblock DM.InitSpin
46
47
48%block kgrid_Monkhorst_Pack
49 21 0 0 0.0
50 0 21 0 0.0
51 0 0 11 0.0
52%endblock kgrid_Monkhorst_Pack
53
54xc.functional GGA
55xc.authors PBE
56MeshCutoff 1400. Ry
57SolutionMethod diagon
58ElectronicTemperature 1 meV
59
60DM.Tolerance 1.0E-5
61MaxSCFIterations 600
62DM.MixingWeight 0.005
63DM.NumberPulay 8
64DM.UseSaveDM T
65DM.MixSCF1 F
66DM.NumberKick 25
67#Diag.DivideAndConquer F
68MixHamiltonian T
69
70MullikenInSCF T
71WriteForces T
72WriteCoorStep T
073
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.pseudos'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.pseudos 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/FePtzy.pseudos 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1Fe_fept_SOC
2Pt_fept_SOC
03
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/README'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/README 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/README 2018-04-30 20:53:35 +0000
@@ -0,0 +1,33 @@
1Ramon Cuadrado del Burgo - March 7, 2016
2
3 The present test performs fully-relativistic simulation of FePt-L1_0 structure
4placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
5By means of the calculation of the total selfconsistent energy it is possible to
6obtain the magnetic anisotropy energy (MAE) checking in addition that:
7
8 * X-alignment:
9
10 1) The total SC energy for x-axis spin orientation corresponds to the
11 lower value: E_x < E_y = E_z => x-axis = Easy axis
12
13 2) The total SC energy for y-axis and z-axis spin orientation have the
14 same value and they are larger than x-axis SC total energy:
15 E_y = E_z => y/z-axis = Hard axes
16
17 * Z-alignment:
18
19 1) The total SC energy for z-axis spin orientation corresponds to the
20 lower value: E_z < E_x = E_y => z-axis = Easy axis
21
22 2) The total SC energy for x-axis and y-axis spin orientation have the
23 same value and they are larger than z-axis SC total energy:
24 E_x = E_y => x/y-axis = Hard axes
25
26 For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
27configurations have to have the same values when the system is rotated in space:
28
29 a) E_x(X-alignment) = E_z(Z-alignment)
30 E_y(X-alignment) = E_x(Z-alignment)
31 E_z(X-alignment) = E_y(Z-alignment)
32
33 b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
034
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/makefile'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/makefile 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/makefile 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1name=FePtzy
2include ../test.mk
03
=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy'
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.fdf'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.fdf 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.fdf 2018-04-30 20:53:35 +0000
@@ -0,0 +1,68 @@
1SystemName FePt-L1_0
2SystemLabel FePtzy
3NumberOfAtoms 2
4NumberOfSpecies 2
5%block Chemical_Species_label
6 1 26 Fe
7 2 78 Pt
8%endblock Chemical_Species_label
9
10PAO.EnergyShift 100 meV
11PAO.SplitNorm 0.15
12PAO.OldStylePolOrbs F
13Restricted.Radial.Grid F
14%Block PAO.Basis
15 Fe 2
16 n=4 0 2 P
17 0.0 0.0
18 n=3 2 2
19 0.0 0.0
20 Pt 2
21 n=6 0 2 P
22 0.0 0.0
23 n=5 2 2
24 0.0 0.0
25%EndBlock PAO.Basis
26
27AtomicCoordinatesFormat NotScaledCartesianAng
28%block LatticeVectors
29 2.793068700 0.000000000 0.000000000
30 0.000000000 2.793068700 0.000000000
31 0.000000000 0.000000000 3.792000000
32%endblock LatticeVectors
33LatticeConstant 1.0 Ang
34
35%block AtomicCoordinatesAndAtomicSpecies
36 1.396535500 1.396535500 0.000000000 1
37 0.000000000 0.000000000 1.896000000 2
38%endblock AtomicCoordinatesAndAtomicSpecies
39
40Spin SO
41%block DM.InitSpin
42 1 +2. 90. 90.
43 2 +1. 90. 90.
44%endblock DM.InitSpin
45
46%block kgrid_Monkhorst_Pack
47 21 0 0 0.0
48 0 21 0 0.0
49 0 0 11 0.0
50%endblock kgrid_Monkhorst_Pack
51
52xc.functional GGA
53xc.authors PBE
54MeshCutoff 1400. Ry
55SolutionMethod diagon
56ElectronicTemperature 1 meV
57
58DM.Tolerance 1.0E-5
59MaxSCFIterations 600
60DM.MixingWeight 0.005
61DM.NumberPulay 8
62DM.UseSaveDM T
63DM.MixSCF1 F
64DM.NumberKick 25
65
66WriteMullikenPop 1
67WriteForces T
68WriteCoorStep T
069
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.pseudos'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.pseudos 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/FePtzy.pseudos 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1Fe_SOC
2Pt_SOC
03
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/README'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/README 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/README 2018-04-30 20:53:35 +0000
@@ -0,0 +1,33 @@
1Ramon Cuadrado del Burgo - March 7, 2016
2
3 The present test performs fully-relativistic simulation of FePt-L1_0 structure
4placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
5By means of the calculation of the total selfconsistent energy it is possible to
6obtain the magnetic anisotropy energy (MAE) checking in addition that:
7
8 * X-alignment:
9
10 1) The total SC energy for x-axis spin orientation corresponds to the
11 lower value: E_x < E_y = E_z => x-axis = Easy axis
12
13 2) The total SC energy for y-axis and z-axis spin orientation have the
14 same value and they are larger than x-axis SC total energy:
15 E_y = E_z => y/z-axis = Hard axes
16
17 * Z-alignment:
18
19 1) The total SC energy for z-axis spin orientation corresponds to the
20 lower value: E_z < E_x = E_y => z-axis = Easy axis
21
22 2) The total SC energy for x-axis and y-axis spin orientation have the
23 same value and they are larger than z-axis SC total energy:
24 E_x = E_y => x/y-axis = Hard axes
25
26 For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
27configurations have to have the same values when the system is rotated in space:
28
29 a) E_x(X-alignment) = E_z(Z-alignment)
30 E_y(X-alignment) = E_x(Z-alignment)
31 E_z(X-alignment) = E_y(Z-alignment)
32
33 b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
034
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/makefile'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/makefile 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zy/offsite_SOC_FePt_zy/makefile 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1name=FePtzy
2include ../test.mk
03
=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz'
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.fdf'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.fdf 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.fdf 2018-04-30 20:53:35 +0000
@@ -0,0 +1,72 @@
1SystemName FePt-L1_0
2SystemLabel FePtzz
3NumberOfAtoms 2
4NumberOfSpecies 2
5%block Chemical_Species_label
6 1 26 Fe_fept_SOC
7 2 78 Pt_fept_SOC
8%endblock Chemical_Species_label
9
10PAO.EnergyShift 100 meV
11PAO.SplitNorm 0.15
12PAO.OldStylePolOrbs F
13Restricted.Radial.Grid F
14%Block PAO.Basis
15 Fe_fept_SOC 2
16 n=4 0 2 P
17 0.0 0.0
18 n=3 2 2
19 0.0 0.0
20 Pt_fept_SOC 2
21 n=6 0 2 P
22 0.0 0.0
23 n=5 2 2
24 0.0 0.0
25%EndBlock PAO.Basis
26
27AtomicCoordinatesFormat NotScaledCartesianAng
28%block LatticeVectors
29 2.793068700 0.000000000 0.000000000
30 0.000000000 2.793068700 0.000000000
31 0.000000000 0.000000000 3.792000000
32%endblock LatticeVectors
33LatticeConstant 1.0 Ang
34
35%block AtomicCoordinatesAndAtomicSpecies
36 1.396535500 1.396535500 0.000000000 1
37 0.000000000 0.000000000 1.896000000 2
38%endblock AtomicCoordinatesAndAtomicSpecies
39
40Spin SO
41
42#%block DM.InitSpin
43# 1 +2. 90. 0.
44# 2 +1. 90. 0.
45#%endblock DM.InitSpin
46
47
48%block kgrid_Monkhorst_Pack
49 21 0 0 0.0
50 0 21 0 0.0
51 0 0 11 0.0
52%endblock kgrid_Monkhorst_Pack
53
54xc.functional GGA
55xc.authors PBE
56MeshCutoff 1400. Ry
57SolutionMethod diagon
58ElectronicTemperature 1 meV
59
60DM.Tolerance 1.0E-5
61MaxSCFIterations 600
62DM.MixingWeight 0.005
63DM.NumberPulay 8
64DM.UseSaveDM T
65DM.MixSCF1 F
66DM.NumberKick 25
67#Diag.DivideAndConquer F
68MixHamiltonian T
69
70MullikenInSCF T
71WriteForces T
72WriteCoorStep T
073
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.pseudos'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.pseudos 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/FePtzz.pseudos 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1Fe_fept_SOC
2Pt_fept_SOC
03
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/README'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/README 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/README 2018-04-30 20:53:35 +0000
@@ -0,0 +1,33 @@
1Ramon Cuadrado del Burgo - March 7, 2016
2
3 The present test performs fully-relativistic simulation of FePt-L1_0 structure
4placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
5By means of the calculation of the total selfconsistent energy it is possible to
6obtain the magnetic anisotropy energy (MAE) checking in addition that:
7
8 * X-alignment:
9
10 1) The total SC energy for x-axis spin orientation corresponds to the
11 lower value: E_x < E_y = E_z => x-axis = Easy axis
12
13 2) The total SC energy for y-axis and z-axis spin orientation have the
14 same value and they are larger than x-axis SC total energy:
15 E_y = E_z => y/z-axis = Hard axes
16
17 * Z-alignment:
18
19 1) The total SC energy for z-axis spin orientation corresponds to the
20 lower value: E_z < E_x = E_y => z-axis = Easy axis
21
22 2) The total SC energy for x-axis and y-axis spin orientation have the
23 same value and they are larger than z-axis SC total energy:
24 E_x = E_y => x/y-axis = Hard axes
25
26 For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
27configurations have to have the same values when the system is rotated in space:
28
29 a) E_x(X-alignment) = E_z(Z-alignment)
30 E_y(X-alignment) = E_x(Z-alignment)
31 E_z(X-alignment) = E_y(Z-alignment)
32
33 b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
034
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/makefile'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/makefile 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/makefile 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1name=FePtzz
2include ../test.mk
03
=== added directory 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz'
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.fdf'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.fdf 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.fdf 2018-04-30 20:53:35 +0000
@@ -0,0 +1,64 @@
1SystemName FePt-L1_0
2SystemLabel FePtzz
3NumberOfAtoms 2
4NumberOfSpecies 2
5%block Chemical_Species_label
6 1 26 Fe
7 2 78 Pt
8%endblock Chemical_Species_label
9
10PAO.EnergyShift 100 meV
11PAO.SplitNorm 0.15
12PAO.OldStylePolOrbs F
13Restricted.Radial.Grid F
14%Block PAO.Basis
15 Fe 2
16 n=4 0 2 P
17 0.0 0.0
18 n=3 2 2
19 0.0 0.0
20 Pt 2
21 n=6 0 2 P
22 0.0 0.0
23 n=5 2 2
24 0.0 0.0
25%EndBlock PAO.Basis
26
27AtomicCoordinatesFormat NotScaledCartesianAng
28%block LatticeVectors
29 2.793068700 0.000000000 0.000000000
30 0.000000000 2.793068700 0.000000000
31 0.000000000 0.000000000 3.792000000
32%endblock LatticeVectors
33LatticeConstant 1.0 Ang
34
35%block AtomicCoordinatesAndAtomicSpecies
36 1.396535500 1.396535500 0.000000000 1
37 0.000000000 0.000000000 1.896000000 2
38%endblock AtomicCoordinatesAndAtomicSpecies
39
40Spin SO
41
42%block kgrid_Monkhorst_Pack
43 21 0 0 0.0
44 0 21 0 0.0
45 0 0 11 0.0
46%endblock kgrid_Monkhorst_Pack
47
48xc.functional GGA
49xc.authors PBE
50MeshCutoff 1400. Ry
51SolutionMethod diagon
52ElectronicTemperature 1 meV
53
54DM.Tolerance 1.0E-5
55MaxSCFIterations 600
56DM.MixingWeight 0.005
57DM.NumberPulay 8
58DM.UseSaveDM T
59DM.MixSCF1 F
60DM.NumberKick 25
61
62WriteMullikenPop 1
63WriteForces T
64WriteCoorStep T
065
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.pseudos'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.pseudos 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/FePtzz.pseudos 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1Fe_SOC
2Pt_SOC
03
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/README'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/README 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/README 2018-04-30 20:53:35 +0000
@@ -0,0 +1,33 @@
1Ramon Cuadrado del Burgo - March 7, 2016
2
3 The present test performs fully-relativistic simulation of FePt-L1_0 structure
4placed with the (001) axis along X and Z, X-alignment and Z-alignment, respectively.
5By means of the calculation of the total selfconsistent energy it is possible to
6obtain the magnetic anisotropy energy (MAE) checking in addition that:
7
8 * X-alignment:
9
10 1) The total SC energy for x-axis spin orientation corresponds to the
11 lower value: E_x < E_y = E_z => x-axis = Easy axis
12
13 2) The total SC energy for y-axis and z-axis spin orientation have the
14 same value and they are larger than x-axis SC total energy:
15 E_y = E_z => y/z-axis = Hard axes
16
17 * Z-alignment:
18
19 1) The total SC energy for z-axis spin orientation corresponds to the
20 lower value: E_z < E_x = E_y => z-axis = Easy axis
21
22 2) The total SC energy for x-axis and y-axis spin orientation have the
23 same value and they are larger than z-axis SC total energy:
24 E_x = E_y => x/y-axis = Hard axes
25
26 For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
27configurations have to have the same values when the system is rotated in space:
28
29 a) E_x(X-alignment) = E_z(Z-alignment)
30 E_y(X-alignment) = E_x(Z-alignment)
31 E_z(X-alignment) = E_y(Z-alignment)
32
33 b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
034
=== added file 'Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/makefile'
--- Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/makefile 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_FePt_zz/offsite_SOC_FePt_zz/makefile 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1name=FePtzz
2include ../test.mk
03
=== added directory 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xx'
=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.fdf'
--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.fdf 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.fdf 2018-04-30 20:53:35 +0000
@@ -0,0 +1,64 @@
1SystemName Pt2 x-alignment x
2SystemLabel Pt2xx
3
4Spin SO
5
6%block DM.InitSpin
7 1 +1. 90. 0.
8 2 +1. 90. 0.
9%endblock DM.InitSpin
10
11NumberOfAtoms 2
12NumberOfSpecies 1
13%block Chemical_Species_label
14 1 78 Pt_pt2_SOC
15%endblock Chemical_Species_label
16
17PAO.EnergyShift 100 meV
18PAO.SplitNorm 0.15
19PAO.OldStylePolOrbs F
20Restricted.Radial.Grid F
21%Block PAO.Basis
22Pt_pt2_SOC 2
23 n=6 0 2 P 1
24 7.158 6.085
25 1.000 1.000
26 n=5 2 2
27 5.044 3.098
28 1.000 1.000
29%EndBlock PAO.Basis
30
31AtomicCoordinatesFormat NotScaledCartesianAng
32LatticeConstant 20.0 Ang
33%block LatticeVectors
34 1.00 .00 .00
35 .00 1.00 .00
36 .00 .00 1.00
37%endblock LatticeVectors
38
39%block AtomicCoordinatesAndAtomicSpecies
40 -1.19940 0.00000 0.00000 1
41 1.19940 0.00000 0.00000 1
42%endblock AtomicCoordinatesAndAtomicSpecies
43
44XC.functional GGA
45XC.authors PBE
46
47MeshCutoff 500. Ry
48
49SolutionMethod diagon
50
51ElectronicTemperature 1 meV
52DM.Tolerance 1.0E-6
53MaxSCFIterations 1000
54DM.MixingWeight 0.005
55DM.MixSCF1 F
56MixHamiltonian T
57DM.NumberPulay 6
58DM.NumberKick 25
59DM.UseSaveDM T
60
61WriteMullikenPop 1
62WriteEigenvalues T
63WriteForces T
64WriteCoorStep T
065
=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.pseudos'
--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.pseudos 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/Pt2xx.pseudos 2018-04-30 20:53:35 +0000
@@ -0,0 +1,1 @@
1Pt_pt2_SOC
02
=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/README'
--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/README 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/README 2018-04-30 20:53:35 +0000
@@ -0,0 +1,34 @@
1Ramon Cuadrado del Burgo - March 7, 2016
2
3 The present test performs fully-relativistic simulation of Pt2 dimer
4placed along X and Z axes, X-alignment and Z-alignment, respectively.
5By means of the calculation of the total selfconsistent energy it is
6possible to obtain the magnetic anisotropy energy (MAE) checking in
7addition that:
8
9 * X-alignment:
10
11 1) The total SC energy for x-axis spin orientation corresponds to the
12 lower value: E_x < E_y = E_z => x-axis = Easy axis
13
14 2) The total SC energy for y-axis and z-axis spin orientation have the
15 same value and they are larger than x-axis SC total energy:
16 E_y = E_z => y/z-axis = Hard axes
17
18 * Z-alignment:
19
20 1) The total SC energy for z-axis spin orientation corresponds to the
21 lower value: E_z < E_x = E_y => z-axis = Easy axis
22
23 2) The total SC energy for x-axis and y-axis spin orientation have the
24 same value and they are larger than z-axis SC total energy:
25 E_x = E_y => x/y-axis = Hard axes
26
27 For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
28configurations have to have the same values when the dimer is rotated in space:
29
30 a) E_x(X-alignment) = E_z(Z-alignment)
31 E_y(X-alignment) = E_x(Z-alignment)
32 E_z(X-alignment) = E_y(Z-alignment)
33
34 b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
035
=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/makefile'
--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/makefile 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xx/makefile 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1name=Pt2xx
2include ../test.mk
03
=== added directory 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xz'
=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.fdf'
--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.fdf 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.fdf 2018-04-30 20:53:35 +0000
@@ -0,0 +1,59 @@
1SystemName Pt2 x-alignment z
2SystemLabel Pt2xz
3
4Spin SO
5
6NumberOfAtoms 2
7NumberOfSpecies 1
8%block Chemical_Species_label
9 1 78 Pt_pt2_SOC
10%endblock Chemical_Species_label
11
12PAO.EnergyShift 100 meV
13PAO.SplitNorm 0.15
14PAO.OldStylePolOrbs F
15Restricted.Radial.Grid F
16%Block PAO.Basis
17Pt_pt2_SOC 2
18 n=6 0 2 P 1
19 7.158 6.085
20 1.000 1.000
21 n=5 2 2
22 5.044 3.098
23 1.000 1.000
24%EndBlock PAO.Basis
25
26AtomicCoordinatesFormat NotScaledCartesianAng
27LatticeConstant 20.0 Ang
28%block LatticeVectors
29 1.00 .00 .00
30 .00 1.00 .00
31 .00 .00 1.00
32%endblock LatticeVectors
33
34%block AtomicCoordinatesAndAtomicSpecies
35 -1.19940 0.00000 0.00000 1
36 1.19940 0.00000 0.00000 1
37%endblock AtomicCoordinatesAndAtomicSpecies
38
39XC.functional GGA
40XC.authors PBE
41
42MeshCutoff 500. Ry
43
44SolutionMethod diagon
45
46ElectronicTemperature 1 meV
47DM.Tolerance 1.0E-6
48MaxSCFIterations 1000
49DM.MixingWeight 0.005
50DM.MixSCF1 F
51MixHamiltonian T
52DM.NumberPulay 6
53DM.NumberKick 25
54DM.UseSaveDM T
55
56WriteMullikenPop 1
57WriteEigenvalues T
58WriteForces T
59WriteCoorStep T
060
=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.pseudos'
--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.pseudos 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/Pt2xz.pseudos 2018-04-30 20:53:35 +0000
@@ -0,0 +1,1 @@
1Pt_pt2_SOC
02
=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/README'
--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/README 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/README 2018-04-30 20:53:35 +0000
@@ -0,0 +1,34 @@
1Ramon Cuadrado del Burgo - March 7, 2016
2
3 The present test performs fully-relativistic simulation of Pt2 dimer
4placed along X and Z axes, X-alignment and Z-alignment, respectively.
5By means of the calculation of the total selfconsistent energy it is
6possible to obtain the magnetic anisotropy energy (MAE) checking in
7addition that:
8
9 * X-alignment:
10
11 1) The total SC energy for x-axis spin orientation corresponds to the
12 lower value: E_x < E_y = E_z => x-axis = Easy axis
13
14 2) The total SC energy for y-axis and z-axis spin orientation have the
15 same value and they are larger than x-axis SC total energy:
16 E_y = E_z => y/z-axis = Hard axes
17
18 * Z-alignment:
19
20 1) The total SC energy for z-axis spin orientation corresponds to the
21 lower value: E_z < E_x = E_y => z-axis = Easy axis
22
23 2) The total SC energy for x-axis and y-axis spin orientation have the
24 same value and they are larger than z-axis SC total energy:
25 E_x = E_y => x/y-axis = Hard axes
26
27 For comparison of (X/Z)-alignment, the total SC energies and MAEs of both
28configurations have to have the same values when the dimer is rotated in space:
29
30 a) E_x(X-alignment) = E_z(Z-alignment)
31 E_y(X-alignment) = E_x(Z-alignment)
32 E_z(X-alignment) = E_y(Z-alignment)
33
34 b) MAE(X-alignment) = E_x - E_(y/z) <=> MAE(Z-alignment) = E_z - E_(x/y)
035
=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/makefile'
--- Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/makefile 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_xz/makefile 2018-04-30 20:53:35 +0000
@@ -0,0 +1,2 @@
1name=Pt2xz
2include ../test.mk
03
=== added directory 'Tests/More_SOC_Examples/offsite_SOC_Pt2_zy'
=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.fdf'
--- Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.fdf 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.fdf 2018-04-30 20:53:35 +0000
@@ -0,0 +1,64 @@
1SystemName Pt2 z-alignment y
2SystemLabel Pt2zy
3
4Spin SO
5
6%block DM.InitSpin
7 1 +1. 90. 90.
8 2 +1. 90. 90.
9%endblock DM.InitSpin
10
11NumberOfAtoms 2
12NumberOfSpecies 1
13%block Chemical_Species_label
14 1 78 Pt_pt2_SOC
15%endblock Chemical_Species_label
16
17PAO.EnergyShift 100 meV
18PAO.SplitNorm 0.15
19PAO.OldStylePolOrbs F
20Restricted.Radial.Grid F
21%Block PAO.Basis
22Pt_pt2_SOC 2
23 n=6 0 2 P 1
24 7.158 6.085
25 1.000 1.000
26 n=5 2 2
27 5.044 3.098
28 1.000 1.000
29%EndBlock PAO.Basis
30
31AtomicCoordinatesFormat NotScaledCartesianAng
32LatticeConstant 20.0 Ang
33%block LatticeVectors
34 1.00 .00 .00
35 .00 1.00 .00
36 .00 .00 1.00
37%endblock LatticeVectors
38
39%block AtomicCoordinatesAndAtomicSpecies
40 0.00000 0.00000 -1.19940 1
41 0.00000 0.00000 1.19940 1
42%endblock AtomicCoordinatesAndAtomicSpecies
43
44XC.functional GGA
45XC.authors PBE
46
47MeshCutoff 500. Ry
48
49SolutionMethod diagon
50
51ElectronicTemperature 1 meV
52DM.Tolerance 1.0E-6
53MaxSCFIterations 1000
54DM.MixingWeight 0.005
55DM.MixSCF1 F
56MixHamiltonian T
57DM.NumberPulay 6
58DM.UseSaveDM T
59DM.NumberKick 25
60
61WriteMullikenPop 1
62WriteEigenvalues T
63WriteForces T
64WriteCoorStep T
065
=== added file 'Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.pseudos'
--- Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.pseudos 1970-01-01 00:00:00 +0000
+++ Tests/More_SOC_Examples/offsite_SOC_Pt2_zy/Pt2zy.pseudos 2018-04-30 20:53:35 +0000
@@ -0,0 +1,1 @@
1Pt_pt2_SOC
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches