SCEE - Directional Couplers Models

These methods are based on the model SCEE found in [CITE PAPER WHEN PUBLISHED].

Helper Functions

Base Directional Coupler Class

class SiPANN.scee.DC(width, thickness, sw_angle=90)

Abstract Class that all directional couplers inherit from. Each DC will inherit from it.

Base Class for DC. All other DC classes should be based on this one, including same functions (so documentation should be the same/similar with exception of device specific attributes). Ports are numbered as:

|       2---\      /---4       |
|            ------            |
|            ------            |
|       1---/      \---3       |
Parameters:
  • width (float or ndarray) – Width of the waveguide in nm
  • thickness (float or ndarray) – Thickness of waveguide in nm
  • sw_angle (float or ndarray, optional) – Sidewall angle of waveguide from horizontal in degrees. Defaults to 90.
update(**kwargs)

Takes in any parameter defined by __init__ and changes it.

Parameters:attribute (float or ndarray) – Included if any device needs to have an attribute changed.
sparams(wavelength)

Returns scattering parameters

Runs SCEE to get scattering parameters at wavelength input.

Parameters:wavelength (float or ndarray) – wavelengths to get sparams at
Returns:
  • freq (ndarray) – frequency for s_matrix in Hz, size n (number of wavelength points)
  • s_matrix (ndarray) – size (n,4,4) complex matrix of scattering parameters, in order of passed in wavelengths
predict(ports, wavelength)

Predicts the output when light is put in the specified port (see diagram above)

Parameters:
  • ports (2-tuple) – Specifies the port coming in and coming out
  • wavelength (float or ndarray) – Wavelength(s) to predict at
  • extra_arc (float, optional) – Adds phase to compensate for waveguides getting to gap function. Defaults to 0.
  • part ({"both", "mag", "ph"}, optional) – To speed up calculation, can calculate only magnitude (mag), phase (ph), or both. Defaults to both.
Returns:

k/t – The value of the light coming through

Return type:

complex ndarray

gds(filename=None, extra=0, units='microns', view=False, sbend_h=0, sbend_v=0)

Writes the geometry to the gds file

Parameters:
  • filename (str, optional) – Location to save file to. Defaults to None.
  • extra (int, optional) – Extra straight portion to add to ends of waveguides to make room in simulation (units same as units parameter). Defaults to 0.
  • units ({'microns' or 'nms'}, optional) – Units to save gds file in. Defaults to microns.
  • view (bool, optional) – Whether to visually show gds file. Defaults to False.
  • sbend_h (int, optional) – How high to horizontally make additional sbends to move ports farther away. Sbends insert after extra. Only available in couplers with all horizontal ports (units same as units parameters). Defaults to 0
  • sbend_v (int, optional) – Same as sbend_h, but vertical distance. Defaults to 0.

Waveguide

class SiPANN.scee.Waveguide(width, thickness, length, sw_angle=90)

Lossless model for a straight waveguide.

Simple model that makes sparameters for a straight waveguide. May not be the best option, but plays nice with other models in SCEE. Ports are numbered as:

|  1 ----------- 2   |
Parameters:
  • width (float or ndarray) – Width of the waveguide in nm
  • thickness (float or ndarray) – Thickness of waveguide in nm
  • length (float or ndarray) – Length of waveguide in nm.
  • sw_angle (float or ndarray, optional) – Sidewall angle of waveguide from horizontal in degrees. Defaults to 90.
update(**kwargs)

Takes in any parameter defined by __init__ and changes it.

Parameters:attribute (float or ndarray) – Included if any device needs to have an attribute changed.
sparams(wavelength)

Returns scattering parameters

Runs SCEE to get scattering parameters at wavelength input.

Parameters:wavelength (float or ndarray) – wavelengths to get sparams at
Returns:
  • freq (ndarray) – frequency for s_matrix in Hz, size n (number of wavelength points)
  • s_matrix (ndarray) – size (2,2,n) complex matrix of scattering parameters
