def split_schrodinger_graph(schrodinger_result, trim_levels_beyond=1e-2, linewidth=1, scale=0.03, suppress_invert=False, probability_density=False, wfalpha=0.8, potentialalpha=0.8, **kwargs): options = copy.copy(defaults) options["square"] = False defaults.update(kwargs) potentials = schrodinger_result["potentials"] wavefunctions = schrodinger_result["wavefunctions"] energy_levels = schrodinger_result["E"] x = schrodinger_result["x"] if 'EU' in energy_levels.keys(): energy_levels['Ehh'] = energy_levels['EU'] energy_levels['Elh'] = energy_levels['EU'] wavefunctions["psi_hh"] = wavefunctions["psi_g1"] wavefunctions["psi_lh"] = wavefunctions["psi_g2"] conduction_data = [GraphData(x, potentials["Ve"], linewidth=2, color="grey", alpha=potentialalpha)] valence_data = [ GraphData(x, potentials["Vlh"], linewidth=2, color="grey", alpha=potentialalpha, dashes=[1, 1], label="Vlh"), GraphData(x, potentials["Vhh"], linewidth=2, color="grey", alpha=potentialalpha, label="Vhh") ] # normalise_psi = lambda p:p/numpy.sqrt(numpy.trapz(x=x*1e9,y=p**2))*q conduction_data.extend( prepare_wavefunction_data(x, energy_levels["Ee"], wavefunctions["psi_e"], trim_levels_beyond, linewidth, "blue", scale, suppress_invert, alpha=wfalpha, square=probability_density)) valence_data.extend( prepare_wavefunction_data(x, energy_levels["Ehh"], wavefunctions["psi_hh"], trim_levels_beyond, linewidth, "green", scale, suppress_invert, alpha=wfalpha, square=probability_density)) valence_data.extend( prepare_wavefunction_data(x, energy_levels["Elh"], wavefunctions["psi_lh"], trim_levels_beyond, linewidth, "red", scale, suppress_invert, alpha=wfalpha, square=probability_density)) g = Graph(valence_data, subplot=212, **options) del options["xlabel"] g.add_subplot(conduction_data, subplot=211, **options) # g.axis.get_xaxis().set_ticklabels([]) return g
def wavefunctions_graph( x, Ee=None, psi_e=None, Ehh=None, psi_hh=None, Elh=None, psi_lh=None, trim_levels_beyond=1e-3, linewidth=1, scale=0.06, colour_by_band=True, **kwargs): global defaults options = copy.copy(defaults) options.update(kwargs) data = [] # normalise_psi = lambda p:p/numpy.sqrt(numpy.trapz(x=x*1e9,y=p**2))*q if Ee is not None: data.extend( prepare_wavefunction_data(x, Ee, psi_e, trim_levels_beyond, linewidth, "blue", scale, label="e")) if Ehh is not None: data.extend( prepare_wavefunction_data(x, Ehh, psi_hh, trim_levels_beyond, linewidth, "green", scale, label="hh")) if Elh is not None: data.extend( prepare_wavefunction_data(x, Elh, psi_lh, trim_levels_beyond, linewidth, "red", scale, label="lh")) g = Graph(data, **options) return g
def structure_graph(structure, **kwargs): global defaults options = copy.copy(defaults) options.update(kwargs) current_x = 0 x = [] conduction = [] valence = [] for layer in structure: x.append(current_x) conduction.append(layer.Ec) conduction.append(layer.Ec) valence.append(layer.Ev) valence.append(layer.Ev) current_x += layer.width x.append(current_x) # x = np.array(x) # conduction = np.array(conduction) # valence = np.array(valence) g = Graph( GraphData(x, conduction, label="Conduction Band", linewidth=2, color="black"), GraphData(x, valence, label="Valence Band", linewidth=2, color="black"), **options ) return g
def potentials_graph(x, Ve=None, Vhh=None, Vlh=None, color="grey", **kwargs): global defaults options = copy.copy(defaults) options.update(kwargs) data = [] normalise_psi = lambda p: p * q * 5e-6 if Ve is not None: data.append(GraphData(x, Ve, color=color, linewidth=2, label="Ve")) if Vlh is not None: data.append(GraphData(x, Vlh, color=color, linewidth=2, dashes=[1, 1], label="Vlh")) if Vhh is not None: data.append(GraphData(x, Vhh, color=color, linewidth=2, label="Vhh")) g = Graph(data, **options) return g
curves = [ GraphData(E, adachi_alpha_data / 100, label="adachi-Generated Data", linewidth=2, color="red"), GraphData(E, solcore_alpha_data / 100, label="Default Solcore Data", linewidth=2, color="grey"), ] g = Graph(curves, yscale="log", legend="best", xlim=(0, 6), ylim=(1000, 1e7)).draw() curves = [ GraphData(E, nn, label="n", linewidth=2, color="red"), GraphData(E, kk, label="k", linewidth=2, color="grey"), ] g = Graph(curves, yscale="log", legend="best", xlim=(0, 6), ylim=(1e-3, 10)).draw()