the electronic transport properties of quasi - onedimensional ( 1d ) systems , described by a localized orbitals basis set , can be calculated using the nonequilibrium green s function ( negf ) method.@xcite the system is usually divided into two semi - infinite left- and right - hand side leads , and a scattering region joining them .
the effect of the leads onto the scattering region is taken into account by the so called self - energies ( se ) , which can be calculated from the surface green s function ( sgf ) of the semi - infinite leads .
these can be obtained either with recursive methods @xcite or by using a semi - analytic formula.@xcite recursive methods are affected by poor convergence for some critical systems , typically when the hamiltonian for the leads is rather sparse .
semi - analytical methods instead bypass those problems by construction , however major difficulties arise if the hopping matrices are singular or , more generally , ill conditioned .
unfortunately the condition of the hamiltonian is set by the electronic structure of the leads and by the unit cell used , and thus it is largely not controllable . for this reason an algorithm that performs under the most generic conditions
is highly desirable .
here we present an improved semi - analytical method that overcomes these limitations and thus represents a robust algorithm for quantum transport based on _ ab initio _ electronic structure .    in the first part of the paper the extended algorithm for the calculation of the se is presented .
first the construction of the green s function of an infinite 1d system as derived in reference [ ] is recast into a more general form based on the notion of a complex group velocity .
then we present an extension of such method to the calculation of the sgf and se .
the new algorithm is defined also for the case of singular hopping matrices .
this largely improves the numerical accuracy
. however we find that even such an improved scheme sometimes fails if the hopping matrices are close to being singular .
we overcome this problem by performing a transformation of the hopping matrix that reduces its condition number @xmath0 , defined as the ratio between its largest to its smallest singular value.@xcite this transformation limits the maximum absolute value of the imaginary part of the bloch wave - vectors , increasing both accuracy and stability .
two approaches are presented , the first is based on a singular value decomposition ( svd ) , which is also used to significantly reduce the dimension of the hamiltonian , while the second consists in adding a random noise matrix .
this extended scheme is implemented in the negf _ ab initio _ transport code _
smeagol_,@xcite based on the density functional theory ( dft ) code siesta.@xcite    in the second part of this work we present three examples of calculations performed with our new implementation .
we compare the results to the ones obtained by using the original method of reference [ ] , finding a considerable improvement .
however , although the algorithm appears very robust , our detailed error analysis reveals that for a given system the accuracy is lost at some specific energies .
this is caused by the divergence of one of the se eigenvalues .
the physical origin of this behavior lies in the presence of surface states very weakly coupled to the semi - infinite leads .
surface states appear whenever at a given energy the set of bloch functions ( with both real and imaginary wave - vectors ) for the infinite quasi-1d system is linearly dependent . in the simplest case
this corresponds to two bloch functions being equal inside the unit cell .
a small imaginary part is thus added to the energy in a small energy range around the surface state .
it is shown that this has little effect on the transport properties in the high transmission regime , whereas for low transmission it has a substantial influence on the results .
crucially only a very small imaginary part is used , and moreover this is added only around the energy of the surface state and thus the error can be carefully controlled .
following the scheme introduced in reference [ ] the construction of the retarded green s function for an infinite quasi-1d system is now recalled .
this is the starting point for the calculation of the sgf .
it is assumed that the hamiltonian is written over a localized orbitals basis set and that the interaction has finite range .
the size of the unit cell can be chosen to guarantee interaction only to the first nearest neighboring unit cells .
the total hamiltonian of the system @xmath1 ( the integers @xmath2 and @xmath3 label the unit cells ) can then be written as @xmath4 where @xmath5 and @xmath6 are @xmath7 matrices , with @xmath8 being the number of orbitals comprised in the unit cell ( see figure [ fig : onedimh ] ) .     and hopping @xmath9 .
the overlap matrix has the same structure.,width=264 ]    if time - reversal symmetry holds then @xmath10 , and @xmath11 , however the solutions presented here are valid also in the more general case when @xmath12 and/or @xmath13 . we further assume that the overlap matrix @xmath14 has the same structure and range of the hamiltonian @xmath15 where @xmath16 and @xmath17 are again @xmath18 matrices with the same meaning of their hamiltonian counterparts .
the solutions of the hamiltonian equation for the associated infinite periodic system @xmath19 are bloch functions @xmath20 , where @xmath21 and @xmath22 are @xmath8-dimensional vectors and @xmath23 is the wave - vector , which in general is a complex number . for a given real or complex energy @xmath24
there are @xmath25 solutions with wave - vectors @xmath26 and corresponding wavefunctions @xmath27 .
each of them satisfies @xmath28 if we define @xmath29 , ( @xmath30 ) , the equation above can be rewritten as @xmath31 where the additional index r denotes explicitly that the solution is a right eigenvector .
the corresponding left eigenvector @xmath32 satisfies @xmath33 time - reversal symmetry gives @xmath34 , so that in the case of real @xmath26 ( propagating states ) left and right eigenvectors are equal . for complex @xmath26 left and right eigenvectors are different , describing left- and right - decaying states . the sets @xmath35 , @xmath36 and @xmath37 that satisfy eqs .
( [ eq : scheq ] ) and ( [ eq : scheql ] ) at a given energy can be found by solving a quadratic eigenvalue problem@xcite of the form @xmath38 where @xmath39 here @xmath40 and @xmath41 are respectively the @xmath7 unit and zero matrices .
the normalization constant is the square root of the complex group velocity @xmath42 ( @xmath43 ) equal to @xmath44 in the following we assume that the eigenvectors @xmath45 and @xmath32 are always normalized to give @xmath46 . if time - reversal symmetry holds then @xmath47 , so that if the imaginary part of @xmath26 is zero the group velocity is real .
note that , at variance with reference [ ] , eqs .
( [ eq : qep1 ] ) and ( [ eq : qep2 ] ) avoid the inversion of @xmath48 , so that they eliminate a possible source of singularities in the calculation of @xmath26 , @xmath45 and @xmath32 .
the full sets of left @xmath49 and right eigenvectors @xmath50 form a complete and orthogonal basis .
the orthogonality relation is @xmath51 where @xmath52 is a constant .
this leads to @xmath53 for @xmath54 this equation is only satisfied if @xmath55 , in which case it corresponds to the definition of @xmath56 . with the chosen normalization
the basis is therefore orthonormal .
the corresponding completeness relation then reads @xmath57 and provides the three following useful relations @xmath58 note that in eqs .
( [ eq : ortho]-[eq : rel3 ] ) the sums run over all @xmath59 solutions . if @xmath60 and @xmath61 eqs .
( [ eq : rel2 ] ) and ( [ eq : rel3 ] ) are equivalent .
the retarded green s function @xmath62 of the system is defined by means of the green s equation @xmath63=\delta_{zz '' } , \label{eq : gf}\ ] ] with @xmath64 real . in what follows we present and expand , by using left and right bloch functions , the solution to eq .
( [ eq : gf ] ) given in reference [ ] only in terms of the right eigenvectors @xmath65 .
first we divide the @xmath59 @xmath45 vectors into @xmath8 right - going states with either im@xmath66 ( right decaying ) or im@xmath67 and @xmath68 ( right propagating ) , and @xmath8 left - going states with either im@xmath69 ( left decaying ) or im@xmath67 and @xmath70 ( left propagating ) . as a matter of notation in order to distinguish left- from right - going states , in what follows we indicate the right - going states with @xmath23 , @xmath22 and @xmath71 , and the left - going states with a bar over these quantities , i.e. @xmath72 , @xmath73 and @xmath74 .    as in reference
[ ] we introduce the duals @xmath75 of the right - going states @xmath45 defined by @xmath76 , and the duals @xmath77 of the left - going states @xmath78 defined by @xmath79 .
if we define the matrices @xmath80 and @xmath81 as @xmath82 then the duals can be obtained by simple inversion @xmath83 the inversions in eqs .
( [ eq : adjbasisl ] ) are usually well defined , unless @xmath80 and @xmath81 do not have full rank .
we will return on this aspect in section [ sec : sstates ] , for the moment we assume that the duals can always be constructed .
the green s function calculated in reference [ ] is then @xmath84 with the matrix @xmath85 given by @xmath86 we now introduce the right transfer matrices@xcite @xmath87 and @xmath88 @xmath89 note that both @xmath87 and @xmath88 have eigenvalues with complex modulus @xmath90 . for an integer @xmath2 the following relations hold @xmath91 which allow us to write the green s function of equation ( [ eq : gfstefano ] ) as @xmath92 in the same way @xmath93 is rewritten as @xmath94 note that although the matrices @xmath87 and @xmath88 are in general well defined , the inverse of these matrices is not .
in fact if @xmath48 and @xmath95 are singular there are some @xmath26 with im@xmath96 , so that @xmath97 ( see section [ sec : svdreduce ] ) . in this case
@xmath87 does not have full rank and is therefore singular .
the same argument holds for @xmath88 .
equation ( [ eq : g00a ] ) can therefore be used only if the matrices @xmath48 and @xmath95 are not singular .
a possible way for overcoming such limitation is by using an equivalent form for the green s function based on the left and right eigenvectors .
the starting point is the relation ( [ eq : rel1 ] ) that will allow us to find the connection between the duals and the left eigenvectors .
( [ eq : rel1 ] ) contains a sum over both left- and right - going states . by moving the contribution of the left - going states to the right side of the equation
we obtain @xmath98 , where we have introduced the auxiliary matrix @xmath99 . by multiplying @xmath99 from the left with either @xmath100 or @xmath101
we obtain respectively @xmath102 and @xmath103 .
the matrix @xmath99 is determined by inserting these relations into eq .
( [ eq : v ] ) and by using eq .
( [ eq : rel3 ] ) , the result is @xmath104 .
the relation between the dual basis and the left eigenvectors is therefore @xmath105 this result allows us to rewrite the green s function of eq .
( [ eq : gfstefano ] ) in a shorter form @xmath106 this result represents a generalization to complex energies and to systems breaking time - reversal symmetry of the solution given in references [ ] for hermitian hamiltonians , real energy and an orthogonal tight binding model .
this derivation shows that the green s function can be equivalently expressed by using the right eigenvectors and their duals ( eq .
( [ eq : gfstefano ] ) ) , or both the right and left eigenvectors ( eq .
( [ eq : gfansatz ] ) ) .
it is thus possible to move from one representation to the other through eq .
( [ eq : phitildeofphil ] ) that relates the duals to the left eigenvectors .
one can then decide which representation to use , depending on the specific problem investigated .
we note that eq .
( [ eq : gfansatz ] ) has the benefit that @xmath107 can be calculated also in the case where the two matrices @xmath48 and @xmath95 are singular . for those @xmath26 where im@xmath96 the group velocity becomes @xmath108 and is therefore well defined ( @xmath109 for im@xmath110 ) .
as a matter of completeness we show that a representation entirely based on the left bloch functions and their duals @xmath111 and @xmath112 is also possible . by multiplying eq .
( [ eq : gfansatz ] ) respectively by @xmath111 and @xmath112 from the right we obtain the two relations @xmath113 again the left transfer matrices @xmath114 and @xmath115 are defined as @xmath116 and the green s function of eq .
( [ eq : gfansatz ] ) can be rewritten as @xmath117 the structure of eq .
( [ eq : gleft ] ) is the same as that of eq .
( [ eq : gfa ] ) , with the difference that now @xmath107 is multiplied to the left of the transfer matrix .
finally we extend eq .
( [ eq : g00a ] ) and present four equivalent relations for the inverse of @xmath107 @xmath118 the second of these relations can be shown by multiplying eq .
( [ eq : rel2 ] ) by @xmath119 from the right and then by using eq .
( [ eq : phitildeofphil ] ) . in the same way the third and fourth equations can be obtained by multiplying equations ( [ eq : rel2 ] ) and ( [ eq : rel3 ] ) by @xmath119 from the left .    in the following
we will use mostly the quantities expressed in terms of the right eigenvectors only , however the same conclusions can be derived using the left eigenvectors .      as an example of the use of the green s function in the form of eq .
( [ eq : gfansatz ] ) we determine the spectral function @xmath120 and the density of states ( dos ) of the infinite quasi-1d system for the special case where the hamiltonian and the overlap matrices are hermitian .
the spectral function is defined as@xcite @xmath121_{zz'}=i\left[g_{zz'}-\left(g_{z'z}\right)^\dagger\right ] .
\label{eq : azzg}\ ] ] the dos @xmath122 projected on the unit cell @xmath2 then is @xmath123.\ ] ] by using eq .
( [ eq : overlap ] ) this becomes @xmath124 .
\label{eq : dosg}\ ] ] in general the main contribution originates from the first term in the sum , which can be interpreted as the onsite dos @xmath125 @xmath126 .
\label{eq : onsitedos}\ ] ] we now calculate @xmath120 and @xmath127 for the special case where @xmath128 and @xmath61 . in this case for im@xmath67
we have @xmath129 , whereas if im@xmath130 then @xmath131 . in the same way for im@xmath132 we have @xmath133 , whereas if im@xmath134 then @xmath135 . therefore for each right decaying state with im@xmath66 there is a left decaying state with @xmath136 and @xmath137 . using these relations when inserting the green s function of eq . (
[ eq : gfansatz ] ) in the definition of @xmath138 , the contribution from all the decaying states cancels out .
the only remaining contributions come from the propagating states , also denoted as open channels .
for these @xmath139 , @xmath140 and @xmath141 . with these constraints , and by using eq .
( [ eq : gfansatz ] ) , the spectral function becomes @xmath142 where @xmath143 is the number of open channels ( number of bloch functions at a given energy with real positive @xmath23 vector ) .
if there are no open channels @xmath144 and the green s function is hermitian . finally , by using eqs .
( [ eq : azz ] ) and ( [ eq : dosg ] ) , and the fact that the eigenvectors are normalized so to give @xmath46 ( see eq .
( [ eq : ln ] ) ) , the dos at the site @xmath145 is simply @xmath146 this is the well known result for the dos of infinite periodic 1d systems.@xcite
the retarded green s function @xmath147 for a quasi - periodic system , where the left and right sides are separated at the position @xmath145 ( the left - hand side part extends from @xmath148 to @xmath149 and the right - hand side part from @xmath150 to @xmath151 , with no coupling between the cells at @xmath149 and @xmath150 ) , can be constructed from the green s function @xmath152 for the infinite chain as demonstrated in reference [ ] @xmath153 the left - hand side sgf is then defined as @xmath154 , and the right sgf as @xmath155 . the sgf can be obtained by using eq .
( [ eq : gfa ] ) @xmath156 this corresponds to the form derived in reference [ ] .
this result can be simplified by using the relations ( [ eq : g00 ] ) for @xmath107 to @xmath157 these equations unfortunately are only defined if @xmath48 and @xmath95 are not singular .
the same problem however does not affect the left and right se , @xmath158 and @xmath159,@xcite since they simply are @xmath160        in complete analogy the same expressions obtained by using the left transfer matrices are @xmath161 and @xmath162 .
this result is equivalent to those obtained in references [ ] and derived with different approaches , demonstrating the equivalence of those to our semi - analytical formula .
since negf - based transport codes simply require @xmath163 and @xmath164 , our scheme allows the calculations of system with arbitrarily complicated electronic structure . a schematic tree diagram describing the steps involved in obtaining the se is shown in figure [ fig : diagram ] ( basic algorithm ) .
( [ eq : senel ] ) and ( [ eq : sener ] ) demonstrate that the se can be calculated directly without explicitly calculating @xmath165 and @xmath166 . in situations where also the sgf are needed ,
these can be obtained by using the relation @xmath167^{-1 } , \label{eq : rgfl}\\ g_\mathrm{r } & = & - \left[k_0 + \sigma_\mathrm{r } \right]^{-1}. \label{eq : rgfr}\end{aligned}\ ] ] this can be derived by adding one layer to the left and one to the right surfaces respectively.@xcite in appendix a we show that the se calculated with eqs .
( [ eq : senel ] ) and ( [ eq : sener ] ) indeed fulfill the above equation .
moreover with the use of eqs .
( [ eq : gfs ] ) and ( [ eq : rgfl ] ) we can now regularize equation ( [ eq : g00a ] ) also for the case where @xmath87 is singular by writing it as @xmath168 we have therefore a scheme where the se are identified as the principal quantities , whereas the sgf and @xmath107 are derived from these .    when we compare the method of reference [ ] with the equations derived above , we notice that now it is not necessary to calculate the matrix @xmath107 and its inverse using eq .
( [ eq : g00a ] ) in order to obtain the se .
this is not defined in the case of singular @xmath48 and @xmath95 , and therefore we expect the new method to be more stable and accurate . also the problems caused close to band edges by the van hove singularities in @xmath107 are avoided .
moreover the method in reference [ ] relies on the calculation of the sgf in order to obtain the se , whereas here the sgf is not needed .
as we will show in section [ sec : sstates ] close to surface states the error in the sgf is much larger than the one for the se , so that we also expect a large improvement in the accuracy for those particular states .
the accuracy with which the se are calculated depends on the accuracy involved in solving eq . (
[ eq : qep1 ] ) , a quadratic eigenvalue problem extensively studied in the past.@xcite however most solution methods have problems if @xmath48 or @xmath95 are close to being singular , or more generally if their condition number @xmath0 is large . in this case
some of the complex eigenvalues tend to infinity and others to zero at the same time , and this results in a loss of accuracy in numerical computations . when calculating @xmath87 ( @xmath88 )
however the contributions from the states with im@xmath169 ( im@xmath170 ) are vanishingly small .
it is therefore useful to limit the range of the eigenvalues @xmath171 in such a way that the important eigenstates with small @xmath172 and @xmath173 can be calculated accurately , while losing precision for the less important eigenstates with large @xmath172 and @xmath173 . in this section
we show how this can be achieved by decreasing @xmath174 and @xmath175 . here
we assume that @xmath60 , so that @xmath176 .
minor modifications are needed for the general case ( see appendix b ) .    in order to obtain @xmath174 first a svd of the matrix
is performed @xmath177 @xmath178 and @xmath93 are unitary matrices , and @xmath179 is a diagonal matrix , whose diagonal elements @xmath180 are the singular values
. these are real and positive , and ordered so that @xmath181 . if @xmath182 is the largest singular value , and @xmath183 the smallest one , then the condition number is defined as @xmath184 , with @xmath48 singular if @xmath183 is zero .
we now replace @xmath179 with an approximate @xmath185 , whose diagonal elements @xmath186 are @xmath187 and accordingly @xmath48 with @xmath188 .
the tolerance parameter @xmath189 is a real positive number that determines the condition number of @xmath190 .
we now present two possible choices for @xmath191 .
the first is to set @xmath192 , resulting in @xmath190 being singular .
we can then perform a unitary transformation in order to eliminate the degrees of freedom associated to @xmath193 , and obtain an effective @xmath48 matrix ( @xmath194 ) with reduced size for which @xmath195 .
the second possibility is to set @xmath196 , so that by definition we have @xmath197 .
the accuracy obtained with both strategies is similar , the advantage of using the first however is that the size of the matrices is reduced , so that for big systems the computation is much faster . in our implementation
we use both methods together , first we reduce the size of the system by setting @xmath192 , and then , if necessary , we further reduce the condition number for the effective system by limiting the smallest singular value .      here
we set all the @xmath198 singular values @xmath180 smaller than @xmath199 to zero , so that there are @xmath200 singular values @xmath180 with @xmath201 .
the transformations needed in order to obtain the right se are now presented ( the procedure for the left se is analogous ) .
we apply the unitary transformation @xmath202 , @xmath203 , and we define @xmath204 , @xmath205 , @xmath206 .
since @xmath198 singular values of @xmath190 are zero the transformed matrices have the structure @xmath207 where the dimensions of the new matrices are : @xmath208 for @xmath209 , @xmath210 and @xmath120 , @xmath211 for @xmath212 and @xmath99 , @xmath213 for @xmath214 and @xmath215 , and @xmath216 for @xmath217 .
finally @xmath218 is a column vector of dimension @xmath219 , and @xmath220 is of dimension @xmath198 .
the transformed form of eq .
( [ eq : scheq ] ) is @xmath221 due to the structure of @xmath222 there are @xmath198 solutions to this equation with @xmath97 and @xmath223 .
we therefore split up the right - going states into those with finite @xmath224 and those with @xmath97 . for the first set , from eq .
( [ eq : scheqv ] ) , we obtain @xmath225 with @xmath226 the @xmath218 are then solutions of an effective system with reduced size @xmath227 where the effective matrices are @xmath228 we can now solve the quadratic eigenvalue problem ( eq .
( [ eq : qep1 ] ) ) for this effective system to get the set of @xmath219 eigenvectors @xmath229 and eigenvalues @xmath171 for the right - going states .
the @xmath198 eigenvectors of the second set of solutions with @xmath97 are given by @xmath223 with a general @xmath220 .
the set of eigenvectors of the full @xmath230 matrix therefore is @xmath231 with @xmath232 , and @xmath233 is a general matrix of solution vectors for the states with @xmath97 . from this
we obtain the set of duals @xmath234 using these results we can now calculate the transfer matrix @xmath235 of the transformed system @xmath236 where we have also used the fact that @xmath97 for the second set of solutions .
we note that setting the @xmath198 smallest singular values @xmath180 to zero causes the last @xmath198 columns of @xmath235 to be zero too .
moreover the explicit calculation of @xmath233 is not needed in order to obtain @xmath235 . from this and eq .
( [ eq : sener ] ) we obtain the right se @xmath237 where @xmath238 is the se of the effective system .     of the diagonal elements of the transformed right se for different values of @xmath239.,width=245 ]
the structure of @xmath240 shows that by applying this unitary transformation we have ordered the elements of the se by absolute size , moving those columns ( rows ) with the smallest values to the right ( bottom ) . by setting the smallest singular values of @xmath48 to zero those columns and rows of the se with small values
have also been set to zero .
this is illustrated in figure [ fig : sigmadiag ] , where the absolute value of the diagonal elements of the transformed selfenergy @xmath241 is shown for a ( 8,0 ) zigzag carbon nanotube at the fermi energy @xmath242 ( see section [ sec : erranalysis ] for a detailed description of the system ) .
the @xmath241 are basically identical for different @xmath189 up to @xmath243 , and indeed an increasing value of @xmath189 results in more diagonal elements of @xmath240 set to zero .
we note that @xmath219 is of similar size as @xmath8 in figure [ fig : sigmadiag ] , since the system is rather short along @xmath2 and a small basis set is used ( i.e. @xmath8 is small ) . for large systems and rich
basis sets the ratio @xmath244 will decrease .
the physical interpretation of the zero columns and rows in the se is that the @xmath198 states with @xmath245 decay infinitely fast , so that the interaction of those states is limited to the site they are localized at . finally the se of the original system can be obtained by applying the inverse unitary transformation @xmath246 and in contrast to @xmath247
the matrix @xmath164 is a dense @xmath7 matrix .
note that in order to obtain the left se we perform the unitary transformation @xmath248 , @xmath249 , and then follow an analogous procedure . in this case
however instead of the right - going states the left - going ones are used .
we can limit the lower bound of the singular values @xmath180 by setting @xmath250 in eq .
( [ eq : ssvd ] ) . in this case
the approximated @xmath251 matrix is obtained by replacing @xmath48 with @xmath190 .
the error introduced is now of the order of @xmath252 .
ideally @xmath252 should be of the order of the machine numerical precision , so that the error is minimal .
however sometimes increasing @xmath252 beyond that value improves the results , therefore @xmath189 is left as a parameter to adjust depending on the material system investigated .
this will be discussed extensively in the next section .
a simpler but equally effective possibility for limiting the smallest singular value of a matrix is that of adding a small random perturbation.@xcite thus another strategy for reducing the condition number of @xmath48 is that of replacing @xmath253 with @xmath254 , where @xmath255 is a matrix whose elements are random complex numbers with an average absolute value @xmath256 . in particular we choose the @xmath257 in such a way that both @xmath258 and @xmath259 are random numbers in the range @xmath260 $ ] .
we find that if @xmath261 the addition of noise usually gives results as accurate as those obtained with the svd procedure , but the calculation is faster since instead of performing a svd we just perform a sum of the matrices .    in figure
[ fig : diagram ] we present our final extended algorithm as it has been implemented in _
smeagol_. this now includes the following regularization procedure of @xmath48 .
first the size of @xmath48 and hence of the whole problem is reduced by using the scheme described in section [ sec : svdreduce ] , with a tolerance parameter @xmath262 .
this generates an effective matrix @xmath263 whose condition number @xmath264 is reduced by adding a small noise matrix @xmath265 .
such a step is extremely fast and enhances considerably the numerical stability of the calculation . in most cases
the se for the effective system can then be calculated and no further regularization steps are needed . however , in some cases the calculation of the se still fails .
this , for example , happens when the solution of eq .
( [ eq : qep1 ] ) for the effective system fails , or else when the calculated number of left - going states erroneously differs from the number of right - going states . in these critical situations
we further decrease @xmath264 by limiting the smallest singular value of @xmath263 as described in section [ sec : svdlimit ] with a tolerance parameter @xmath266 .
the code automatically adjusts @xmath267 , @xmath268 and @xmath269 within a given range until the se is calculated . in our test calculations for a number of different systems we found no situation where such a scheme has failed . in contrast
when the standard algorithm of reference [ ] is employed the number of failures was considerable .
note that our extended algorithm can also be used in conjunction with recursive methods for evaluating the se.@xcite also in this case it will decrease the computing time for large systems due to the reduced size of the effective @xmath251 matrix .
when recursive algorithms are used the accuracy of the se is automatically known as it coincides with the convergence criterion .
poor convergence is found when the error can not be reduced below a given tolerance .
direct methods , as the one presented here , are in principle error free in the sense that when the solution is found , this is in principle exact . for this reason the numerical errors arising from direct schemes usually are not estimated . in this section
we perform this estimate and present a detailed error analysis for three different material systems .    in order to estimate the numerical accuracy we use the recursive relations of eqs .
( [ eq : rgfl ] ) and ( [ eq : rgfr ] ) , written as @xmath270^{-1 } k_{1}\\ \sigma_\mathrm{r}^{\mathrm{out } } & = - k_1 \left[k_0 + \sigma_\mathrm{r}^\mathrm{in } \right]^{-1 } k_{-1 } , \end{split } \label{eq : sigmaout}\ ] ] where @xmath271 are calculated with our extended algorithm , and @xmath272 are obtained by evaluating the right - hand side term of the above equations .
when the solution is exact then @xmath273 and @xmath274 . therefore we can define a measure of the error @xmath275 as @xmath276 where @xmath277 stands for the max norm,@xcite the corresponding relative error is @xmath278 .
the accuracy criterion used in the extended algorithm is the following .
we first set @xmath267 , @xmath269 and eventually @xmath268 and compute @xmath279 .
this should be lower than a target accuracy @xmath280 .
if this is not the case then the se will be recalculated with a different set of tolerance parameters , until @xmath279 reaches the desired accuracy .
if this condition is never achieved the final se is the one with to the smallest @xmath279 .
we now calculate the se for different variations of the method , chosen in order to highlight the problems arising from @xmath48 and @xmath95 and to show the difference between the basic method of reference [ ] and the extensions presented here .
there are two main differences between the two methods .
the first is that here we solve eq .
( [ eq : qep1 ] ) without inverting @xmath48 , whereas in reference [ ] @xmath281 is used to solve the inverse band - structure relation @xmath282 . clearly this second choice is less accurate if @xmath48 is close to singular .
however it is much faster computationally , so that it might be of advantage for big systems .
the second difference is that here it is not necessary to calculate @xmath107 via eq .
( [ eq : g00a ] ) , so that one does not need to invert @xmath87 and @xmath88 .    in order to investigate the effect of these two aspects independently
, we have calculated the se using the following four methods . in method 1
we use the algorithm presented in this work .
in particular we use eq .
( [ eq : qep1 ] ) to solve the quadratic eigenvalue problem and eqs .
( [ eq : senel]-[eq : sener ] ) to obtain the se ( for the right se we actually use a different form of eq .
( [ eq : qep1 ] ) , see appendix c ) .
method 2 is essentially the same , with the only difference that instead of solving eq .
( [ eq : qep1 ] ) we use the eigenvalue method of reference [ ] . in method 3 we solve eq .
( [ eq : qep1 ] ) , but we use eq .
( [ eq : sgfstefano ] ) to calculate the sgf , with @xmath107 obtained from eq .
( [ eq : g00a ] ) .
finally method 4 is the algorithm of reference [ ] .    in order to obtain a statistically significant average of the errors , we plot a histogram of the calculated errors for both @xmath163 and @xmath164 for a large energy range . here
we use the absolute error , since it can readily be compared to the energy scale of the problem .
note that although the relative error might be small , the absolute error can be very large if @xmath283  ry . furthermore in order to keep the analysis simple in all the calculations of this section we do not reduce the system size nor do we add noise ( @xmath284 ) .
we regularize @xmath48 and @xmath95 by using @xmath196 in eq .
( [ eq : ssvd ] ) .
since the error depends on the chosen @xmath189 , here we calculate @xmath285 for a set of @xmath189 in the range @xmath286 $ ] .
we then present the smallest @xmath275 found for @xmath189 taken in that range .
this is the smallest possible error achievable with a given method and allows us to extract informations on the range of optimal svd values for a given method .
, i.e. the direction of the transport.,width=264 ]     for three different systems . ( a ) ( 8,0 )
zigzag carbon nanotube , ( b ) bcc fe , ( c ) fcc au .
@xmath8 is the number of times a given error @xmath275 occurs ( not normalized).,width=302 ]     giving the smallest error in the self - energy .
( a ) ( 8,0 ) zigzag carbon nanotube , ( b ) bcc fe , ( c ) fcc au .
@xmath8 is the number of times a given @xmath189 generates the smallest error ( not normalized).,width=302 ]    as first example a ( 8,0 ) zigzag carbon nanotube@xcite is presented ( the unit cell is shown in figure [ fig : ucellc](a ) ) .
the length of the periodic unit cell is 4.26   along the nanotube , with 32 carbon atoms in the unit cell .
the lda approximation ( no spin - polarization ) is used for the exchange correlation potential .
we consider @xmath287 and @xmath288 orbitals for carbon with double-@xmath289 and a cutoff radius @xmath290 for the first @xmath289 of @xmath291 bohr .
higher @xmath289 are constructed with the split - norm scheme with a split - norm of 15%.@xcite the real space mesh cutoff is 200 ry .
the matrices @xmath292 , @xmath9 , @xmath293 and @xmath294 are extracted from a ground state dft calculation for an infinite periodic nanotube .
we calculate the se for the semi - infinite nanotube at 1024 energy points in a range of @xmath295 ev around the fermi energy .
figure [ fig : deltaall](a ) shows the histogram of the errors in the se , where @xmath8 is the number of times a given error @xmath275 appears .
in general the figure shows that for this system the average error increases when going from method 1 to method 2 and method 3 , and finally to method 4 .
the error obtained with method 1 is on average about 6 orders of magnitude smaller than the one obtained with method 4 .
the main reason behind this dramatically improved accuracy is that method 1 does not involve any steps where a singular @xmath48 leads to divergencies .
method 4 on the other hand is strongly dependent on the condition number of @xmath48 , since it necessitates to invert @xmath48 and @xmath87 ( or @xmath88 ) .
methods 2 and 3 are on average about one order of magnitude more precise than method 4 .
since they both still involve one of the two inversions the difference is however not large .
figure [ fig : fsall](a ) shows the histogram of the optimum @xmath296 used for the calculations of the se .
here we plot the number of times @xmath8 a particular @xmath189 has given the smallest error in the set of calculations . a larger optimal value for @xmath296 indicates a stronger dependence of the computational scheme on @xmath174 . for method 1 the range of used @xmath296 is smaller than @xmath297 .
if we force @xmath296 to be zero we get almost the same level of accuracy as shown in figure [ fig : deltaall](a ) , which confirms that the accuracy of for method 1 depends little on @xmath174 for this system .
however also for this method there is a set of energies ( a few percent of the total number ) where the solution of eq .
( [ eq : qep1 ] ) fails if @xmath296 is too small .
the optimal @xmath296 for the other methods is orders of magnitude larger than that of method 1 , and it is never smaller than @xmath298 . the absolute error induced by replacing @xmath48 by @xmath190 is of the order of @xmath299 .
usually @xmath182 is of the order of 1 ry , so that the error is of the order of @xmath189 ry .
therefore since in methods 2 to 4 a large value of @xmath296 is needed in order to improve @xmath300 , also the resulting error is large .
the second example is bcc fe ( figure [ fig : ucellc](b ) ) , oriented along the ( 100 ) direction .
the lattice parameters are the same as in reference [ ] .
there are 4 fe atoms in the unit cell .
we apply periodic boundary conditions in the direction perpendicular to the stacking , so that these correspond to 4 fe planes .
the length of the cell along the stacking direction is 5.732  .
a double-@xmath289 @xmath301 ( @xmath290=5.6 bohr ) , single-@xmath289 @xmath302 ( @xmath290=5.6 bohr ) and single-@xmath289 @xmath303 ( @xmath290=5.2 bohr ) basis is used .
the real space mesh cutoff is 600 ry , and the dft calculation is converged for 7x7 @xmath23-points in the brillouin zone orthogonal to the stacking .
the se have been calculated for the converged dft calculation at 32 different energies in a range of @xmath3041  ev around the fermi energy , and for 10,000 @xmath23-points in the 2d brillouin zone perpendicular to the stacking direction . for each @xmath23-point
there is a different set of matrices @xmath305 , @xmath48 and @xmath95 , so that for each @xmath23-point there is a different se .
the histogram for the error of the calculated self - energy @xmath275 is shown in figure [ fig : deltaall](b ) , and the histogram for the optimal @xmath296 in figure [ fig : fsall](b ) .
the general behavior is similar to the one found for the carbon nanotube .
we note that , although for the vast majority of the calculations the error in the se is small , there is a long tail in the histograms of figure [ fig : deltaall](b ) indicating the presence of a small number of large errors .
this is present for all the methods , with a maximum error of  @xmath306 ry for method 1 , and  @xmath307 ry for method 4 .
closer inspection shows that the reason for the increase of the error for certain energies and @xmath23-points is caused by a divergence in @xmath308 .
this will be illustrated in more detail in the next section .
finally we consider fcc au ( figure [ fig : ucellc](c ) ) , with the stacking along the ( 111 ) direction .
the unit cell consists of three planes of nine gold atoms each .
these are the typical leads used for the calculations of the transmission properties of molecules attached to gold.@xcite we use double-@xmath289 @xmath301 ( @xmath290=6.0 bohr ) and single-@xmath289 @xmath303 ( @xmath290=5.5 bohr ) and four @xmath23-points in the brillouin zone perpendicular to the stacking .
the mesh cutoff is 400 ry .
the se have been calculated for 418 energy points , from about 15 ev below to about 10 ev above the fermi energy . the general behavior ( figures [ fig : deltaall](c ) and [ fig : fsall](c ) )
is again similar to that of the previous examples .
also here the error for method 1 is about 6 orders of magnitude smaller than that of method 4 , with method 2 and 3 giving some marginal improvement .
our results show that the new scheme in general allows the calculation of the se with high accuracy .
the main advantage of method 1 is rooted in the possibility of using a much smaller @xmath296 . for big systems
sometimes one might prefer to use method 2 , since it is considerably faster than method 1 and gives the second best accuracy . in this case
we first calculate the se with method 2 and check the error . only for those energy points where the error is above some maximum value ( of the order of @xmath309 ry for example ) the calculation
is repeated with method 1 to improve the accuracy .
finally the results show that for all methods the svd transformation of @xmath48 is necessary , although for method 1 it is needed only a few percent of the times . for big systems , in particular if the unit cell is elongated along the stacking direction , or if a rich basis set is used , @xmath174 will generally increase as there will be some singular values of @xmath48 going to zero . in these cases
also method 1 will require a svd transformation for most energies .
the range of @xmath296 should however be similar to the one shown in figure [ fig : fsall ] , so that also the error in the se should be of the same order of magnitude .
we also note that in order to keep the analysis simpler here we have not used the reduction of system size described in section [ sec : svdreduce ] , for such large systems it is however crucial in order to decrease the computational effort and regularize @xmath48 at the same time .
the center of the error distribution for method 1 ( figure [ fig : deltaall ] ) is located at small @xmath310 , usually smaller than 10@xmath311 ry .
however the histogram has also a tail reaching up to very large errors .
these are found only at some critical energies as demonstrated in figure [ fig : ev_gf](a ) , where we show @xmath275 for the carbon nanotube calculated over 1024 energy points in a range of 2 ev around the fermi energy .
the average error is of the order of 10@xmath312 ry , but at energies around -0.8  ev and -0.34  ev the error drastically increases .
indeed a finer energy mesh at these points suggests a divergence .
the origin of the large errors at particular energies can be investigated by looking at the eigenvalues @xmath313 of the sgf @xmath314 . in figure
[ fig : ev_gf](b ) the largest and the smallest absolute value for the eigenvalues , respectively @xmath315 and @xmath316 , are plotted as function of energy ( @xmath317 ) .
it can be seen that @xmath315 diverges close to the energies where the error increases , i.e. we can associate large errors in @xmath165 with a divergence in its spectrum . since @xmath318 is calculated from eq .
( [ eq : senel ] ) the only possible origin for the divergence is in the norm of some of the @xmath75 . as these are obtained by inverting the matrix @xmath319 ( eq .
( [ eq : q ] ) ) , one deduces that the set of vectors @xmath320 is not linearly independent . for these energies
we therefore can simply check the magnitude of @xmath322 to determine whether there is a divergence of the se close to a particular energy .
physically the divergence of the se translates into the presence of a surface state at that particular energy.@xcite consider the spectral representation of @xmath165 @xmath323 where @xmath324 are the eigenvalues and @xmath325 are the right eigenvectors of the effective surface hamiltonian matrix @xmath326 with overlap @xmath293 , and @xmath327 are the left eigenvectors of the same hamiltonian .
a localized surface state is found when there is a real eigenvalue @xmath328 at @xmath329 ( or more generally if im(@xmath328 ) is very small ) .    from the recursive relation ( [ eq : rgfl ] ) one can deduce that for an infinite eigenvalue there is also a corresponding vanishing eigenvalue .
therefore in figure [ fig : ev_gf](b ) for energies where @xmath330 we have also @xmath331 .
close to the singularity we can therefore expand the two eigenvalues as @xmath332 and @xmath333 . for @xmath334 the largest eigenvalue in eq .
( [ eq : gldiagonal ] ) is then equal to @xmath335 , and the smallest is equal to @xmath336 . to avoid divergence therefore the magnitude of the @xmath165 eigenvalues
can be bounded to a finite value @xmath335 by introducing a small imaginary part to the energy for energies in the vicinity of a surface state .
another possibility for limiting the size of @xmath315 is to bound the singular values of @xmath80 from below in the same way as it is done for @xmath48 ( section [ sec : svdlimit ] ) .
this essentially imposes the @xmath45 to be linearly independent from each other .
however , with this scheme it is not possible to conserve the green s function causality , so that the sgf might have eigenvalues lying on the positive imaginary axis .
moreover we loose control over the accuracy of the computed sgf and se .
both these problems are avoided when using a finite @xmath336 .
error analysis for the carbon nanotube of figure [ fig : ucellc ] : ( a ) absolute error @xmath275 of the self - energy as function of the energy @xmath24 , ( b ) maximum ( @xmath315 ) and minimum ( @xmath316 ) eigenvalues of @xmath165.,width=264 ]    density of states and transmission coefficient for the carbon nanotube of figure [ fig : ucellc ] .
( a ) density of states of the surface layer @xmath337 as function of energy @xmath24 , calculated for different broadenings @xmath336 .
the inset is a zoom at energies around -0.34  ev .
( b ) transmission coefficient @xmath338 for different values of @xmath336.,width=264 ]    we now investigate the dos and transport properties of a system when the finite imaginary part @xmath336 ( broadening ) is added to the energy .
we consider as an example the carbon nanotube of figure [ fig : ucellc ] . in figure
[ fig : trho0](a ) the onsite surface dos @xmath337 as defined in eq .
( [ eq : onsitedos ] ) is shown for @xmath339  ry , @xmath340  ry , @xmath341  ry and @xmath342  ry .
for @xmath339 the surface dos vanishes for energies between -0.37  ev to + 0.45  ev , indicating the presence of a gap around the fermi energy .
note that there are no van hove singularities in @xmath337 , since we never divide by the group velocity when calculating the sgf . for finite @xmath336 and energies away from the band gap ,
the dos is essentially identical to that calculated for @xmath339 , however inside the gap @xmath337 does not vanish but saturates to a small value proportional to @xmath335 .
moreover whereas the surface states are not visible for @xmath339 , they appear in the dos for finite @xmath336 , with a full width at half maximum ( fwhm ) equal to @xmath343 .
we then move to the transport by calculating the transmission coefficient@xcite @xmath344 for a carbon nanotube attached to semi - infinite leads made from an identical carbon nanotube . since this is a periodic system @xmath344
must equal the number of open channels , so that it can only have integer values .
this is indeed the case for @xmath339 ( figure [ fig : trho0](b ) ) . for finite @xmath336s
the transmission coefficient is only approximately an integer , especially inside the energy gap region where the finite surface dos introduced by @xmath336 leads to a non zero transmission .
the transmission in the gap is proportional to @xmath345 ( note that the scale is logarithmic ) , since on both sides of the scattering region the artificial surface dos is proportional to @xmath336 . in this region of small transmission
therefore the results might change by orders of magnitude depending on the value of @xmath336 .
for all values of @xmath336 however we find no contributions to the transmission coming from the surface state , indicating that these do not carry current .
these results show that adding a finite value @xmath336 to the energy has little effect on the actual transmission if this is large .
however when the transmission is small , as in the case of tunnel junctions , the finite @xmath336 introduces an additional contribution to the conduction that might arbitrarily affect the results .
it is thus imperative for those systems to identify surface states and use the imaginary @xmath336 only in a narrow energy interval around them .
finally we can give an estimate of the relative accuracy @xmath346 at the energy corresponding to the surface state .
as discussed before the origin of the error is the inversion of @xmath80 needed to calculate the duals . the relative error introduced by the inversion of @xmath80 is proportional to @xmath322.@xcite close to a surface state the smallest singular value is of the order of @xmath336 , so that @xmath347 .
as this is the dominant source of error in the calculation of the se close to a surface state , we can approximate the relative error as @xmath348 where @xmath349 is a constant that depends on the machine precision and on the details of the algorithm .
the label `` in '' explicitly indicates that this is the error in the se calculated with the extended algorithm ( @xmath350 in eq .
( [ eq : sigmaout ] ) ) .
the absolute error @xmath351 is equal to the relative error times @xmath352 , which is itself proportional to @xmath335 , so that we get @xmath353 .    when using eq .
( [ eq : error ] ) to estimate the error in the se we introduce an additional error due to the inversion involved in obtaining @xmath165 . the largest singular value of @xmath165 is proportional to @xmath335 , and the smallest one is proportional to @xmath336 , so that the relative error introduced by the inversion is proportional to @xmath354 . for small @xmath336 we can therefore write for the error in @xmath355 @xmath356 where @xmath357 is again a constant .
since the errors are random the total estimated error can be approximated by adding the contributions from the two inversions @xmath358 @xmath279 is therefore a good estimate for the true error @xmath359 if @xmath360 is small .
close to surface states however @xmath361 , so that @xmath279 largely overestimates the true error .
( a ) relative error of the self - energy ( @xmath362 represents the true error ) , ( b ) condition numbers of @xmath80 and @xmath165 , as a function of the broadening @xmath336 for the carbon nanotube of figure [ fig : ucellc ] calculated at the surface state energy.,width=264 ]    to verify these estimates numerically we present a scheme for calculating @xmath359 and @xmath360 independently . for each se
we perform a second calculation where we add a small amount of noise to the input matrices @xmath363 , and @xmath95 , so that we obtain the self - energy @xmath364 for a slightly perturbed system . the noise is added as a random relative perturbation of each element of the matrices . as we decrease the magnitude of the noise the difference between @xmath163 and @xmath364
is reduced until it becomes constant for noise smaller than a critical value . in this range of minimum noise
even if the difference in the input matrices decreases , the difference in the output matrices is constant , it therefore corresponds to the error in the calculation .
as one might expect we find that this critical value of noise is of the same order of magnitude as the numerical accuracy used ( approximately @xmath365 in our calculations ) .
we can therefore obtain @xmath366 and @xmath367 , with the magnitude of the noise equal to the critical value .
we have calculated the maximum error for a set of 128 energy points located within @xmath368  ry around the energy of the surface state at -0.34  ev for different values of @xmath336 .
the result is shown in figure [ fig : errss](a ) .
indeed for small @xmath336 @xmath362 follows eq .
( [ eq : dsin ] ) with @xmath369  ry , @xmath370 follows eq .
( [ eq : dsout ] ) with @xmath371  ry@xmath372 , and @xmath373 . in figure
[ fig : errss](b ) the condition numbers @xmath322 and @xmath374 are shown , confirming @xmath347 and @xmath375 .
this demonstrates that close to surface states @xmath279 is mainly caused by the calculation of @xmath165 .
thus @xmath279 largely overestimates the real error @xmath362 , which even for @xmath376  ry has an acceptable size of @xmath377 .
since @xmath349 and @xmath357 are generally system dependent , in practical calculations we use a value of @xmath336 ranging between @xmath378 ry and @xmath379 ry for energies in the vicinity of surface states , mainly in order to limit the absolute error . moreover @xmath336 is added in an energy range corresponding approximately to the fwhm of the imaginary part of @xmath380 , which is equal to @xmath343 .
although this range is only of the order of @xmath381 ry , in practical calculations where both energy and @xmath23-point sampling is fine the number of times when this prescription is applied can be rather large ( see figure [ fig : deltaall ] ) .
the above analysis confirms that close to surface states also direct methods have the same accuracy problems of recursive methods .
this fact is usually ignored in the literature,@xcite where it is assumed that the accuracy is constant for a given algorithm . here
we show that the accuracy of a method is solely determined by the value of @xmath349 , which , as indicated in section [ sec : erranalysis ] , can vary over many orders of magnitude .
our analysis also shows that methods requiring the explicit calculation of @xmath165 from its inverse are much less accurate close to surface states than those calculating @xmath163 directly .
by extending the scheme proposed in reference [ ] we have presented a different but equivalent form for calculating the green s functions of an infinite quasi-1d system , as well as the sgf and se for the semi - infinite system .
we have then constructed an extended algorithm containing also the necessary steps to regularize the ill conditioned hopping matrices .
this is found to be crucial in order to obtain a numerically stable algorithm . by applying a unitary transformation based on a svd
we remove the rapidly decaying states and calculate the se for an effective system with reduced size .
we further decrease the condition number of the hopping matrices by adding a small random perturbation and by limiting the smallest singular value .
we have performed a detailed error analysis on the numerical calculation of the se , showing that if the algorithm does not involve an inversion of the hopping matrices @xmath48 ( or @xmath95 ) high accuracy is obtained .
we also find that the error is not constant as function of energy .
it is shown that an increase of accuracy is needed especially close to energies where the se and sgf diverge , which corresponds to the presence of surface states in the semi - infinite system . at these energies
we improved the accuracy by adding a small imaginary part to the energy .
we have shown that this procedure affects the transport properties little in the high transmission limit . however , for low transmission this adds some spurious surface density of states contributing significantly to the total transmission .
the transport can therefore be strongly affected , so that the imaginary part should be added only in a small energy range around the poles and it should be as small as possible .
our final algorithm is therefore highly numerically stable and extremely accurate .
most importantly errors and accuracy can be closely monitored .
we believe that this is an ideal algorithm to be used with _
ab initio _ transport schemes , where the condition of the hamiltonian and its sparsity is controlled by the convergence of the electronic structure and therefore can not be fixed _ a priori_.
here we demonstrate that @xmath163 calculated using eq .
( [ eq : senel ] ) indeed fulfills the recursive relation for @xmath165 of eq .
( [ eq : rgfl ] ) .
insert eqs .
( [ eq : gfs ] ) and ( [ eq : senel ] ) into eq .
( [ eq : rgfl ] ) and take the inverse to obtain @xmath382 using the definition of the matrix @xmath88 ( eq .
( [ eq : bara ] ) ) we write @xmath383 this equation corresponds to the defining equation for the @xmath78 and is therefore fulfilled by definition .
the same is therefore true for eq .
( [ eq : rgfl ] ) .
( [ eq : rgfr ] ) for @xmath166 can be demonstrated similarly .
in section [ sec : svdreduce ] we assume that @xmath60 in order to write the transformed matrices @xmath385 and @xmath222 in form of eq .
( [ eq : transfmat ] ) .
if @xmath384 the same can be done by performing a generalized svd of the hamiltonian and overlap matrices as described in reference [ ] . here we present a different approach , based on two standard svd transformations , one for @xmath48 and one for @xmath386 @xmath387 here @xmath388 and @xmath389 are unitary matrices , @xmath390 and @xmath391 are diagonal matrices with the singular values on the diagonal . in general
there are @xmath392 singular values of @xmath48 smaller than @xmath393 , and @xmath394 singular values of @xmath95 smaller than @xmath395 , with @xmath396 and @xmath397 being respectively the largest singular value of @xmath48 and @xmath95 .
if @xmath398 , we obtain @xmath190 by setting the smallest @xmath198 singular values of @xmath48 to zero . in the same way we obtain @xmath399 by setting the smallest @xmath198 singular values of @xmath95 to zero .
a transformation @xmath400 brings both @xmath385 and @xmath222 to the form of eq .
( [ eq : transfmat ] ) .
all the results of section [ sec : svdreduce ] are then valid also for @xmath384 .
if the hamiltonian and overlap matrices are real and hermitian , but the energy is complex , then @xmath401 . by using eq .
( [ eq : k1m1svd ] ) , and the fact that @xmath390 and @xmath391 are real , we obtain @xmath402 , so that @xmath403 . if the hamiltonian and overlap matrices are hermitian but not real , then in general @xmath404 .
however in all the calculations performed the difference between @xmath390 and @xmath405 was very small , so that in practice we always had @xmath406 .
in section [ sec : svdlimit ] we limit the singular values of @xmath48 from below without reducing the size of the system . if @xmath384 we simply apply the transformations described in section [ sec : svdlimit ] to both @xmath48 and @xmath95 independently .
we find that in the solution of eq .
( [ eq : qep1 ] ) the numerical accuracy for those eigenvalues with @xmath407 ( im@xmath408 ) is better than for those with @xmath409 ( im@xmath410 ) , especially when @xmath411 . for @xmath163
we only need the left - going states , for which eq .
( [ eq : qep1 ] ) gives the better accuracy .
for @xmath164 the right - going states are needed . in this case , in order to increase the accuracy for the right decaying states ( im@xmath410 ) , instead of eq .
( [ eq : qep1 ] ) we solve the equivalent equation @xmath412 with @xmath413 the eigenvalues of the states with im@xmath410 now have an absolute value larger than one and therefore a higher accuracy .