matrix operator spectrum example?
I'm interested in using Kwant for my own research. While trying the kernel_polynomial_method.py examples, it seems the identity matrix spectrum is not right. Has anyone really tried to run that example? the relevant part of the python code is: ##################### def operator_example(fsyst): # identity matrix matrix_op = scipy.sparse.eye(len(fsyst.sites)) matrix_spectrum = kwant.kpm.SpectralDensity(fsyst, operator=matrix_op) # # 'sum=True' means we sum over all the sites # kwant_op = kwant.operator.Density(fsyst, sum=True) # operator_spectrum = kwant.kpm.SpectralDensity(fsyst, operator=kwant_op) plot_dos([ ('identity matrix', matrix_spectrum()), # ('kwant.operator.Density', operator_spectrum()), ]) ##################### Thank you for your help and communication.
BTW the result I got from this code looks exactly the same as the graphene case. For an identity matrix it should be a flat band and the DOS should just show a peak, right?
Hi Edmond, You are plotting the spectral density of the identity operator, which is the same as the density of states. If you were plotting the density of states of an identity operator, you'd see a delta-function peak indeed. Please review the definitions in the tutorial: https://kwant-project.org/doc/1/tutorial/kpm#calculating-the-density-of-stat... Best, Anton On Tue, 9 Jun 2020 at 00:47, <edmondztt@gmail.com> wrote:
BTW the result I got from this code looks exactly the same as the graphene case. For an identity matrix it should be a flat band and the DOS should just show a peak, right?
Right. That's what I thought. However just wanna point out the original example code kernel_polynomial_method.py was buggy and doesn't give the delta function for this identity matrix. I managed to get it almost right by changing some lines. But right now it's shifted instead of being a peak at 1. Best wishes, Edmond On Tue, Jun 9, 2020 at 2:16 PM Anton Akhmerov <anton.akhmerov+kd@gmail.com> wrote:
Hi Edmond,
You are plotting the spectral density of the identity operator, which is the same as the density of states. If you were plotting the density of states of an identity operator, you'd see a delta-function peak indeed. Please review the definitions in the tutorial:
https://kwant-project.org/doc/1/tutorial/kpm#calculating-the-density-of-stat...
Best, Anton
On Tue, 9 Jun 2020 at 00:47, <edmondztt@gmail.com> wrote:
BTW the result I got from this code looks exactly the same as the
graphene case. For an identity matrix it should be a flat band and the DOS should just show a peak, right?
participants (3)
-
Anton Akhmerov
-
Edmond
-
edmondztt@gmail.com