predict(wavelength)

Predicts the output when light is put in port 1 and out port 2

Parameters:wavelength (float or ndarray) – Wavelength(s) to predict at
Returns:k/t – The value of the light coming through
Return type:complex ndarray
gds(filename=None, extra=0, units='microns', view=False)

Writes the geometry to the gds file

Parameters:
  • filename (str) – location to save file to, or if you don’t want to defaults to None
  • extra (int) –
    extra straight portion to add to ends of waveguides to make room in simulation
    (input with units same as units input)
  • units (str) – either ‘microns’ or ‘nms’. Units to save gds file in

Effective Index Finder

SiPANN.scee.get_neff(wavelength, width, thickness, sw_angle=90)

Return neff for a given waveguide profile

Leverages Multivariate Linear Regression that maps wavelength, width, thickness and sidewall angle to effective index with silicon core and silicon dioxide cladding

Parameters:
  • wavelength (float or ndarray) – wavelength
  • width (float or ndarray) – width
  • thickness (float or ndarray) – thickness
  • sw_angle (float or ndarray) – sw_angle
Returns:

neff – effective index of waveguide

Return type:

float or ndarray

Integrations Coefficient Finder

SiPANN.scee.get_coeffs(wavelength, width, thickness, sw_angle)

Return coefficients and neff for a given waveguide profile as used in SCEE

Leverages Multivariate Linear Regression that maps wavelength, width, thickness and sidewall angle to effective index and coefficients used in estimate of even and odd effective indices with silicon core and silicon dioxide cladding.

Parameters:
  • wavelength (float or ndarray) – wavelength
  • width (float or ndarray) – width
  • thickness (float or ndarray) – thickness
  • sw_angle (float or ndarray) – sw_angle
Returns:

  • ae (float or ndarray) – used in even mode estimation in neff + ae exp(ge * g)
  • ao (float or ndarray) – used in odd mode estimation in neff + ao exp(go * g)
  • ge (float or ndarray) – used in even mode estimation in neff + ae exp(ge * g)
  • go (float or ndarray) – used in odd mode estimation in neff + ao exp(go * g)
  • neff (float or ndarray) – effective index of waveguide

Input Cleaner

SiPANN.scee.clean_inputs(inputs)

Makes all inputs as the same shape to allow passing arrays through

Used to make sure all inputs have the same length - ie that it’s trying to run a specific number of simulations, not a varying amount

Parameters:inputs (tuple) – can be an arbitrary mixture of floats/ndarray
Returns:inputs – returns all inputs as same size ndarrays
Return type:tuple

Coupling Devices

Symmetric Coupler

class SiPANN.scee.GapFuncSymmetric(width, thickness, gap, dgap, zmin, zmax, sw_angle=90)

This class will create arbitrarily shaped SYMMETRIC (ie both waveguides are same shape) directional couplers.

It takes in a gap function that describes the gap as one progreses through the device. Note that the shape fo the waveguide will simply be half of gap function. Also requires the derivative of the gap function for this purpose. Ports are numbered as:

|       2---\      /---4       |
|            ------            |
|            ------            |
|       1---/      \---3       |
Parameters:
  • width (float or ndarray) – Width of the waveguide in nm
  • thickness (float or ndarray) – Thickness of waveguide in nm
  • gap (function) – Gap function as one progresses along the waveguide
  • dgap (function) – Derivative of the gap function
  • zmin (float) – Where to begin integration in the gap function
  • zmax (float) – Where to end integration in the gap function
  • sw_angle (float or ndarray, optional) – Sidewall angle of waveguide from horizontal in degrees. Defaults to 90.
update(**kwargs)

Takes in any parameter defined by __init__ and changes it.

Parameters:attribute (float or ndarray) – Included if any device needs to have an attribute changed.
predict(ports, wavelength, extra_arc=0, part='both')

