Commonly, the term `mode coupling' adresses one of at least three different means of power transfer. These include coupling modes of distinct waveguides by evanescent fields, coupling modes in the same waveguide by longitudinally homogeneous perturbations, and co and contradirectional coupling by longitudinally inhomogeneous, usually periodical perturbations. While one of the example files on magnetooptic polarization conversion adresses the second topic, this section is concerned with the first version, i.e. with codirectional light propagation in closely spaced adjacent waveguides. See the paper on radiatively coupled polarization splitters or the theory chapter in the survey for details on the employed formulation of coupled mode theory. However, some remarks on the notion of supermodes in the current framework may be helpful:
Suppose a composite longitudinally homogeneous waveguide is to be simulated. Its permittivity profile shall be such that the propagating light E, H may be reasonably assumed a superposition of a number of known guided mode profiles, E_{m}, H_{m} with longitudinally varying amplitudes C_{m}:
.
The factors P_{m} normalize the members of the superposition.
Given the basic modes (propagation constants and profiles) and the total underlying structure, coupled mode theory predicts the following dependence of the coupled mode amplitudes on the propagation distance:
.
This can be interpreted as follows: A fraction a_{m}^{s} of the basic mode number m participates in supermode number s (a superposition of basic modes), which propagates strictly harmonically with propagation constant beta^{s}. The supermodes are normalized by factors P^{s} and excited with amplitudes A^{s}. If one defines the supermode profiles E^{s}, H^{s} by
,
and with the two equations above inserted into the ansatz at the beginning, the total guided field can be rearranged as:
.
Here the interpretation of the superposed fields as supermodes becomes evident.
The application cmt.cpp, a simulation of two parallel raised strip waveguides, shall serve to illustrate the WMM procedures related to coupled mode theory. All functions are encoded in wmmcmt.h and wmmcmt.cpp.
The calculations that establish the coupled mode theory model are performed by the procedure
CMTsetup
,
defined in
wmmcmt.h and
wmmcmt.cpp.
Arguments are the basic modes, collected in a
WMM_ModeArray
,
and the combined permittivity profile, a
Waveguide
object.
On completion, the procedure sets the following reference arguments,
double matrices or vectors as defined in
matrix.h,
matrix.cpp:
sigma 
A symmetrical matrix of normalized
overlap integrals
(lscalprod s)
of the basic modes. The matrix is to be reused by some of the following
procedures.

smpc 
The supermode propagation constants, collected in a double vector.
By construction, the number of supermodes equals the number
umode.num of basic modes (all indices
range from 0 to umode.num1 !).

smav 
The amplitude fractions a_{m}^{s}, as introduced above.
The column smav(?, s) corresponds to the amplitude vector
a_{?}^{s} for supermode number s.

The example cmt.cpp investigates a symmetrical coupler segment composed of two separate waveguides:
The simulation starts with computing the single mode (for fixed polarization)
of one isolated waveguide. The mode is then duplicated and the two copies
translate
d to the positions of the
coupler ports, with the two port modes combined into a mode array.
This WMM_ModeArray
and the Waveguide
analogon of the
structure shown above constitute the input to
CMTsetup
.
The function responds with the line
* WMMCMT setup (2)  OK.
in the stderr output.
Afterwards, the supermode propagation constants are
accessible by the two entries of smpc
, and with them the coupling
length as the reciprocal of their difference.
While the former procedure computes the supermode propagation constants and the amplitude fractions, an explicit assembly of the mode profiles needs a call to
CMTsupermodes
.
wmmcmt.h and
wmmcmt.cpp contain the code.
The function fills its last reference argument, a WMM_ModeArray
,
with the supermode information. The supplied Waveguide
serves as the wg
member of the new WMM_Mode
s; the propagation
constants are taken from the vector smpc
as output from
CMTsetup
. Symbolic superpostions of all trial functions of
the basic modes constitute the mode profile of the new supermodes.
For the cmt.cpp example, the stderr output of
CMTsupermodes
informs about the supermodes propagation constants.
While the coupled mode approximation naturally enters the new mode object
(the wave equation relating fields and the propagation constant holds
only approximately), from the programmers
viewpoint the two entries
of the mode array are ordinary
* WMMCMT supermodecomposition (2)
* > sm(0): beta: 9.8337, neff: 2.03461, npcB: 0.324939
* > sm(1): beta: 9.81473, neff: 2.03068, npcB: 0.309558
WMM_Mode
s.
Hence all visualization routines may be applied. Surface plots of the
dominant component show a symmetric and an antisymmetric TM mode,
as expected:
(Here the raw MATLAB output obviously requires some polishing.)
Internally, the supermodes are represented as common WMM_Modes
, i.e.
symbolically. Each supermode object requires the same amount
of memory as the underlying basic modes together. Analogously, any
operation on the supermodes needs the time for performing the operation
separately on each of the basic modes (e.g. for a field evaluation)
or a higher order of this duration (e.g. in case of a field overlap).
Therefore, if possible, one should avoid constructing the supermodes
explicitely.
The next sections show that many useful information about the
light propagation can be obtained without the supermodes at hand,
i.e. on the level of the coupled mode theory field representation
in terms of basic modes with zdependent coefficients C_{m}.
The sources wmmcmt.h and wmmcmt.cpp define the following functions for evaluating the coupled mode field. All functions assume the basic modes to be normalized, i.e. as output from the mode solver:
CMTsz 
Given the set of basic modes, the index of the input mode (assuming an
input power of 1 W), the output of CMTsetup , and a point
specified by three coordinates (x, y, z),
the function returns the local intensity of the interference field at that
position.

CMTprop
CMTprop2 
For a fixed xelevation, the functions evaluate the local intensity
of the coupled mode field on a rectangular regular mesh in the yzplane.
The last reference argument returns a Dmatrix of intensity values.
CMTprop assumes one of the basic coupled modes to be excited
at the beginning z=0 of the coupling segment with a unit amplitude.
CMTprop2 computes the coupled mode field, if power is inserted
at the same time in two of the basic modes with arbitrary complex amplitudes.

At present, the above functions refer to the local intensity,
the longitudinal component of the time averaged Poynting vector only.
If other field components are of interest, the
mode interference and
interference visualization
capabilities of the supermode WMM_ModeArray
may be employed.
This applies to other input configurations as well.
As long as only few calculations are required
(cf. the remarks at the end of the previous section),
that is the most convenient way. In particular, the MATLAB output
code is accessible directly in this way.
The cmt.cpp example applies the
WMM_ModeArray.prop
procedure to write a mscript for
displaying a few coupling lengths. The MATLAB output looks like this:
Referring again to the threesegmentcoupler configuration, as discussed in the framework of mode interference and visualization, a common configuration consists of a multiwaveguide coupler segment of finite length between two input and output segments, where the modes of the input/output waveguides enter the coupled mode description of the coupling segment. See e.g. the paper on radiatively coupled waveguides as an example. Once the coupled mode theory has been established for the coupling segment, the power throughput from one or more of the coupled modes at the input z=0 to other members of the coupled mode set at the output can be computed very efficiently.
The files wmmcmt.h and wmmcmt.cpp supply the following functions for this purpose:
CMTamp 
Computes the relative (complex) output amplitude for a specified mode,
given an input in another one of the coupled modes. Besides the indices of the
relevant modes, the function
takes the output of CMTsetup and the device length as arguments.

CMTpower
CMTpower2

As before, but for the relative output power, in the case that
one of the coupled modes is excited with unit input power
(CMTpower ),
or for two of the basic modes excited with arbitrary complex amplitudes
(CMTpower2 ).

CMTamp
and CMTpower
is not directly the
(square of) the relevant zdependent coefficient C_{m}
(overlap integrals from two waveguide junctions enter).