Welcome to modesolverpy’s documentation!¶
Contents:
Introduction¶
This documentation demonstrates the potential of modesolverpy.
Examples¶
Two example scripts.
Example 1¶
import modesolverpy.mode_solver as ms
import modesolverpy.structure as st
import numpy as np
# All units are relative. [um] were chosen in this case.
x_step = 0.02
y_step = 0.02
wg_height = 0.4
wg_width = 0.5
sub_height = 0.5
sub_width = 2.
clad_height = 0.5
n_sub = 1.4
n_wg = 3.
n_clad = 1.
film_thickness = 0.5
wavelength = 1.55
angle = 75.
structure = st.RidgeWaveguide(wavelength,
x_step,
y_step,
wg_height,
wg_width,
sub_height,
sub_width,
clad_height,
n_sub,
n_wg,
angle,
n_clad,
film_thickness)
structure.write_to_file('example_structure_1.dat')
mode_solver = ms.ModeSolverSemiVectorial(2, semi_vectorial_method='Ey')
mode_solver.solve(structure)
mode_solver.write_modes_to_file('example_modes_1.dat')
Example 2¶
import modesolverpy.mode_solver as ms
import modesolverpy.structure as st
import opticalmaterialspy as mat
import numpy as np
wl = 1.55
x_step = 0.06
y_step = 0.06
wg_height = 0.8
wg_width = 1.8
sub_height = 1.0
sub_width = 4.
clad_height = 1.0
film_thickness = 1.2
angle = 60.
def struct_func(n_sub, n_wg, n_clad):
return st.RidgeWaveguide(wl, x_step, y_step, wg_height, wg_width,
sub_height, sub_width, clad_height,
n_sub, n_wg, angle, n_clad, film_thickness)
n_sub = mat.SiO2().n(wl)
n_wg_xx = mat.Ktp('x').n(wl)
n_wg_yy = mat.Ktp('y').n(wl)
n_wg_zz = mat.Ktp('z').n(wl)
n_clad = mat.Air().n()
struct_xx = struct_func(n_sub, n_wg_xx, n_clad)
struct_yy = struct_func(n_sub, n_wg_yy, n_clad)
struct_zz = struct_func(n_sub, n_wg_zz, n_clad)
struct_ani = st.StructureAni(struct_xx, struct_yy, struct_zz)
struct_ani.write_to_file()
solver = ms.ModeSolverFullyVectorial(8)
solver.solve(struct_ani)
solver.write_modes_to_file()
solver.solve_ng(struct_ani, 0.01)
solver.solve_sweep_wavelength(struct_ani, np.linspace(1.501, 1.60, 21))
API documentation¶
Mode Solvers¶
Classes¶
ModeSolverFullyVectorial (n_eigs[, tol, …]) |
A fully-vectorial mode solver object used to setup and run a mode solving simulation. |
ModeSolverSemiVectorial (n_eigs[, tol, …]) |
A semi-vectorial mode solver object used to setup and run a mode solving simulation. |
Class Inheritance Diagram¶

Pre-defined Structures¶
Classes¶
RidgeWaveguide (wavelength, x_step, y_step, …) |
A general ridge waveguide structure. |
Slab (name, x_step, y_step, x_max, y_max, …) |
A Slab represents a horizontal slice of the refractive index profile. |
Slabs (wavelength, y_step, x_step, x_max[, x_min]) |
Class to implement device refractive index profile cross-section designs. |
Structure (x_step, y_step, x_max, y_max[, …]) |
|
StructureAni (structure_xx, structure_yy, …) |
Anisottropic structure object. |
WgArray (wavelength, x_step, y_step, …[, …]) |
Class Inheritance Diagram¶

Structure Creation¶
Classes¶
Slab (name, x_step, y_step, x_max, y_max, …) |
A Slab represents a horizontal slice of the refractive index profile. |
Slabs (wavelength, y_step, x_step, x_max[, x_min]) |
Class to implement device refractive index profile cross-section designs. |
Structure (x_step, y_step, x_max, y_max[, …]) |
|
StructureAni (structure_xx, structure_yy, …) |
Anisottropic structure object. |
Class Inheritance Diagram¶

Design Tools¶
Functions¶
directional_coupler_lc (wavelength_nm, …) |
Calculates the coherence length (100% power transfer) of a directional coupler. |
grating_coupler_period (wavelength, n_eff, …) |
Calculate the period needed for a grating coupler. |
Coupling Efficiency¶
Functions¶
coupling_efficiency (mode_solver, fibre_mfd) |
Finds the coupling efficiency between a solved fundamental mode and a fibre of given MFD. |
reflection (n1, n2) |
Calculate the power reflection at the interface of two refractive index materials. |
transmission (n1, n2) |
Calculate the power transmission at the interface of two refractive index materials. |