Home Examples Screenshots User manual Bluesky logo
OghmaNano Simulate organic/Perovskite Solar Cells, OFETs, and OLEDs DOWNLOAD

Transfer matrix model (TMM)

1. Introduction

The transfer matrix method (TMM) is a fast, reliable technique for modeling light propagation in multilayer (“sandwich-type”) structures under normal incidence. It is widely used for devices such as solar cells, optical filters, and sensors, where you need to quantify how light is absorbed, reflected, and transmitted through thin films.

Compared with full-wave solvers like FDTD, TMM achieves similar insights at a computational cost that is typically orders of magnitude lower. This makes it ideal for rapid design iteration, parameter sweeps, and optimization of multilayer stacks, while still capturing the key interference and thin-film effects that govern device behavior. Although TMM is most straightforward for normal incidence in planar stacks, it can be extended to oblique incidence and polarization-dependent analyses when required.

👉 Want to start simulating now?: Try the quick start tutorial on the Transfer matrix model

2. Accessing the TMM tool

The Transfer Matrix simulation tool can be accessed from the Optical ribbon in the main window by selecting Transfer matrix (see Figure ??).

OghmaNano Transfer Matrix solver accessed from the Optical ribbon in the main menu, showing photon density and photon absorption rate in the device
The Transfer Matrix solver, accessible via the Optical ribbon in the main menu. This window provides access to different optical models and displays outputs such as photon density and absorption rate within the device.

3. Running a TMM simulation

Clicking Run optical simulation (see Figure ??) calculates the distribution of light within the structure as a function of wavelength and position. At the top of the simulation window you can select from several optical models. Choosing Transfer matrix performs a full optical simulation, while the other options provide simplified approximations that are useful for exploring alternative generation profiles.

OghmaNano Transfer Matrix optical simulation window showing photon density and photon absorption rate in the device
The Transfer Matrix optical simulation window. The Play button runs the simulation, and the selected mode determines which optical model is used.
OghmaNano Transfer Matrix optical simulation window showing a photon density map as a function of wavelength and depth in the device
Example photon density output. The colour map shows the spatial and spectral distribution of photons inside the device as a function of wavelength and depth (y-position).

The available simulation modes are:

The optical simulation window provides several tabs that allow you to explore how light interacts with the device. For example, ?? shows the photon density inside the structure, where reflections at the layer interfaces give rise to clear interference patterns. ?? presents the same data as ??, but displayed as a band diagram. This alternative view is accessed by right-clicking in the window and adjusting the menu options, and is particularly useful for generating band diagram figures for publications. Finally, ?? shows the configuration window of the optical model. A key parameter here is the photon efficiency, which specifies how many electron–hole pairs are created per absorbed photon. In organic devices, this parameter accounts for geminate recombination, whereas in inorganic or well-ordered systems it should typically be set close to 1.0.

OghmaNano Transfer Matrix optical simulation window showing the generation rate profile across the device with energy level diagram overlay
Generation rate output from the Transfer Matrix optical simulation window. The black curve shows the spatial distribution of charge-carrier generation rate inside the device, while the overlaid energy level diagram (right axis) indicates the relative positions of the HOMO and LUMO levels for each material layer.
OghmaNano Transfer Matrix optical simulation window showing the energy level diagram of the device stack
Energy level diagram from the Transfer Matrix optical simulation window. The diagram shows the HOMO and LUMO levels (or band edges) of each material layer, providing an overview of the electronic structure across the device stack. This view can be toggled to include or exclude additional information such as generation rate data or axis labels.
OghmaNano Transfer Matrix solver configuration window showing photon efficiency, generation rate file, QE spectra file, and output verbosity settings
The Configure → Output files window of the Transfer Matrix solver. The key parameter here is the photon efficiency, which controls how many electron–hole pairs are generated per absorbed photon. Another important option is output verbosity to disk, which determines how much detail the solver writes to disk. Writing all outputs can be useful when analysing the optical simulation in depth, but for routine runs a reduced verbosity is often sufficient.

