femto.waveguide module#

class Waveguide(scan=1, speed=1.0, samplesize=(100, 50), x_init=-2.0, y_init=0.0, z_init=None, lsafe=2.0, speed_closed=5, speed_pos=0.5, cmd_rate_max=1200, acc_max=500, _x=array([], dtype=float32), _y=array([], dtype=float32), _z=array([], dtype=float32), _f=array([], dtype=float32), _s=array([], dtype=float32), depth=0.035, radius=15, pitch=0.08, pitch_fa=0.127, int_dist=None, int_length=0.0, arm_length=0.0, dz_bridge=0.007)#

Bases: LaserPath

Class that computes and stores the coordinates of an optical waveguide.

depth: float = 0.035#

Distance for sample’s bottom facet

radius: float = 15#

Curvature radius

pitch: float = 0.08#

Distance between adjacent modes

pitch_fa: float = 0.127#

Distance between fiber arrays’ adjacent modes (for fan-in, fan-out)

int_dist: float | None = None#

Directional Coupler’s interaction distance

int_length: float = 0.0#

Directional Coupler’s interaction length

arm_length: float = 0.0#

Mach-Zehnder interferometer’s length of central arm

dz_bridge: float = 0.007#

Maximum z-height for 3D bridges

property dy_bend: float#

y-displacement of an S-bend.

Returns

The difference between the waveguide pitch and the interaction distance.

Return type

float

property dx_bend: float#

x-displacement of an S-bend.

Return type

float

property dx_coupler: float#

x-displacement of a Directional Coupler.

Returns

Sum of two x-displacements S-bend segments and the interaction distance straight segment.

Return type

float

property dx_mzi: float#

x-displacement of a Mach-Zehnder Interferometer.

Returns

Sum of two x-displacements Directional Coupler segments and the arm_length distance straight segment.

Return type

float

static get_sbend_parameter(dy, radius)#

Compute the rotation angle, and x-displacement for a circular S-bend.

Parameters
  • dy (float, optional) – Displacement along y-direction [mm].

  • radius (float, optional) – Curvature radius of the S-bend [mm]. The default value is self.radius

Returns

rotation angle [rad], x-displacement [mm].

Return type

tuple(float, float)

get_spline_parameter(disp_x=None, disp_y=None, disp_z=None, radius=None)#

Compute x, y, z displacement, and length of the curve.

The disp_x, disp_y and disp_z displacements are given as input. If disp_x is unknown and it is computed using the get_sbend_parameter() method for the given radius. In this latter case, the l_curve is computed using the formula for the circular arc (radius * angle) which is then multiply by a factor of 2 in order to retrieve the S-bend shape.

Parameters
  • disp_x (float) – Displacement along x-direction [mm].

  • disp_y (float) – Displacement along y-direction [mm].

  • disp_z (float) – Displacement along z-direction [mm].

  • radius (float, optional) – Curvature radius [mm]. The default value is self.radius.

Returns

x, y, z-displacements [mm] and the length of the curve [mm].

Return type

tuple(float, float, float)

circ(initial_angle, final_angle, radius=None, shutter=1, speed=None)#

Add a circular curved path to the waveguide.

Computes the points in the xy-plane that connects two angles (initial_angle and final_angle) with a circular arc of a given radius. The transition speed and the shutter state during the movement can be given as input.

Parameters
  • initial_angle (float) – Starting angle of the circular arc [radians].

  • final_angle (float) – Final angle of the circular arc [radians].

  • radius (float, optional) – Curvature radius [mm]. The default value is self.radius

  • shutter (int) – State of the shutter during the transition (0: ‘OFF’, 1: ‘ON’). The default value is 1.

  • speed (float, optional) – Translation speed [mm/s]. The default value is self.speed.

Return type

The object itself.

arc_bend(dy, radius=None, shutter=1, speed=None)#

Concatenate two circular arc to make a circular S-bend.

