Dear all I was trying to plot the wavefunction on each site of a 3D lattice and each site is described by a 4x4 matrix. However, it turned out the that plotted wave function is overlapped with the surrounding site and I could not identify the magnitude of wave function on each site. The code I had implemented for plotting was the same as the codes in " http://kwantproject.org/doc/1.0/tutorial/tutorial6" with a copy of specific plot command as below. I have varied the value "3" before wf[i] to tune the size however it turned out this value cannot tune the plot size of the wavefunction. I think I'm not doing it correctly. def site_size(i): return 3 * wf[i] / wf.max() kwant.plot(sys, site_size=site_size, site_color=(0, 0, 1, 0.3), hop_lw=0.1) This method works perfectly for 2D lattice plot. However, it cannot display the wavefunction properly in 3d lattice. My question is, how can I plot the wavefunction in 3d lattice clearly? (Or maybe I can force the kwant to plot it in 2d by configuring the kwant.plot?) Thank you for advance. Sincerely, Liming
Hi Liming, I believe this is related to a known outstanding bug: https://gitlab.kwantproject.org/kwant/kwant/issues/39 What version of matplotlib you are using? Best, Anton On Wed, Jul 20, 2016 at 2:58 AM, L.M J <heysuperming@gmail.com> wrote:
Dear all
I was trying to plot the wavefunction on each site of a 3D lattice and each site is described by a 4x4 matrix. However, it turned out the that plotted wave function is overlapped with the surrounding site and I could not identify the magnitude of wave function on each site. The code I had implemented for plotting was the same as the codes in "http://kwantproject.org/doc/1.0/tutorial/tutorial6" with a copy of specific plot command as below.
I have varied the value "3" before wf[i] to tune the size however it turned out this value cannot tune the plot size of the wavefunction. I think I'm not doing it correctly.
def site_size(i): return 3 * wf[i] / wf.max()
kwant.plot(sys, site_size=site_size, site_color=(0, 0, 1, 0.3), hop_lw=0.1)
This method works perfectly for 2D lattice plot. However, it cannot display the wavefunction properly in 3d lattice. My question is, how can I plot the wavefunction in 3d lattice clearly? (Or maybe I can force the kwant to plot it in 2d by configuring the kwant.plot?)
Thank you for advance.
Sincerely,
Liming
Hi Anton My matplotlib version is 1.5.1. Can I solve this problem by updating the matplotlib package? I came out another way to get around with this bug. I built a system that has same sites except it is 2d. Then I plot the wavefunction calculated by 3d on the 2d system. It seems works, but I'm not sure whether this is a right way to do. Is this accurate? Thanks Sincerely, Liming On 27 July 2016 at 00:27, Anton Akhmerov <anton.akhmerov+kd@gmail.com> wrote:
Hi Liming,
I believe this is related to a known outstanding bug: https://gitlab.kwantproject.org/kwant/kwant/issues/39
What version of matplotlib you are using?
Best, Anton
Dear all
I was trying to plot the wavefunction on each site of a 3D lattice and each site is described by a 4x4 matrix. However, it turned out the that
wave function is overlapped with the surrounding site and I could not identify the magnitude of wave function on each site. The code I had implemented for plotting was the same as the codes in "http://kwantproject.org/doc/1.0/tutorial/tutorial6" with a copy of specific plot command as below.
I have varied the value "3" before wf[i] to tune the size however it turned out this value cannot tune the plot size of the wavefunction. I think I'm not doing it correctly.
def site_size(i): return 3 * wf[i] / wf.max()
kwant.plot(sys, site_size=site_size, site_color=(0, 0, 1, 0.3), hop_lw=0.1)
This method works perfectly for 2D lattice plot. However, it cannot display the wavefunction properly in 3d lattice. My question is, how can I plot
wavefunction in 3d lattice clearly? (Or maybe I can force the kwant to
On Wed, Jul 20, 2016 at 2:58 AM, L.M J <heysuperming@gmail.com> wrote: plotted the plot
it in 2d by configuring the kwant.plot?)
Thank you for advance.
Sincerely,
Liming
Hi Liming, As far as I know, upgrading won't help: the bug is due to some changes in recent versions of matplotlib. As far as workarounds go, you could use the argument `pos_transform` of the plotter to map the 3D system into 2D instead of defining a different one. Or you can take a look at the bug and help fix it :) Best, Anton On Tue, Jul 26, 2016 at 9:31 PM, L.M J <heysuperming@gmail.com> wrote:
Hi Anton
My matplotlib version is 1.5.1. Can I solve this problem by updating the matplotlib package?
I came out another way to get around with this bug. I built a system that has same sites except it is 2d. Then I plot the wavefunction calculated by 3d on the 2d system. It seems works, but I'm not sure whether this is a right way to do. Is this accurate?
Thanks
Sincerely, Liming
On 27 July 2016 at 00:27, Anton Akhmerov <anton.akhmerov+kd@gmail.com> wrote:
Hi Liming,
I believe this is related to a known outstanding bug: https://gitlab.kwantproject.org/kwant/kwant/issues/39
What version of matplotlib you are using?
Best, Anton
On Wed, Jul 20, 2016 at 2:58 AM, L.M J <heysuperming@gmail.com> wrote:
Dear all
I was trying to plot the wavefunction on each site of a 3D lattice and each site is described by a 4x4 matrix. However, it turned out the that plotted wave function is overlapped with the surrounding site and I could not identify the magnitude of wave function on each site. The code I had implemented for plotting was the same as the codes in "http://kwantproject.org/doc/1.0/tutorial/tutorial6" with a copy of specific plot command as below.
I have varied the value "3" before wf[i] to tune the size however it turned out this value cannot tune the plot size of the wavefunction. I think I'm not doing it correctly.
def site_size(i): return 3 * wf[i] / wf.max()
kwant.plot(sys, site_size=site_size, site_color=(0, 0, 1, 0.3), hop_lw=0.1)
This method works perfectly for 2D lattice plot. However, it cannot display the wavefunction properly in 3d lattice. My question is, how can I plot the wavefunction in 3d lattice clearly? (Or maybe I can force the kwant to plot it in 2d by configuring the kwant.plot?)
Thank you for advance.
Sincerely,
Liming
participants (2)

Anton Akhmerov

L.M J