5. Output files

Overview: After running an optical simulation, an overview of the results can be viewed in the optical simulation window (??), as described above. For more detailed analysis, additional information is available in the Output tab of the main window (??). In ?? two key icons are visible: optical_output and optical_snapshots. Double-clicking optical_output opens the optical results window (Figure ??), while double-clicking optical_snapshots opens the Optical Snapshots window (??). The Optical Snapshots window allows you to inspect wavelength-resolved data such as photon density, absorbed photons, and electric field distributions within the device. Because results are stored for each wavelength, this tool provides a detailed view of device performance across the optical spectrum.

OghmaNano output tab showing results from the Transfer Matrix simulation including optical_output and optical_snapshots files
The Output tab showing the results of a Transfer Matrix simulation. The files optical_output and optical_snapshots are usually only generated when the optical simulation is run directly, and are not written when the optical solver is called as part of a coupled electrical simulation.
OghmaNano Optical Snapshots window showing a plot of absorbed photons versus depth at a given wavelength
The Optical Snapshots window. This tool allows the user to explore wavelength-resolved quantities such as photon density, absorbed photons, and electric field profiles within the device. In this example, the plot shows photons absorbed as a function of depth for light with a wavelength of 630 nm.

Optical_snapshots: The optical_snapshots folder described above provides access to photon density, absorbed photons, and the optical electric field as a function of wavelength when viewed through the graphical interface. However, it is simply a standard directory and can also be explored directly in a file manager. As shown in Figure ??, the folder contains subdirectories numbered from 0 to 12, each corresponding to a single simulated wavelength. Opening one of these subdirectories (for example, directory 0) reveals the output files shown in Figure ??.

These files include data such as absorption profiles, electric fields, photon densities, and generation rates, all written in plain-text CSV format for easy inspection or post-processing. The table below summarises the contents of a typical wavelength directory:

Optical_snapshots folder containing 12 subdirectories, each representing one simulated wavelength
The optical_snapshots folder. Subdirectories numbered 0–12 each contain results for one simulated wavelength.
Contents of directory 0 in optical_snapshots showing CSV files such as photons.csv, photons_abs.csv, and G.csv
Example contents of directory 0. Files include absorption, electric field, photon density, and generation rate data for that wavelength.
Example contents of photons_abs.csv including metadata and simulation output values
Example contents of photons_abs.csv, showing metadata followed by axis labels and data values.

Since these outputs are plain text, they can be opened with any editor. As shown in Figure ??, the first line of each CSV contains metadata for plotting, the second line describes the axes, and the remaining lines provide the raw numerical data.

Files produced by a single-wavelength optical snapshot
File name Description
alpha.csv y-position vs. absorption at the selected wavelength
data.json JSON metadata file including wavelength value and plotting information
En.csv y-position (m) vs. electric field, negative component (V/m)
Ep.csv y-position (m) vs. electric field, positive component (V/m)
G.csv y-position (m) vs. generation rate (\(m^{-3}s^{-1}\))
n.csv y-position (m) vs. real part of the refractive index n
photons.csv y-position (m) vs. photon density (\(m^{-3}\))
photons_abs.csv y-position (m) vs. absorbed photons (\(m^{-3}s^{-1}\))

The optical_output folder in depth: While the optical_snapshots directory stores wavelength-resolved results (one subfolder per simulated wavelength), the optical_output directory contains wavelength-integrated data in the form of two-dimensional maps of wavelength vs. position. These outputs provide an overview of how light interacts with the device across the full spectrum, including key quantities such as charge-carrier generation rate, photon density, normalized photon density, transmission, and reflection. The contents of the directory are shown in Figure ??.

The files listed in Figure ?? are described in detail in Table ??.

