topocm / topocm_content

Course on topology in condensed matter
http://topocondmat.org
Other
281 stars 147 forks source link

w7_defects/ti_majoranas.ipynb densities**0.25? #145

Closed basnijholt closed 8 years ago

basnijholt commented 8 years ago

In the second plot of w7_defects/ti_majoranas.ipynb the densities are raised to the power 1/4th, and I have no idea why. Was this just to make the values visible? In that case we should remove the numbers, or don't use a linear cmap.

kwant.plotter.map(sys, densities[:,0]**0.25, cmap='gist_heat_r', show=False)

akhmerov commented 8 years ago

Your guess is correct. A nonliner cmap would be the best resolution.

basnijholt commented 8 years ago

What about:

import matplotlib.cm
import matplotlib.colors as mcolors
colors = matplotlib.cm.gist_heat_r(np.linspace(0, 1, 128)**.25)
nonlinearcmap = mcolors.LinearSegmentedColormap.from_list('nonlinearcmap', colors)

p = SimpleNamespace(t=1.0, mu=0.4, delta=0.5, phase=lambda x, y: np.angle(x+1j*y))
l = 60
w = 60
sys = make_2d_pwave(w, l)
energies, states, densities = calc_energies(sys, p, num_orbitals=2, num_states=10)
kwant.plotter.map(sys, densities[:,0], cmap=nonlinearcmap, show=False)
plt.show()

download 1

the image aims to show that the wf is mostly near the edge and center.

akhmerov commented 8 years ago

Looks good to me. The colorbar now needs to be truncated or hidden though :)

EDIT: an extra thing gist_heat_r_rescaled is probably better than nonlinearcolormap.

basnijholt commented 8 years ago

Renamed in a7be2ff.