
Dear all, I have made a code to compute the transmission matrices for many close values of energies for a graphene sheet. At a certain value of energy the program stops returning the following error: Traceback (most recent call last): File "4leads_grap_mag.py", line 308, in <module> main() File "4leads_grap_mag.py", line 289, in main print_smatrix(sys, energies, maglist, t_0=t_0) File "4leads_grap_mag.py", line 181, in print_smatrix smatrix = kwant.smatrix(sys, en, args=[t, Phi]) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/solvers/common.py", line 338, in smatrix check_hermiticity, False) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/solvers/common.py", line 173, in _make_linear_sys prop, stab = lead.modes(energy, args) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/system.py", line 213, in modes return physics.modes(ham, self.inter_cell_hopping(args)) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/physics/leads.py", line 590, in modes evan_vecs = ord_schur(evanselect)[:, :nevan] File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/physics/leads.py", line 391, in <lambda> calc_ev=False)[2] File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/linalg/decomp_schur.py", line 495, in order_gen_schur return tgsen(select, s, t, q, z, calc_ev) File "kwant/linalg/lapack.pyx", line 1861, in kwant.linalg.lapack.dtgsen (kwant/linalg/lapack.c:30475) kwant.linalg.lapack.LinAlgError: Reordering failed; problem is very ill-conditioned I’ve tried to run the same code on a different computer, where kwant is installed without umfpack and without mumps, and the programs stops returning exactly the same error, but at a different value of energy. This value of energy at which this second computer stops had not given any problems in the first computer, that instead is able to use umfpack and mumps. Can you suggest a solution? Thank you, Michael

Hi Michael, This error doesn't have anything to do with the scattering region, and is raised in the calculation of mode wave functions in the lead. I guess that you are now trying an energy coinciding with band bottom of one of the bands in the lead (you can easily verify this by using kwant.plotter.bands. Once the energy is close to a band bottom, the problem does become physically ill-defined, and there is no way to resolve the instability. Usually the regions in parameter space that have such singularities are extremely narrow. I also believe the reason why different computers fail could be different lapack versions or so (but in both cases the failure should be associated with a band bottom. I believe the only way to resolve the problem is to skip the energies where the algorithm fails. Once again, I don't think it's a problem with Kwant itself, so the solution is to just skip that energy point. You can do so by using a try statement and catching this error. Best, Anton On Thu, Jun 18, 2015 at 10:09 AM, Michael Beconcini <dottus@gmail.com> wrote:
Dear all,
I have made a code to compute the transmission matrices for many close values of energies for a graphene sheet. At a certain value of energy the program stops returning the following error:
Traceback (most recent call last): File "4leads_grap_mag.py", line 308, in <module> main() File "4leads_grap_mag.py", line 289, in main print_smatrix(sys, energies, maglist, t_0=t_0) File "4leads_grap_mag.py", line 181, in print_smatrix smatrix = kwant.smatrix(sys, en, args=[t, Phi]) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/solvers/common.py", line 338, in smatrix check_hermiticity, False) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/solvers/common.py", line 173, in _make_linear_sys prop, stab = lead.modes(energy, args) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/system.py", line 213, in modes return physics.modes(ham, self.inter_cell_hopping(args)) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/physics/leads.py", line 590, in modes evan_vecs = ord_schur(evanselect)[:, :nevan] File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/physics/leads.py", line 391, in <lambda> calc_ev=False)[2] File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/linalg/decomp_schur.py", line 495, in order_gen_schur return tgsen(select, s, t, q, z, calc_ev) File "kwant/linalg/lapack.pyx", line 1861, in kwant.linalg.lapack.dtgsen (kwant/linalg/lapack.c:30475) kwant.linalg.lapack.LinAlgError: Reordering failed; problem is very ill-conditioned
I’ve tried to run the same code on a different computer, where kwant is installed without umfpack and without mumps, and the programs stops returning exactly the same error, but at a different value of energy. This value of energy at which this second computer stops had not given any problems in the first computer, that instead is able to use umfpack and mumps. Can you suggest a solution?
Thank you, Michael

Thank you very much! Using the try statement and computing the transmission matrix for a slight different value of energy it works. Best, Michael
Il giorno 18/giu/2015, alle ore 11:07, Anton Akhmerov <anton.akhmerov@gmail.com> ha scritto:
Hi Michael,
This error doesn't have anything to do with the scattering region, and is raised in the calculation of mode wave functions in the lead. I guess that you are now trying an energy coinciding with band bottom of one of the bands in the lead (you can easily verify this by using kwant.plotter.bands.
Once the energy is close to a band bottom, the problem does become physically ill-defined, and there is no way to resolve the instability. Usually the regions in parameter space that have such singularities are extremely narrow. I also believe the reason why different computers fail could be different lapack versions or so (but in both cases the failure should be associated with a band bottom.
I believe the only way to resolve the problem is to skip the energies where the algorithm fails. Once again, I don't think it's a problem with Kwant itself, so the solution is to just skip that energy point. You can do so by using a try statement and catching this error.
Best, Anton
On Thu, Jun 18, 2015 at 10:09 AM, Michael Beconcini <dottus@gmail.com> wrote:
Dear all,
I have made a code to compute the transmission matrices for many close values of energies for a graphene sheet. At a certain value of energy the program stops returning the following error:
Traceback (most recent call last): File "4leads_grap_mag.py", line 308, in <module> main() File "4leads_grap_mag.py", line 289, in main print_smatrix(sys, energies, maglist, t_0=t_0) File "4leads_grap_mag.py", line 181, in print_smatrix smatrix = kwant.smatrix(sys, en, args=[t, Phi]) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/solvers/common.py", line 338, in smatrix check_hermiticity, False) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/solvers/common.py", line 173, in _make_linear_sys prop, stab = lead.modes(energy, args) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/system.py", line 213, in modes return physics.modes(ham, self.inter_cell_hopping(args)) File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/physics/leads.py", line 590, in modes evan_vecs = ord_schur(evanselect)[:, :nevan] File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/physics/leads.py", line 391, in <lambda> calc_ev=False)[2] File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/kwant/linalg/decomp_schur.py", line 495, in order_gen_schur return tgsen(select, s, t, q, z, calc_ev) File "kwant/linalg/lapack.pyx", line 1861, in kwant.linalg.lapack.dtgsen (kwant/linalg/lapack.c:30475) kwant.linalg.lapack.LinAlgError: Reordering failed; problem is very ill-conditioned
I’ve tried to run the same code on a different computer, where kwant is installed without umfpack and without mumps, and the programs stops returning exactly the same error, but at a different value of energy. This value of energy at which this second computer stops had not given any problems in the first computer, that instead is able to use umfpack and mumps. Can you suggest a solution?
Thank you, Michael
participants (2)
-
Anton Akhmerov
-
Michael Beconcini