Predicts the output when light is put in the specified port (see diagram above)

Parameters:
  • ports (2-tuple) – Specifies the port coming in and coming out
  • wavelength (float or ndarray) – Wavelength(s) to predict at
  • extra_arc (float, optional) – Adds phase to compensate for waveguides getting to gap function. Defaults to 0.
  • part ({"both", "mag", "ph"}, optional) – To speed up calculation, can calculate only magnitude (mag), phase (ph), or both. Defaults to both.
Returns:

k/t – The value of the light coming through

Return type:

complex ndarray

gds(filename=None, extra=0, units='microns', view=False, sbend_h=0, sbend_v=0)

Writes the geometry to the gds file

Parameters:
  • filename (str, optional) – Location to save file to. Defaults to None.
  • extra (int, optional) – Extra straight portion to add to ends of waveguides to make room in simulation (units same as units parameter). Defaults to 0.
  • units ({'microns' or 'nms'}, optional) – Units to save gds file in. Defaults to microns.
  • view (bool, optional) – Whether to visually show gds file. Defaults to False.
  • sbend_h (int, optional) – How high to horizontally make additional sbends to move ports farther away. Sbends insert after extra. Only available in couplers with all horizontal ports (units same as units parameters). Defaults to 0
  • sbend_v (int, optional) – Same as sbend_h, but vertical distance. Defaults to 0.
sparams(wavelength)

Returns scattering parameters

Runs SCEE to get scattering parameters at wavelength input.

Parameters:wavelength (float or ndarray) – wavelengths to get sparams at
Returns:
  • freq (ndarray) – frequency for s_matrix in Hz, size n (number of wavelength points)
  • s_matrix (ndarray) – size (n,4,4) complex matrix of scattering parameters, in order of passed in wavelengths

Non-Symmetric Coupler

class SiPANN.scee.GapFuncAntiSymmetric(width, thickness, gap, zmin, zmax, arc1, arc2, arc3, arc4, sw_angle=90)

This class will create arbitrarily shaped ANTISYMMETRIC (ie waveguides are different shapes) directional couplers.

It takes in a gap function that describes the gap as one progreses through the device. Also takes in arc length of each port up till coupling point. Ports are numbered as: | 2— /—4 | | —— | | —— | | 1—/ —3 |

Parameters:
  • width (float or ndarray) – Width of the waveguide in nm
  • thickness (float or ndarray) – Thickness of waveguide in nm
  • gap (function) – Gap function as one progresses along the waveguide
  • zmin (float) – Where to begin integration in the gap function
  • zmax (float) – Where to end integration in the gap function
  • arc2, arc3, arc4 (arc1,) – Arclength from entrance of each port till minimum coupling point
  • sw_angle (float or ndarray, optional) – Sidewall angle of waveguide from horizontal in degrees. Defaults to 90.
update(**kwargs)

Takes in any parameter defined by __init__ and changes it.

Parameters:attribute (float or ndarray) – Included if any device needs to have an attribute changed.
predict(ports, wavelength, extra_arc=0, part='both')

Predicts the output when light is put in the specified port (see diagram above)

Parameters:
  • ports (2-tuple) – Specifies the port coming in and coming out
  • wavelength (float or ndarray) – Wavelength(s) to predict at
  • extra_arc (float, optional) – Adds phase to compensate for waveguides getting to gap function. Defaults to 0.
  • part ({"both", "mag", "ph"}, optional) – To speed up calculation, can calculate only magnitude (mag), phase (ph), or both. Defaults to both.
Returns:

k/t – The value of the light coming through

Return type:

complex ndarray

gds(filename=None, extra=0, units='microns', view=False, sbend_h=0, sbend_v=0)

Still needs to be implemented for this class

sparams(wavelength)

Returns scattering parameters

Runs SCEE to get scattering parameters at wavelength input.

