Re: [Kwant] Issue in display wave function in 3D lattice
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 Jwrote: > 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 2-d. Then I plot the wavefunction calculated by > 3-d on the 2-d 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 > wrote: >> >> Hi Liming, >> >> I believe this is related to a known outstanding bug: >> https://gitlab.kwant-project.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 wrote: >> > Dear all >> > >> > I was trying to plot the wavefunction on each site of a 3-D 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://kwant-project.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 2-D lattice plot. However, it cannot >> > display >> > the wavefunction properly in 3-d lattice. My question is, how can I plot >> > the >> > wavefunction in 3-d lattice clearly? (Or maybe I can force the kwant to >> > plot >> > it in 2-d by configuring the kwant.plot?) >> > >> > Thank you for advance. >> > >> > Sincerely, >> > >> > Liming > >
Re: [Kwant] Issue in display wave function in 3D lattice
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 2-d. Then I plot the wavefunction calculated by 3-d on the 2-d 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 Akhmerovwrote: > Hi Liming, > > I believe this is related to a known outstanding bug: > https://gitlab.kwant-project.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 wrote: > > Dear all > > > > I was trying to plot the wavefunction on each site of a 3-D 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://kwant-project.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 2-D lattice plot. However, it cannot > display > > the wavefunction properly in 3-d lattice. My question is, how can I plot > the > > wavefunction in 3-d lattice clearly? (Or maybe I can force the kwant to > plot > > it in 2-d by configuring the kwant.plot?) > > > > Thank you for advance. > > > > Sincerely, > > > > Liming >
Re: [Kwant] Issue in display wave function in 3D lattice
Hi Liming, I believe this is related to a known outstanding bug: https://gitlab.kwant-project.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 Jwrote: > Dear all > > I was trying to plot the wavefunction on each site of a 3-D 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://kwant-project.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 2-D lattice plot. However, it cannot display > the wavefunction properly in 3-d lattice. My question is, how can I plot the > wavefunction in 3-d lattice clearly? (Or maybe I can force the kwant to plot > it in 2-d by configuring the kwant.plot?) > > Thank you for advance. > > Sincerely, > > Liming