OptStrata module¶
This module contains MaxwellLayer
and OptStrata
classes.
The physics model can be seen in Optics tab
MaxwellLayer
is a transfer matrix solver for 1D optical stabs,
OptStrata
is a wrapper of MaxwellLayer
with material information coded.
OptStrata class¶
- class ErwinJr2.OptStrata.OptStrata(wl=3.0, materials=['Air', 'InP'], moleFracs=None, dopings=None, Ls=[1.0, 1.0], mobilities=None, cstmIndx={}, cstmPrd={}, cstmGain={})¶
Class for groups of stratum, a wrapper of
MaxwellLayer
with material parsing support- Parameters
wl (float) – Wavelength in vacuum to guide in the stratum
materials (list(str)) – Name of the material for each strata, with materials[0] being the top (usually air) and materials[-1] the substrate.
moleFracs (list(float)) – Mole fractions for each material. The number should be between 0 and 1. For strata that the parameter is not applicable, the number doesn’t influence the result.
dopings (list(float)) – The doping level in unit 1E17 cm^-3 for the material. For strata that the parameter is not applicable, the number doesn’t influence the result.
Ls (list(float)) – Thickness of stratum, same unit as wl. The first and last elements are for top and substrate and is not used for calculation
mobilities (None or list(float)) – Mobility influence the relaxation rate for plasmon resonance. When it’s None, it is assumed to have 1E13 s^1 relaxation.
cstmIdx (dict) – A dictionary of customized material, with key the name and value the complex refractive index
cstmPrd (dict) – A dictionary of customized material, with key the name and value a list of two elements, 0-th being the period length (float in unit Angstrom) and 1-st (int) being the number of periods. If the 0-th value is 0 or not key not exists, it’s not a periodic structure. The variable is only for book keeping and is not used to validate Ls within the class
cstmGain (dict) – A dictionary of customized material, with key the name and value the gain coefficient. The variable is only for book keeping and is not used for any calculation.
- confinementy(beta, xs=None, Ey=None)¶
Return the confinement factor corresponds to mode with effective refractive index beta. If xs and Ey is None, they will be generated. The active region is labelled by anything start with “Active”.
- delete(row)¶
Delete the strata indexed with row (top air and bottom substrate included)
- indexOf(n)¶
Return the refractive of the strata indexed with n (top air and bottom substrate included). The result is a combination of linear interpolation of mole fraction and plasmonic loss by Drude model
- insert(row, material=None, moleFrac=None, doping=None, L=None, mobility=None)¶
Insert a strata indexed with row (top air and bottom substrate included) with parameters listed
- populateMtrl(xs, mtrlList=None)¶
Populate a boolean array for index slicing on xs for material in the mtrlList. If mtrlList is None, the active region is labelled by anything start with “Active”.
- updateIndices()¶
Update indices information according to material info
- Yields
indices (list(complex)) – complex refractive index of the stratum
index0 (complex) – Refractive index of the top (before Ls[0]) strata
indexS (complex) – refractive index of the substrate (after Ls[-1])
MaxwellLayer class¶
- class ErwinJr2.OptStrata.MaxwellLayer(wl, Ls=[1.0, 3.0], allIndex=[1.0, 1.0])¶
Class for layer structure for Maxwell solver using transfer matrix method.
This is used as the base class of
OptStrata
for separation of material property and the solver.- Parameters
wl (float) – Wavelength in vacuum to guide in the stratum
indices (numpy.ndarray) – The Refractive indices of the layers except for the top and the substrate. The substrate and the top layer is not part of the list because they decides the boundary condition for the solver.
index0 (complex) – The refractive index for the top layer
indexS (complex) – The refractive index for the substrate layer
Ls (List[complex]) – Thickness of the stratum, same unit as wl. The first and last elements are for top and substrate and is not used for calculation
- boundModeTM(beta=None)¶
Solve for TM bounded mode near beta
Solve for TM bounded mode near beta (as first guess in root finding) with frequency \(\omega = c/\text{wl}\) on the stratum structure described with the thickness and index list; top/substrate defined by index0 and indexS. wl and Ls should be same unit
- chiMTM(beta)¶
Modal-dispersion function for TM wave
Calculate the with modal-dispersion function for TM wave with frequency \(\omega = c/\text{wl}\) on the stratum structure described with the thickness and index list; top/substrate defined by index and index. wl and Ls should be same unit
- confinementy(beta, actives, xs=None, Ey=None)¶
Return the confinement factor corresponds to mode with effective refractive index beta. Assuming active only couple to E_y filed. The active region is defined in actives. If xs and Ey is None, they will be generated.
- Parameters
beta (complex) – The refractive index of the mode to calculate
actives (list(np.ndarray(bool))) – The list of active region for confinement factor
xs (np.ndarray) – The array for positions: controls the accuracy of the numerical integral for confinement factor calculation
Ey (np.ndarray(complex)) – The field to integral on
- Return type
- Returns
float – The confinement factor of the structure
- populateIndices(xs)¶
Generate indices position array xs
- Parameters
xs (np.ndarray) – The position coordinate to calculate field on
- Return type
- Returns
np.ndarray – refractive indices of the material at position xs
- populateMode(beta, xs)¶
Generate TM modes (field) on position array xs
Generate TM modes (field) on position array xs, assuming beta is a bounded Mode (i.e. return value of
boundModeTM()
) return Ey, Hx, Ez, normalized to max(abs(Ey)) = 1; unit of Hx is \(([\text{nit of beta}]\times \sqrt{\mu_0/\epsilon_0})^-1\)- Parameters
beta (complex) – The effective refractive index traveling along z
xs (np.ndarray) – The position coordinate to calculate field on
- Return type
- Returns
np.ndarray – E field perpendicular to layers and propagation
np.ndarray – H field parallel to layers and perpendicular to propagation
np.ndarray – E field in propagation
- transferTM(beta)¶
Transfer matrix for TM wave
Calculate the transfer matrix for TM wave with frequency \(\omega = c/\text{wl}\) on the stratum structure described with the thickness and index list. wl and Ls should be same unit
Others¶
- class ErwinJr2.OptStrata.MaxwellLayer_anisotropic(wl, Ls=[1.0, 1.0], indexz=[1.0, 1.0], indexy=None)¶
Bases:
ErwinJr2.OptStrata.MaxwellLayer
class for anisotropic Maxwell layers, cannot deal with anisotropy for top air and bottom substrate.
- populateIndices(xs)¶
Generate indices position array xs
- Parameters
xs (np.ndarray) – The position coordinate to calculate field on
- Returns
np.ndarray – refractive indices of the material at position xs
- ErwinJr2.OptStrata.optimizeOptStrata(stratum, alphaM, toOptimize, maxLength, iter=20, tol=0.05)¶
Optimize strata with threshold gain as the minimize objective function g_th = (alphaM + alphaW)/confinement, where the waveguide loss alphaW and the confinement factor is a character of strata. The optimization is done on layer indexed by elements in toOptimize, and conditioned on total length to be smaller than maxLength. Newton’s method with an increasing penalty is used.
- Return type
- Returns
float (The optimized threshold gain in cm^-1)
Example¶
Todo
Add examples