Open edmundsj opened 2 years ago
This is currently being worked on using the fields
branch.
Hi Jordan. Indeed, the optical field patterns inside nano- and micro-structures is of major interest to the sensing community. Highly localized fields in gratings or similar 3D structures can point to regions of high-densities of optical states. This in turn can affect spontaneous emission, FRET, and other quantum phenomena in those regions. This may be of further interest to microfluidics community where localized optical fields can trigger more sensitive detection of nearby capillaries.
In your code the ability to extract the individual harmonic amplitudes inside the structure (most general) would be beneficial; but perhaps the most useful and user friendly would be the ability to specify a region-of-interest (x,y,z volume or plane) and the code outputs the fields (Ex,Ey,Ez) in that region.
Feature Description
Sometimes it is important to know not only the reflected modes and transmitted S-parameters, but also what the fields inside a grating look like. This would be very useful and pretty straightforward to implement.
Proposed Implementation
For extracting the fields:
x, y, and z can either be single points or lists of individual coordinates. The points will be generated with a Cartesian product. This implementation is simple, and allows for easy specification of single points, lines, planes, and volumes, and allows non-uniform points lists to be used (if you want higher resolution near an edge, for example). If
layer
isNone
, the z-coordinate will be assumed absolute relative to those specified in the documentation. Iflayer
specifies a specific layer, the z-coordinate will be relative to the top of that layer. By default, a single point is returned. If the layer in question is a 1D or 2D photonic crystal, there should be a special way to indicate the volume be a single period of the device. A reasonable default behavior, rather than returning a single point, would also be to display a single period, and an array of fields is returned.For directly plotting:
This would plot the z-component of the electric field in the x-y plane projected along the x/y axes. It might actually be better to have a separate method than plot() for this. Perhaps an
imshow
method, which callsplot
but defaults to the x-y plane, so only two arguments are needed. Alternatively, it might be a better idea to calculate the fields from a specified set of x, y, and z. coordinates.