The Metric program collection combines a series of semianalytical tools for the simulation and design of structures or devices from integrated optics / photonics. The programs are meant for frequency domain modeling of configurations in one, two, or 2.5 spatial dimensions, with (mostly) piecewise constant, isotropic, lossless, and preferably rectangular permittivity distributions.
Optical electromagnetic fields are represented by series of eigenmodes associated with 1-D, piecewise constant refractive index profiles. Accordingly, a reasonably robust and general mode solver for dielectric multilayer slab waveguides is found at the center of the tool collection. Apart from standard guided mode analysis, the mode solver routines include facilities for the generation of orthonormal modal basis sets on finite 1-D intervals, where the mode spectrum is discretized by Dirichlet- or Neumann boundary conditions.
Scattering problems (Helmholtz problems) are addressed by semianalytical mode expansion along one (bidirectional eigenmode propagation, BEP) or two coordinate axes (quadridirectional eigenmode propagation, QUEP). The BEP procedures are meant for configurations that can be represented adequately as a sequence of longitudinally homogeneous waveguide segments, laterally enclosed by Dirichlet boundary conditions, with half-infinite entry and exit segments. The QUEP model becomes relevant for dielectric structures on a rectangular computational domain, where omnidirectional (2-D) propagation and guided or nonguided influx and outflux across all four boundaries is important. A given structure is to be encoded into simple objects for waveguides, sequences of waveguides, or rectangular integrated optical “circuits”. The objects that hold the resulting optical fields provide facilities for a detailed evaluation and inspection of the relevant electromagnetic quantities, including routines for the static or time-animated visualization.
Due to the semianalytical field representation, the incorporation of small additional effects is straightforward in terms of perturbational expressions or coupled mode theory. This concerns effects like low levels of attenuation, small uniform refractive index modifications e.g. due to electro- or magnetooptic tuning, specific cases of anisotropy, or the weak interaction of guided modes. However, so far the corresponding expressions are only partly implemented systematically.
Adhering to the continuous development, the underlying algorithms have been the subject of a couple of papers concerned with the bidirectional and quadridirectional mode expansion technique, and with the related applications. For a more detailed account on the Metric procedures we refer to these publications. Many of the simulation examples given there can be reproduced using the programs that come with this document.
Currently, the Metric collection consists of a number of C++ library files. For a new application, you will have to write a C++ program including the main() procedure, or to edit one of the supplied application examples for your own purposes (this should be the easiest way to get started). Compiling the application together with the library produces the executable.
This organization has the disadvantage of frequent program recompilations, and may seem to be discomfortable at the first glance. The second reveals, that only the usually short application file has to be multiply compiled and linked, which should be a matter of not more than a few seconds. The time overhead is negligible, while in this way the full functionality of the C++ language becomes available for the applications. For a design task which usually involves sweeps over various geometrical or material parameters, or spectral scans, this organization seems to be more appropriate than clicking through a kind of session management or learning a new and probably restricted script language. It also keeps the code portable and open for own extensions.
The library files are accessed via the single header file metric.h. Apart form the declarations of the routines and data structures that are described on the following pages, the header provides a couple of more general, supportive routines:
What concerns the routines for complex numbers and linear algebra, these are present mainly for historical reasons; you may wish to replace these by the standard library functions or by more sophisticated (and probably more efficient) linear algebra subroutine libraries of your choice.
Relevant source files: metric.h; complex.h, complex.cpp, matrix.h, matrix.cpp, gengwed.h, gengwed.cpp.
The program structure obviously requires some knowledge of the C++ programming language and a working C++ compiler. So far, the code has been executed mainly on a number of PCs with Linux operating system, where the free GNU Compiler Collection is available. While the Metric programs should work well with that compiler (also on other platforms), on some occasions we have observed executables produced with the native compilers of the operating systems to be considerably faster. Thus, if possible, one should use a programming environment which is optimized for (i.e. comes with) the underlying operating system / machine.
The Metric programs do not include tools for visualizing the numerical output data. One will need at least a means to view two dimensional curves (something like the Gnuplot utility) and a program package to display three dimensional data. For this purpose, subroutines have been added to the Metric collection which put out valid MATLAB scripts (.m-files). Therefore it is most convenient to work within an environment where this tool is available (not necessarily the very latest version). Otherwise, the output routines would have to be adapted.
Part of the functionality for numerical linear algebra relies on subroutines as provided by the Eigen library. This package needs to be downloaded and appropriately placed in addition to the Metric programs.
Naming convention, output files
The application files may be regarded as the input to the Metric programs. The output consists of the (stderr) text stream on the one hand. This includes control information about the structure under investigation, log information about the progress of the routines, notification about file input and output, and results according to the instructions in the driver file. On the other hand, the solvers return numerical data in files of one of the following types, identified by their extensions (all output files are in ASCII format):
.xyf: Data file for twodimensional curves, two columns (real case: x, f(x)) or three columns (complex case: x, Re f(x), Im f(x)) of numbers separated by blank and newline characters.
.smo:All information concerning a single multilayer slab mode.
.sma:Data describing an array of slab modes.
.mef:Representation of a bidirectional mode expansion field, including structural information.
.qep:All data to reconstruct a field represented by quadridirectional eigenmode expansion, including structural information.
.m:MATLAB script files, usually containing commands and data to plot an entire figure. The type of the figure is indicated by the last character of the truncated filename, one of 'I', 'F', or 'M' for an intensity image, a fancy style surface graphic (the introductory figures of this document), or a movie script intended to show a sequence of one of the former plots. For two dimensional data (mode profiles), a script of type 'L' produces a figure displaying the corresponding curve, while a script of type 'V' represents an additional curve meant to be included into an 'L'-figure. Where appropriate, besides the field values the output files include commands for proper annotation and for a sketch of the structure geometry. The resulting figures are aimed to be as close as possible to a state of being fit for publishing. Script files ending with 'A.m' ('all') raise a viewer window that includes a few control elements. These scripts are intended to inspect interactively the various parts of a field solution.
m, f, q, r, i
E, H, S
x, y, z