WPTherml: A Python Package for the Design of Materials for Harnessing Heat

WPTherml is a Python package for the design of materials with tailored optical and thermal properties for the vast number of energy applications where control of absorption and emission of radiation, or conversion of heat to radiation or vice versa, is paramount. The optical properties are treated within classical electrodynamics via the Transfer Matrix Method which rigorously solve Maxwell's equations for layered isotropic media. A flexible multilayer class connects rigorous electrodynamics properties to figures of merit for a variety of thermal applications, and facilitates extensions to other applications for greater reuse potential. WPTherml can be accessed at https://github.com/FoleyLab/wptherml.


Introduction
In 2017 over sixty five percent of energy produced was not useable and released as waste heat [1]; consequently, there are a large number of opportunities to develop technologies which can mitigate waste heat associated with energy production, or which can be used to convert or reclaim waste heat for useful purposes. Nano-scale materials, including multi-layered nanostructures among others, with tailored optical and thermal emission properties are centrally important for many of these envisioned technologies, which include solar thermophotovoltaics (STPV) [2][3][4], radiative cooling devices [5], and highly efficient incandescent lighting [6] that minimize IR losses.
WPTherml (William Paterson University's tool for Thermal Energy and Radiation management with Multi-Layer nanostructures), is a computational engine for materials which can be leveraged for these and other technologies where the control of optical and/or thermal radiation properties is paramount. Specifically, WPTherml can be utilized to simulate optical properties (reflectivity, transmissivity, absorptivity, and emissivity) of nanostructures made from layered isotropic media; thermal radiation spectra of these nanostructures can be derived from these optical quantities in conjunction with Planck's blackbody radiation law. With these spectral quantities in hand, figures of merit for the design of such multi-layer nanostructures for applications such as STPV, passive radiative cooling, concentrated solar power, incandescent lighting, and plasmonics can be computed. Thus, the WPTherml package serves as an engine for computing spectral quantities, and for relating these spectral quantities to relevant figures of merit. Central to the WPTherml package is a multilayer class; computation of spectral quantities and figures of merit are performed by methods of the multilayer class and are stored as attributes. Spectral quantities are computed within the framework of classical electrodynamics, specifically utilizing the transfer matrix method [7], which is implemented in a library called tmm. The required inputs for the transfer matrix method include the geometry (thickness) and refractive index of each layer in the multi-layer nanostructure, so the multilayer class has an associated method for parsing user input in an intuitive format to specify the geometry and material composition of a multi-layer structure. Refractive index data for a number of common materials is stored and accessed within a data library called datalib.This library also provides access to relevant data for the computation of various figures of merit, for example, spectral response functions of several popular photovoltaic materials (see Figure 1 for an illustration of the spectral response of InGaAsSb), the AM1.5 solar spectrum, the photopic luminosity function, and the atmospheric transmissivity spectrum can all be accessed using the functionality of datalib.
The core of WPTherml is the transfer matrix method, implemented in the tmm library, which is a classical electrodynamics approach that relates the incident electromagnetic field upon a multi-layer structure to the reflected and transmitted electromagnetic fields, thereby permitting computation of reflection, transmission, and absorption of light by the multilayer: where M i , j are the elements of the transfer matrix, r is the reflection amplitude, and t is the transmission amplitude, The reflection and transmission amplitudes may be used to compute the reflectivity, transmissivity, absorptivity, and emissivity of the structure: ( 4) T =t ¿ t n L cos (θ L ) n 1 cos ( θ 1 ) , (5) A ≡ϵ =1−R−T , (6) where R denotes the reflectivity, T the transmissivity, A the absorptivity, and ϵ the emissivity. It should be noted that all quantities above depend on wavelength, and the explicit wavelength dependence of the elements of the transfer matrix have been defined in detail [8]. The core transfer matrix library has been utilized by one of the authors to model thermal emission of multi-layer planar nanostructures [4], and the optical properties of the 2D material known as Borophene [9]. In Equation (6), an important relation known as Kirchoff's law [2][3][4] is invoked, which equates the absorption spectrum of a multi-layer structure to its emissivity spectrum. The emissivity spectrum plays a key role in shaping the thermal emission spectrum of a structure at a given temperature, (7) where TE ( λ ,T ) denotes the thermal emission, and is Planck's blackbody law, where T ml denotes the temperature of the multi-layer structure, λ denotes the wavelength of light, h is Planck's constant, c is the speed of light, and k B is Boltzmann's constant. In the following, we will illustrate the particular application of WPTherml to solar thermophotovoltaics (STPV), where one tailors the thermal emission spectrum of an object through its emissivity such that it is dramatically different from an ideal blackbody emitter, which has an emissivity of 1 for all wavelengths. Following that discussion, we will briefly summarize several other applications for which WPTherml has been specifically designed to address.

Overview of application
Management of thermal emission as an energy source, as is done in STPV, may have many beneficial impacts in multiple markets including but not limited to clean energy, military use, and the consumer market [3]. Here we illustrate the use of WPTherml to simulate the thermal emission of a multi-layer nanostructure optimized for performance as an STPV emitter; this structure is illustrated in Figure 1 (a). Briefly, the objective is to tune the thermal emission of a material so that it is well matched to the spectral response of a photovoltaic (PV) material. In Figure 1 (b), we illustrate the thermal emission spectrum of the structure when it is heated to 1700 K and overlay it with the spectral response function of an InGaAsSb PV cell, which is commonly used in STPV applications [4], along with the blackbody spectrum at 1700 K. Importantly, the thermal emission of the structure illustrated in Figure 1(a) strongly departs from the blackbody spectrum, and has excellent overlap with the spectral response of InGaAsSb. To further illustrate the suitability of this structure for STPV applications, we plot the product of the thermal emission of this structure with the spectral response of InGaAsSb in Figure 1(c). It is in fact the ratio of the area under this curve, relative to the total area under the thermal emission curve, which plays a critical role in the overall conversion efficiency in a given STPV device (see [8] for more details). An example of code used to generate these figures in WPTherml is included below Figure 1.

Figure 1: (a)
Example of a multi-layer structure that exhibits selective thermal emission that is nearly optimal for the spectral response of InGaAsSb PVs. (b) The spectral response (in A/W) of InGaAsSb plotted against the thermal emission spectrum of the structure illustrated in (a) and the blackbody spectrum at 1700 K; these thermal emission spectra are scaled by an arbitrary number (what is the number in this case?) to aid visualization against the spectral response function. (c) Plot of the convolution of the spectral response function of InGaAsSb with the thermal emission of the structure in (a) plotted against the thermal emission itself; these two functions are the integrands in that give rise to the short circuit current and the incident power in a STPV system, respectively. See reference [8] for a more detailed discussion of these quantities and their relation to the STPV efficiency. In the above code example, an instance of the multilayer class called stpv_fig is created following user input defined in the dictionary called structure. The physical structure that this instance models consists of several dielectric layers (aluminium oxide (Al 2 O 3 ), titanium dioxide (TiO 2 ), and glass (SiO 2 )), and an optically-thick tungsten (W) layer, which are defined in the 'Material_List' key of the structure dictionary. Upon instantiation, the optical and thermal emission properties of this structure at 1700 K (specified by 'Temperature' ) are computed for 1000 wavelengths between 300 and 6000 nm (specified in 'Lambda_List') and stored as attributes of stpv_fig. Additionally, because the key 'STPV_EMIT' is set to the value 1, several STPV figures of merit for this structure, including the spectral efficiency, power density, and the TPV efficiency, will be computed at instantiation and stored as attributes the stpv_fig.spectral_efficiency_val, stpv_fig.power_density_val, stpv_fig.tpv_efficiency_val, respectively. The mathematical details of these figures of merit are discussed in references [4,8].

Example
After instantiation, a modification to one of the layers is made whereby the layer with index 1 (originally Al 2 O 3 ) is changed to an alloy of Al 2 O 3 and W with a volume fraction of 75% W; note that in this example, we specify a static refractive index of 1.66+0i for the Al 2 O 3 layer. The model used to define the wavelength-dependent refractive index of this alloy is known as the Maxwell-Garnett effective medium theory [4], specified by the argument "MaxwellGarnett" (an alternative model known as the Bruggeman model [4] can be invoked with the argument "Bruggeman"). Once this modification is made, the optical properties (reflectivity, transmissivity, emissivity) are recomputed by calling the fresnel() method, and the thermal emission spectrum is recomputed with these updated quantities by calling the thermal_emission() method. Also illustrated in this example is how our data library datalib can be used to extract relevant data (either stored or computed) including the spectral response function of InGaAsSb (datalib.SR_InGaAsSb(array_of_wavelengths)) and the blackbody spectrum at a specific temperature (datalib.BB(array_of_wavelengths, temperature)). The remaining code in the example represents standard usage of the python library matplotlib, for which extensive documentation already exists [10]. A full list of methods and attributes associated with the multilayer class can be found in the WPTherml README documentation [11].

Brief Summary of Additional Applications
The control of optical and thermal emission properties of materials is critical for a number of applications, and here we briefly summarize some of these applications for which WPTherml provides unique capabilities.
Incandescent light bulbs with efficiencies approaching or exceeding that of LED-based lights can be realized by tailoring the thermal emission of filament materials [6]. In particular, the thermal emission should be high in the visible and low in the IR at standard operating temperatures (~2500 K). The key to this property is to tailor the emissivity of the filament material to have strong overlap with the photopic luminosity function, which describes the sensitivity of the human eye to visible light [6]. A figure of merit for incandescent bulbs, known as the luminous efficiency, is related to the convolution of the thermal emission and the photopic luminosity function [6,8], and this figure of merit can be computed using the method luminous_efficiency() of the multilayer class (see [11] for more details).
Daytime radiative cooling is an application where a material is used to passively cool a space through a net negative radiative power flux from the material's surface, thereby eliminating or mitigating the need for the use of air conditioning [5]. The key properties of these materials are that they are highly reflective in the solar spectrum and highly emissive in mid-IR wavelengths, specifically wavelengths where the atmosphere is highly transparent (~8-14 microns);. Hence, these materials minimize the positive (warming) radiative power flux associated with solar absorption and absorption of thermal radiation from the atmosphere, and maximize the negative (cooling) radiative power flux associated with the material's thermal emission at its operating temperature. These power fluxes are computed by the method cooling_power() in the multilayer class. An illustration of the emissivity of such a radiative cooling structure taken from reference [5] is shown in Figure 2, and the code used to make this structure can be found in a Jupyter notebook that ships with our package [12].

Figure 2: (a)
Visible absorptivity/emissivity (blue line) of a multi-layered structure optimized for radiative cooling plotted alongside the AM1.5 solar spectrum, illustrating that this structure minimizes absorption of solar power. (b) IR emissivity (red line) of the multi-layered structure optimized for radiative cooling plotted alongside the transmissivity of the earth's atmospheres, illustrating that this structure maximizes ambient thermal radiation and minimizes absorption of thermal radiation from the atmosphere. Further details of this structure can be found in reference [5], and code to reproduce these figures in WPTherml can be found in a Jupyter notebook that ships with our package [12].
The optical properties of thin metal films has been the subject of intensive investigation owing to their ability to support optical resonances known as surface plasmon polaritons [13][14][15], and perfectly absorbing modes [16][17][18]. We have included the capability to analyze multi-layer structures for both surface plasmon polariton and perfectly absorbing modes through the find_spp() and find_pa() methods of the multilayer class, respectively. Mathematical details of these modes can be found in references [8, 13,16].
Finally, to aid in the user's intuition for the relation between optical properties, thermal emission, and appearance of a structure, we have implemented methods to render the color of a structure based on its reflectance (ambient_color()) or based on its thermal emission (thermal_color()). The details behind these methods are discussed in reference [8].

Description of alternative packages
There are several open-source software packages that implement the transfer matrix method to simulate the optical response (for example, reflectivity, transmissivity, absorptivity, emissivity) of multi-layer nanostructures; a partial list includes several python-based transfer matrix method packages [19][20][21][22][23], a cython implementation [24], and a Matlab implementation [25]. Related electrodynamics methods, specifically the S-matrix method, have also been implemented in open-source software packages [26][27][28]. The authors are currently unaware of any alternative software package that leverages such rigorous electrodynamics techniques for the use in thermal radiation applications; consequently, WPTherml provides a unique and useful capability for a large community of scientists and engineers who aim to design materials and technologies for harnessing heat.

Implementation and architecture
WPTherml is written in pure Python 3 with minimal dependencies including numpy, scipy, and matplotlib. WPTherml has been tested with Anaconda Python 3.6 and 3.7 running on Windows 10, Mac OS Sierra, Mac OS Mojave, and Fedora 22. WPTherml includes a multilayer class, several function libraries (tmm, numlib, stpvlib, coolinglib, colorlib, and lightlib), and a data library (datalib). The function libraries contain the functions that perform calculations to extract spectral information and figures of merit for the various applications supported by WPTherml as follows: -tmm leverages the transfer matrix method to compute optical properties (reflectivity, transmissivity, absorptivity, emissivity) of multi-layered nanostructures.
numlib provides a simple function for numerical quadrature, which is used to compute a variety of figures of merit. o Refractive index as a function of wavelength for an extensive number of common materials; this data is required by the transfer matrix method for computing optical properties. o Spectral Response functions for several common photovoltaic materials; this data is required for computing STPV and standard PV efficiencies. o AM1.5 spectral data; this data is required for traditional PV efficiency calculations, concentrated solar absorption calculations, and radiative cooling applications. o Atmospheric transmission spectrum; this data is required for radiative cooling applications. o Spectral response functions for the human eye; this data is required for rendering the colors of structures and for computing the luminous efficiency of incandescent light sources.
The multilayer class provides an intuitive framework for connecting user input to the functionality of WPTherml. The user specifies information about the materials, geometry (thickness), and calculation type to the multilayer class through a dictionary whose keys are descriptive of their meaning with respect to the class. The following code illustrates a simple example where a dictionary called 'structure' is defined such that when passed to the multilayer class, it specifies the 3-layer structure illustrated in Figure 3 below: This needs a header, and also, remove the colon above, because Figure 3 is not immediately below that sentence. Also, make sure you describe what this block of code is in the text. It is important to note the ordering convention used for the 'Material_List' and 'Thickness_List' keys, whose values are lists of strings and floats that specify the materials and thicknesses of each layer in the multi-layer structure, respectively. In particular, these lists are both ordered starting from the side upon which light is incident in a typical reflection experiment and ending in the material into which light would finally be transmitted in the same experiment. Also of note is that both reflected light and thermally emitted light emanate from the top side of structure. All optical and thermal emission spectra will be computed in the range 400 -800 nm, with resolution of (800-400)/1000 nm as specified by the value of 'Lambda_List'. A full list of supported keys that can be parsed by the multilayer class is provided in the WPTherml README documentation [11]. Figure 3: Schematic of the three-layer structure as defined by the 'structure' dictionary above, illustrating the convention for the direction of incoming, reflected, transmitted, and emitted light with respect to the order in which materials and thicknesses are specified by the user.
A schematic of the flow of data between the user, the multilayer class, and the data and function libraries is illustrated in Figure 4 below.

Quality control
Unit testing was performed for all function libraries, reproducing results from peer-reviewed literature on various thermal applications when applicable. The tmm library was unit tested against the existing python transfer matrix package developed by S. J. Byrnes [19,20], and a system test of WPTherml that is directly comparable to this package can be run by the user through the Jupyter notebook entitled 'Validate_Fresnel' that ships with our package [29]. This test also serves as a check for the stpvlib library. The user may also run a system test of WPTherml that checks the functionality of coolinglib through the Jupyter notebook entitled 'Validate_Cooling' that ships with our package [30].

Operating system
WPTherml has been tested on MacOS Sierra, MacOS Mojave, Windows 10, and Fedora 22. Since WPTherml is written in Python, it should run on any system on which Python and the WPTherml dependencies run.

(3) Reuse potential
WPTherml was developed to support the simulation and design of a practically endless number of structures for multiple applications where optical and thermal emission properties are paramount. The package was also developed to be easily extensible to support new applications as the developers or users see fit. Several potential applications are illustrated in Jupyter notebooks that ship with the package, and the developers plan to continue to add and refine these examples over time. Users seeking support for additional features can communicate with us through the issues page of the GitHub repository [31], or may contact the corresponding author by email at foleyj10@wpunj.edu.

Copyright Notice
Authors who publish with this journal agree to the following terms: Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
By submitting this paper you agree to the terms of this Copyright Notice, which will apply to this submission if and when it is published by this journal.

Software paper for submission to the Journal of Open Research Software
To complete this template, please replace the blue text with your own. The paper has three main sections: (1) Overview; (2) Availability; (3) Reuse potential.

Introduction
In 2017 over sixty five percent of energy produced was not useable and released as waste heat [1]; consequently, there are a large number of opportunities to develop technologies which can mitigate waste heat associated with energy production, or which can be used to convert or reclaim waste heat for useful purposes. Nano-scale materials, including multi-layered nanostructures among others, with tailored optical and thermal emission properties are centrally important for many of these envisioned technologies, which include solar thermophotovoltaics (STPV) [2][3][4], radiative cooling devices [5], and highly efficient incandescent lighting [6] that minimize IR losses.
WPTherml (William Paterson University's tool for Thermal Energy and Radiation management with Multi-Layer nanostructures), is a computational engine for materials which can be leveraged for these and other technologies where the control of optical and/or thermal radiation properties is paramount. Specifically, WPTherml can be utilized to simulate optical properties (reflectivity, transmissivity, absorptivity, and emissivity) of nanostructures made from layered isotropic media; thermal radiation spectra of these nanostructures can be derived from these optical quantities in conjunction with Planck's blackbody radiation law. With these spectral quantities in hand, figures of merit for the design of such multi-layer nanostructures for applications such as STPV, passive radiative cooling, concentrated solar power, incandescent lighting, and plasmonics can be computed. Thus, the WPTherml package serves as an engine for computing spectral quantities, and for relating these spectral quantities to relevant figures of merit. Central to the WPTherml package is a multilayer class; computation of spectral quantities and figures of merit are performed by methods of the multilayer class and are stored as attributes. Spectral quantities are computed within the framework of classical electrodynamics, specifically utilizing the transfer matrix method [7], which is implemented in a library called tmm. The required inputs for the transfer matrix method include the geometry (thickness) and refractive index of each layer in the multi-layer nanostructure, so the multilayer class has an associated method for parsing user input in an intuitive format to specify the geometry and material composition of a multi-layer structure. Refractive index data for a number of common materials is stored and accessed within a data library called datalib.This library also provides access to relevant data for the computation of various figures of merit, for example, spectral response functions of several popular photovoltaic materials (see Figure 1 for an illustration of the spectral response of InGaAsSb), the AM1.5 solar spectrum, the photopic luminosity function, and the atmospheric transmissivity spectrum can all be accessed using the functionality of datalib.
The core of WPTherml is the transfer matrix method, implemented in the tmm library, which is a classical electrodynamics approach that relates the incident electromagnetic field upon a multi-layer structure to the reflected and transmitted electromagnetic fields, thereby permitting computation of reflection, transmission, and absorption of light by the multilayer: where , are the elements of the transfer matrix, is the reflection amplitude, and is the transmission amplitude, The reflection and transmission amplitudes may be used to compute the reflectivity, transmissivity, absorptivity, and emissivity of the structure: where denotes the reflectivity, the transmissivity, the absorptivity, and the emissivity. It should be noted that all quantities above depend on wavelength, and the explicit wavelength dependence of the elements of the transfer matrix have been defined in detail [8]. The core transfer matrix library has been utilized by one of the authors to model thermal emission of multi-layer planar nanostructures [4], and the optical properties of the 2D material known as Borophene [9]. In Equation (6), an important relation known as Kirchoff's law [2][3][4] is invoked, which equates the absorption spectrum of a multi-layer structure to its emissivity spectrum. The emissivity spectrum plays a key role in shaping the thermal emission spectrum of a structure at a given temperature, is Planck's blackbody law, where denotes the temperature of the multilayer structure, denotes the wavelength of light, ℎ is Planck's constant, is the speed of light, and is Boltzmann's constant. In the following, we will illustrate the particular application of WPTherml to solar thermophotovoltaics (STPV), where one tailors the thermal emission spectrum of an object through its emissivity such that it is dramatically different from an ideal blackbody emitter, which has an emissivity of 1 for all wavelengths. Following that discussion, we will briefly summarize several other applications for which WPTherml has been specifically designed to address.

Overview of application
Management of thermal emission as an energy source, as is done in STPV, may have many beneficial impacts in multiple markets including but not limited to clean energy, military use, and the consumer market [3]. Here we illustrate the use of WPTherml to simulate the thermal emission of a multilayer nanostructure optimized for performance as an STPV emitter; this structure is illustrated in Figure 1 (a). Briefly, the objective is to tune the thermal emission of a material so that it is well matched to the spectral response of a photovoltaic (PV) material. In Figure 1 (b), we illustrate the thermal emission spectrum of the structure when it is heated to 1700 K and overlay it with the spectral response function of an InGaAsSb PV cell, which is commonly used in STPV applications [4], along with the blackbody spectrum at 1700 K. Importantly, the thermal emission of the structure illustrated in Figure 1(a) strongly departs from the blackbody spectrum, and has excellent overlap with the spectral response of InGaAsSb. To further illustrate the suitability of this structure for STPV applications, we plot the product of the thermal emission of this structure with the spectral response of InGaAsSb in Figure 1(c). It is in fact the ratio of the area under this curve, relative to the total area under the thermal emission curve, which plays a critical role in the overall conversion efficiency in a given STPV device (see [8] for more details). An example of code used to generate these figures in WPTherml is included below Figure 1.  Figure 1: (a) Example of a multi-layer structure that exhibits selective thermal emission that is nearly optimal for the spectral response of InGaAsSb PVs. (b) The spectral response (in A/W) of InGaAsSb plotted against the thermal emission spectrum of the structure illustrated in (a) and the blackbody spectrum at 1700 K; these thermal emission spectra are scaled by an arbitrary number (what is the number in this case?) to aid visualization against the spectral response function. (c) Plot of the convolution of the spectral response function of InGaAsSb with the thermal emission of the structure in (a) plotted against the thermal emission itself; these two functions are the integrands in that give rise to the short circuit current and the incident power in a STPV system, respectively. See reference [8] for a more detailed discussion of these quantities and their relation to the STPV efficiency.

Example Code
from wptherml.wpml import multilayer from matplotlib import pyplot as plt from wptherml.datalib import datalib  In the above code example, an instance of the multilayer class called stpv_fig is created following user input defined in the dictionary called structure. The physical structure that this instance models consists of several dielectric layers (aluminium oxide (Al2O3), titanium dioxide (TiO2), and glass (SiO2)), and an optically-thick tungsten (W) layer, which are defined in the 'Material_List' key of the structure dictionary. Upon instantiation, the optical and thermal emission properties of this structure at 1700 K (specified by 'Temperature' ) are computed for 1000 wavelengths between 300 and 6000 nm (specified in 'Lambda_List') and stored as attributes of stpv_fig. Additionally, because the key 'STPV_EMIT' is set to the value 1, several STPV figures of merit for this structure, including the spectral efficiency, power density, and the TPV efficiency, will be computed at instantiation and stored as attributes the stpv_fig.spectral_efficiency_val, stpv_fig.power_density_val, stpv_fig.tpv_efficiency_val, respectively. The mathematical details of these figures of merit are discussed in references [4,8].
After instantiation, a modification to one of the layers is made whereby the layer with index 1 (originally Al2O3) is changed to an alloy of Al2O3 and W with a volume fraction of 75% W; note that in this example, we specify a static refractive index of 1.66+0i for the Al2O3 layer. The model used to define the wavelength-dependent refractive index of this alloy is known as the Maxwell-Garnett effective medium theory [4], specified by the argument "MaxwellGarnett" (an alternative model known as the Bruggeman model [4] can be invoked with the argument "Bruggeman"). Once this modification is made, the optical properties (reflectivity, transmissivity, emissivity) are recomputed by calling the fresnel() method, and the thermal emission spectrum is recomputed with these updated quantities by calling the thermal_emission() method. Also illustrated in this example is how our data library datalib can be used to extract relevant data (either stored or computed) including the spectral response function of InGaAsSb (datalib.SR_InGaAsSb(array_of_wavelengths)) and the blackbody spectrum at a specific temperature (datalib.BB(array_of_wavelengths, temperature)). The remaining code in the example represents standard usage of the python library matplotlib, for which extensive documentation already exists [10]. A full list of methods and attributes associated with the multilayer class can be found in the WPTherml README documentation [11].

Brief Summary of Additional Applications
The control of optical and thermal emission properties of materials is critical for a number of applications, and here we briefly summarize some of these applications for which WPTherml provides unique capabilities.
Incandescent light bulbs with efficiencies approaching or exceeding that of LED-based lights can be realized by tailoring the thermal emission of filament materials [6]. In particular, the thermal emission should be high in the visible and low in the IR at standard operating temperatures (~2500 K).
The key to this property is to tailor the emissivity of the filament material to have strong overlap with the photopic luminosity function, which describes the sensitivity of the human eye to visible light [6]. A figure of merit for incandescent bulbs, known as the luminous efficiency, is related to the convolution of the thermal emission and the photopic luminosity function [6,8], and this figure of merit can be computed using the method luminous_efficiency() of the multilayer class (see [11] for more details).
Daytime radiative cooling is an application where a material is used to passively cool a space through a net negative radiative power flux from the material's surface, thereby eliminating or mitigating the need for the use of air conditioning [5]. The key properties of these materials are that they are highly reflective in the solar spectrum and highly emissive in mid-IR wavelengths, specifically wavelengths where the atmosphere is highly transparent (~8-14 microns);. Hence, these materials minimize the positive (warming) radiative power flux associated with solar absorption and absorption of thermal radiation from the atmosphere, and maximize the negative (cooling) radiative power flux associated with the material's thermal emission at its operating temperature. These power fluxes are computed by the method cooling_power() in the multilayer class. An illustration of the emissivity of such a radiative cooling structure taken from reference [5] is shown in Figure  2, and the code used to make this structure can be found in a Jupyter notebook that ships with our package [12]. Figure 2: (a) Visible absorptivity/emissivity (blue line) of a multi-layered structure optimized for radiative cooling plotted alongside the AM1.5 solar spectrum, illustrating that this structure minimizes absorption of solar power. (b) IR emissivity (red line) of the multi-layered structure optimized for radiative cooling plotted alongside the transmissivity of the earth's atmospheres, illustrating that this structure maximizes ambient thermal radiation and minimizes absorption of thermal radiation from the atmosphere. Further details of this structure can be found in reference [5], and code to reproduce these figures in WPTherml can be found in a Jupyter notebook that ships with our package [12].
The optical properties of thin metal films has been the subject of intensive investigation owing to their ability to support optical resonances known as surface plasmon polaritons [13][14][15], and perfectly absorbing modes [16][17][18]. We have included the capability to analyze multi-layer structures for both surface plasmon polariton and perfectly absorbing modes through the find_spp() and find_pa() methods of the multilayer class, respectively. Mathematical details of these modes can be found in references [8, 13,16].
Finally, to aid in the user's intuition for the relation between optical properties, thermal emission, and appearance of a structure, we have implemented methods to render the color of a structure based on its reflectance (ambient_color()) or based on its thermal emission (thermal_color()). The details behind these methods are discussed in reference [8].

Description of alternative packages
There are several open-source software packages that implement the transfer matrix method to simulate the optical response (for example, reflectivity, transmissivity, absorptivity, emissivity) of multi-layer nanostructures; a partial list includes several python-based transfer matrix method packages [19][20][21][22][23], a cython implementation [24], and a Matlab implementation [25]. Related electrodynamics methods, specifically the Smatrix method, have also been implemented in open-source software packages [26][27][28]. The authors are currently unaware of any alternative software package that leverages such rigorous electrodynamics techniques for the use in thermal radiation applications; consequently, WPTherml provides a unique and useful capability for a large community of scientists and engineers who aim to design materials and technologies for harnessing heat.

Implementation and architecture
WPTherml is written in pure Python 3 with minimal dependencies including numpy, scipy, and matplotlib. WPTherml has been tested with Anaconda Python 3.6 and 3.7 running on Windows 10, Mac OS Sierra, Mac OS Mojave, and Fedora 22. WPTherml includes a multilayer class, several function libraries (tmm, numlib, stpvlib, coolinglib, colorlib, and lightlib), and a data library (datalib). The function libraries contain the functions that perform calculations to extract spectral information and figures of merit for the various applications supported by WPTherml as follows: -tmm leverages the transfer matrix method to compute optical properties (reflectivity, transmissivity, absorptivity, emissivity) of multi-layered nanostructures.
numlib provides a simple function for numerical quadrature, which is used to compute a variety of figures of merit. o Refractive index as a function of wavelength for an extensive number of common materials; this data is required by the transfer matrix method for computing optical properties. o Spectral Response functions for several common photovoltaic materials; this data is required for computing STPV and standard PV efficiencies. o AM1.5 spectral data; this data is required for traditional PV efficiency calculations, concentrated solar absorption calculations, and radiative cooling applications. o Atmospheric transmission spectrum; this data is required for radiative cooling applications. o Spectral response functions for the human eye; this data is required for rendering the colors of structures and for computing the luminous efficiency of incandescent light sources.
The multilayer class provides an intuitive framework for connecting user input to the functionality of WPTherml. The user specifies information about the materials, geometry (thickness), and calculation type to the multilayer class through a dictionary whose keys are descriptive of their meaning with respect to the class. The following code illustrates a simple example where a dictionary called 'structure' is defined such that when passed to the multilayer class, it specifies the 3-layer structure illustrated in Figure 3 below: This needs a header, and also, remove the colon above, because Figure 3 is not immediately below that sentence. Also, make sure you describe what this block of code is in the text. It is important to note the ordering convention used for the 'Material_List' and 'Thickness_List' keys, whose values are lists of strings and floats that specify the materials and thicknesses of each layer in the multilayer structure, respectively. In particular, these lists are both ordered starting from the side upon which light is incident in a typical reflection experiment and ending in the material into which light would finally be transmitted in the same experiment. Also of note is that both reflected light and thermally emitted light emanate from the top side of structure. All optical and thermal emission spectra will be computed in the range 400 -800 nm, with resolution of (800-400)/1000 nm as specified by the value of 'Lambda_List'. A full list of supported keys that can be parsed by the multilayer class is provided in the WPTherml README documentation [11]. Figure 3: Schematic of the three-layer structure as defined by the 'structure' dictionary above, illustrating the convention for the direction of incoming, reflected, transmitted, and emitted light with respect to the order in which materials and thicknesses are specified by the user.
A schematic of the flow of data between the user, the multilayer class, and the data and function libraries is illustrated in Figure 4 below.

Quality control
Unit testing was performed for all function libraries, reproducing results from peer-reviewed literature on various thermal applications when applicable. The tmm library was unit tested against the existing python transfer matrix package developed by S. J. Byrnes [19,20], and a system test of WPTherml that is directly comparable to this package can be run by the user through the Jupyter notebook entitled 'Validate_Fresnel' that ships with our package [29]. This test also serves as a check for the stpvlib library. The user may also run a system test of WPTherml that checks the functionality of coolinglib through the Jupyter notebook entitled 'Validate_Cooling' that ships with our package [30].

Operating system
WPTherml has been tested on MacOS Sierra, MacOS Mojave, Windows 10, and Fedora 22. Since WPTherml is written in Python, it should run on any system on which Python and the WPTherml dependencies run.