The vertical displacement of the S-bend and the curvature radius are given as input. Starting and ending angles of the arcs are computed automatically.

The sign of dy encodes the direction of the S-bend:

  • dy > 0, upward S-bend

  • dy < 0, downward S-bend

Parameters
  • dy (float) – Vertical displacement of the waveguide of the S-bend [mm].

  • radius (float, optional) – Curvature radius [mm]. The default value is self.radius.

  • shutter (int) – State of the shutter during the transition (0: ‘OFF’, 1: ‘ON’). The default value is 1.

  • speed (float, optional) – Translation speed [mm/s]. The default value is self.speed.

Return type

The object itself.

arc_coupler(dy, radius=None, int_length=None, shutter=1, speed=None)#

Concatenates two circular S-bend to make a single mode of a circular Directional Coupler.

Parameters
  • dy (float) – Vertical displacement of the waveguide of the S-bend [mm].

  • radius (float, optional) – Curvature radius [mm]. The default value is self.radius.

  • int_length (float, optional) – Length of the Directional Coupler’s straight interaction region [mm]. The default is self.int_length.

  • shutter (int) – State of the shutter during the transition (0: ‘OFF’, 1: ‘ON’). The default value is 1.

  • speed (float, optional) – Translation speed [mm/s]. The default value is self.speed.

Return type

The object itself.

See also

circ

Add a circular curved path to the waveguide.

arc_bend

Concatenate two circular arc to make a circular S-bend.

arc_mzi(dy, radius=None, int_length=None, arm_length=None, shutter=1, speed=None)#

Concatenates two circular Directional Couplers curves to make a single mode of a circular Mach-Zehnder Interferometer.

Parameters
  • dy (float) – Vertical displacement of the waveguide of the S-bend [mm].

  • radius (float, optional) – Curvature radius [mm]. The default value is self.radius.

  • int_length (float, optional) – Length of the Directional Coupler’s straight interaction region [mm]. The default is self.int_length.

  • arm_length (float) – Length of the Mach-Zehnder Interferometer’s straight arm [mm]. The default is self.arm_length.

  • shutter (int) – State of the shutter during the transition (0: ‘OFF’, 1: ‘ON’). The default value is 1.

  • speed (float, optional) – Translation speed [mm/s]. The default value is self.speed.

Return type

The object itself.

See also

circ

Add a circular curved path to the waveguide.

arc_bend

Concatenate two circular arc to make a circular S-bend.

arc_coupler

Concatenates two circular S-bend to make a single mode of a circular Directional Coupler.

sin_bridge(dy, dz=None, omega=(1.0, 1.0), radius=None, shutter=1, speed=None)#

Add a sinusoidal curved path to the waveguide.

Combines sinusoidal bend curves in the xy- and xz-plane. The x-displacement between the initial and final point is identical to the one of the (circular) S-bend computed with the same radius.

The sign of the y, z displacement encodes the direction of the sin-bend:

  • d > 0, upward sin-bend

  • d < 0, downward sin-bend

Parameters
  • dy (float) – y displacement of the sinusoidal-bend [mm].

  • dz (float, optional) – z displacement of the sinusoidal-bend [mm]. The default values is self.dz_bridge

  • omega (tuple(float, float)) – Frequency of the Sin-bend oscillations for y and z coordinates, respectively. The deafult values are fy = 1, fz = 1.

  • radius (float, optional) – Curvature radius [mm]. The default value is self.radius.

  • shutter (int) – State of the shutter during the transition (0: ‘OFF’, 1: ‘ON’). The default value is 1.

  • speed (float, optional) – Translation speed [mm/s]. The default value is self.speed.

Return type

The object itself.

Notes

The radius is an effective radius. The given radius is used to compute the x displacement using the get_sbend_parameter method. The radius of curvature of the overall curve will be lower (in general) than the specified radius.

See also

get_sbend_parameter

