Components¶
The components module holds all optical components currently defined in scampy. Each scampy 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.
|
Symmetrical beam splitter component with predefined scattering matrix. |
|
Beam dump to terminate stack. |
|
Faraday rotator with variable rotation angle. |
|
Ideal optical isolator, prevents light propagating from the first node to the zeroth. |
|
Mirror for reflecting stack output back into input. |
|
Linear polariser with variable rotation angle, extinction ratio and loss for transmission of in-plane polarised light. |
Symmetrical polarising beam splitter component. |
|
|
Reflector with specified reflectivity coefficients, and separated inputs and outputs. |
|
Light source. |
|
Stack of one or more layers for linking components. |
|
Waveplate with variable retardance and rotation angle. |
Beam splitter¶
-
class
scampy.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
- namestr
Unique name of the component.
- nodesstr
Nodes to which the component is attached.
- modelscampy.Model()
Model in which component is to be included.
- rPcomplex
Ampltiude reflectivity coefficient for P polarised light.
- rScomplex
Ampltiude reflectivity coefficient for S polarised light.
- tPcomplex
Ampltiude transmission coefficient for P polarised light.
- tScomplex
Ampltiude transmission coefficient for S polarised light.
Methods
initEquation
(self, nodes)Initialises sympy equation for component.
setVals
(self)Returns numerical values needed to solve the network matrix.
-
initEquation
(self, nodes)¶ Initialises sympy equation for component.
Should not need to be called by the user.
- Parameters
- nodeslist of scampy.Node
Nodes to which the component is attached.
-
setVals
(self)¶ Returns numerical values needed to solve the network matrix.
Should not need to be called by the user.
Dump¶
-
class
scampy.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
(self, nodes)Initialises sympy equation for component.
-
initEquation
(self, nodes)¶ Initialises sympy equation for component.
Should not need to be called by the user.
- Parameters
- nodeslist of scampy.Node
Nodes to which the component is attached.
-
Faraday rotator¶
-
class
scampy.components.
FaradayRotator
(name, nodes, model)¶ Faraday rotator with variable rotation angle.
Nodes: 2
- Attributes
- rotationdouble
Angle by which the incided polarisation state is rotated, measured clockwise looking from the zeroth node to the first.
Methods
initEquation
(self, nodes)Initialises sympy equation for component.
setVals
(self)Returns numerical values needed to solve the network matrix.
update
(self)Updates numeric values of matrix from user set optical parameters.
-
initEquation
(self, nodes)¶ Initialises sympy equation for component.
Should not need to be called by the user.
- Parameters
- nodeslist of scampy.Node
Nodes to which the component is attached.
-
setVals
(self)¶ Returns numerical values needed to solve the network matrix.
Should not need to be called by the user.
-
update
(self)¶ Updates numeric values of matrix from user set optical parameters.
Must be called manually when values have been changed.
Ideal isolator¶
-
class
scampy.components.
IdealIsolator
(name, nodes, model)¶ Ideal optical isolator, prevents light propagating from the first node to the zeroth.
Nodes: 2
- Attributes
- isolationCoefficientdouble
Fraction of intensity of light propagating from node 1 to 0 that is blocked by the isolator.
Methods
initEquation
(self, nodes)Initialises sympy equation for component.
setVals
(self)Returns numerical values needed to solve the network matrix.
update
(self)Updates numeric values of matrix from user set optical parameters.
-
initEquation
(self, nodes)¶ Initialises sympy equation for component.
Should not need to be called by the user.
- Parameters
- nodeslist of scampy.Node
Nodes to which the component is attached.
-
setVals
(self)¶ Returns numerical values needed to solve the network matrix.
Should not need to be called by the user.
-
update
(self)¶ Updates numeric values of matrix from user set optical parameters.
Must be called manually when values have been changed.
Mirror¶
-
class
scampy.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
- rPcomplex
P polarised amplitude reflectivity coefficient.
- rScomplex
S polarised amplitude reflectivity coefficient.
Methods
initEquation
(self, nodes)Initialises sympy equation for component.
setVals
(self)Returns numerical values needed to solve the network matrix.
-
initEquation
(self, nodes)¶ Initialises sympy equation for component.
Should not need to be called by the user.
- Parameters
- nodeslist of scampy.Node
Nodes to which the component is attached.
-
setVals
(self)¶ Returns numerical values needed to solve the network matrix.
Should not need to be called by the user.
Polariser¶
-
class
scampy.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
- rotationdouble
Rotation of the transmission axis of the polariser, measured clockwise from the S polarised axis, looking from the zeroth node to the first.
- extinctiondouble
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.
- lossdouble
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
(self, nodes)Initialises sympy equation for component.
setVals
(self)Returns numerical values needed to solve the network matrix.
update
(self)Updates numeric values of matrix from user set optical parameters.
-
initEquation
(self, nodes)¶ Initialises sympy equation for component.
Should not need to be called by the user.
- Parameters
- nodeslist of scampy.Node
Nodes to which the component is attached.
-
setVals
(self)¶ Returns numerical values needed to solve the network matrix.
Should not need to be called by the user.
-
update
(self)¶ Updates numeric values of matrix from user set optical parameters.
Must be called manually when values have been changed.
Polarising beam splitter¶
-
class
scampy.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
- namestr
Unique name of the component.
- nodesstr
Nodes to which the component is attached.
- modelscampy.Model()
Model in which component is to be included.
- rExtinctiondouble
Polarisation extinction coefficient for the reflected beam. Defined as the intensity ratio of reflected P polarised light to reflected S polarised light.
- tExtinctiondouble
Polarisation extinction coefficient for the transmitted beam. Defined as the intensity ratio of transmitted S polarised light to transmitted P polarised light.
- sLossdouble
Defined as the sum of the intensities of the relfection and transmitted S polarised components.
- pLossdouble
Defined as the sum of the intensities of the relfection and transmitted P polarised components.
- theta0double
Rotation angle about the node 0 to node 2 axis, measured clockwise from the S polarised axis, looking from node 0 to 2.
- theta1double
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
(self, nodes)Initialises sympy equation for component.
setVals
(self)Returns numerical values needed to solve the network matrix.
update
(self)Updates numeric values of matrix from user set optical parameters.
-
initEquation
(self, nodes)¶ Initialises sympy equation for component.
Should not need to be called by the user.
- Parameters
- nodeslist of scampy.Node
Nodes to which the component is attached.
-
setVals
(self)¶ Returns numerical values needed to solve the network matrix.
Should not need to be called by the user.
-
update
(self)¶ Updates numeric values of matrix from user set optical parameters.
Must be called manually when values have been changed.
Reflector¶
-
class
scampy.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
- rppcomplex
Reflectivity coefficient for P to P polarised light.
- rsscomplex
Reflectivity coefficient for S to S polarised light.
- rpscomplex
Reflectivity coefficient for P to S polarised light.
- rspcomplex
Reflectivity coefficient for S to P polarised light.
- rotationdouble
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
(self, nodes)Initialises sympy equation for component.
setVals
(self)Returns numerical values needed to solve the network matrix.
update
(self)Updates numeric values of matrix from user set optical parameters.
-
initEquation
(self, nodes)¶ Initialises sympy equation for component.
Should not need to be called by the user.
- Parameters
- nodeslist of scampy.Node
Nodes to which the component is attached.
-
setVals
(self)¶ Returns numerical values needed to solve the network matrix.
Should not need to be called by the user.
-
update
(self)¶ Updates numeric values of matrix from user set optical parameters.
Must be called manually when values have been changed.
Source¶
-
class
scampy.components.
Source
(name, nodes, model)¶ Light source.
Nodes: 1
- Attributes
- namestr
Unique name of the component.
- nodesstr
Node to which the component is attached.
- modelscampy.Model()
Model in which component is to be included.
- amplitudelist of complex
Jones amplitude vector of the emitted light. Defaults to S polarised light. Should be set by user for other polarisations.
- node_numberint
Number of nodes component attaches to. Should not be changed.
Methods
initEquation
(self, nodes)Initialises sympy equation for component.
setVals
(self)Returns numerical values needed to solve the network matrix.
-
initEquation
(self, nodes)¶ Initialises sympy equation for component.
Should not need to be called by the user.
- Parameters
- nodeslist of scampy.Node
Nodes to which the component is attached.
-
setVals
(self)¶ Returns numerical values needed to solve the network matrix.
Should not need to be called by the user.
Stack¶
-
class
scampy.components.
Stack
(name, nodes, model)¶ Stack of one or more layers for linking components. Nodes: 2
Methods
initEquation
(self, nodes)Initialises sympy equation for component.
setVals
(self)Returns numerical values needed to solve the network matrix.
set_length
(self, length)Sets stack transfer matrix to a single layer of thickness length, in units of wavelength.
set_pyctmm
(self, cstack)Sets stack transfer matrix to that of a pyctmm stack.
-
set_length
(self, length)¶ Sets stack transfer matrix to a single layer of thickness length, in units of wavelength.
- Parameters
- lengthdouble
Optical thickness of stack in units of wavelength.
-
set_pyctmm
(self, 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
- cstackpyctmm stack
A pyctmm with pre-set layer thicknesses and refractive indexes.
-
Waveplate¶
-
class
scampy.components.
Waveplate
(name, nodes, model)¶ Waveplate with variable retardance and rotation angle.
Nodes: 2
- Attributes
- rotationdouble
Rotation of waveplate, measured clockwise from the S polarised axis, looking from the zeroth node to the first.
- retardancedouble
Phase retardance of the waveplate - the phase difference introduced between polarisation components passing through the fast and slow axes of the waveplate.
Methods
initEquation
(self, nodes)Initialises sympy equation for component.
setVals
(self)Returns numerical values needed to solve the network matrix.
update
(self)Updates numeric values of matrix from user set optical parameters.
-
initEquation
(self, nodes)¶ Initialises sympy equation for component.
Should not need to be called by the user.
- Parameters
- nodeslist of scampy.Node
Nodes to which the component is attached.
-
setVals
(self)¶ Returns numerical values needed to solve the network matrix.
Should not need to be called by the user.
-
update
(self)¶ Updates numeric values of matrix from user set optical parameters.
Must be called manually when values have been changed.
Utility functions¶
-
components.
rotationMatrix44
(theta)¶ 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
- thetadouble
Rotation angle, measured clockwise when looking from the first to the second node.
- Returns
- rMatnumpy.ndarray
Rotation matrix.
-
components.
rotationMatrix88
(theta0, 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
- theta0double
Rotation angle about zeroth to second node axis, measured clockwise when looking from the zeroth node to the second.
- theta1double
Rotation angle about first to third node axis, measured clockwise looking from the first node to the third.
- Returns
- rMatnumpy.ndarray
Rotation matrix.