-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") |