Compute the rotation angle, and x-displacement for a circular S-bend.

sin_bend(dy, *, dz=0.0, omega=(1.0, 2.0), radius=None, shutter=1, speed=None)#
Return type

Waveguide

sin_comp(dy, *, dz=0.0, omega=(2.0, 2.0), radius=None, shutter=1, speed=None)#
Return type

Waveguide

sin_coupler(dy, radius=None, int_length=None, shutter=1, speed=None)#

Concatenates two sinusoidal S-bend to make a single mode of a circular Directional Coupler.

Parameters
  • dy (float) – Vertical displacement of the waveguide of the sinusoidal-bend [mm].

  • radius (float, optional) – Curvature radius [mm]. The default value is self.radius.

  • int_length (float, optional) – Length of the Directional Coupler’s straight interaction region [mm]. The default is self.int_length.

  • shutter (int) – State of the shutter during the transition (0: ‘OFF’, 1: ‘ON’). The default value is 1.

  • speed (float, optional) – Translation speed [mm/s]. The default value is self.speed.

Return type

The object itself.

See also

sin_bridge

Add a sinusoidal curved path to the waveguide.

sin_bend

Concatenate two circular arc to make a sinusoidal S-bend.

sin_mzi(dy, radius=None, int_length=None, arm_length=None, shutter=1, speed=None)#

Concatenates two sinusoidal Directional Couplers curves to make a single mode of a circular Mach-Zehnder Interferometer.

Parameters
  • dy (float) – Vertical displacement of the waveguide of the sinusoidal-bend [mm].

  • radius (float, optional) – Curvature radius [mm]. The default value is self.radius.

  • int_length (float, optional) – Length of the Directional Coupler’s straight interaction region [mm]. The default is self.int_length.

  • arm_length (float) – Length of the Mach-Zehnder Interferometer’s straight arm [mm]. The default is self.arm_length.

  • shutter (int) – State of the shutter during the transition (0: ‘OFF’, 1: ‘ON’). The default value is 1.

  • speed (float, optional) – Translation speed [mm/s]. The default value is self.speed.

Return type

The object itself.

See also

sin_bridge

Add a sinusoidal curved path to the waveguide.

sin_bend

Concatenate two circular arc to make a sinusoidal S-bend.

sin_coupler

Concatenates two sinusoidal S-bend to make a single mode of a circular Directional Coupler.

spline(disp_x, disp_y, disp_z, init_pos=None, radius=None, shutter=1, speed=None, bc_y=((1, 0.0), (1, 0.0)), bc_z=((1, 0.0), (1, 0.0)))#

Connect the current position to a new point with a Bezier curve.

It takes in an initial position (x_0, y_0, z_0) and linear displacements in the x, y, and z directions. The final point of the curved is computed as (x_0 + dx, y_0 + dy, z_0 + dz). The points are connected with a Cubic Spline function.

Parameters
  • disp_x (float) – x-displacement from initial position [mm].

  • disp_y (float) – y-displacement from initial position [mm].

  • disp_z (float) – z-displacement from initial position [mm].

  • init_pos (numpy.ndarray, optional) – x-displacement from initial position.

  • radius (float, optional) – Curvature radius [mm]. The default value is self.radius.

  • shutter (int) – State of the shutter during the transition (0: ‘OFF’, 1: ‘ON’). The default value is 1.

  • speed (float, optional) – Translation speed [mm/s]. The default value is self.speed.

  • bc_y (2-tuple, optional) –

    Boundary condition type.

    The tuple (order, deriv_values) allows to specify arbitrary derivatives at curve ends. The first and the second value will be applied at the curve start and end respectively:

    • order: the derivative order, 1 or 2.

    • deriv_value: array_like containing derivative values.

  • bc_z (2-tuple, optional) –

    Boundary condition type.

    The tuple (order, deriv_values) allows to specify arbitrary derivatives at curve ends. The first and the second value will be applied at the curve start and end respectively:

    • order: the derivative order, 1 or 2.

    • deriv_value: array_like containing derivative values.

