\section{Band structure of a polariton}

\begin{comment}
#include <stdio.h>
#include <stdlib.h>

#include <meep.h>
using namespace meep;

const double rmax = 1.0;
\end{comment}

Here we compute and plot the band structure of a polariton material.  We
look at a simple metallic waveguide filled with a polaritonic material.
The material we look at has an epsilon of 13.4 and a longitudinal phonon
frequency of 0.7 and a transverse phonon frequency of 0.4.

\begin{figure}
\label{polaritonbands}
\caption{Polariton band structure.}
\includegraphics[width=8.8cm,clip=true]{polaritonbands-out/bands}
\end{figure}

\begin{verbatim}
double eps(const vec &) { return 13.4; }
double one(const vec &) { return 1; }
\end{verbatim}

\begin{comment}
int main(int argc, char **argv) {
  initialize mpi(argc, argv);
  deal_with_ctrl_c();
  const int a = 10;
  const int m = 0;
  double k;
  const double ttot = 1000;  
\end{comment}

\begin{comment}
  mat ma(volcyl(rmax, 0.0, a), eps);
  const char *dirname = make_output_directory(__FILE__);
  ma.set_output_directory(dirname);
  grace g("bands", dirname);
  g.set_range(0.0, 4.0, 0.0, 1.1);
\end{comment}

To create the polaritonic material, we add the polarizability to the
material after we have created it.

\begin{verbatim}
  double freq = 0.4, gamma = 0.01, delta_eps = 27.63;
  ma.add_polarizability(one, freq, gamma, delta_eps);
\end{verbatim}

\begin{verbatim}
  for (k=0.0;k<4.01 && !interrupt;k+=.5) {
    master_printf("Working on k of %g and m = %d...\n", k, m);
    fields f(&ma, m);
    f.use_bloch(k);
\end{verbatim}

Now we excite the first TE mode (we are only looking at m = 0 here), and
remember to excite along with it the phonon with which it couples.

\begin{verbatim}
    f.initialize_with_nth_te(1);
    f.initialize_polarizations();
\end{verbatim}

Finally, we compute the band structure as usual.

\begin{verbatim}
    f.prepare_for_bands(vec(0.501,0.0), ttot, .7+.15*k/3.0, 50, 1e-4);
    f.prepare_for_bands(vec(0.301,0.0), ttot, .7+.15*k/3.0, 50, 1e-4);
    
    while (f.time() < ttot && !interrupt) {
      f.record_bands();
      f.step();
    }
    f.grace_bands(&g, 16);
\end{verbatim}
\begin{comment}
  }
}
\end{comment}

The final output of this routine (as calculated using the ``plot'' program)
is shown in Figure~\ref{polaritonbands}.