Convention for coordinate system, polarization, units
All Metric routines rely on a representation of the 2D problems in a Cartesian coordinate system with axes x and z. As suggested by the figure below, occasionally these directions are referred to as "horizontal" (z) and "vertical" (x). The structure under investigation and all optical fields are assumed to be constant along the direction y perpendicular to the computational xzplane. For the description of 2D waveguides and the associated modes, the zaxis takes the role of the direction of light propagation, the "longitudinal" direction, while the xaxis is oriented along the "transverse" direction. In the context of the scattering problems, the distinction between the roles of the axes becomes irrelevant.
The propagation of continuous optical electromagnetic waves in linear isotropic dielectric structures is considered. The vacuum wavelength lambda = 2 pi / k_{0} = 2 pi c / omega specifies the fixed angular frequency omega, corresponding to a time dependence ∼exp(i omega t) of all fields, for vacuum wavenumber k_{0} and vacuum speed of light c. Conventionally, optical waves are described in terms of the electric field E and the magnetic field H. Under the above assumptions, the Maxwell equations for the optical electromagnetic field split into two independent subsets of equations, that apply to solutions with different polarization states:
Based on the numerical value for the vacuum wavelength lambda, all values for quantities with dimension length are meant in micrometers (no normalization is performed internally). Where relevant, time intervals are counted in femtoseconds. In principle, electric and magnetic field levels should be computed consistently in units of V/µm or A/µm, respectively. Consequently, modal powers are given in W/µm (power per length unit in the lateral ydirection). See the definitions and functions in gengwed.h and gengwed.cpp for numerical values of the relevant electrodynamic constants, for functions that translate the vacuum wavelength to other frequency dependent quantities, and for identifiers and functions related to field components and polarization states.
Relevant source files: gengwed.h, gengwed.cpp.
Multilayer slab waveguide objects
Waveguide
objects represent a 1D piecewise constant refractive index
profile. The waveguide cross section, the xaxis, is to be divided
into an array of intervals with constant refractive index, where the bottom
and top intervals are unbounded.
Since the specification of permittivity or refractive index levels is always
related to optical oscillations at a definite frequency, the value of
the vacuum wavelength is made part of the waveguide container.
The information on the number of layers, the layer boundaries,
the refractive index values, and the vacuum wavelength constitute a
Waveguide
object as defined in
structure.h,
structure.cpp.
See
matrix.h
and
matrix.cpp
for the definition of Dvector
s used for the boundary locations and
refractive indices.
Among the members of a Waveguide
object are:
nx 
The number of inner layers in the division of the cross section axis. 
hx 
The xpositions of the layer boundaries,
a Dvector(nx+1) . 
lambda 
The vacuum wavelength of the light propagating in this waveguide. 
n 
The array of refractive index values,
a Dvector(nx+2) . 
eps 
Functions which return permittivity values, for positions specified by a layer index or by an xcoordinate. 
layer 
Returns the layer boundaries (an Interval object,
also declared in structure.h)
for a given xcoordinate or a layer index. 
layeridx 
Returns the index of a layer that corresponds to a given xcoordinate. 
plot 
Generate a .mscript that produces a plot of the refractive index profile when executed in MATLAB; for purposes of inspecting a waveguide specification. See the section on visualization of structural information. 
Additionally, objects of class Waveguide
can be copied and assigned, they
know how to
write
and read
themselves to/from FILEs,
they can
translate
themselves to new coordinates,
they have some knowledge about the bounds
(defaultepseffmin
, defaultepseffmax
) on prospective
effective indices (permittivities) of guided modes,
they can compare (equal
) themselves to another Waveguide
,
and they supply a number of methods for testing
(consistency
,
bdmatch
),
information
(constmed
,
checksymmetry
,
decoupepseff
,
lbdecepseff
,
ubdecepseff
),
and transformation
(optimize
,
split
,
expand
,
mirror
)
that are used by the routines for mode analysis, and by the Helmholtz solvers.
Further details can be found in the source files
structure.h,
structure.cpp
directly.
Note the following points:
Waveguide
member nx
denotes the number of inner
layers in the decomposition. Accordingly, for a Waveguide(nx)
one has to specify the locations hx(0), ..., hx(nx)
of the
layer boundaries, and refractive index values n(0), ..., n(nx+1)
.
Consequently, hx
is a Dvector(nx+1)
, and n
is a
Dvector(nx+2)
.
nx
of inner layers must be greater or equal than one.
Disregarding this constraint is likely to end in a core dump. A homogeneous
piece of material can still be specified as a Waveguide(1)
with two
arbitrary layer positions and three equal refractive index values. In case
of a structure with only one dielectric interface one should split one of the
layers into two with equal permittivity.
hx(l) < hx(l+1)
. Disregarding this constraint is likely to end in a
core dump.
The Waveguide
constructors take one of the sets {}, {nx
},
or {nx, hx, lambda, n
} as arguments, where the remaining information
must be directly assigned. See one of the
example files
(e.g. tlwg.cpp)
for an actual waveguide definition.
Class:
Waveguide
.
Relevant source files:
structure.h,
structure.cpp.
Sequences of waveguide segments
The BEP and QUEP Helmholtz solvers operate on sequences of multilayer
slab waveguides as containers for the geometrical and material specification
of the scattering problems. Sequences of zhomogeneous waveguide
segments are combined into SegWgStruct
objects, as defined in
structure.h and
structure.cpp. The ingredients are an array
of 1D (xdependent) refractive index profiles,
i.e. Waveguide
s, and the accompanying zpositions of the
vertical interfaces between the segments.
The SegWgStruct
objects provide the following methods / members:
nz 
The number of inner segments in the sequence. 
hz 
The zpositions of the segment interfaces,
a Dvector(nz+1) .

