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

Proposed by Nick Papior
Status: Merged
Merged at revision: 695
Proposed branch: lp:~nickpapior/siesta/merge-OSSO-fixes
Merge into: lp:~albertog/siesta/merge-OSSO
Diff against target: 476 lines (+99/-138)
7 files modified
Docs/siesta.tex (+63/-85)
Src/bands.F (+0/-1)
Src/dfscf.f (+3/-9)
Src/m_spin.F90 (+30/-27)
Src/rhoofd.F90 (+0/-13)
Src/state_analysis.F (+2/-2)
version.info (+1/-1)
To merge this branch: bzr merge lp:~nickpapior/siesta/merge-OSSO-fixes
Reviewer Review Type Date Requested Status
Alberto Garcia Approve
Review via email: mp+343692@code.launchpad.net

Description of the change

Fixed minor issues and comments from me.

To post a comment you must log in.
Revision history for this message
Alberto Garcia (albertog) wrote :

Good. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Docs/siesta.tex'
2--- Docs/siesta.tex 2018-04-20 08:00:21 +0000
3+++ Docs/siesta.tex 2018-04-20 13:37:02 +0000
4@@ -2242,7 +2242,7 @@
5 The default is \emph{one} KB projector from each angular momentum,
6 constructed from the nodeless eigenfunction.
7
8-For full spin--orbit calculations, the program generates $lj$
9+For full spin-orbit calculations, the program generates $lj$
10 projectors using the $l+1/2$ and $l-1/2$ components of the
11 (relativistic) pseudopotentials. In this case the specification of the
12 reference energies for projectors is not changed: only $l$ is
13@@ -3258,7 +3258,7 @@
14 coordinates rigidly to have them positive, by using
15 \fdf{AtomicCoordinatesOrigin}. See the
16 \program{Sies2arc}\index{Sies2arc@\textsc{Sies2arc}} utility in the
17- \program{Util/} directory for generating \sysfile*{.arc} files for CERIUS animation.
18+ \program{Util/} directory for generating \sysfile*{arc} files for CERIUS animation.
19
20 \end{fdflogicalF}
21
22@@ -3728,12 +3728,12 @@
23
24 \option[spin-orbit]%
25 \fdfindex*{Spin:spin-orbit}%
26- Performs calculations including the spin--orbit coupling. By default the
27- off--site SO option is set to \fdftrue. To perform an on--site SO calculations
28- this option has to be {\bf spin-orbit+onsite}. This requires the
29+ Performs calculations including the spin-orbit coupling. By default the
30+ off-site SO option is set to \fdftrue. To perform an on-site SO calculations
31+ this option has to be \fdf*{spin-orbit+onsite}. This requires the
32 pseudopotentials to be relativistic.
33
34- See Sect.~\ref{sec:spin-orbit} for further specific spin--orbit options.
35+ See Sect.~\ref{sec:spin-orbit} for further specific spin-orbit options.
36
37 \end{fdfoptions}
38
39@@ -3778,48 +3778,49 @@
40 \end{fdflogicalF}
41
42
43-\subsection{Spin--Orbit coupling}
44+\subsection{Spin-Orbit coupling}
45 \label{sec:spin-orbit}
46
47 \siesta\ includes the posibility to perform fully relativistic
48 calculations by means of the inclusion in the total Hamiltonian not
49 only the Darwin and velocity correction terms~(Scalar--Relativistic
50-calculations), but also the spin--orbit~(SO) contribution. There are
51-two approaches regarding the SO formalism: on--site and off--site.
52-Within the on--site approximation only the intra--atomic SO contribution is taken
53-into account. In the off--site scheme additional neighboring
54-interactions are also included in the SO term. By default, the off--site SO
55-formalism is switched on, being necessary to change the \fdf{Spin} flag
56-in the input file if the on--site approximation wants to be used. See
57-\fdf{Spin} on how to handle the spin--orbit coupling.
58+calculations), but also the spin-orbit~(SO) contribution. There are
59+two approaches regarding the SO formalism: on-site and off-site.
60+Within the on-site approximation only the intra-atomic SO
61+contribution is taken into account. In the off-site scheme additional
62+neighboring interactions are also included in the SO term. By default,
63+the off-site SO formalism is switched on, being necessary to change
64+the \fdf{Spin} flag in the input file if the on-site approximation
65+wants to be used. See \fdf{Spin} on how to handle the spin-orbit
66+coupling.
67
68-The on--site spin-orbit scheme in this version of \siesta\ has been implemented by
69-Dr. Ram\'on Cuadrado based on the original on--site SO formalism and
70+The on-site spin-orbit scheme in this version of \siesta\ has been implemented by
71+Dr. Ram\'on Cuadrado based on the original on-site SO formalism and
72 implementation developed by Prof. Jaime Ferrer and his collaborators \textit{et al}~(L
73 Fern\'andez--Seivane, M Oliveira, S Sanvito, and J Ferrer, Journal of
74-Physics: Condensed Matter, {\bf 18}, 7999 (2006); L Fern\'andez--Seivane
75-and Jaime Ferrer, Phys. Rev. Lett. {\bf 99}, 183401 (2007)).
76+Physics: Condensed Matter, \textbf{18}, 7999 (2006); L Fern\'andez--Seivane
77+and Jaime Ferrer, Phys. Rev. Lett. \textbf{99}, 183401 (2007)).
78
79-The off--site scheme has been implemented by
80+The off-site scheme has been implemented by
81 Dr. Ram\'on Cuadrado and Dr. Jorge I. Cerd\'a based on their initial
82 work~(R. Cuadrado and J. I. Cerd\'a ``Fully relativistic pseudopotential
83 formalism under an atomic orbital basis: spin-orbit splittings and
84-magnetic anisotropies'', J. Phys.: Condens. Matter {\bf 24}, 086005 (2012);
85+magnetic anisotropies'', J. Phys.: Condens. Matter \textbf{24}, 086005 (2012);
86 ``In-plane/out-of-plane disorder influence on the magnetic anisotropy of
87 Fe$_{1-y}$Mn$_y$Pt-L1(0) bulk alloy'', R. Cuadrado, Kai Liu, Timothy
88-J. Klemmer and R. W. Chantrell, Applied Physics Letters, {\bf 108},
89+J. Klemmer and R. W. Chantrell, Applied Physics Letters, \textbf{108},
90 123102 (2016)).
91
92 The inclusion of the SO term in the Hamiltonian (and in the Density
93-Matrix) causes an increase in the number of non--zero elements in their
94-off--diagonal parts, i.e., for some $(\mu,\nu)$ pair of basis
95-orbitals, H$^{\sigma\sigma'}_{\mu\nu}$~(DM$^{\sigma\sigma'}_{\mu\nu}$)
96-[$\sigma,\sigma'$=$\uparrow,\downarrow$] will be $\neq$0. This is
97+Matrix) causes an increase in the number of non-zero elements in their
98+off-diagonal parts, i.e., for some $(\mu,\nu)$ pair of basis
99+orbitals, $\mathbf H^{\sigma\sigma'}_{\mu\nu}$ ($\mathbf{DM}^{\sigma\sigma'}_{\mu\nu}$)
100+[$\sigma,\sigma'=\uparrow,\downarrow$] will be $\neq0$. This is
101 mainly due to the fact that the $\mathbf L\cdot\mathbf S$ operator
102-will promote the mixing between different spin--up/down components.
103-In addition, these H$^{\sigma\sigma'}_{\mu\nu}$~(and
104-DM$^{\sigma\sigma'}_{\mu\nu}$) elements will be complex, in contrast
105-with typical polarized/non--polarized calculations where these
106+will promote the mixing between different spin-up/down components.
107+In addition, these $\mathbf H^{\sigma\sigma'}_{\mu\nu}$ (and
108+$\mathbf{DM}^{\sigma\sigma'}_{\mu\nu}$) elements will be complex, in contrast
109+with typical polarized/non-polarized calculations where these
110 matrices are purely real. Since the spin-up and spin-down manifolds
111 are essentially mixed, the solver has to deal with matrices whose
112 dimensions are twice as large as for the collinear (unmixed) spin
113@@ -3828,13 +3829,13 @@
114
115
116 Unless explicitly advised the following type of calculation can be carried out
117-regardless of whether on--site or off--site approximation is employed:
118+regardless of whether on-site or off-site approximation is employed:
119 \begin{itemize}
120 %
121 \item Selfconsistent calculations for gamma point as well as for
122 bulks.
123 %
124- \item Structure optimizations %% only supported by the off--site SO
125+ \item Structure optimizations %% only supported by the off-site SO
126 %% formalism *** Why ?
127 %
128 %%% *** Incompatible... \item LDA+U calculations~(See Sect.\ref{sec:lda+u} for further info).
129@@ -3855,35 +3856,35 @@
130 %
131 \end{itemize}
132
133-Note: Due to the small SO contribution to the total
134-energy, the level of precision required to perform a proper fully
135-relativistic calculation during the selfconsistent process is quite
136-demanding. The following values must be carefully converged and
137-checked for each specific system to assure that the results are
138-accurate enough: \fdf{SCF.H!Tolerance} during the
139-selfconsistency~(typically between 10$^{-3}$eV -- 10$^{-4}$eV),
140-\fdf{ElectronicTemperature},
141-\textbf{k}--point sampling and high values of
142-\fdf{MeshCutoff}~(specifically for extended solids). In general, one
143-can say that a good calculation will have high number of \textbf{k}--points,
144-low \fdf{ElectronicTemperature}, extremely small \fdf{SCF.H!Tolerance}
145-and high values of \fdf{MeshCutoff}. We encourage the user to test
146-carefully these options for each system. An additional point to take
147-into account is the mixing scheme employed. You are encouraged to use
148-\fdf{SCF.Mix} \fdf*{hamiltonian} (currently is set up by default)
149-instead of density matrix mixing, since it speeds up the convergence.
150-The pseudopotentials have to be properly generated and tested for each
151-specific system and they have to be in their fully relativistic form,
152-together with the non--linear core corrections. Finally it is worth to
153-mention that the selfconsistent convergence for some non--highly symmetric
154-magnetizations directions with respect to the physical symmetry axis
155+Note: Due to the small SO contribution to the total energy, the level
156+of precision required to perform a proper fully relativistic
157+calculation during the selfconsistent process is quite demanding. The
158+following values must be carefully converged and checked for each
159+specific system to assure that the results are accurate enough:
160+\fdf{SCF.H!Tolerance} during the selfconsistency (typically between
161+$10^{-3}\,\mathrm{eV}$ -- $10^{-4}\,\mathrm{eV}$),
162+\fdf{ElectronicTemperature}, \textbf{k}--point sampling and high
163+values of \fdf{MeshCutoff}~(specifically for extended solids). In
164+general, one can say that a good calculation will have high number of
165+\textbf{k}--points, low \fdf{ElectronicTemperature}, extremely small
166+\fdf{SCF.H!Tolerance} and high values of \fdf{MeshCutoff}. We
167+encourage the user to test carefully these options for each system. An
168+additional point to take into account is the mixing scheme
169+employed. You are encouraged to use \fdf{SCF.Mix:hamiltonian}
170+(currently is set up by default) instead of density matrix mixing,
171+since it speeds up the convergence. The pseudopotentials have to be
172+properly generated and tested for each specific system and they have
173+to be in their fully relativistic form, together with the non-linear
174+core corrections. Finally it is worth to mention that the
175+selfconsistent convergence for some non-highly symmetric
176+magnetizations directions with respect to the physical symmetry axis
177 could still be difficult.
178
179 \begin{fdfentry}{Spin!OrbitStrength}[real]<1.0>
180
181 It allows to vary the strength of the
182- spin--orbit interaction from zero to any positive value. It can be
183- used for both the on--site and off-site SOC flavors, but only for
184+ spin-orbit interaction from zero to any positive value. It can be
185+ used for both the on-site and off-site SOC flavors, but only for
186 debugging and testing purposes, as the only physical value is 1.0.
187
188 \end{fdfentry}
189@@ -3902,29 +3903,6 @@
190
191 \end{fdflogicalF}
192
193-% *** The following items should not be relevant.
194-
195-%%For the off--site SO approximation some mandatory flags have to set
196-%%up to \fdffalse\ in the fdf file:
197-
198-%%\begin{fdflogicalT}{PAO!OldStylePolOrbs}
199-
200-%% By default is set up to \fdftrue, however it has to set up to \fdffalse.
201-
202-%%\end{fdflogicalT}
203-
204-%%\begin{fdflogicalT}{DM.MixSCF1}
205-
206-%% By default is set up to \fdftrue, however it has to set up to \fdffalse.
207-
208-%%\end{fdflogicalT}
209-
210-%%\begin{fdflogicalT}{Restricted.Radial.Grid}
211-
212-%% By default is set up to \fdftrue, however it has to set up to \fdffalse.
213-
214-%%\end{fdflogicalT}
215-
216
217
218 \subsection{The self-consistent-field loop}
219@@ -5049,7 +5027,7 @@
220 \index{reading saved data!density matrix}
221
222 Instructs to read the density matrix stored in file
223- \sysfile{.DM} by a previous run.
224+ \sysfile{DM} by a previous run.
225
226 \siesta\ will continue even if \sysfile*{DM} is not found.
227
228@@ -9067,8 +9045,8 @@
229 Enable an experimental timer which is based on wall time on the master
230 node and is aware of the tree-structure of the timed sections. At the
231 end of the program, a report is generated in the output file, and a
232-{\tt time.json} file in JSON format is also written. \index{JSON
233- timing report@{\bf JSON timing report}} This file can be used by
234+\file{time.json} file in JSON format is also written. \index{JSON
235+ timing report@\textbf{JSON timing report}} This file can be used by
236 third-party scripts to process timing data.
237
238 \note, if used with the PEXSI solver (see Sec.~\ref{SolverPEXSI})
239@@ -10620,9 +10598,9 @@
240
241 \begin{fdflogicalF}{TDED.Saverho}
242
243-If \fdftrue\ the instantaneous time-dependent density is saved to
244-\texttt{ <istep>}.\texttt{TDRho}\index{TDRho@{\bf TDRho}} after every
245-\fdf{TDED.Nsaverho} number of steps.
246+ If \fdftrue\ the instantaneous time-dependent density is saved to
247+ \file{<istep>.TDRho} after every \fdf{TDED.Nsaverho} number of
248+ steps.
249
250 \end{fdflogicalF}
251
252
253=== modified file 'Src/bands.F'
254--- Src/bands.F 2017-10-19 09:19:20 +0000
255+++ Src/bands.F 2018-04-20 13:37:02 +0000
256@@ -366,7 +366,6 @@
257 use atmfuncs, only : symfio, cnfigfio, labelfis, nofis
258 use writewave, only : wfs_filename
259
260-! use m_spin, only: NoMagn, SPpol, NonCol, SpOrb
261 use m_spin, only: spin
262
263 use m_diag_option, only: ParallelOverK, Serial
264
265=== modified file 'Src/dfscf.f'
266--- Src/dfscf.f 2018-02-21 12:52:06 +0000
267+++ Src/dfscf.f 2018-04-20 13:37:02 +0000
268@@ -71,12 +71,8 @@
269 use parallel, only: Nodes, Node
270 use sys, only: die
271 use parallelsubs, only: GlobalToLocalOrb
272-! use m_spin, only: NonCol, SpOrb
273-! use m_spin, only: h_spin_dim, spinor_dim
274
275-! CC RC Added for the offSpOrb
276 use m_spin, only: spin
277-! CC RC Added for the offSpOrb
278
279 implicit none
280
281@@ -354,14 +350,12 @@
282 ! done with nspin=4 (grid_nspin)?
283 V(1:nsp,1:nspin) = Vscf(1:nsp,ip,1:nspin)
284
285-!! CC RC Added for the offSpOrb
286 C Factor two for nondiagonal elements for non-collinear spin
287- if( spin%SO ) then
288+ if ( spin%SO ) then
289 V(1:nsp,7:8) = V(1:nsp,3:4)
290- elseif( spin%NCol ) then
291+ else if ( spin%NCol ) then
292 V(1:nsp,3:4) = 2.0_dp * V(1:nsp,3:4)
293- endif
294-!! CC RC Added for the offSpOrb
295+ end if
296
297 C Loop on first orbital of mesh point
298 do ic = 1,nc
299
300=== modified file 'Src/m_spin.F90'
301--- Src/m_spin.F90 2018-04-19 12:47:26 +0000
302+++ Src/m_spin.F90 2018-04-20 13:37:02 +0000
303@@ -184,18 +184,14 @@
304 spin%NCol = .true.
305
306 else if ( leqi(opt, 'spin-orbit') .or. leqi(opt, 'S-O') .or. &
307- leqi(opt, 'SOC') .or. leqi(opt, 'SO') ) then
308+ leqi(opt, 'SOC') .or. leqi(opt, 'SO') .or. &
309+ leqi(opt, 'spin-orbit+offsite') .or. leqi(opt, 'S-O+offsite') .or. &
310+ leqi(opt, 'SOC+offsite') .or. leqi(opt, 'SO+offsite') ) then
311 ! Spin-orbit defaults to the off-site implementation
312
313 spin%SO = .true.
314 spin%SO_offsite = .true.
315
316- else if ( leqi(opt, 'spin-orbit+offsite') .or. leqi(opt, 'S-O+offsite') .or. &
317- leqi(opt, 'SOC+offsite') .or. leqi(opt, 'SO+offsite') ) then
318-
319- spin%SO = .true.
320- spin%SO_offsite = .true.
321-
322 else if ( leqi(opt, 'spin-orbit+onsite') .or. leqi(opt, 'S-O+onsite') .or. &
323 leqi(opt, 'SOC+onsite') .or. leqi(opt, 'SO+onsite') ) then
324
325@@ -207,12 +203,12 @@
326 call die('Spin: unknown flag, please assert the correct input.')
327 end if
328
329- if (spin%SO_offsite) then
330+ if ( spin%SO_offsite ) then
331 call add_citation("10.1088/0953-8984/24/8/086005")
332- endif
333- if (spin%SO_onsite) then
334+ end if
335+ if ( spin%SO_onsite ) then
336 call add_citation("10.1088/0953-8984/18/34/012")
337- endif
338+ end if
339
340 ! Note that, in what follows,
341 ! spinor_dim = min(h_spin_dim,2)
342@@ -242,9 +238,10 @@
343 spin%Col = .false.
344 spin%NCol = .false.
345 spin%SO = .true.
346+ ! off/on MUST already be set!
347
348 ! should be moved...
349- TRSym = .false.
350+ TRSym = .false.
351
352 else if ( spin%NCol ) then
353 ! Non-collinear case
354@@ -257,13 +254,15 @@
355 spin%spinor = 2
356
357 ! Flags
358- spin%none = .false.
359- spin%Col = .false.
360- spin%NCol = .true.
361- spin%SO = .false.
362+ spin%none = .false.
363+ spin%Col = .false.
364+ spin%NCol = .true.
365+ spin%SO = .false.
366+ spin%SO_onsite = .false.
367+ spin%SO_offsite = .false.
368
369 ! should be moved...
370- TRSym = .false.
371+ TRSym = .false.
372
373 else if ( spin%Col ) then
374 ! Collinear case
375@@ -276,13 +275,15 @@
376 spin%spinor = 2
377
378 ! Flags
379- spin%none = .false.
380- spin%Col = .true.
381- spin%NCol = .false.
382- spin%SO = .false.
383+ spin%none = .false.
384+ spin%Col = .true.
385+ spin%NCol = .false.
386+ spin%SO = .false.
387+ spin%SO_onsite = .false.
388+ spin%SO_offsite = .false.
389
390 ! should be moved...
391- TRSym = .true.
392+ TRSym = .true.
393
394 else if ( spin%none ) then
395 ! No spin configuration...
396@@ -295,13 +296,15 @@
397 spin%spinor = 1
398
399 ! Flags
400- spin%none = .true.
401- spin%Col = .false.
402- spin%NCol = .false.
403- spin%SO = .false.
404+ spin%none = .true.
405+ spin%Col = .false.
406+ spin%NCol = .false.
407+ spin%SO = .false.
408+ spin%SO_onsite = .false.
409+ spin%SO_offsite = .false.
410
411 ! should be moved...
412- TRSym = .true.
413+ TRSym = .true.
414
415 end if
416
417
418=== modified file 'Src/rhoofd.F90'
419--- Src/rhoofd.F90 2018-04-15 22:13:08 +0000
420+++ Src/rhoofd.F90 2018-04-20 13:37:02 +0000
421@@ -331,12 +331,6 @@
422 ! Retrieve phi values
423 if ( spin%SO_offsite ) then
424 Clocal(:,ic) = phia(iphi,:)
425-! if(ip.lt.10) then
426-! write(6,*) ' ip/nc/Clocal(1,:) = ', ip, nc, Clocal(1,:)
427-! else
428-! stop 'Stopping in rhoofd...'
429-! endif
430-
431 else
432 Clocal(:,ic) = dsqrt(2._dp) * phia(iphi,:)
433 end if
434@@ -389,13 +383,6 @@
435 ! Retrieve phi values
436 if ( spin%SO_offsite ) then
437 Clocal(:,ic) = phi(:,imp)
438-! if(ip.lt.5) then
439-! write(6,*) ' ip/nc/Clocal(1,:) = ', ip, nc, Clocal(1,:)
440-! else
441-! stop 'Stopping in rhoofd...'
442-! endif
443-
444-
445 else
446 Clocal(:,ic) = dsqrt(2._dp) * phi(:,imp)
447 end if
448
449=== modified file 'Src/state_analysis.F'
450--- Src/state_analysis.F 2018-04-19 09:00:15 +0000
451+++ Src/state_analysis.F 2018-04-20 13:37:02 +0000
452@@ -22,7 +22,7 @@
453 & CartesianForce_to_ZmatForce
454 use atomlist, only : iaorb, iphorb, amass, no_u, lasto
455 use atomlist, only : indxuo
456- use m_spin, only : SpOrb
457+ use m_spin, only : spin
458 use m_fixed, only : fixed
459 use sparse_matrices
460 use siesta_geom
461@@ -167,7 +167,7 @@
462 endif
463
464 ! Population and moment analysis
465- if ( SpOrb .and. orbmoms) then
466+ if ( spin%SO .and. orbmoms) then
467 call moments( 1, na_u, no_u, maxnh, numh, listhptr,
468 . listh, S, Dscf, isa, lasto, iaorb, iphorb,
469 . indxuo )
470
471=== modified file 'version.info'
472--- version.info 2018-04-20 09:41:55 +0000
473+++ version.info 2018-04-20 13:37:02 +0000
474@@ -1,1 +1,1 @@
475-trunk-687--merge-OSSO-694
476+trunk-687--merge-OSSO-694--fixes-1

Subscribers

People subscribed via source and target branches

to all changes: