Components

The components module holds all optical components currently defined in strapy. Each strapy optical component is defined in a separate class, and must inherit at least from the _Component class, and optionally from the _ScatterComponent or _TransferComponent class.

When defining new components, if not using the _ScatterComponent or _TransferComponent classes, care must be taken to ensure the correct stack attachment logic is employed in the _TransferComponent.initEquation method. Adding new components that do not inherit from the _ScatterComponent or _TransferComponent is therefore discouraged, to avoid cluttering the attachment logic.

Coupling of counter propagating electric field components is resolved as follows:

  • Sources always emit into stacks; sources set the ‘a’ components of their single node.
  • Beamsplitters always take inputs from stacks; the input to any port of the beamsplitter is the ‘a’ component at the given node.
  • General multi-port devices will always take inputs from stacks; the input to any port is the ‘a’ component at the given node.
  • Dumps always block the component going into the stack; the ‘b’ component is set to 0.

All direction logic therefore takes place in the stack equation initialisation. This ensures there is no change to the physics depending on how components are ordered. This model allows light to propagate in both directions simultaneously, so there should be no concept of ‘forwards’.

Eventually this should be automated by checking all nodes connect to at least one stack and inserting a identity matrix connection stack if this is not the case. In the long term placing individual components in their own file is probably a better approach as well.

strapy.components.BeamSplitter(name, nodes, …) Symmetrical beam splitter component with predefined scattering matrix.
strapy.components.Dump(name, nodes, model) Beam dump to terminate stack.
strapy.components.FaradayRotator(name, …) Faraday rotator with variable rotation angle.
strapy.components.IdealIsolator(name, nodes, …) Ideal optical isolator, prevents light propagating from the first node to the zeroth.
strapy.components.Mirror(name, nodes, model) Mirror for reflecting stack output back into input.
strapy.components.Polariser(name, nodes, model) Linear polariser with variable rotation angle, extinction ratio and loss for transmission of in-plane polarised light.
strapy.components.PolarisingBeamSplitter(…) Symmetrical polarising beam splitter component.
strapy.components.Reflector(name, nodes, model) Reflector with specified reflectivity coefficients, and separated inputs and outputs.
strapy.components.Source(name, nodes, model) Light source.
strapy.components.Stack(name, nodes, model) Stack of one or more layers for linking components.
strapy.components.Waveplate(name, nodes, model) Waveplate with variable retardance and rotation angle.

Beam splitter

class strapy.components.BeamSplitter(name, nodes, model)

Symmetrical beam splitter component with predefined scattering matrix.

Transmission and reflection properties are identical for all incident ports of the beam splitter. Can be used for non-polarising or polarising beam splitters by setting the amplitude coefficients for each polarisation.

Nodes: 4

Attributes:
name : str

Unique name of the component.

nodes : str

Nodes to which the component is attached.

model : strapy.Model()

Model in which component is to be included.

rP : complex

Ampltiude reflectivity coefficient for P polarised light.

rS : complex

Ampltiude reflectivity coefficient for S polarised light.

tP : complex

Ampltiude transmission coefficient for P polarised light.

tS : complex

Ampltiude transmission coefficient for S polarised light.

Methods

initEquation(nodes) Initialises sympy equation for component.
setVals() Returns numerical values needed to solve the network matrix.
initEquation(nodes)

Initialises sympy equation for component.

Should not need to be called by the user.

Parameters:
nodes : list of strapy.Node

Nodes to which the component is attached.

setVals()

Returns numerical values needed to solve the network matrix.

Should not need to be called by the user.

Dump

class strapy.components.Dump(name, nodes, model)

Beam dump to terminate stack.

Sets the input into the end of an otherwise uncoupled stack to zero. Dumps must be attached to all free stack ends for the network matrix equation to be fully defined.

Nodes: 1

Methods

initEquation(nodes) Initialises sympy equation for component.
initEquation(nodes)

Initialises sympy equation for component.

Should not need to be called by the user.

Parameters:
nodes : list of strapy.Node

Nodes to which the component is attached.

Faraday rotator

class strapy.components.FaradayRotator(name, nodes, model)

Faraday rotator with variable rotation angle.

Nodes: 2

Attributes:
rotation : double

Angle by which the incided polarisation state is rotated, measured clockwise looking from the zeroth node to the first.

Methods

initEquation(nodes) Initialises sympy equation for component.
setVals() Returns numerical values needed to solve the network matrix.
update() Updates numeric values of matrix from user set optical parameters.
initEquation(nodes)

Initialises sympy equation for component.

Should not need to be called by the user.

Parameters:
nodes : list of strapy.Node

Nodes to which the component is attached.

setVals()

Returns numerical values needed to solve the network matrix.

Should not need to be called by the user.

update()

Updates numeric values of matrix from user set optical parameters.

Must be called manually when values have been changed.

Ideal isolator

class strapy.components.IdealIsolator(name, nodes, model)

Ideal optical isolator, prevents light propagating from the first node to the zeroth.

Nodes: 2

Attributes:
isolationCoefficient : double

Fraction of intensity of light propagating from node 1 to 0 that is blocked by the isolator.

Methods

initEquation(nodes) Initialises sympy equation for component.
setVals() Returns numerical values needed to solve the network matrix.
update() Updates numeric values of matrix from user set optical parameters.
initEquation(nodes)

Initialises sympy equation for component.

Should not need to be called by the user.

Parameters:
nodes : list of strapy.Node

Nodes to which the component is attached.

setVals()

Returns numerical values needed to solve the network matrix.

Should not need to be called by the user.

update()

Updates numeric values of matrix from user set optical parameters.

Must be called manually when values have been changed.

Mirror

class strapy.components.Mirror(name, nodes, model)

Mirror for reflecting stack output back into input.

Connects to the end of a stack and couples together the inputs and outputs of the stack using the specified amplitude reflection coefficients.

Nodes: 1

Attributes:
rP : complex

P polarised amplitude reflectivity coefficient.

rS : complex

S polarised amplitude reflectivity coefficient.

Methods

initEquation(nodes) Initialises sympy equation for component.
setVals() Returns numerical values needed to solve the network matrix.
initEquation(nodes)

Initialises sympy equation for component.

Should not need to be called by the user.

Parameters:
nodes : list of strapy.Node

Nodes to which the component is attached.

setVals()

Returns numerical values needed to solve the network matrix.

Should not need to be called by the user.

Polariser

class strapy.components.Polariser(name, nodes, model)

Linear polariser with variable rotation angle, extinction ratio and loss for transmission of in-plane polarised light.

Nodes: 2

Attributes:
rotation : double

Rotation of the transmission axis of the polariser, measured clockwise from the S polarised axis, looking from the zeroth node to the first.

extinction : double

Extinction coefficient, defined as the intensity ratio of transmitted light polarised perpendicular to the transmission axis of the polariser to the intensity of transmitted light polarised parallel to the transmission axis.

loss : double

Transmission loss, defined as the intensity ratio of transmitted light polarised parallel to the transmission axis to the intensity of the component of the incident light polarised along that axis.

Methods

initEquation(nodes) Initialises sympy equation for component.
setVals() Returns numerical values needed to solve the network matrix.
update() Updates numeric values of matrix from user set optical parameters.
initEquation(nodes)

Initialises sympy equation for component.

Should not need to be called by the user.

Parameters:
nodes : list of strapy.Node

Nodes to which the component is attached.

setVals()

Returns numerical values needed to solve the network matrix.

Should not need to be called by the user.

update()

Updates numeric values of matrix from user set optical parameters.

Must be called manually when values have been changed.

Polarising beam splitter

class strapy.components.PolarisingBeamSplitter(name, nodes, model)

Symmetrical polarising beam splitter component.

A polarising beam splitter that reflects S polarised light and transmits P polarised light. Transmission and reflection properties are identical for all incident ports of the beam splitter.

Nodes: 4

Attributes:
name : str

Unique name of the component.

nodes : str

Nodes to which the component is attached.

model : strapy.Model()

Model in which component is to be included.

rExtinction : double

Polarisation extinction coefficient for the reflected beam. Defined as the intensity ratio of reflected P polarised light to reflected S polarised light.

tExtinction : double

Polarisation extinction coefficient for the transmitted beam. Defined as the intensity ratio of transmitted S polarised light to transmitted P polarised light.

sLoss : double

Defined as the sum of the intensities of the relfection and transmitted S polarised components.

pLoss : double

Defined as the sum of the intensities of the relfection and transmitted P polarised components.

theta0 : double

Rotation angle about the node 0 to node 2 axis, measured clockwise from the S polarised axis, looking from node 0 to 2.

theta1 : double

Rotation angle about the node 1 to node 3 axis, measured clockwise from the S polarised axis, looking from node 1 to 3.

Methods

initEquation(nodes) Initialises sympy equation for component.
setVals() Returns numerical values needed to solve the network matrix.
update() Updates numeric values of matrix from user set optical parameters.
initEquation(nodes)

Initialises sympy equation for component.

Should not need to be called by the user.

Parameters:
nodes : list of strapy.Node

Nodes to which the component is attached.

setVals()

Returns numerical values needed to solve the network matrix.

Should not need to be called by the user.

update()

Updates numeric values of matrix from user set optical parameters.

Must be called manually when values have been changed.

Reflector

class strapy.components.Reflector(name, nodes, model)

Reflector with specified reflectivity coefficients, and separated inputs and outputs. Rotation allows for change of polarisation axes.

Allows for polarisation mixing on reflection.

Nodes: 2

Attributes:
rpp : complex

Reflectivity coefficient for P to P polarised light.

rss : complex

Reflectivity coefficient for S to S polarised light.

