-
Notifications
You must be signed in to change notification settings - Fork 5
tmm_optics
Simulation of the propagation of plane waves through an arbitrary layered system of thin-film stacks using optical matrices. Performs the calculation of reflectance, transmittance, absorptance, electromagnetic field and photonic bandgap (for photonic crystals only) using the transfer matrix formalism. This method supports the calculation of isotropic indices of refraction within one-dimensional (1D) media with uniform thickness for each layer. For further details see https://arxiv.org/abs/1809.07708.
Details about the main structures to construct the models can be found in Common Structures.
Examples are posted in the following pages, and the full code for them can be obtained from here.
- Example: Thin film single layer
- Example: Brewster's angle
- Example: Antireflection coating (AR)
- Example: Antireflection coating 2 (AR)
- Example: Multilayer-stack (DBR)
- Example: Multilayer-stack 2 (DBR)
- Example: Omnidirectional mirror
- Example: Fabry-Perot/Microcavity
The typical calling structure is as follow (check out the examples as well):
solution = tmm_optics(
beam, layers;
λ0=mean(beam.λ), emfflag=false, h=10, pbgflag=false,
)
Where tmm_optics
is the main function to compute the optical properties using ThinFilmsTools.jl
.
beam
can be constructed using the PlaneWave
subtype of LightSource
. It usually wraps the wavelength range and the angles of incidence. For example:
λ = 200:1000
θ = [0.] # normal incidence
beam = PlaneWave(λ, θ)
tmm_optics
performs the calculations by default for both types of polarisation, p/TM and s/TE, at every run. For more details see PlaneWave structure inside Common Structures.
To define each layer in the sequence, the LayerTMMO
structure is a Material
subtype exported to ensure the proper parameters are included. This subtype is thought for isotropic media (index of refraction). For instance, the structure of layers to simulate is set by letting the input layers
to collect the information defined before. For instance, to define a thin film single layer with a incident (air) and substrate (silicon) media, we can write:
layers = [
LayerTMMO(RIdb.air(beam.λ)),
LayerTMMO(RIdb.sno2f(beam.λ), d=250.),
LayerTMMO(RIdb.aluminum(beam.λ); type=:OT, d=1/2.),
LayerTMMO(RIdb.silicon(beam.λ)),
]
For more details, see LayerTMMO structure inside Common Structures.
The reference wavelength is used when the input of the thickness is given in units of the reference wavelength. If you defined the type=:OT
inside LayerTMMO
, then the geometrical thickness is calculated based on the reference wavelength and the index of refraction at the given wavelength (see LayerTMMO structure).
The reference wavelength is also used to compute the index of refraction at this wavelength (nλ0
) used to plot the profile of indices in PlottingTools.jl.
By default, the code assigns to the reference wavelength the average of the wavelength range.
emfflag::Bool
is a flag that indicates whether to compute the field distribution inside the multilayer or not. If emfflag=true
, the EMF is computed, while if emfflag=false
is not. This is useful especially when you just want the reflectance or transmission spectra information but not the field distribution. The default value is false
.
h::Int64
set the number of sub-layers the script will use to divide each layer defined in layers
to calculate the EMF. If you set emfflag=true
, then you might want to set this to, say 10
, to better visualize the field distribution. The default value is 10
. If emfflag=false
, then h
is neglected. Increasing the value of h
comes with a higher computing cost.
pbgflag::Bool
indicates whether to calculate or not the photonic dispersion. It is only useful when computing photonic crystals without defects, i.e., when computing binary periodic systems that alternate two different refractive indexes. By default pbgflag=false
. Notice that when λ0 ∉ λ
the pbgflag
is set to false
.
solution
contains all the information regarding the calculations of the desired parameters. The reflectance and transmittance spectra are calculated by default since is the base of what TMMOptics
does. The other parameters, except the photonic dispersion. Maybe in the future, we can add this flag as well, to only compute the photonic dispersion instead of the whole spectra as well.
solutions::TMMOptics
is a structure containing different subfields of outputs depending on their relation (more or less). There are five subfields included in the output:
solution.Spectra
contains information on the reflectance, transmittance and Fresnel coefficients spectra. Inside this subtype there exist the following fields:
-
Rp::Array{Float64}(length(beam.λ), length(beam.θ))
: p-TM wave reflectance. -
Rs::Array{Float64}(length(beam.λ), length(beam.θ))
: s-TE wave reflectance. -
Tp::Array{Float64}(length(beam.λ), length(beam.θ))
: p-TM wave transmittance. -
Ts::Array{Float64}(length(beam.λ), length(beam.θ))
: s-TE wave transmittance. -
ρp::Array{ComplexF64}(length(beam.λ), length(beam.θ))
: p-TM wave complex reflection coefficient. -
ρs::Array{ComplexF64}(length(beam.λ), length(beam.θ))
: s-TE wave complex reflection coefficient. -
τp::Array{ComplexF64}(length(beam.λ), length(beam.θ))
: p-TM wave complex transmission coefficient. -
τs::Array{ComplexF64}(length(beam.λ), length(beam.θ))
: s-TE wave complex transmission coefficient.
solution.Field
contains information on the electromagnetic field distribution calculated, with the following fields:
-
emfp::Array{Float64}(length(beam.λ), length(beam.θ), length(solution.Misc.ℓ))
: p-TM wave electric field distribution. -
emfs::Array{Float64}(length(beam.λ), length(beam.θ), length(solution.Misc.ℓ))
: s-TE wave electric field distribution.
solution.Bloch
contains information on the Bloch wavevectors calculated for periodic structures, with the following fields:
-
κp::Array{ComplexF64}(length(beam.λ), length(beam.θ))
: p-TM wave Bloch dispersion wavevectors. -
κs::Array{ComplexF64}(length(beam.λ), length(beam.θ))
: s-TE wave Bloch dispersion wavevectors. -
ω::Array{Float64}
(length(beam.λ): angular frequency obtained from the wavelength. -
Λ::Float64
: Period of a periodic structure. Adds two different thicknesses in a binary periodic multilayer, without considering the incident and emergent media. -
ωl::Float64
andωh::Float64
: Range to mid-range ratios as described here for a binary periodic photonic crystal. -
qz::Array{Float64}
: Parallel wavevector use to plot the photonic dispersion in 2D.
solution.Misc
gives information about the geometrical (physical) thicknesses in nanometers (even if you input the optical thickness information, the output returns the physical one), the geometrical thickness taking into account the h
number defined above, and the index of refraction of each layer defined in layers
at the wavelength of reference λ0
. The fields are as follow:
-
d::Array{Float64}(size(layers,2))
: geometrical (physical) thickness of each layer as ordered byn
[nm]. -
ℓ::Array{Float64}((size(layers,2)-2)*h)
: geometrical (physical) thickness of each layer, where each layer is divided intoh
sub-layers [nm], disregarding the incident and emergent media. -
nλ0::Array{Float64}(size(layers,2))
: profile of index of refraction profile computed at the wavelength referenceλ0
. -
layers_n::Array{ComplexF64}(length(beam.λ),(size(layers, 2))
: contains the indices of refraction for each wavelength and layer in the structure.
solution.AdmPhase
: wraps the admittance for both polarizations and the phase shift angle (for the thickness) of the whole structure. The fields are as follow:
-
ηp::Array{ComplexF64}(length(beam.λ), length(beam.θ), length(size(layers,2)))
: p-TM wave admittance of the structure. -
ηs::Array{ComplexF64}(length(beam.λ), length(beam.θ), length(size(layers,2)))
: s-TE wave admittance of the structure. -
δ::Array{ComplexF64}(length(beam.λ), length(beam.θ), length(size(layers,2)))
: phase shift (thickness) of the structure.
solution.beam
: wraps the information of the input beam with PlaneWave
structure.
solution.Layers
: wraps the information of the input layers.