def test_equal_wavenumbers_for_type_two_eh(): """Tests if the wavenumbers of the electron/hole wavefunctions are equal, given all relevant variables are equal. """ a = Material(1.0, 0.0, 1.0, 1.0, 1.0) b = Material(1.0, -0.5, 1.0, 1.0, 1.0) # Lower band edges. csnc = CoreShellParticle(a, b, 1.0, 1.0) # Type 1 CSNC. electron_core_wavenumber, electron_shell_wavenumber, hole_core_wavenumber, hole_shell_wavenumber = ( csnc.calculate_wavenumbers()) test.assert_allclose(electron_core_wavenumber, hole_shell_wavenumber) test.assert_allclose(electron_shell_wavenumber, hole_core_wavenumber)
def test_wavenumbers_are_order_unity(): """Tests that wavenumbers are approximately around 1. """ a = Material(1.0, 0.0, 1.0, 1.0, 1.0) b = Material(1.0, -0.5, 1.0, 1.0, 1.0) # Lower band edges. csnc1 = CoreShellParticle(a, b, 1.0, 1.0) # Type 2 CSNC. h/e structure. wavenumbers = csnc1.calculate_wavenumbers() assert np.all( np.logical_and(1e-1 < abs(wavenumbers), abs(wavenumbers) < 10))
from pyncband import Material, CoreShellParticle if __name__ == "__main__": AlSb = Material(1.6, -2.9, 0.12, 0.98, 2, "AlSb") CdS = Material(2.4, -3.5, 0.21, 0.8, 3, "CdS") test.assert_almost_equal(AlSb.vbe, -4.5) test.assert_almost_equal(CdS.vbe, -5.9) CdS_AlSb = CoreShellParticle(CdS, AlSb, 5, 3) AlSb_CdS = CoreShellParticle(AlSb, CdS, 5, 3) assert CdS_AlSb.type_two, "CdS/AlSb is is a type 2 QD" assert CdS_AlSb.e_h, "CdS/AlSb should be e-h core-shell." assert AlSb_CdS.type_two, "AlSb/CdS is is a type 2 QD" assert AlSb_CdS.h_e, "AlSb/CdS should be h-e core-shell." print(CdS_AlSb.ue) print(CdS_AlSb.calculate_wavenumbers()) # print(CdS_AlSb.calculate_s1_energies()) # s1_e_CdS_AlSb, s1_h_CdS_AlSb = CdS_AlSb.calculate_s1_energies() # print("S1 energy:", s1_e_CdS_AlSb) # ke, qe = CdS_AlSb.calculate_wavenumbers() # print("Electron wavevector in core and shell:", ke, qe) """ x, dx = np.linspace(1e-14, 10, 1000, retstep=True) wf = CdS_AlSb.plot_electron_wavefunction(x, ke, qe) plt.plot(x, wf * wf) plt.show() print(CdS_AlSb.cmat.m_e, CdS_AlSb.smat.m_e) cme, sme = CdS_AlSb.cmat.m_e, CdS_AlSb.smat.m_e plt.plot(x, np.gradient(wf, dx) * np.where(x < CdS_AlSb.core_width, 1, 4)) # plt.xlim(4.8, 5.2) plt.show() """