diff --git a/lasy/optical_elements/__init__.py b/lasy/optical_elements/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lasy/optical_elements/optical_element.py b/lasy/optical_elements/optical_element.py new file mode 100644 index 00000000..64b78145 --- /dev/null +++ b/lasy/optical_elements/optical_element.py @@ -0,0 +1,38 @@ + +class OpticalElement(object): + """ + Base class to model thin optical elements. + + Any optical element should inherit from this class, and define its own + `amplitude_multiplier` method, using the same signature as the method below. + """ + + def __init__(self): + pass + + def amplitude_multiplier(self, x, y, omega): + """ + Return the complex number :math:`T` with which to multiply the + complex amplitude of the laser just before this thin element, + in order to obtain the complex amplitude output laser just + after this thin element: + + .. math:: + + \tilde{\mathcal{E}}_{out}(x, y, \omega) = T(x, y, \omega)\tilde{\mathcal{E}}_{in}(x, y, \omega) + + Parameters + ---------- + x, y, omega: ndarrays of floats + Define points on which to evaluate the multiplier. + These arrays need to all have the same shape. + + Returns + ------- + multiplier: ndarray of complex numbers + Contains the value of the multiplier at the specified points + This array has the same shape as the arrays x, y, omega + """ + # The base class only defines dummy multiplier + # (This should be replaced by any class that inherits from this one.) + return np.zeros_like(x, dtype="complex128")