Contents of the optical_output directory showing summary files generated by the Transfer Matrix simulation
The optical_output directory, containing wavelength-integrated summary files generated by the Transfer Matrix solver.
Files produced in the optical_output directory
File name Description Plot type
data.json Metadata file with simulation settings in JSON format 1D
G_y.csv y-position (m) vs. charge generation rate (\(m^{-3} s^{-1}\)) 2D
G_zxy.csv zxy-position (m) vs. charge generation rate (\(m^{-3} s^{-1}\)) 2D
Htot_zxy.csv zxy-position (m) vs. optical heat generation (\(W m^{-3}\)) 2D
light_src_id_xxx.csv Wavelength (m) vs. light intensity from a specified source (\(W/m\)) 2D
photons_abs_yl.csv Wavelength (m) vs. y-position (m) vs. absorbed photons (\(m^{-3} s^{-1}\)) 2D
photons_yl.csv Wavelength (m) vs. y-position (m) vs. photon density (\(m^{-3}\)) 2D
photons_yl_norm.csv Wavelength (m) vs. y-position (m) vs. normalized photon density (a.u.) 2D
reflect.csv Wavelength (m) vs. reflected light from the device stack 1D
transmit.csv Wavelength (m) vs. transmitted light through the device stack 1D

6. Simulating optically thick layers (incoherent layers)

OghmaNano layer editor showing configuration of coherent and incoherent layers
The layer editor showing both coherent and incoherent layers.
OghmaNano Transfer Matrix window showing the Optical Thickness button
The Optical Thickness button in the Transfer Matrix window.
OghmaNano configuration window for setting the effective optical thickness of a layer
The configuration window for setting a layer’s effective optical thickness.

Typical optoelectronic devices have active layers between 10 nm and 100 nm thick. However, these devices are often deposited on substrates that are 10 mm to 1 cm thick. In many cases it is useful to simulate not only the device itself but also the optical effects of the substrate. This requires a simulation tool that can span length scales from nanometres up to metres. There are three main challenges with doing this:

OghmaNano addresses these issues in two ways. First, it allows the user to treat a layer as incoherent, considering only absorption and neglecting phase information. This approach resolves Problems 2 and 3. The option can be set in the layer editor (Figure ??). In the column labelled Solve optical problem, layers marked Yes – n/k include both phase and absorption, while those marked Yes – k account only for attenuation, effectively treating them as incoherent layers.

Second, to handle Problem 1 (large differences in length scale), OghmaNano allows an effective optical thickness to be assigned to any layer. For example, a substrate might be defined as 100 nm thick in the layer editor but assigned an effective depth of 1 m. Internally, this is implemented by scaling the absorption coefficient:

\[\alpha_{\text{effective}}(\lambda) = \alpha(\lambda)\,\frac{L_{\text{effective}}}{L_{\text{simulation}}}\]

where \(\alpha_{\text{effective}}\) is the scaled absorption used in the simulation, \(\alpha\) is the material absorption coefficient, \(L_{\text{effective}}\) is the desired effective thickness (e.g. 1 m), and \(L_{\text{simulation}}\) is the actual layer thickness in the editor. This approach reduces numerical issues and also produces more useful plots, where the substrate does not dominate the axes and the device layers remain clearly visible.

To use this feature, set up the device structure as shown in Figure ??. Then, in the Transfer Matrix window, click the Optical Thickness button (Figure ??). This opens the configuration dialog (Figure ??), where the effective optical thickness of any layer can be specified. In the example shown, the glass substrate is set to 1 m.

4. When is the TMM run?

The transfer matrix simulation can be run in two ways. First, it can be launched directly by clicking the Play button. Alternatively, the optical model is executed automatically whenever an electrical simulation is run, requiring no additional user action.

The main difference between these two modes is in the output. When run directly, the optical simulation generates a more complete set of output files on disk. In contrast, when it is invoked as part of an electrical simulation, the output is reduced to essential data only, in order to avoid slowing down the electrical solver.

👉 TMM theory: Go to the next section to understand transfer matrix theory.