1 Introduction
Written by Steve Byrnes, originally in 2012. Please email me any feedback. My website is
http://sjbyrnes.com, and the code lives at https://github.com/sbyrnes321/tmm.
This is a group of programs written in Python / NumPy for simulating light propagation
in planar multilayer thin films, including the effects of multiple internal reflections and
interference, using the “Transfer Matrix Method”. It can also simulate combinations of thin
and thick films (e.g. a thick piece of glass with a multi-layer antireflection coating on one
side and a mirror on the other side), or purely thick films.
In addition to calculating how much light is transmitted and reflected, the program can
calculate, at any given point in the structure, how much light is being absorbed there. This
is a very important feature for solar-cell modeling, for example.
It can also calculate the parameters measured in ellipsometry.
I wrote out derivations and discussions of the formulas and calculations imple-
mented by this program at: http://arxiv.org/abs/1603.02720. You are encour-
aged to cite that paper if you publish results that come from this software. :-)
2 Files and API
There are four files: (1) tmm core.py contains all the main programs, (2) color.py has
additional color-related functions, like calculating the RGB color of a thin film under re-
flected light, (3) examples.py contains a few example calculations to get you started, and
(4) tests.py contains a number of programs that perform various tests and consistency
checks to confirm that everything is coded and running correctly. There is also the standard
init .py, the home of the main tmm namespace, into which are imported all the tmm core
functions. [To run the color-theory related functions in color.py, you need to download the
package colorpy at https://pypi.python.org/pypi/colorpy/ . But even without that,
you can still run all the other code.]
The API information (list of functions and how to call them) is available at https://
pythonhosted.org/tmm/. I also suggest to look at the functions in the examples submodule
to see examples of various kinds of calculations and plots. (If you’re not sure how to find
this code, it is online at https://pythonhosted.org/tmm/_modules/tmm/examples.html)
3 Other people’s programs
There are many other free (and non-free) programs that do some or all of what this program
does. I have a list at: http://sjbyrnes.com/multilayer-film-optics-programs/
I have done a few consistency checks between my program and others. They tend to agree
perfectly except in the tricky (and somewhat unusual) case of calculating reflected power or
1