Slab

class modesolverpy.structure_base.Slab(name, x_step, y_step, x_max, y_max, x_min, y_min, n_background, wavelength)[source]

Bases: modesolverpy.structure_base.Structure

A Slab represents a horizontal slice of the refractive index profile.

A Slabs object composes many Slab objects. The more Slab are added, the more horizontal slices are added. A Slab has a chosen fixed height, and a background (nominal) refractive index. A slab can then be customised to include a desired design.

Parameters:
  • name (str) – The name of the slab.
  • x_step (float) – The step in x.
  • y_step (float) – The step in y.
  • x_max (float) – The maximum x-value.
  • y_max (float) – The maximum y-value.
  • x_min (float) – The minimum x-value.
  • y_min (float) – The minimum x-value.
  • n_background (float) – The nominal refractive index.
  • wavelength (float) – The wavelength the structure operates at.
name

str – The name of the Slab object.

position

int – A unique identifier for the

:class:`Slab` object.

Attributes Summary

eps np.array – A grid of permittivies representing the permittivity profile of the structure.
eps_func function – a function that when passed a x and y values, returns the permittivity profile of the structure, interpolating if necessary.
n np.array – A grid of refractive indices representing the refractive index profile of the structure.
n_func function – a function that when passed a x and y values, returns the refractive index profile of the structure, interpolating if necessary.
position
x np.array – The grid points in x.
x_ctr float – The centre distance in x.
x_pts int – The number of grid points in x.
xc np.array – The centre points of the x points.
xc_max float – The maximum value of xc.
xc_min float – The minimum value of xc.
xc_pts int – The number of points in xc.
y np.array – The grid points in y.
y_ctr float – The centre distance in y
y_pts int – The number of grid points in y.
yc np.array – The centre points of the y points.
yc_max float – The maximum value of yc.
yc_min float – The minimum value of yc.
yc_pts int – The number of points in yc.

Methods Summary

add_material(x_min, x_max, n[, angle]) Add a refractive index between two x-points.
write_to_file([filename, plot]) Write the refractive index profile to file.

Attributes Documentation

eps

np.array – A grid of permittivies representing the permittivity profile of the structure.

eps_func

function – a function that when passed a x and y values, returns the permittivity profile of the structure, interpolating if necessary.

n

np.array – A grid of refractive indices representing the refractive index profile of the structure.

n_func

function – a function that when passed a x and y values, returns the refractive index profile of the structure, interpolating if necessary.

position = 0
x

np.array – The grid points in x.

x_ctr

float – The centre distance in x.

x_pts

int – The number of grid points in x.

xc

np.array – The centre points of the x points.

xc_max

float – The maximum value of xc.

xc_min

float – The minimum value of xc.

xc_pts

int – The number of points in xc.

y

np.array – The grid points in y.

y_ctr

float – The centre distance in y

y_pts

int – The number of grid points in y.

yc

np.array – The centre points of the y points.

yc_max

float – The maximum value of yc.

yc_min

float – The minimum value of yc.

yc_pts

int – The number of points in yc.

Methods Documentation

add_material(x_min, x_max, n, angle=0)[source]

Add a refractive index between two x-points.

Parameters:
  • x_min (float) – The start x-point.
  • x_max (float) – The stop x-point.
  • n (float, function) – Refractive index between x_min and x_max. Either a constant (float), or a function that accepts one parameters, the wavelength, and returns a float of the refractive index. This is useful when doing wavelength sweeps and solving for the group velocity. The function provided could be a Sellmeier equation.
  • angle (float) – Angle in degrees of the slope of the sidewalls at x_min and x_max. This is useful for defining a ridge with angled sidewalls.
write_to_file(filename='material_index.dat', plot=True)

Write the refractive index profile to file.

Parameters:
  • filename (str) – The nominal filename the refractive index data should be saved to.
  • plot (bool) – True if plots should be generates, otherwise False. Default is True.