PLaSK library
Loading...
Searching...
No Matches
newgain.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2# This file is part of PLaSK (https://plask.app) by Photonics Group at TUL
3# Copyright (c) 2022 Lodz University of Technology
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation, version 3.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12# GNU General Public License for more details.
13
14import unittest
15
16from numpy import *
17
18from plask import *
19from plask import material, geometry, mesh
20from gain import WasiakNew2D
21
22@material.simple()
24 def lattC(T=300., x='a'): return 5.5
25 def nr(self, wl, T=300., n=0.): return 4.0
26 def Eg(self, T=300., e=0., point='G'): return 0.5
27 def VB(self, T=300., e=0., point='G', hole='H'): return 0.5
28 def VB(self, T=300., e=0., point='G', hole='L'): return 0.5
29 def CB(self, T=300., e=0., point='G'): return 1.0
30 def Dso(self, T=300., e=0.): return 0.35
31 def Me(self, T=300., e=0., point='G'): return 0.050
32 def Mhh(self, T=300., e=0.): return 0.200
33 def Mlh(self, T=300., e=0.): return 0.080
34
35@material.simple()
37 def Eg(self, T=300., e=0., point='G'): return 0.75
38 def VB(self, T=300., e=0., point='G', hole='H'): return 0.45
39 def VB(self, T=300., e=0., point='G', hole='L'): return 0.45
40 def CB(self, T=300., e=0., point='G'): return 1.2
41 def Dso(self, T=300., e=0.): return 0.35
42 def Me(self, T=300., e=0., point='G'): return 0.050
43 def Mhh(self, T=300., e=0.): return 0.200
44 def Mlh(self, T=300., e=0.): return 0.080
45
46@material.simple()
48 def Eg(self, T=300., e=0., point='G'): return 0.9
49 def VB(self, T=300., e=0., point='G', hole='H'): return 0.4
50 def VB(self, T=300., e=0., point='G', hole='L'): return 0.4
51 def CB(self, T=300., e=0., point='G'): return 1.3
52 def Dso(self, T=300., e=0.): return 0.35
53 def Me(self, T=300., e=0., point='G'): return 0.050
54 def Mhh(self, T=300., e=0.): return 0.200
55 def Mlh(self, T=300., e=0.): return 0.080
56
57@material.simple()
59 def Eg(self, T=300., e=0., point='G'): return 1.5
60
61@material.simple()
63 def Eg(self, T=300., e=0., point='G'): return 1.5
64
66
67 def setUp(self):
68 self.solver = WasiakNew2D("GAIN")
70
72 self.rect1.role = 'substrate'
73 self.rect2 = geometry.Rectangle(10., 0.01, Cladding())
74 self.rect3 = geometry.Rectangle(10., 0.01, Barrier())
75 self.rect4 = geometry.Rectangle(10., 0.01, Well())
76 self.rect4.role = 'QW'
77 self.rect5 = geometry.Rectangle(10., 0.01, Barrier())
78 self.rect6 = geometry.Rectangle(10., 0.01, Cladding())
79 self.rect7 = geometry.Rectangle(10., 0.02, Cap())
80 stack_active = geometry.Stack2D()
81 stack_main = geometry.Stack2D()
85 stack_active.role = 'active'
88 stack_main.append(stack_active)
91
92 space = geometry.Cartesian2D(stack_main, left="mirror")
93 self.solver.geometry = space
94
95 self.solver.lifetime = 0.10
96 self.solver.roughness = 0.05
97 self.solver.matrix_elem = 10.
98 self.solver.matrix_elem_sc_fact = 1.
99 self.solver.cond_qw_shift = 0.000
100 self.solver.vale_qw_shift = 0.000
101 self.solver.strains = False
102 self.solver.build_struct_once = False
103 self.solver.Tref = 300.
104
106
107 self.solver.inTemperature = 300.0
108 self.solver.inCarriersConcentration = 4e18
109
110 self.solver.invalidate()
111
112 wavelengths = linspace(1500, 2500, 101)
113 print(wavelengths)
114 peak = 0.
115 actlevel = 0.025
116 spectrum = self.solver.spectrum(5, actlevel)
117 gains = spectrum(wavelengths)
118 peak = max(zip(wavelengths,gains), key=lambda wg: wg[1])
119 print("Gain peak: {}".format(peak[0]))
120 print(gains)
121 self.assertAlmostEqual(peak[0], 2180, 1)
122
124
125 self.solver.inTemperature = 300.0
126 self.solver.inCarriersConcentration = 4e18
127
128 e = 0.001
129 axis0 = plask.mesh.Regular(0.+e, 10.-e, 3)
130 axis1 = plask.mesh.Regular(0.+e, 0.050-e, 3)
131 msh = mesh.Rectangular2D(axis0, axis1)
132
133 print("Mesh:")
134 for i in range(9):
135 print(msh[i])
136
137 self.solver.inTemperature = 300.
138
139 print("Outgain:")
140 outgain = self.solver.outGain(msh,2000.)
141 for i in range(9):
142 print("[{}]: {}".format(i, outgain[i], "cm-1"))
143
144 self.assertAlmostEqual(outgain[1], 2527.548, 2)
145 self.assertAlmostEqual(outgain[4], 2527.548, 2)
146 self.assertAlmostEqual(outgain[7], 2527.548, 2)
147
148
149if __name__ == '__main__':
150 test = unittest.main(exit=False)