Flex Device Library

API Documentation

pyOptiShared.Designs.flex_crossing(cross_dw)

Creates a waveguide crossing with flexable crossing section.

pyOptiShared.Designs.flex_taper(widths[, ...])

Creates a taper waveguide with varying widths.

pyOptiShared.Designs.flex_splitter(widths, ...)

Creates a splitter where its main body consists of multiple sections of different widths.

pyOptiShared.Designs.flex_bend90(dr_in, dr_out)

Creates a flexable 90 degrees bend where the bend body consists of multiple sections of different width

pyOptiShared.Designs.rotate_curve(x, y, ...)

Rotate a curve defined by x and y arrays by a given angle around a center point.

pyOptiShared.Designs.flex_bend90(dr_in: ndarray, dr_out: ndarray, waveguide_width: float = 0.5, radius: float = 2, resolution: int = 40, layer: int = 1, write: bool = False) Cell

Creates a flexable 90 degrees bend where the bend body consists of multiple sections of different width

Parameters:
  • dr_in (np.ndarray) – An array that contains the changes in the radius of the input section.

  • dr_out (np.ndarray) – An array that contains the changes in the radius of the output section.

  • waveguide_width (float, optional) – Port width. Defaults to 0.5.

  • radius (float, optional) – Defines the radius of the bend. Defaults to 2.

  • resolution (int, optional) – The order of the polynomial used to smooth the body section widths. Defaults to 40.

  • layer (int, optional) – Defines the layer number where the bend resides. Defaults to 1.

  • write (bool, optional) – Write the created GDS file. Defaults to False.

Returns:

a gdstk library cell that contains the device.

Return type:

gdstk.Cell

pyOptiShared.Designs.flex_crossing(cross_dw: ndarray, width: float = 0.5, length: float = 1, dsep: float = 2, resolution=40, layer: int = 1, write: bool = False)

Creates a waveguide crossing with flexable crossing section.

Parameters:
  • cross_dw (np.ndarray) – Array of widths variations

  • width (float, optional) – Input port width. Defaults to 0.5.

  • length (float, optional) – Length of each section in the crossing. Defaults to 1.

  • dsep (float, optional) – Separation of the straight. Defaults to 2.

  • layer (int, optional) – Defines the layer number of the device.

  • write (bool, optional) – Use to write the generated gds. Defaults to False.

Returns:

gdstk cell

Return type:

gdstk.Cell

pyOptiShared.Designs.flex_splitter(widths: ndarray, length: float, waveguide_input: float = 0.5, taper_length: float = 3.0, taper_input: float = 1.0, resolution: int = 20, layer: int = 1, write: bool = False) Library

Creates a splitter where its main body consists of multiple sections of different widths.

Parameters:
  • widths (np.ndarray) – Array of widths in the taper section.

  • length (float) – Total length of the splitter body

  • waveguide_input (float, optional) – Input port width. Defaults to 0.5.

  • taper_length (float, optional) – Length of the taper section of the connected waveguides. Defaults to 3.0.

  • taper_input (float, optional) – The width of the taper connected to the splitter body. Defaults to 1.00.

  • resolution (int, optional) – The order of the polynomial used to smooth the body section widths. Defaults to 20.

  • layer (int, optional) – Defines the layer number of the device.

  • write (bool, optional) – Use to write the generated gds. Defaults to False.

Returns:

A gdstk Library of the created device.

Return type:

gdstk.Library

pyOptiShared.Designs.flex_taper(widths: ndarray, input_length: float = 0.3, taper_length: float = 1.0, in_width: float = 0.5, out_width: float = 2.0, resolution: int = 20, layer: int = 1, write: bool = False) Library

Creates a taper waveguide with varying widths.

Parameters:
  • widths (np.ndarray) – array of widths that defines the taper section

  • input_length (float, optional) – input waveguide length. Defaults to 0.3.

  • taper_length (float, optional) – taper length. Defaults to 1.0.

  • in_width (float, optional) – input waveguide width. Defaults to 0.5.

  • out_width (float, optional) – output waveguide width. Defaults to 2.0.

  • resolution (int, optional) – the order of polynomial fit used to smooth the widths of the taper section. Defaults to 20.

  • layer (int, optional) – Defines the layer number of the device.

  • write (bool, optional) – Use to write the generated gds. Defaults to False.

Returns:

gdstk library that holds the created device.

Return type:

gdstk.library

pyOptiShared.Designs.rotate_curve(x, y, angle_degrees, center=(0, 0))

Rotate a curve defined by x and y arrays by a given angle around a center point.

Parameters:
  • x (array-like) – x-coordinates of the curve

  • y (array-like) – y-coordinates of the curve

  • angle_degrees (float) – rotation angle in degrees (counter-clockwise)

  • center (tuple) – (x0, y0) point around which to rotate

Returns:

Rotated x and y coordinates (numpy arrays)

Return type:

x_rot, y_rot