rps : complex

Reflectivity coefficient for P to S polarised light.

rsp : complex

Reflectivity coefficient for S to P polarised light.

rotation : double

Rotation of polarisation coordinate system relative the rest of the model, measured clockwise from the S polarised axis looking from the zeroth node to the first.

Methods

initEquation(nodes) Initialises sympy equation for component.
setVals() Returns numerical values needed to solve the network matrix.
update() Updates numeric values of matrix from user set optical parameters.
initEquation(nodes)

Initialises sympy equation for component.

Should not need to be called by the user.

Parameters:
nodes : list of strapy.Node

Nodes to which the component is attached.

setVals()

Returns numerical values needed to solve the network matrix.

Should not need to be called by the user.

update()

Updates numeric values of matrix from user set optical parameters.

Must be called manually when values have been changed.

Source

class strapy.components.Source(name, nodes, model)

Light source.

Nodes: 1

Attributes:
name : str

Unique name of the component.

nodes : str

Node to which the component is attached.

model : strapy.Model()

Model in which component is to be included.

amplitude : list of complex

Jones amplitude vector of the emitted light. Defaults to S polarised light. Should be set by user for other polarisations.

node_number : int

Number of nodes component attaches to. Should not be changed.

Methods

initEquation(nodes) Initialises sympy equation for component.
setVals() Returns numerical values needed to solve the network matrix.
initEquation(nodes)

Initialises sympy equation for component.

Should not need to be called by the user.

Parameters:
nodes : list of strapy.Node

Nodes to which the component is attached.

setVals()

Returns numerical values needed to solve the network matrix.

Should not need to be called by the user.

Stack

class strapy.components.Stack(name, nodes, model)

Stack of one or more layers for linking components. Nodes: 2

Methods

initEquation(nodes) Initialises sympy equation for component.
setVals() Returns numerical values needed to solve the network matrix.
set_length(length[, loss]) Sets stack transfer matrix to a single layer of thickness length, in units of wavelength.
set_pyctmm(cstack) Sets stack transfer matrix to that of a pyctmm stack.
set_length(length, loss=0)

Sets stack transfer matrix to a single layer of thickness length, in units of wavelength. An intensity loss can also be included.

Parameters:
length : double

Optical thickness of stack in units of wavelength.

loss : double

Intensity loss for propagation through stack.

set_pyctmm(cstack)

Sets stack transfer matrix to that of a pyctmm stack.

pyctmm allows multilayer stacks to be defined, this can be used for optical paths consisting of several parallel interfaces between materials, or to model thin film stacks, for example anti-reflection coatings. Metallic materials can also be modelled, allowing realistic properties of metallic mirrors to be modeled.

The pyctmm stack will be evaluated when passed to this function, so all desired properties of the stack should have already been set. If the stack properties are changed, this function should be called again.

Parameters:
cstack : pyctmm stack

A pyctmm with pre-set layer thicknesses and refractive indexes.

Waveplate

class strapy.components.Waveplate(name, nodes, model)

Waveplate with variable retardance and rotation angle.

Nodes: 2

Attributes:
rotation : double

Rotation of waveplate, measured clockwise from the S polarised axis, looking from the zeroth node to the first.

retardance : double

Phase retardance of the waveplate - the phase difference introduced between polarisation components passing through the fast and slow axes of the waveplate.

Methods

initEquation(nodes) Initialises sympy equation for component.
setVals() Returns numerical values needed to solve the network matrix.
update() Updates numeric values of matrix from user set optical parameters.
initEquation(nodes)

Initialises sympy equation for component.

Should not need to be called by the user.

Parameters:
nodes : list of strapy.Node

Nodes to which the component is attached.

setVals()

Returns numerical values needed to solve the network matrix.

Should not need to be called by the user.

update()

Updates numeric values of matrix from user set optical parameters.

Must be called manually when values have been changed.

Utility functions

components.rotationMatrix44()

Returns rotation matrix for vector ordered (a0P, a0S, a1P, a1S).

The calculated rotation matrix rotates both the forward and backward propagating polarisation vectors at a node.

Parameters:
theta : double

Rotation angle, measured clockwise when looking from the first to the second node.

Returns:
rMat : numpy.ndarray

Rotation matrix.

components.rotationMatrix88(theta1)

Calculates rotation matrix for vector ordered (a0P, a0S, a1P, a1S, a2P, a2S, a3P, a3S).

Intended for coordinate rotations at four port devices (for example beam splitters). Note that this does not rotate the optical component, it just allows the S and P polarised states of the component to be misaligned relative to the S and P polarised states of the rest of the model.

Parameters:
theta0 : double

Rotation angle about zeroth to second node axis, measured clockwise when looking from the zeroth node to the second.

theta1 : double

Rotation angle about first to third node axis, measured clockwise looking from the first node to the third.

Returns:
rMat : numpy.ndarray

Rotation matrix.