Parameters:wavelength (float or ndarray) – wavelengths to get sparams at
Returns:
  • freq (ndarray) – frequency for s_matrix in Hz, size n (number of wavelength points)
  • s_matrix (ndarray) – size (n,4,4) complex matrix of scattering parameters, in order of passed in wavelengths

Coupling Straight Waveguides

class SiPANN.scee.StraightCoupler(width, thickness, gap, length, sw_angle=90)

This class will create half of a ring resonator.

It takes in a radius and gap along with usual waveguide parameters. Ports are numbered as:

|      2---------------4       |
|      1---------------3       |
Parameters:
  • width (float or ndarray) – Width of the waveguide in nm
  • thickness (float or ndarray) – Thickness of waveguide in nm
  • gap (float or ndarray) – Distance between the two waveguides edge in nm.
  • length (float or ndarray) – Length of both waveguides in nm.
  • sw_angle (float or ndarray, optional) – Sidewall angle of waveguide from horizontal in degrees. Defaults to 90.
update(**kwargs)

Takes in any parameter defined by __init__ and changes it.

Parameters:attribute (float or ndarray) – Included if any device needs to have an attribute changed.
predict(ports, wavelength)

Predicts the output when light is put in the specified port (see diagram above)

Parameters:
  • ports (2-tuple) – Specifies the port coming in and coming out
  • wavelength (float or ndarray) – Wavelength(s) to predict at
  • extra_arc (float, optional) – Adds phase to compensate for waveguides getting to gap function. Defaults to 0.
  • part ({"both", "mag", "ph"}, optional) – To speed up calculation, can calculate only magnitude (mag), phase (ph), or both. Defaults to both.
Returns:

k/t – The value of the light coming through

Return type:

complex ndarray

gds(filename=None, view=False, extra=0, units='nms', sbend_h=0, sbend_v=0)

Writes the geometry to the gds file

Parameters:
  • filename (str, optional) – Location to save file to. Defaults to None.
  • extra (int, optional) – Extra straight portion to add to ends of waveguides to make room in simulation (units same as units parameter). Defaults to 0.
  • units ({'microns' or 'nms'}, optional) – Units to save gds file in. Defaults to microns.
  • view (bool, optional) – Whether to visually show gds file. Defaults to False.
  • sbend_h (int, optional) – How high to horizontally make additional sbends to move ports farther away. Sbends insert after extra. Only available in couplers with all horizontal ports (units same as units parameters). Defaults to 0
  • sbend_v (int, optional) – Same as sbend_h, but vertical distance. Defaults to 0.
sparams(wavelength)

Returns scattering parameters

Runs SCEE to get scattering parameters at wavelength input.

Parameters:wavelength (float or ndarray) – wavelengths to get sparams at
Returns:
  • freq (ndarray) – frequency for s_matrix in Hz, size n (number of wavelength points)
  • s_matrix (ndarray) – size (n,4,4) complex matrix of scattering parameters, in order of passed in wavelengths

Standard Directional Coupler

class SiPANN.scee.Standard(width, thickness, gap, length, H, V, sw_angle=90)

Normal/Standard Shaped Directional Coupler.

This is what most people think of when they think directional coupler. Ports are numbered as:

|       2---\      /---4       |
|            ------            |
|            ------            |
|       1---/      \---3       |
Parameters:
  • width (float or ndarray) – Width of the waveguide in nm
  • thickness (float or ndarray) – Thickness of waveguide in nm
  • gap (float or ndarray) – Minimum distance between the two waveguides edge in nm.
  • length (float or ndarray) – Length of the straight portion of both waveguides in nm.
  • H (float or ndarray) – Horizontal distance between end of coupler until straight portion in nm.
  • H – Vertical distance between end of coupler until straight portion in nm.
  • sw_angle (float or ndarray, optional) – Sidewall angle of waveguide from horizontal in degrees. Defaults to 90.
update(**kwargs)

Takes in any parameter defined by __init__ and changes it.

Parameters:attribute (float or ndarray) – Included if any device needs to have an attribute changed.
predict(ports, wavelength)

