Hi Joe, Computing the Green's function or the self-energy of the lead fails when a terminated lead has a bound state at the energy we're looking at (so there's an exact pole). For example a lead made out of a topological superconductor always has this problem at zero energy. At the same time the mode solvers face no singularities in this case. In linear algebra terms computing a self-energy corresponds to partially fixing the order of Gaussian elimination, while the most general case may require pivoting incompatible with this order. That's what concerns stability. The speed difference is, I think, insignificant: the number of right hand sides is smaller with the modes solver since we use one per incoming mode, not one per degree of freedom. However in practice obtaining the LU decomposition causes the largest slowdown. Cheers, Anton On Wed, 18 Mar 2020 at 22:12, Joseph Weston (Aquent LLC - Canada) <v-josewe@microsoft.com> wrote:

Hello again,

I Noticed a couple of minor mistakes in my previous email:

I used the term “out of the box” linear solvers, when I meant “black box” linear solvers. By this I meant that we are not tailoring the algorithm used for solving the linear system based on the properties of the LHS (e.g. as we do in RGF by the choice of scattering region slices), but rather trusting that the applied mathematicians have done their job properly, and any incidental structure in the LHS is found “automatically” by the solver. I claimed that the RHSs for the scattering problem were “indicator vectors with 1s in [the] extended part”. This is not true, however the interpretation of the RHS as a “single incoming mode” is correct AFAIK.

Happy Kwanting,

Joe

From: Kwant-discuss <kwant-discuss-bounces@kwant-project.org> On Behalf Of Joseph Weston (Aquent LLC - Canada) Sent: Wednesday, March 18, 2020 12:08 PM To: kwant-discuss@kwant-project.org Subject: [EXTERNAL] [Kwant] Stability of the retarded Green's function calculation

Hello Kwantoptians,

I have a question regarding the speed/stability of computing the retarded Green’s function of a transport setup using Kwant.

In the Kwant source-code [1] it is noted that using `kwant.greens_function` is “often slower and less stable than the scattering matrix calculation”. I was wondering if you could provide me with some references for this assertion.

I have perused the Kwant paper [2] and (part I of) the thesis of Michael Wimmer [3] and cannot find any mention of a speed/stability comparison of the algorithm implemented by `kwant.greens_function` vs `kwant.smatrix`.

My understanding is that in both cases a linear system (LHS) is constructed and solved for different right hand-sides (RHS) using out of the box linear solvers. The solution for each RHS corresponds to one column of the retarded Green’s function / extended scattering matrix respectively. The difference between `kwant.greens_function` and `kwant.smatrix` is then the following. In the former case the leads are taken into account by added the retarded self-energy to the LHS and the RHSs are indicator vectors for the sites of the lead/scattering region interface, which corresponds to a “unit impulse” boundary condition. In the latter case the linear system is “extended” so as to include extra unknowns that correspond to the scattering amplitudes, and the RHSs are indicator vectors with the 1’s in this “extended” part, which corresponds to a “single incoming mode” boundary condition.

It seems to me that the salient difference is in the boundary conditions, and I do not have a good intuition as to why one set of boundary conditions would make the linear system easier/harder to solve.

Happy Kwanting!

Joe

[1]: https://gitlab.kwant-project.org/kwant/kwant/-/blob/master/kwant/solvers/com...

[2]: https://iopscience.iop.org/article/10.1088/1367-2630/16/6/063065/pdf