rcwa API¶
There are four main user-facing classes: Solver
, Layer
, LayerStack
, Source
, Material
, Crystal
, and Plotter
. The Layer
class is used to set up the individual simulation layers and define their properties, including thickness, material properties, and crystal structures (if applicable). The Material
class can be passed into the Layer
class to define a layer whose material properties are dependent on refractive index. The Crystal
class is used to define layers which are periodic in x and y, and is also passed into the Layer
class. Once all individual layers are constructed, they are used to create a LayerStack
, which contains information about which region is considered the “incident” region and which is the “transmission” region (both are semi-infinite).
The Source
class is used to define the excitation source - the wavelength, polarization, and incident angle.
Once the user has created a Source
and LayerStack
class, these are passed into the Solver
class, which then runs the simulation, and makes the results available as a dictionary Solver.results
.
- class rcwa.Solver(layerStack, source, numberHarmonics=(1, 1))¶
Main class that invokes all methods necessary to solve an RCWA/TMM simulation
- Parameters
layerStack – layerStack: Stack of layers to simulate
source – Source object which includes wavelength and direction information
numberHarmonics – The number of harmonics in x, y to simulate (number of Fourier components). Defaults to (1, 1). Should be a 2-dimensional tuple.
- Solve(wavelengths=array([], dtype=float64))¶
Solves the simulation or performs a simulation sweep of the desired parameters
- Parameters
wavelengths – list of wavelengths to simulate (can be a single number)
- class rcwa.Layer(er=1.0, ur=1.0, L=0.0, n=None, crystal=None, numberHarmonics=None, material=None, source=None)¶
Class for defining a single layer of a layer stack used in a simulation
- Parameters
er – Permittivity of the layer
ur – Permeability of the layer
L – Thickness of the layer
n – Refractive index of the layer
crystal – Crystal object if the layer is periodic in x/y
material – Material object containing the material’s permittivity and permeability as a function of wavelength/angle.
- class rcwa.LayerStack(*layers)¶
- class rcwa.Source(wavelength=6.283185307179586, theta=0, phi=0, pTEM=[1, 1], layer=Layer with er: 1 ur: 1 L: 0.0 n: 1.0 crystal: None)¶
Class for defining monochromatic excitation source
- Parameters
wavelength – The wavelength (in microns, or your preferred length unit due to the scale-invariance of Maxwell’s equations.
theta – Angle with respect to the vector normal to the layer stack, in radians
phi – Rotation angle amount the vector normal to the layer stack
pTEM – Polarization vector for TE/TM polarization fraction (can be complex)
layer – Layer source is located in
- class rcwa.Crystal(permittivityCellData=1, permeabilityCellData=1, *latticeVectors)¶
Class used for defining periodic structures in x and y
- Parameters
permittivityCellData – 2D numpy array of permittivity values
permeabilityCellData – 2D numpy array of permeability values
latticeVectors – Real-space lattice vectors
- class rcwa.Material(name=None, er=1, ur=1, n=None, database_path=None, filename=None, source=None)¶
- class rcwa.utils.Plotter¶