Predicts the output when light is put in the specified port (see diagram above)

Parameters:
  • ports (2-tuple) – Specifies the port coming in and coming out
  • wavelength (float or ndarray) – Wavelength(s) to predict at
  • extra_arc (float, optional) – Adds phase to compensate for waveguides getting to gap function. Defaults to 0.
  • part ({"both", "mag", "ph"}, optional) – To speed up calculation, can calculate only magnitude (mag), phase (ph), or both. Defaults to both.
Returns:

k/t – The value of the light coming through

Return type:

complex ndarray

gds(filename=None, view=False, extra=0, units='nms', sbend_h=0, sbend_v=0)

Writes the geometry to the gds file

Parameters:
  • filename (str, optional) – Location to save file to. Defaults to None.
  • extra (int, optional) – Extra straight portion to add to ends of waveguides to make room in simulation (units same as units parameter). Defaults to 0.
  • units ({'microns' or 'nms'}, optional) – Units to save gds file in. Defaults to microns.
  • view (bool, optional) – Whether to visually show gds file. Defaults to False.
  • sbend_h (int, optional) – How high to horizontally make additional sbends to move ports farther away. Sbends insert after extra. Only available in couplers with all horizontal ports (units same as units parameters). Defaults to 0
  • sbend_v (int, optional) – Same as sbend_h, but vertical distance. Defaults to 0.
sparams(wavelength)

Returns scattering parameters

Runs SCEE to get scattering parameters at wavelength input.

Parameters:wavelength (float or ndarray) – wavelengths to get sparams at
Returns:
  • freq (ndarray) – frequency for s_matrix in Hz, size n (number of wavelength points)
  • s_matrix (ndarray) – size (n,4,4) complex matrix of scattering parameters, in order of passed in wavelengths

Half Ring

class SiPANN.scee.HalfRing(width, thickness, radius, gap, sw_angle=90)

This class will create half of a ring resonator.

It takes in a radius and gap along with usual waveguide parameters. Ports are numbered as:

|         2 \     / 4          |
|            \   /             |
|             ---              |
|         1---------3          |
Parameters:
  • width (float or ndarray) – Width of the waveguide in nm
  • thickness (float or ndarray) – Thickness of waveguide in nm
  • radius (float or ndarray) – Distance from center of ring to middle of waveguide in nm.
  • gap (float or ndarray) – Minimum distance from ring waveguide edge to straight waveguide edge in nm.
  • sw_angle (float or ndarray, optional) – Sidewall angle of waveguide from horizontal in degrees. Defaults to 90.
update(**kwargs)

Takes in any parameter defined by __init__ and changes it.

Parameters:attribute (float or ndarray) – Included if any device needs to have an attribute changed.
predict(ports, wavelength)

Predicts the output when light is put in the specified port (see diagram above)

Parameters:
  • ports (2-tuple) – Specifies the port coming in and coming out
  • wavelength (float or ndarray) – Wavelength(s) to predict at
  • extra_arc (float, optional) – Adds phase to compensate for waveguides getting to gap function. Defaults to 0.
  • part ({"both", "mag", "ph"}, optional) – To speed up calculation, can calculate only magnitude (mag), phase (ph), or both. Defaults to both.
Returns:

k/t – The value of the light coming through

Return type:

complex ndarray

gds(filename=None, view=False, extra=0, units='nms')

Writes the geometry to the gds file

Parameters:
  • filename (str, optional) – Location to save file to. Defaults to None.
  • extra (int, optional) – Extra straight portion to add to ends of waveguides to make room in simulation (units same as units parameter). Defaults to 0.
  • units ({'microns' or 'nms'}, optional) – Units to save gds file in. Defaults to microns.
  • view (bool, optional) – Whether to visually show gds file. Defaults to False.
sparams(wavelength)

Returns scattering parameters

Runs SCEE to get scattering parameters at wavelength input.

