Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Lucas Laplanche
EAM VCSEL
Commits
44db9726
Commit
44db9726
authored
Apr 30, 2021
by
Lucas Laplanche
Browse files
erreur dans tmm meshgrid
parent
4d3ee0fa
Changes
4
Show whitespace changes
Inline
Side-by-side
calculation.py
View file @
44db9726
...
...
@@ -8,6 +8,7 @@ import plot as plt
import
quantum
as
qt
import
scipy.io
import
super_lattice_structure
as
st
from
globals
import
T
...
...
@@ -31,6 +32,12 @@ def reflectivity(bypass_dbr=True, start_wavelength=820e-9, stop_wavelength=880e-
plt
.
plot_reflectivity
(
wavelength
,
r
)
def
reflectivity_meshgrid
(
temperature
=
T
,
bypass_dbr
=
True
,
start_wavelength
=
820e-9
,
stop_wavelength
=
880e-9
,
electric_field
=
0.
,
n_points
=
100
):
wavelength
=
np
.
linspace
(
start_wavelength
,
stop_wavelength
,
num
=
n_points
)
time
,
r
=
op
.
reflectivity_meshgrid
(
bypass_dbr
,
electric_field
,
wavelength
,
temperature
)
plt
.
plot_reflectivity_heatmap
(
wavelength
,
time
,
r
)
def
electromagnetic_amplitude
(
bypass_dbr
=
True
,
electric_field
=
0.
,
wavelength
=
850e-9
):
...
...
optic.py
View file @
44db9726
...
...
@@ -3,6 +3,7 @@ from scipy.linalg import expm
from
tqdm
import
tqdm
import
pandas_tools
as
pt
import
super_lattice_structure
as
st
from
globals
import
C
,
EPS0
,
HEV
,
N0
,
NGAAS
,
T
from
sqw_lengyel_absorption
import
gaas_sqw_absorption_at_wavelength
...
...
@@ -10,7 +11,7 @@ from sqw_lengyel_absorption import gaas_sqw_absorption_at_wavelength
def
algaas_super_lattice_refractive_index
(
super_lattice
,
electric_field
,
wavelength
):
def
algaas_super_lattice_refractive_index
(
super_lattice
,
electric_field
,
wavelength
,
temperature
=
T
):
for
i
in
range
(
len
(
super_lattice
)):
name
=
super_lattice
.
at
[
i
,
'name'
]
al
=
super_lattice
.
at
[
i
,
'al'
]
...
...
@@ -31,7 +32,7 @@ def algaas_super_lattice_refractive_index(super_lattice, electric_field, wavelen
# if refractive index has never been calculated
if
calculated_qw_layers
.
empty
:
# refractive index value
n
=
afromovitz_varshni_real_algaas_refractive_index
(
al
,
wavelength
)
n
=
afromovitz_varshni_real_algaas_refractive_index
(
al
,
wavelength
,
temperature
=
temperature
)
# confinement barrier aluminium content
al
=
confinement_barrier_mean_al_content
(
super_lattice
,
i
)
# [1]
...
...
@@ -57,7 +58,7 @@ def algaas_super_lattice_refractive_index(super_lattice, electric_field, wavelen
# layer is NOT a quantum well
else
:
# refractive index value
n
=
afromovitz_varshni_real_algaas_refractive_index
(
al
,
wavelength
)
n
=
afromovitz_varshni_real_algaas_refractive_index
(
al
,
wavelength
,
temperature
=
temperature
)
na
=
super_lattice
.
at
[
i
,
'na'
]
nd
=
super_lattice
.
at
[
i
,
'nd'
]
...
...
@@ -136,6 +137,26 @@ def reflection(n, d, wavelength):
return
np
.
abs
(
((
N0
*
e_m
-
h_m
)
/
(
N0
*
e_m
+
h_m
))
**
2
)
def
reflection_with_intermediary_values
(
n
,
d
,
wavelength
):
# reflection array
r
=
np
.
zeros
(
np
.
size
(
n
))
# element matrix
m
=
np
.
identity
(
2
)
for
i
in
range
(
np
.
size
(
n
)):
m
=
np
.
matmul
(
m
,
element_matrix
(
n
[
i
],
d
[
i
],
wavelength
))
# electromagnetic field element amplitude
[
e_m
,
h_m
]
=
np
.
matmul
(
m
,
np
.
array
([
1
,
NGAAS
]))
# eta_s = NGAAS since theta = 0
# reflection
r
[
i
]
=
np
.
abs
(((
N0
*
e_m
-
h_m
)
/
(
N0
*
e_m
+
h_m
))
**
2
)
return
r
def
absorption
(
n
,
d
,
wavelength
):
# element matrix
m
=
np
.
identity
(
2
)
...
...
@@ -171,6 +192,44 @@ def reflectivity(bypass_dbr, electric_field, wavelength):
return
r
def
reflectivity_meshgrid
(
bypass_dbr
,
electric_field
,
wavelength
,
temperature
):
# get the dimension of the dataframe
df
=
st
.
structure_eam
(
bypass_dbr
=
bypass_dbr
)
dim
=
df
.
shape
[
0
]
# create empty reflection map
r_meshgrid
=
np
.
zeros
((
len
(
wavelength
),
dim
))
# add the depth column
pt
.
add_depth_column
(
df
)
# extract the depth column
depth
=
df
[
'depth'
].
to_numpy
()
growth_speed
=
1.
# [um/h]
growth_speed
*=
1e-6
# [m/h]
growth_speed
/=
3600.
# [m/s]
# calculate the layer epitaxial time
time
=
growth_speed
*
depth
# wavelength in [m]
# wavelength must be a numpy array
for
i
in
tqdm
(
range
(
len
(
wavelength
))):
sl
=
st
.
structure_eam
(
bypass_dbr
=
bypass_dbr
)
sl
=
algaas_super_lattice_refractive_index
(
sl
,
electric_field
,
wavelength
[
i
],
temperature
)
n
=
sl
[
'refractive_index'
].
to_numpy
(
dtype
=
np
.
complex128
)
d
=
sl
[
'thickness'
].
to_numpy
(
dtype
=
np
.
complex128
)
# reflection array
r
=
reflection_with_intermediary_values
(
n
,
d
,
wavelength
[
i
])
# insert the reflection array
# into the corresponding wavelength column of the reflection map
fill_array_row
(
r_meshgrid
,
r
,
i
)
return
time
,
r_meshgrid
def
afromovitz_real_algaas_refractive_index
(
al
,
wavelength
):
...
...
@@ -225,8 +284,8 @@ def afromovitz_simplified_real_algaas_refractive_index(al, wavelength):
return
n
def
afromovitz_varshni_real_algaas_refractive_index
(
al
,
wavelength
):
t_c
=
T
-
273.15
def
afromovitz_varshni_real_algaas_refractive_index
(
al
,
wavelength
,
temperature
=
T
):
t_c
=
temperature
-
273.15
e
=
HEV
*
C
/
wavelength
e_1
=
-
0.000402347826086942
*
t_c
+
3.65714869565217
...
...
@@ -411,23 +470,23 @@ def scattering_matrix_layer(vi, vg, xi):
return
s
def
redheffer_star_product
(
s
a
,
s
b
):
ba
=
np
.
matmul
(
s
b
[
0
,
0
],
s
a
[
1
,
1
])
ab
=
np
.
matmul
(
s
a
[
1
,
1
],
s
b
[
0
,
0
])
def
redheffer_star_product
(
s
g
,
s
i
):
ig
=
np
.
matmul
(
s
i
[
0
,
0
],
s
g
[
1
,
1
])
gi
=
np
.
matmul
(
s
g
[
1
,
1
],
s
i
[
0
,
0
])
d
=
np
.
matmul
(
s
a
[
0
,
1
],
np
.
linalg
.
inv
(
np
.
identity
(
2
)
-
ba
))
f
=
np
.
matmul
(
s
b
[
1
,
0
],
np
.
linalg
.
inv
(
np
.
identity
(
2
)
-
ab
))
d
=
np
.
matmul
(
s
g
[
0
,
1
],
np
.
linalg
.
inv
(
np
.
identity
(
2
)
-
ig
))
f
=
np
.
matmul
(
s
i
[
1
,
0
],
np
.
linalg
.
inv
(
np
.
identity
(
2
)
-
gi
))
s
ab
=
np
.
array
([[
s
a
[
0
,
0
]
+
np
.
matmul
(
np
.
matmul
(
d
,
s
b
[
0
,
0
]),
s
a
[
1
,
0
]),
np
.
matmul
(
d
,
s
b
[
0
,
1
])
s
=
np
.
array
([[
s
g
[
0
,
0
]
+
np
.
matmul
(
np
.
matmul
(
d
,
s
i
[
0
,
0
]),
s
g
[
1
,
0
]),
np
.
matmul
(
d
,
s
i
[
0
,
1
])
],
[
np
.
matmul
(
f
,
s
a
[
1
,
0
]),
s
b
[
1
,
1
]
+
np
.
matmul
(
np
.
matmul
(
f
,
s
a
[
1
,
1
]),
s
b
[
0
,
1
])
np
.
matmul
(
f
,
s
g
[
1
,
0
]),
s
i
[
1
,
1
]
+
np
.
matmul
(
np
.
matmul
(
f
,
s
g
[
1
,
1
]),
s
i
[
0
,
1
])
]])
return
s
ab
return
s
def
em_amplitude_smm
(
super_lattice
,
wavelength
):
...
...
@@ -474,12 +533,6 @@ def em_amplitude_smm(super_lattice, wavelength):
# update global scattering matrix
s_global
=
redheffer_star_product
(
s_global
,
s_i
)
# calculate transmitted and reflected fields
e_ref
=
np
.
matmul
(
s_global
[
0
,
0
],
np
.
array
([
1.
,
0.
])
)
e_trm
=
np
.
matmul
(
s_global
[
1
,
0
],
np
.
array
([
1.
,
0.
])
)
amplitude
=
np
.
abs
(
e_ref
[
0
]
+
e_trm
[
0
])
**
2
e
=
np
.
append
(
e
,
amplitude
)
# compute reflection side scattering matrix
# s_reflection =
...
...
@@ -517,3 +570,12 @@ def confinement_barrier_mean_al_content(super_lattice, i):
return
al
def
fill_array_row
(
m
,
v
,
i
):
# m is a matrix of shape [len(v), ?]
for
x
in
range
(
len
(
v
)):
m
[
i
,
x
]
=
v
[
x
]
return
m
\ No newline at end of file
pandas_tools.py
View file @
44db9726
...
...
@@ -99,6 +99,22 @@ def cut_in_equal_layers_thickness(super_lattice, step):
def
add_depth_column
(
super_lattice
):
# check wether the depth column exist
if
not
'depth'
in
super_lattice
:
super_lattice
.
insert
(
super_lattice
.
shape
[
1
],
'depth'
,
value
=
np
.
nan
)
# calculate the depth of every layer
for
i
in
range
(
super_lattice
.
shape
[
0
]):
super_lattice
.
at
[
i
,
'depth'
]
=
super_lattice
.
loc
[
0
:
i
,
'thickness'
].
sum
()
return
super_lattice
def
fexp
(
number
):
(
sign
,
digits
,
exponent
)
=
Decimal
(
number
).
as_tuple
()
return
len
(
digits
)
+
exponent
-
1
...
...
plot.py
View file @
44db9726
...
...
@@ -318,6 +318,15 @@ def plot_reflectivity(wavelength, r):
fig
.
show
()
def
plot_reflectivity_heatmap
(
wavelength
,
time
,
r
):
fig
=
go
.
Figure
(
data
=
go
.
Heatmap
(
x
=
time
,
y
=
wavelength
,
z
=
r
,
))
# show the figure
fig
.
show
()
def
plot_psie
(
lz
=
0.01e-9
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment