Nonlinear Element
svetlanna.elements.NonlinearElement
NonlinearElement(
simulation_parameters: SimulationParameters,
response_function: Callable[[Wavefront], Wavefront],
)
Bases: Element
Nonlinear optical element with a given response function. The response function takes an incident wavefront and returns the modified wavefront.
Examples:
Suppose the response function is defined as \(E^\text{out} = \sqrt{|E^\text{in}|}e^{i \arg(E^\text{in})}\):
If you want to optimize the parameters of the response function, you can use
svetlanna.PartialWithParameters to wrap the response function with trainable parameters.
For example, if the response function is defined as
\(E^\text{out} = |E^\text{in}|^a e^{i b \arg(E^\text{in})}\), where \(0<a<1\) and
\(b\) are trainable, you can define the nonlinear element as follows:
You can also train a neural network inside the nonlinear element!
Parameters:
-
simulation_parameters(SimulationParameters) –Simulation parameters.
-
response_function(Callable[[Wavefront], Wavefront]) –Function that describes the nonlinear response of the element.