Parameters:wavelength (float or ndarray) – wavelengths to get sparams at
Returns:
  • freq (ndarray) – frequency for s_matrix in Hz, size n (number of wavelength points)
  • s_matrix (ndarray) – size (n,4,4) complex matrix of scattering parameters, in order of passed in wavelengths

Half Racetrack Resonator

class SiPANN.scee.HalfRacetrack(width, thickness, radius, gap, length, sw_angle=90)

This class will create half of a ring resonator.

It takes in a radius and gap along with usual waveguide parameters. Ports are numbered as:

|      2 \           / 4       |
|         \         /          |
|          ---------           |
|      1---------------3       |
Parameters:
  • width (float or ndarray) – Width of the waveguide in nm
  • thickness (float or ndarray) – Thickness of waveguide in nm
  • radius (float or ndarray) – Distance from center of ring to middle of waveguide in nm.
  • gap (float or ndarray) – Minimum distance from ring waveguide edge to straight waveguide edge in nm.
  • length (float or ndarray) – Length of straight portion of ring waveguide in nm.
  • sw_angle (float or ndarray, optional) – Sidewall angle of waveguide from horizontal in degrees. Defaults to 90.
update(**kwargs)

Takes in any parameter defined by __init__ and changes it.

Parameters:attribute (float or ndarray) – Included if any device needs to have an attribute changed.
predict(ports, wavelength)

Predicts the output when light is put in the specified port (see diagram above)

Parameters:
  • ports (2-tuple) – Specifies the port coming in and coming out
  • wavelength (float or ndarray) – Wavelength(s) to predict at
  • extra_arc (float, optional) – Adds phase to compensate for waveguides getting to gap function. Defaults to 0.
  • part ({"both", "mag", "ph"}, optional) – To speed up calculation, can calculate only magnitude (mag), phase (ph), or both. Defaults to both.
Returns:

k/t – The value of the light coming through

Return type:

complex ndarray

gds(filename=None, view=False, extra=0, units='nms')

Writes the geometry to the gds file

Parameters:
  • filename (str, optional) – Location to save file to. Defaults to None.
  • extra (int, optional) – Extra straight portion to add to ends of waveguides to make room in simulation (units same as units parameter). Defaults to 0.
  • units ({'microns' or 'nms'}, optional) – Units to save gds file in. Defaults to microns.
  • view (bool, optional) – Whether to visually show gds file. Defaults to False.
sparams(wavelength)

Returns scattering parameters

Runs SCEE to get scattering parameters at wavelength input.

Parameters:wavelength (float or ndarray) – wavelengths to get sparams at
Returns:
  • freq (ndarray) – frequency for s_matrix in Hz, size n (number of wavelength points)
  • s_matrix (ndarray) – size (n,4,4) complex matrix of scattering parameters, in order of passed in wavelengths

Double Half Ring

class SiPANN.scee.DoubleHalfRing(width, thickness, radius, gap, sw_angle=90)

This class will create two equally sized halfrings coupling.

It takes in a radius and gap along with usual waveguide parameters. Ports are numbered as:

|         2 \     / 4          |
|            \   /             |
|             ---              |
|             ---              |
|            /   \             |
|         1 /     \ 3          |
Parameters:
  • width (float or ndarray) – Width of the waveguide in nm
  • thickness (float or ndarray) – Thickness of waveguide in nm
  • radius (float or ndarray) – Distance from center of ring to middle of waveguide in nm.
  • gap (float or ndarray) – Minimum distance from ring waveguide edge to other ring waveguide edge in nm.
  • sw_angle (float or ndarray, optional) – Sidewall angle of waveguide from horizontal in degrees. Defaults to 90.
update(**kwargs)

Takes in any parameter defined by __init__ and changes it.

Parameters:attribute (float or ndarray) – Included if any device needs to have an attribute changed.
predict(ports, wavelength)

Predicts the output when light is put in the specified port (see diagram above)