() 
Integer subscript operators, range 0 , ..., nz+1 :
Access to the individual Waveguide s in the sequence.

init 
Initialize all segments with the same Waveguide profile.

segidx 
The segment index corresponding to a given zcoordinate. 
segment 
The boundaries of a segment corresponding to a given zcoordinate or segment index. 
n 
A function that returns the local refractive index, given a pair of xzcoordinates. 
lambda 
The vacuum wavelength, assuming that it is unique in all Waveguide s.

defaultwindow 
Determines a default window around the "inner" structure, e.g. for plotting purposes. 
plot 
Generate a .mscript that produces a plot of the refractive index profile when executed in MATLAB; for purposes of inspecting a structure specification. See the section on visualization of structural information. 
Additionally, SegWgStruct
objects can
be copied and assigned, they can
write
and read
themselves to / from files, and they know
how to shift all coordinate data along the x and z directions
(ztranslate
, xtranslate
). The QUEP routines access
methods that convert the horizontal sequence to a vertical one
(rotate
), procedures that add and remove additional outer segments
(expand
, shrink
), or a function that eliminates unnecessary
boundaries between identical segments (optimize
).
Finally, a SegWgStruct
can convert itself into a Circuit
(see below).
Note that, in contrast to the waveguide container, here numbers of
inner segments of less than 1 are allowed: SegWgStruct(1)
defines a zhomogeneous waveguide (with hz
not to be
accessed, used only as a means to enable the plot routines for mode
arrays). SegWgStruct(0)
is a structure with a single vertical interface, e.g. a waveguide facet.
Two SegWgStruct
constructors take one of the sets
{}, {nz
} as arguments; the waveguides and zpositions have
to be assigned individually. As an example, in the driver files
sgrat.cpp and
defcav.cpp
the structure definition as an array of pieces of waveguides is quite
intuitive. A third SegWgStruct
constructor converts a
a Circuit
object (see below) into a SegWgStruct
.
Class:
SegWgStruct
.
Relevant source files:
structure.h,
structure.cpp.
Rectangular optical circuits
In some cases the arrangement of the structural data for a scattering
problem in the particular form of sequences of waveguides appears to be rather
cumbersome. Where appropriate, Circuit
objects can be used
for a specification of the material and geometrical information.
A Circuit
as defined in structure.h,
structure.cpp combines a matrix
of refractive index values, two arrays of positions of horizontal and
vertical interfaces, and the vacuum wavelength.
Since the Circuit
s are  so far  only meant to provide an
alternative way of constructing the SegWgStruct
s, only basic
members and methods are provided:
nx 
The number of inner layers in the rectangular division. 
hx 
The xpositions of the horizontal layer interfaces,
a Dvector(nx+1) .

nz 
The number of inner slices in the rectangular division. 
hz 
The zpositions of the vertical slice interfaces,
a Dvector(nz+1) .

lambda 
The vacuum wavelength for the scattering problem. 
n 
Refractive index values for the rectangular patches,
a Dmatrix(nx+2, nz+2) .

plot 
Generate a .mscript that produces a plot of the refractive index profile when executed in MATLAB; for purposes of inspecting a structure specification. See the section on visualization of structural information. 
Copying and assignment of Circuit
s is automatically implemented via
the respective methods of the member objects.
To avoid core dumps caused by access to illegal index positions, note the
following issues:
nx
and nz
are the numbers of inner layers and slices
in the decomposition. Consequently,
hx
is to de declared as a Dvector(nx+1)
,
hz
is to de declared as a Dvector(nz+1)
,
and n
is a Dmatrix(nx+2, nz+2)
.
nx
and nz
must be greater or equal than 1.
To define even simpler structures, one needs to provide additional interfaces
between regions with equal refractive indices. Examples are the
definitions of a waveguide facet in
facet.cpp,
or the simulations of beams in a homogeneous medium in
bcross.cpp,
bspread.cpp
hx
and hz
must be
in strictly ascending order, without any equal entries.
The Circuit
constructors accept one of the sets {} or
{nx
, nz
}.
Additional information (the layer positions, the refractive index matrix, and
the wavelength) must be assigned explicitly. For examples of simple
Circuit(1, 1)
structures see the driver files
corner.cpp,
tjunc.cpp,
cross.cpp, or
hole.cpp.
Larger structures,
a Circuit(17, 19)
, or a Circuit(19, 19)
, respectively,
are defined in
pcwg.cpp
or
pcbend.cpp.
Class:
Circuit
.
Relevant source files:
structure.h,
structure.cpp.