def test_64_quantum_mechanics_schrodinger(self): bulk = material("GaAs")(T=293) barrier = material("GaAsP")(T=293, P=0.1) bulk.strained = False barrier.strained = True top_layer = Layer(width=si("30nm"), material=bulk) inter = Layer(width=si("3nm"), material=bulk) barrier_layer = Layer(width=si("15nm"), material=barrier) bottom_layer = top_layer E = np.linspace(1.15, 1.5, 300) * q alfas = np.zeros((len(E), 6)) alfas[:, 0] = E / q alpha_params = { "well_width": si("7.2nm"), "theta": 0, "eps": 12.9 * vacuum_permittivity, "espace": E, "hwhm": si("6meV"), "dimensionality": 0.16, "line_shape": "Gauss" } QW = material("InGaAs")(T=293, In=0.2) QW.strained = True well_layer = Layer(width=si("7.2nm"), material=QW) my_structure = Structure( [top_layer, barrier_layer, inter] + 1 * [well_layer, inter, barrier_layer, inter] + [bottom_layer], substrate=bulk) band_edge, bands = QM.schrodinger(my_structure, quasiconfined=0, num_eigenvalues=20, alpha_params=alpha_params, calculate_absorption=True) for key in band_edge['E']: for i in range(len(band_edge['E'][key])): band_edge['E'][key][i] = solcore.asUnit( band_edge['E'][key][i], 'eV') * 1000 band_edge['E'][key][i] = round(band_edge['E'][key][i]) Ehh = np.all(np.equal(band_edge['E']['Ehh'], my_energies['Ehh'])) Elh = np.all(np.equal(band_edge['E']['Elh'], my_energies['Elh'])) Ee = np.all(np.equal(band_edge['E']['Ee'], my_energies['Ee'])) idx = 100 out = [band_edge['alpha'][0][idx] / q, band_edge['alpha'][1][idx]] # Test over the energies self.assertTrue(Ehh and Elh and Ee) # Test over the absorption coefficent at a given energy for i, data in enumerate(out): self.assertAlmostEqual(out[i], my_absorption[i])
# The following lines create the QW structure, with different number of QWs and interlayers # test_structure = Structure([top_layer, barrier_layer, inter] + 1 * [well_layer, inter, barrier_layer, inter] + # [bottom_layer]) test_structure = Structure([barrier_layer, inter] + 1 * [well_layer, inter] + [barrier_layer]) # test_structure = Structure([top_layer, barrier_layer] + 1 * [well_layer, barrier_layer] + # [bottom_layer]) test_structure.substrate = bulk # Finally, the quantum properties are claculated here output = QM.schrodinger(test_structure, quasiconfined=0, num_eigenvalues=20, alpha_params=alpha_params, calculate_absorption=True) alfa = output[0]['alphaE'](E) plt.plot(1240 / (E / q), alfa / 100, label='{}%'.format(int(i * 100))) alfas[:, j + 1] = alfa / 100 plt.xlim(826, 1100) plt.ylim(0, 23000) plt.xlabel('Wavelength (nm)') plt.ylabel('$\\alpha$ cm$^{-1}$') plt.legend(loc='upper right', frameon=False) plt.tight_layout() plt.show()
"dimensionality": 0.16, "line_shape": "Gauss" } # We create the QW material at the given composition QW = material("InGaAs")(T=293, In=0.15) QW.strained = True # And the layer well_layer = Layer(width=si("7.2nm"), material=QW) # The following lines create the QW structure, with different number of QWs and interlayers # test_structure = Structure([top_layer, barrier_layer, inter] + 10 * [well_layer, inter, barrier_layer, inter] + # [bottom_layer]) # test_structure = Structure([barrier_layer, inter] + 1 * [well_layer, inter] + # [barrier_layer]) test_structure = Structure([top_layer, barrier_layer] + 10 * [well_layer, barrier_layer] + [bottom_layer]) test_structure.substrate = bulk # Finally, the quantum properties are claculated here output = QM.schrodinger(test_structure, quasiconfined=0, graphtype='potentials', num_eigenvalues=50, alpha_params=alpha_params, calculate_absorption=True)
def test_quantum_mechanics_schrodinger(): """ Testing schrodinger equation solver """ bulk = material("GaAs")(T=293) barrier = material("GaAsP")(T=293, P=0.1) bulk.strained = False barrier.strained = True top_layer = Layer(width=si("30nm"), material=bulk) inter = Layer(width=si("3nm"), material=bulk) barrier_layer = Layer(width=si("15nm"), material=barrier) bottom_layer = top_layer E = np.linspace(1.15, 1.5, 300) * q alfas = np.zeros((len(E), 6)) alfas[:, 0] = E / q alpha_params = { "well_width": si("7.2nm"), "theta": 0, "eps": 12.9 * vacuum_permittivity, "espace": E, "hwhm": si("6meV"), "dimensionality": 0.16, "line_shape": "Gauss", } QW = material("InGaAs")(T=293, In=0.2) QW.strained = True well_layer = Layer(width=si("7.2nm"), material=QW) my_structure = Structure( [ top_layer, barrier_layer, inter, well_layer, inter, barrier_layer, inter, bottom_layer, ], substrate=bulk, ) band_edge, bands = QM.schrodinger( my_structure, quasiconfined=0, num_eigenvalues=20, alpha_params=alpha_params, calculate_absorption=True, ) for key in band_edge["E"]: for i in range(len(band_edge["E"][key])): band_edge["E"][key][i] = solcore.asUnit(band_edge["E"][key][i], "eV") * 1000 band_edge["E"][key][i] = round(band_edge["E"][key][i]) Ehh = np.all(np.equal(band_edge["E"]["Ehh"], my_energies["Ehh"])) Elh = np.all(np.equal(band_edge["E"]["Elh"], my_energies["Elh"])) Ee = np.all(np.equal(band_edge["E"]["Ee"], my_energies["Ee"])) idx = 100 out = [band_edge["alpha"][0][idx] / q, band_edge["alpha"][1][idx]] # Test over the energies assert Ehh and Elh and Ee # Test over the absorption coefficent at a given energy for i, data in enumerate(out): assert out[i] == approx(my_absorption[i], rel=1e-4)
def solve(self, Efield=0, WLsteps=(300e-9, 1100e-9, 801), wavelengths=None, periodic=True, filter_strength=0.0, blur=None, blurmode="left", offset=0, mode='kp8x8_bulk', use_Adachi=False, calculate_absorption=True, alpha_params=None, T=293): """ Solves the structure, calculating the energy levels, the absorption, etc. """ if alpha_params == None: if wavelengths is None: self.wl = np.linspace(*WLsteps) else: self.wl = wavelengths E = 1240 / (self.wl * 1e9) * q alpha_params = { "well_width": self.QW_width, "theta": 0, "eps": 12.9 * vacuum_permittivity, "espace": E, "hwhm": si("4meV"), "dimensionality": 0.2, "line_shape": "Gauss" } else: self.wl = 1240 / (alpha_params["espace"] * 1e-9) * q SR, bands = schrodinger(self, mode=mode, periodic=True, calculate_absorption=calculate_absorption, Efield=Efield, blur=None, blurmode=blurmode, alpha_params=alpha_params, filter_strength=filter_strength) self.schrodinger = SR self.bands = bands self.__dict__["elevels"] = (SR["E"]["Ee"][:] - min(SR["potentials"]["Ve"])) / q self.__dict__["hhlevels"] = (max(SR["potentials"]["Vhh"]) - SR["E"]["Ehh"][:]) / q self.__dict__["lhlevels"] = (max(SR["potentials"]["Vlh"]) - SR["E"]["Elh"][:]) / q self.RecalculateBandEdges(mode, SR) self.RecalculateDensityOfStates(SR) if calculate_absorption: self.CalculateAbsorption(use_Adachi, SR) return SR
} # We create the QW material at the given composition QW = material("InGaAs")(T=293, In=0.15, strained=True) # And the layer well_layer = Layer(width=si("7.2nm"), material=QW) # The following lines create the QW structure, with different number of QWs and interlayers ## A single QW with interlayers # test_structure = Structure([top_layer, inter, well_layer, inter, bottom_layer]) ## 10 QWs without interlayers test_structure = Structure([top_layer, barrier_layer] + 10 * [well_layer, barrier_layer] + [bottom_layer]) test_structure.substrate = bulk # Finally, the quantum properties are claculated here output = QM.schrodinger(test_structure, quasiconfined=0.05, graphtype='potentialsLDOS', periodic=False, num_eigenvalues=200, alpha_params=alpha_params, calculate_absorption=False, Efield=0, show=True, pdf=False)
import solcore.quantum_mechanics as QM # First we create the materials we need bulk = material("GaAs")(T=293, strained=False) barrier = material("GaAsP")(T=293, P=0.1, strained=True) # As well as some of the layers top_layer = Layer(width=si("30nm"), material=barrier) inter = Layer(width=si("3nm"), material=bulk) barrier_layer = Layer(width=si("5nm"), material=barrier) bottom_layer = top_layer # We create the QW material at the given composition QW = material("InGaAs")(T=293, In=0.15, strained=True) # And the layer well_layer = Layer(width=si("7.2nm"), material=QW) # The following lines create the QW structure, with different number of QWs and interlayers. Indicating the substrate # material with the keyword "substrate" is essential in order to calculate correctly the strain. # A single QW with interlayers test_structure_1 = Structure([top_layer, inter, well_layer, inter, bottom_layer], substrate=bulk) output_1 = QM.schrodinger(test_structure_1, quasiconfined=0, graphtype='potentials', num_eigenvalues=20, show=True) # 10 QWs without interlayers test_structure_2 = Structure([top_layer, barrier_layer] + 10 * [well_layer, barrier_layer] + [bottom_layer], substrate=bulk) output_2 = QM.schrodinger(test_structure_2, quasiconfined=0.05, graphtype='potentialsLDOS', num_eigenvalues=200, show=True)