Parameters:
  • ports (2-tuple) – Specifies the port coming in and coming out
  • wavelength (float or ndarray) – Wavelength(s) to predict at
  • extra_arc (float, optional) – Adds phase to compensate for waveguides getting to gap function. Defaults to 0.
  • part ({"both", "mag", "ph"}, optional) – To speed up calculation, can calculate only magnitude (mag), phase (ph), or both. Defaults to both.
Returns:

k/t – The value of the light coming through

Return type:

complex ndarray

gds(filename, extra=0, units='nm', view=False)

Writes the geometry to the gds file

Parameters:
  • filename (str, optional) – Location to save file to. Defaults to None.
  • extra (int, optional) – Extra straight portion to add to ends of waveguides to make room in simulation (units same as units parameter). Defaults to 0.
  • units ({'microns' or 'nms'}, optional) – Units to save gds file in. Defaults to microns.
  • view (bool, optional) – Whether to visually show gds file. Defaults to False.
sparams(wavelength)

Returns scattering parameters

Runs SCEE to get scattering parameters at wavelength input.

Parameters:wavelength (float or ndarray) – wavelengths to get sparams at
Returns:
  • freq (ndarray) – frequency for s_matrix in Hz, size n (number of wavelength points)
  • s_matrix (ndarray) – size (n,4,4) complex matrix of scattering parameters, in order of passed in wavelengths

Pushed Half Ring

class SiPANN.scee.AngledHalfRing(width, thickness, radius, gap, theta, sw_angle=90)

This class will create a halfring resonator with a pushed side.

It takes in a radius and gap along with usual waveguide parameters. Ports are numbered as:

|      2  \        / 4       |
|          \      /          |
|      1--- \    / ---3      |
|          \ \  / /          |
|           \ -- /           |
|            ----            |
Parameters:
  • width (float or ndarray) – Width of the waveguide in nm
  • thickness (float or ndarray) – Thickness of waveguide in nm
  • radius (float or ndarray) – Distance from center of ring to middle of waveguide in nm.
  • gap (float or ndarray) – Minimum distance from ring waveguide edge to straight waveguide edge in nm.
  • theta (float or ndarray) – Angle that the straight waveguide is curved in radians (???).
  • sw_angle (float or ndarray, optional) –
update(**kwargs)

Takes in any parameter defined by __init__ and changes it.

Parameters:attribute (float or ndarray) – Included if any device needs to have an attribute changed.
predict(ports, wavelength)

Predicts the output when light is put in the specified port (see diagram above)

Parameters:
  • ports (2-tuple) – Specifies the port coming in and coming out
  • wavelength (float or ndarray) – Wavelength(s) to predict at
  • extra_arc (float, optional) – Adds phase to compensate for waveguides getting to gap function. Defaults to 0.
  • part ({"both", "mag", "ph"}, optional) – To speed up calculation, can calculate only magnitude (mag), phase (ph), or both. Defaults to both.
Returns:

k/t – The value of the light coming through

Return type:

complex ndarray

gds(filename, extra=0, units='nm', view=False)

Writes the geometry to the gds file

Parameters:
  • filename (str, optional) – Location to save file to. Defaults to None.
  • extra (int, optional) – Extra straight portion to add to ends of waveguides to make room in simulation (units same as units parameter). Defaults to 0.
  • units ({'microns' or 'nms'}, optional) – Units to save gds file in. Defaults to microns.
  • view (bool, optional) – Whether to visually show gds file. Defaults to False.
sparams(wavelength)

Returns scattering parameters

Runs SCEE to get scattering parameters at wavelength input.

Parameters:wavelength (float or ndarray) – wavelengths to get sparams at
Returns:
  • freq (ndarray) – frequency for s_matrix in Hz, size n (number of wavelength points)
  • s_matrix (ndarray) – size (n,4,4) complex matrix of scattering parameters, in order of passed in wavelengths