Return type

The object itself.

See also

CubicSpline

Cubic spline data interpolator.

spline_bridge(disp_x, disp_y, disp_z, init_pos=None, radius=None, shutter=1, speed=None)#

Connect two points in the xy plane with a Bezier curve bridge.

It takes in an initial position (x_0, y_0, z_0) and linear displacements in the x, y, and z directions. The final point of the curved is computed as (x_0 +d_x, y_0 +d_y, z_0 +d_z). The points are connected with a sequence of two spline segments.

The spline segments join at the peak of the bridge. In this point it is required to have a derivative along the z direction of df(x, z)/dz = 0 and a derivative along the y direction that is contiunous. This latter value is fixed to be df(x, y)/dx = disp_y/disp_y. The values of the first derivatives df(x, y)/dx, df(x, z)/dx are set to zero in the initial and final point of the spline bridge.

Moreover, to increase the regularity of the curve, the points of the spline bridge are fitted with a spline of the 5-th order. In this way the final curve has second derivatives close to zero (~1e-4) while maintaining the first derivative to zero.

Parameters
  • disp_x (float) – x-displacement from initial position [mm].

  • disp_y (float) – y-displacement from initial position [mm].

  • disp_z (float) – z-displacement from initial position [mm].

  • init_pos (numpy.ndarray, optional) – x-displacement from initial position.

  • radius (float, optional) – Curvature radius [mm]. The default value is self.radius.

  • shutter (int) – State of the shutter during the transition (0: ‘OFF’, 1: ‘ON’). The default value is 1.

  • speed (float, optional) – Translation speed [mm/s]. The default value is self.speed.

Return type

The object itself.

See also

CubicSpline

Cubic spline data interpolator.

InterpolatedUnivariateSpline

1-D interpolating spline for a given set of data points.

spline

Connect the current position to a new point with a Bezier curve.

class NasuWaveguide(scan=1, speed=1.0, samplesize=(100, 50), x_init=-2.0, y_init=0.0, z_init=None, lsafe=2.0, speed_closed=5, speed_pos=0.5, cmd_rate_max=1200, acc_max=500, _x=array([], dtype=float32), _y=array([], dtype=float32), _z=array([], dtype=float32), _f=array([], dtype=float32), _s=array([], dtype=float32), depth=0.035, radius=15, pitch=0.08, pitch_fa=0.127, int_dist=None, int_length=0.0, arm_length=0.0, dz_bridge=0.007, adj_scan_shift=(0, 0.0004, 0), adj_scan=5)#

Bases: Waveguide

Class that computes and stores the coordinates of a Nasu optical waveguide 1.

References

1

Nasu Waveguides on Optics Letters.

adj_scan_shift: tuple[float, float, float] = (0, 0.0004, 0)#

(x, y, z)-shifts between adjacent passes

adj_scan: int = 5#

Number of adjacent scans

property adj_scan_order: list[float]#

Scan order.

Given the number of adjacent scans it computes the list of adjacent scans as:

  • if self.adj_scan is odd

    [0, 1, -1, 2, -2, ...]

  • if self.adj_scan is even

    [0.5, -0.5, 1.5, -1.5, 2.5, -2.5, ...]

Returns

Ordered list of adjacent scans.

Return type

list(float)

coupler(param, nasu=False)#

Directional coupler.

Creates the two modes of a Directional Coupler. Waveguides can be standard multi-scan waveguides or Nasu Waveguides. The interaction region of the coupler is in the center of the sample.

Parameters
  • param (dict) – Set of Waveguide parameters.

  • nasu (bool, optional) – Flag value for selecting Nasu Waveguide over standard multi-scan Waveguides. The default value is False.

Returns

List of the two modes of the Directional Coupler.

Return type

list(Waveguide) or list(NasuWaveguide)