diff --git a/.github/workflows/draft-pdf.yml b/.github/workflows/draft-pdf.yml new file mode 100644 index 0000000..998b3ac --- /dev/null +++ b/.github/workflows/draft-pdf.yml @@ -0,0 +1,19 @@ +on: [push] + +jobs: + paper: + runs-on: ubuntu-latest + name: Paper Draft + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Build draft PDF + uses: openjournals/openjournals-draft-action@master + with: + journal: joss + paper-path: paper/paper.md + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: paper + path: paper/paper.pdf diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 1329833..005f6ab 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -3,8 +3,6 @@ name: Linting on: push: branches: [master] - pull_request: - branches: [master] jobs: linting: diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 40a4ab4..f7457af 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -6,8 +6,6 @@ name: Pytest on: push: branches: [master] - pull_request: - branches: [master] jobs: test_python: diff --git a/.github/workflows/requirements.yml b/.github/workflows/requirements.yml index 67ed458..6ca2bc9 100644 --- a/.github/workflows/requirements.yml +++ b/.github/workflows/requirements.yml @@ -3,8 +3,6 @@ name: Dev requirements for target python on: push: branches: [master] - pull_request: - branches: [master] jobs: test_python: diff --git a/paper/fit_decorator_example.png b/paper/fit_decorator_example.png new file mode 100644 index 0000000..49ef40a Binary files /dev/null and b/paper/fit_decorator_example.png differ diff --git a/paper/paper.bib b/paper/paper.bib new file mode 100644 index 0000000..bc01f62 --- /dev/null +++ b/paper/paper.bib @@ -0,0 +1,430 @@ +@Article{Wilkinson2016, + author={Wilkinson, Mark D. + and Dumontier, Michel + and Aalbersberg, IJsbrand Jan + and Appleton, Gabrielle + and Axton, Myles + and Baak, Arie + and Blomberg, Niklas + and Boiten, Jan-Willem + and da Silva Santos, Luiz Bonino + and Bourne, Philip E. + and Bouwman, Jildau + and Brookes, Anthony J. + and Clark, Tim + and Crosas, Merc{\`e} + and Dillo, Ingrid + and Dumon, Olivier + and Edmunds, Scott + and Evelo, Chris T. + and Finkers, Richard + and Gonzalez-Beltran, Alejandra + and Gray, Alasdair J.G. + and Groth, Paul + and Goble, Carole + and Grethe, Jeffrey S. + and Heringa, Jaap + and 't Hoen, Peter A.C + and Hooft, Rob + and Kuhn, Tobias + and Kok, Ruben + and Kok, Joost + and Lusher, Scott J. + and Martone, Maryann E. + and Mons, Albert + and Packer, Abel L. + and Persson, Bengt + and Rocca-Serra, Philippe + and Roos, Marco + and van Schaik, Rene + and Sansone, Susanna-Assunta + and Schultes, Erik + and Sengstag, Thierry + and Slater, Ted + and Strawn, George + and Swertz, Morris A. + and Thompson, Mark + and van der Lei, Johan + and van Mulligen, Erik + and Velterop, Jan + and Waagmeester, Andra + and Wittenburg, Peter + and Wolstencroft, Katherine + and Zhao, Jun + and Mons, Barend}, + title={The FAIR Guiding Principles for scientific data management and stewardship}, + journal={Scientific Data}, + year={2016}, + month={Mar}, + day={15}, + volume={3}, + number={1}, + pages={160018}, + abstract={There is an urgent need to improve the infrastructure supporting the reuse of scholarly data. A diverse set of stakeholders---representing academia, industry, funding agencies, and scholarly publishers---have come together to design and jointly endorse a concise and measureable set of principles that we refer to as the FAIR Data Principles. The intent is that these may act as a guideline for those wishing to enhance the reusability of their data holdings. Distinct from peer initiatives that focus on the human scholar, the FAIR Principles put specific emphasis on enhancing the ability of machines to automatically find and use the data, in addition to supporting its reuse by individuals. This Comment is the first formal publication of the FAIR Principles, and includes the rationale behind them, and some exemplar implementations in the community.}, + issn={2052-4463}, + doi={10.1038/sdata.2016.18}, + url={https://doi.org/10.1038/sdata.2016.18} +} + +@Article{Barker2022, + author={Barker, Michelle + and Chue Hong, Neil P. + and Katz, Daniel S. + and Lamprecht, Anna-Lena + and Martinez-Ortiz, Carlos + and Psomopoulos, Fotis + and Harrow, Jennifer + and Castro, Leyla Jael + and Gruenpeter, Morane + and Martinez, Paula Andrea + and Honeyman, Tom}, + title={Introducing the FAIR Principles for research software}, + journal={Scientific Data}, + year={2022}, + month={Oct}, + day={14}, + volume={9}, + number={1}, + pages={622}, + abstract={Research software is a fundamental and vital part of research, yet significant challenges to discoverability, productivity, quality, reproducibility, and sustainability exist. Improving the practice of scholarship is a common goal of the open science, open source, and FAIR (Findable, Accessible, Interoperable and Reusable) communities and research software is now being understood as a type of digital object to which FAIR should be applied. This emergence reflects a maturation of the research community to better understand the crucial role of FAIR research software in maximising research value. The FAIR for Research Software (FAIR4RS) Working Group has adapted the FAIR Guiding Principles to create the FAIR Principles for Research Software (FAIR4RS Principles). The contents and context of the FAIR4RS Principles are summarised here to provide the basis for discussion of their adoption. Examples of implementation by organisations are provided to share information on how to maximise the value of research outputs, and to encourage others to amplify the importance and impact of this work.}, + issn={2052-4463}, + doi={10.1038/s41597-022-01710-x}, + url={https://doi.org/10.1038/s41597-022-01710-x} +} + +@article{Konnecke2015, + author = "K{\"{o}}nnecke, Mark and Akeroyd, Frederick A. and Bernstein, Herbert J. and Brewster, Aaron S. and Campbell, Stuart I. and Clausen, Bj{\"{o}}rn and Cottrell, Stephen and Hoffmann, Jens Uwe and Jemian, Pete R. and M{\"{a}}nnicke, David and Osborn, Raymond and Peterson, Peter F. and Richter, Tobias and Suzuki, Jiro and Watts, Benjamin and Wintersberger, Eugen and Wuttke, Joachim", + title = "{The NeXus data format}", + journal = "Journal of Applied Crystallography", + year = "2015", + volume = "48", + number = "1", + pages = "301--305", + month = "Feb", + doi = {10.1107/S1600576714027575}, + url = {https://doi.org/10.1107/S1600576714027575}, + abstract = {NeXus is an effort by an international group of scientists to define a common data exchange and archival format for neutron, X-ray and muon experiments. NeXus is built on top of the scientific data format HDF5 and adds domain-specific rules for organizing data within HDF5 files, in addition to a dictionary of well defined domain-specific field names. The NeXus data format has two purposes. First, it defines a format that can serve as a container for all relevant data associated with a beamline. This is a very important use case. Second, it defines standards in the form of application definitions for the exchange of data between applications. NeXus provides structures for raw experimental data as well as for processed data.}, + keywords = {NeXus data format, data exchange, data archiving, platform-independent, HDF5}, +} + +@article{rii, + author = {Mikhail N. Polyanskiy}, + title = {Refractiveindex.info database of optical constants}, + journal = "Scientific Data", + year = "2024", + volume = "11", + number = "1", + pages = "94", + month = "Jan", + day = "18", + issn={2052-4463}, + doi = {10.1038/s41597-023-02898-2}, + url = {https://doi.org/10.1038/s41597-023-02898-2}, + abstract = {We introduce the refractiveindex.info database, a comprehensive open-source repository containing optical constants for a wide array of materials, and describe in detail the underlying dataset. This collection, derived from a meticulous compilation of data sourced from peer-reviewed publications, manufacturers’ datasheets, and authoritative texts, aims to advance research in optics and photonics. The data is stored using a YAML-based format, ensuring integrity, consistency, and ease of access. Each record is accompanied by detailed metadata, facilitating a comprehensive understanding and efficient utilization of the data. In this descriptor, we outline the data curation protocols and the file format used for data records, and briefly demonstrate how the data can be organized in a user-friendly fashion akin to the books in a traditional library.}, +} + +@software{berreman4x4_software, + author = {Olivier Castany and Céline Molinaro}, + title = {Berreman4x4}, + url = {https://github.com/Berreman4x4/Berreman4x4}, + urldate = {2024-07-02}, + year = {2021} +} + +@manual{berreman4x4_doku, + author = {Olivier Castany}, + title = {Berreman4x4}, + url = {https://sourceforge.net/projects/berreman4x4/files/documentation.pdf}, + year = {2021}, + month = oct, + day = {31}, +} + +@Article{ harris2020array, + title = {Array programming with {NumPy}}, + author = {Charles R. Harris and K. Jarrod Millman and St{\'{e}}fan J. + van der Walt and Ralf Gommers and Pauli Virtanen and David + Cournapeau and Eric Wieser and Julian Taylor and Sebastian + Berg and Nathaniel J. Smith and Robert Kern and Matti Picus + and Stephan Hoyer and Marten H. van Kerkwijk and Matthew + Brett and Allan Haldane and Jaime Fern{\'{a}}ndez del + R{\'{i}}o and Mark Wiebe and Pearu Peterson and Pierre + G{\'{e}}rard-Marchant and Kevin Sheppard and Tyler Reddy and + Warren Weckesser and Hameer Abbasi and Christoph Gohlke and + Travis E. Oliphant}, + year = {2020}, + month = sep, + journal = {Nature}, + volume = {585}, + number = {7825}, + pages = {357--362}, + doi = {10.1038/s41586-020-2649-2}, + publisher = {Springer Science and Business Media {LLC}}, + url = {https://doi.org/10.1038/s41586-020-2649-2} +} + +@ARTICLE{2020SciPy-NMeth, + author = {Virtanen, Pauli and Gommers, Ralf and Oliphant, Travis E. and + Haberland, Matt and Reddy, Tyler and Cournapeau, David and + Burovski, Evgeni and Peterson, Pearu and Weckesser, Warren and + Bright, Jonathan and {van der Walt}, St{\'e}fan J. and + Brett, Matthew and Wilson, Joshua and Millman, K. Jarrod and + Mayorov, Nikolay and Nelson, Andrew R. J. and Jones, Eric and + Kern, Robert and Larson, Eric and Carey, C J and + Polat, {\.I}lhan and Feng, Yu and Moore, Eric W. and + {VanderPlas}, Jake and Laxalde, Denis and Perktold, Josef and + Cimrman, Robert and Henriksen, Ian and Quintero, E. A. and + Harris, Charles R. and Archibald, Anne M. and + Ribeiro, Ant{\^o}nio H. and Pedregosa, Fabian and + {van Mulbregt}, Paul and {SciPy 1.0 Contributors}}, + title = {{{SciPy} 1.0: Fundamental Algorithms for Scientific Computing in Python}}, + journal = {Nature Methods}, + year = {2020}, + volume = {17}, + pages = {261--272}, + adsurl = {https://rdcu.be/b08Wh}, + doi = {10.1038/s41592-019-0686-2}, +} + +@article{Berreman72, + author = {Dwight W. Berreman}, + journal = {J. Opt. Soc. Am.}, + keywords = {Cholesteric liquid crystals; Faraday effect; Liquid crystals; Magnetic fields; Nonlinear effects; Optical activity}, + number = {4}, + pages = {502--510}, + publisher = {Optica Publishing Group}, + title = {Optics in Stratified and Anisotropic Media: 4{\texttimes}4-Matrix Formulation}, + volume = {62}, + month = {Apr}, + year = {1972}, + url = {https://opg.optica.org/abstract.cfm?URI=josa-62-4-502}, + doi = {10.1364/JOSA.62.000502}, + abstract = {A 4{\texttimes}4-matrix technique was recently introduced by Teitler and Henvis for finding propagation and reflection by stratified anisotropic media. It is more general than the 2{\texttimes}2-matrix technique developed by Jones and by Abel\`{e}s and is applicable to problems involving media of low optical symmetry. A little later, we developed a 4{\texttimes}4 differential-matrix technique in order to solve the problem of reflection and transmission by cholesteric liquid crystals and other liquid crystals with continuously varying but planar ordering. Our technique is mathematically equivalent to that of Teitler and Henvis, but we used a somewhat different approach. We start with a 6{\texttimes}6-matrix representation of Maxwell's equations that can include Faraday rotation and optical activity. From this, we derive expressions for 16 differential-matrix elements so that a wide variety of specific problems can be attacked without repeating a large amount of tedious algebra. The 4{\texttimes}4-matrix technique is particularly well suited for solving complicated reflection and transmission problems on a computer. It also serves as an illuminating alternative way to rederive closed solutions to a number of less-complicated classical problems. Teitler and Henvis described a method of solving some of these problems, briefly in their paper. We give solutions to several such problems and add a solution to the Oseen--DeVries optical model of a cholesteric liquid crystal, to illustrate the power and simplicity of the 4{\texttimes}4-matrix technique.}, +} + +@misc{byrnes2020multilayer, + title={Multilayer optical calculations}, + author={Steven J. Byrnes}, + year={2020}, + eprint={1603.02720}, + archivePrefix={arXiv}, + primaryClass={physics.comp-ph} +} + +@Article{Scheffler2022, + author={Scheffler, Matthias + and Aeschlimann, Martin + and Albrecht, Martin + and Bereau, Tristan + and Bungartz, Hans-Joachim + and Felser, Claudia + and Greiner, Mark + and Gro{\ss}, Axel + and Koch, Christoph T. + and Kremer, Kurt + and Nagel, Wolfgang E. + and Scheidgen, Markus + and W{\"o}ll, Christof + and Draxl, Claudia}, + title={FAIR data enabling new horizons for materials research}, + journal={Nature}, + year={2022}, + month={Apr}, + day={01}, + volume={604}, + number={7907}, + pages={635-642}, + abstract={The prosperity and lifestyle of our society are very much governed by achievements in condensed matter physics, chemistry and materials science, because new products for sectors such as energy, the environment, health, mobility and information technology (IT) rely largely on improved or even new materials. Examples include solid-state lighting, touchscreens, batteries, implants, drug delivery and many more. The enormous amount of research data produced every day in these fields represents a gold mine of the twenty-first century. This gold mine is, however, of little value if these data are not comprehensively characterized and made available. How can we refine this feedstock; that is, turn data into knowledge and value? For this, a FAIR (findable, accessible, interoperable and reusable) data infrastructure is a must. Only then can data be readily shared and explored using data analytics and artificial intelligence (AI) methods. Making data 'findable and AI ready' (a forward-looking interpretation of the acronym) will change the way in which science is carried out today. In this Perspective, we discuss how we can prepare to make this happen for the field of materials science.}, + issn={1476-4687}, + doi={10.1038/s41586-022-04501-x}, + url={https://doi.org/10.1038/s41586-022-04501-x} +} + +@Inbook{Hilfiker2018, + author="Hilfiker, James N. + and Tiwald, Tom", + editor="Fujiwara, Hiroyuki + and Collins, Robert W.", + title="Dielectric Function Modeling", + bookTitle="Spectroscopic Ellipsometry for Photovoltaics: Volume 1: Fundamental Principles and Solar Cell Characterization", + year="2018", + publisher="Springer International Publishing", + address="Cham", + pages="115--153", + abstract="Spectroscopic ellipsometry (SE) is commonly used to measure the optical constants of thin films and bulk materials. The optical constants vary with wavelength, which is referred to as dispersion. Rather than independently determine the optical constants at each wavelength, it is convenient to use an equation to describe their dispersion. A dispersion equation simplifies the description of the optical constants and improves the efficiency of data analysis. We begin this chapter by describing the optical constants, optical resonance, and the Kramers-Kronig relations. Different absorption phenomena are also briefly described. Many dispersion equations relate an optical resonance or absorption in terms of the complex dielectric function. Multiple resonance and absorption features can be summed to describe the overall dielectric function for the material. Finally, we review the common dispersion equations used for photovoltaic materials. The Cauchy and Sellmeier equations are used to describe transparent materials. The Lorentz, Harmonic, and Gaussian equations describe a resonant absorption. The Tauc-Lorentz and Cody-Lorentz were developed for amorphous semiconductors with dispersion features necessary to describe the optical functions near the bandgap energy. Additional dispersion equations are designed to describe the critical points in semiconductor band structure. We conclude this review with a description of polynomials, splines, and basis-splines, which are used to empirically match the optical functions of many materials.", + isbn="978-3-319-75377-5", + doi="10.1007/978-3-319-75377-5_5", + url="https://doi.org/10.1007/978-3-319-75377-5_5" +} + +@software{matt_newville_2024_12785036, + author = {Matt Newville and + Renee Otten and + Andrew Nelson and + Till Stensitzki and + Antonino Ingargiola and + Dan Allan and + Austin Fox and + Faustin Carter and + Michał and + Ray Osborn and + Dima Pustakhod and + Sebastian Weigand and + lneuhaus and + Andrey Aristov and + Glenn and + Mark and + mgunyho and + Christoph Deil and + Allan L. R. Hansen and + Gustavo Pasquevich and + Leon Foks and + Nicholas Zobrist and + Oliver Frost and + Stuermer and + Jean-Christophe Jaskula and + Shane Caldwell and + Pieter Eendebak and + Matteo Pompili and + Jens Hedegaard Nielsen and + Arun Persaud}, + title = {lmfit/lmfit-py: 1.3.2}, + month = jul, + year = 2024, + publisher = {Zenodo}, + version = {1.3.2}, + doi = {10.5281/zenodo.12785036}, + url = {https://doi.org/10.5281/zenodo.12785036}, +} + +@article{eberheim2022, + author = {Eberheim, Kevin and Dues, Christof and Attaccalite, Claudio and Müller, Marius J. and Schwan, Sebastian and Mollenhauer, Doreen and Chatterjee, Sangam and Sanna, Simone}, + title = {Tetraphenyl Tetrel Molecules and Molecular Crystals: From Structural Properties to Nonlinear Optics}, + journal = {The Journal of Physical Chemistry C}, + volume = {126}, + number = {7}, + pages = {3713-3726}, + year = {2022}, + doi = {10.1021/acs.jpcc.1c10107}, + url = {https://doi.org/10.1021/acs.jpcc.1c10107}, + eprint = { https://doi.org/10.1021/acs.jpcc.1c10107} +} + +@article{Passler17, + author = {Nikolai Christian Passler and Alexander Paarmann}, + journal = {J. Opt. Soc. Am. B}, + keywords = {Anisotropic optical materials; Multilayers; Spectroscopy, infrared; Thin films, optical properties; Nanophotonics and photonic crystals ; Light matter interactions; Light propagation; Material properties; Stratified media; Thin films; Total internal reflection}, + number = {10}, + pages = {2128--2139}, + publisher = {Optica Publishing Group}, + title = {Generalized 4 {\texttimes} 4 matrix formalism for light propagation in anisotropic stratified media: study of surface phonon polaritons in polar dielectric heterostructures}, + volume = {34}, + month = {Oct}, + year = {2017}, + url = {https://opg.optica.org/josab/abstract.cfm?URI=josab-34-10-2128}, + doi = {10.1364/JOSAB.34.002128}, + abstract = {We present a generalized 4{\texttimes}4 matrix formalism for the description of light propagation in birefringent stratified media. In contrast to previous work, our algorithm is capable of treating arbitrarily anisotropic or isotropic, absorbing or non-absorbing materials and is free of discontinuous solutions. We calculate the reflection and transmission coefficients and derive equations for the electric field distribution for any number of layers. The algorithm is easily comprehensible and can be straightforwardly implemented in a computer program. To demonstrate the capabilities of the approach, we calculate the reflectivities, electric field distributions, and dispersion curves for surface phonon polaritons excited in the Otto geometry for selected model systems, where we observe several distinct phenomena ranging from critical coupling to mode splitting, and surface phonon polaritons in hyperbolic media.}, +} + +@article{Passler19, + author = {Nikolai Christian Passler and Alexander Paarmann}, + journal = {J. Opt. Soc. Am. B}, + keywords = {Electric fields; Evanescent waves; Light propagation; Polaritons; Stratified media; Transmission coefficient}, + number = {11}, + pages = {3246--3248}, + publisher = {Optica Publishing Group}, + title = {Generalized 4 {\texttimes} 4 matrix formalism for light propagation in anisotropic stratified media: study of surface phonon polaritons in polar dielectric heterostructures: erratum}, + volume = {36}, + month = {Nov}, + year = {2019}, + url = {https://opg.optica.org/josab/abstract.cfm?URI=josab-36-11-3246}, + doi = {10.1364/JOSAB.36.003246}, + abstract = {In our paper J. Opt. Soc. Am. B34, 2128 (2017)JOBPDE0740-322410.1364/JOSAB.34.002128 in Section 2.C, the calculation of the layer-dependent electric field distribution is only valid for media with permittivity tensors that are diagonal in the lab frame, i.e., non-birefringent media. This erratum corrects Section 2.C such that the electric field distribution in birefringent media is calculated correctly. Further, Eqs. (20) and (33)--(36) are corrected. The associated MATLAB implementation has been updated.}, +} + +@article{Pearce2021, + doi = {10.21105/joss.03460}, + url = {https://doi.org/10.21105/joss.03460}, + year = {2021}, + publisher = {The Open Journal}, + volume = {6}, + number = {65}, + pages = {3460}, + author = {Phoebe M. Pearce}, + title = {RayFlare: flexible optical modelling of solar cells}, + journal = {Journal of Open Source Software} +} + +@article{Luce22, + author = {Alexander Luce and Ali Mahdavi and Florian Marquardt and Heribert Wankerl}, + journal = {J. Opt. Soc. Am. A}, + keywords = {Matrix methods; Neural networks; Refractive index; Thin film design; Thin film optical properties; Thin films}, + number = {6}, + pages = {1007--1013}, + publisher = {Optica Publishing Group}, + title = {TMM-Fast, a transfer matrix computation package for multilayer thin-film optimization: tutorial}, + volume = {39}, + month = {Jun}, + year = {2022}, + url = {https://opg.optica.org/josaa/abstract.cfm?URI=josaa-39-6-1007}, + doi = {10.1364/JOSAA.450928}, + abstract = {Achieving the desired optical response from a multilayer thin-film structure over a broad range of wavelengths and angles of incidence can be challenging. An advanced thin-film structure can consist of multiple materials with different thicknesses and numerous layers. Design and optimization of complex thin-film structures with multiple variables is a computationally heavy problem that is still under active research. To enable fast and easy experimentation with new optimization techniques, we propose the Python package Transfer Matrix Method - Fast (TMM-Fast), which enables parallelized computation of reflection and transmission of light at different angles of incidence and wavelengths through the multilayer thin film. By decreasing computational time, generating datasets for machine learning becomes feasible, and evolutionary optimization can be used effectively. Additionally, the subpackage TMM-Torch allows us to directly compute analytical gradients for local optimization by using PyTorch Autograd functionality. Finally, an OpenAI Gym environment is presented, which allows the user to train new reinforcement learning agents on the problem of finding multilayer thin-film configurations.}, +} + +@article{Bay2022, + title = {PyLlama: A stable and versatile Python toolkit for the electromagnetic modelling of multilayered anisotropic media}, + journal = {Computer Physics Communications}, + volume = {273}, + pages = {108256}, + year = {2022}, + issn = {0010-4655}, + doi = {https://doi.org/10.1016/j.cpc.2021.108256}, + url = {https://www.sciencedirect.com/science/article/pii/S0010465521003684}, + author = {Mélanie M. Bay and Silvia Vignolini and Kevin Vynck}, + keywords = {Multilayers, Anisotropic optical materials, Optical modelling, Photonic crystals, Cholesterics, Surface phonon polaritons}, + abstract = {PyLlama is a handy Python toolkit to compute the electromagnetic reflection and transmission properties of arbitrary multilayered linear media, including the case of anisotropy. Relying on a 4×4-matrix formalism, PyLlama implements not only the transfer matrix method, that is the most popular choice in existing codes, but also the scattering matrix method, which is numerically stable in all situations (e.g., thick, highly birefringent cholesteric structures at grazing incident angles). PyLlama is also designed to suit the practical needs by allowing the user to create, edit and assemble layers or multilayered domains with great ease. In this article, we present the electromagnetic theory underlying the transfer matrix and scattering matrix methods and outline the architecture and main features of PyLlama. Finally, we validate the code by comparison with available analytical solutions and demonstrate its versatility and numerical stability by modelling cholesteric media of varying complexity. A detailed documentation and tutorial are provided in a separate user manual. Applications of PyLlama range from the design of optical components to the modelling of polaritonic effects in polar crystals, to the study of structurally coloured materials in the living world. + Program summary + Program Title: PyLlama – Python Toolkit for the Electromagnetic Modelling of Multilayered Anisotropic Media CPC Library link to program files: https://doi.org/10.17632/dzw8x5vyrv.1 Developer's repository link: https://github.com/VignoliniLab/PyLlama Licensing provisions: GPLv3 Programming language: Python Supplementary material: User guide and tutorials at https://pyllama.readthedocs.io/ Nature of problem: Computation of the optical reflection and transmission coefficients of arbitrary multilayered linear media, composed of an arbitrary number of layers, possibly mixing isotropic and anisotropic, absorbing and non-absorbing materials, for linearly or circularly polarised light. Solution method: Implementation of both the transfer matrix method (faster) and the scattering matrix method (more robust) relying on a 4×4 matrix formalism. Additional comments including restrictions and unusual features: Integration of a physical model to handle cholesteric structures, blueprint for the integration of user-created custom systems, hassle-free export of spectra for non-programmers even for complex and/or custom systems. External routines include: Numpy [1], Scipy [2], as well as Sympy [3] (optional). + References + [1]Numpy, https://numpy.org/.[2]Scipy, https://www.scipy.org/.[3]Sympy, https://www.sympy.org/.} +} + +@book{tompkins2005, + title={Handbook of Ellipsometry}, + author={Tompkins, H. and Irene, E.A.}, + isbn={9780815517474}, + year={2005}, + publisher={William Andrew}, + address={Norwich} +} + +@manual{WVASEguide, + title={Guide to Using WVASE}, + organization={J. A. Woollam Co., Inc.}, + address={Lincoln, NE}, + year={2012} +} + +@software{tmmax, + author = {Bahrem Serhat Danis, Esra Zayim}, + title = {tmmax: transfer matrix method with jax}, + version = {1.0.0}, + url = {https://github.com/bahremsd/tmmax}, + year = {2025} +} + +@article{Langevin:24, + author = {Denis Langevin and Pauline Bennet and Abdourahman Khaireh-Walieh and Peter Wiecha and Olivier Teytaud and Antoine Moreau}, + journal = {J. Opt. Soc. Am. B}, + keywords = {Deep learning; Optical computing; Optical filters; Optical properties; Resonant modes; Wavelength division multiplexing}, + number = {2}, + pages = {A67--A78}, + publisher = {Optica Publishing Group}, + title = {PyMoosh: a comprehensive numerical toolkit for computing the optical properties of multilayered structures}, + volume = {41}, + month = {Feb}, + year = {2024}, + url = {https://opg.optica.org/josab/abstract.cfm?URI=josab-41-2-A67}, + doi = {10.1364/JOSAB.506175}, + abstract = {We present PyMoosh, a Python-based simulation library designed to provide a comprehensive set of numerical tools allowing the computation of essentially all optical characteristics of multilayered structures, ranging from reflectance and transmittance to guided modes and photovoltaic efficiency. PyMoosh is designed not just for research purposes, but also for use cases in education. To this end, we have invested significant effort in ensuring the user-friendliness and simplicity of the interface. PyMoosh has been developed in line with the principles of open science and considering the fact that multilayered structures are increasingly being used as a testing ground for optimization and deep learning approaches. We provide in this paper the theoretical basis at the core of PyMoosh, an overview of its capabilities, as well as a comparison between the different numerical methods implemented in terms of speed and stability. We are convinced such a versatile tool will be useful for the community in many ways.}, +} diff --git a/paper/paper.md b/paper/paper.md new file mode 100644 index 0000000..69b01dc --- /dev/null +++ b/paper/paper.md @@ -0,0 +1,203 @@ +--- +title: "pyElli: An open source ellipsometry analysis tool for FAIR data" +tags: + - Python + - spectroscopy + - ellipsometry + - solid state physics + - transfer matrix method +authors: + - name: Marius J. Müller + orcid: 0009-0005-2187-0122 + affiliation: 1 + - name: Florian Dobener + orcid: 0000-0003-1987-6224 + - name: Sangam Chatterjee + orcid: 0000-0002-0237-5880 + affiliation: 1 +affiliations: + - name: Institute of Experimental Physics I and Center for Materials Research (ZfM/LaMa), Justus Liebig University Giessen, Heinrich-Buff-Ring 16, Giessen, D-35392 Germany + index: 1 +date: 24 April 2023 +bibliography: paper.bib +--- + +# Summary + +**PyElli** is an open-source Python-based analysis tool for evaluating the linear optical interaction of layered materials. +The code primarily targets spectroscopic ellipsometry (SE) but is adaptable to various transmission and reflection experiments featuring spectral and polarization resolution. + +Various scientific fields use SE to determine the optical constants - or rather functions - of materials and multiple-layer stacks. +The as-measured SE experimental data requires numerical analysis to deduce physically meaningful material parameters. +A typical approach uses transfer-matrix methods (TMM) [@tompkins2005; @WVASEguide]. +Here, an interaction matrix describes the optical response of each individual material layer. +The full optical response of a multilayer system is then determined by matrix multiplication of the layers' matrices. + +The ellipsometer hardware typically supports bundled proprietary software solutions for such analyses. +Unfortunately, each manufacturer supplies their own adapted tools. +This approach promises efficient laboratory workflows if working flawlessly. +However, it binds scientists to specific optical models and experiments available in the provided software. +Furthermore, data interchange can be cumbersome, and results may be hard to reproduce on competitive systems due to the use of other models or parameters. +In addition, limitations of the bundled software may stimulate scientists to use third-party software: bundled software packages may not support specific kinds of analyses, such as including the response of optically anisotropic materials or simultaneous fitting of external experimental parameters. + +**PyElli** offers an open-source alternative extending the capabilities of existing solutions, while aiming to remain as compatible as possible, by providing data imports from various manufacturers (Woollam VWASE, Woollam CompleteEASE, Sentech, Accurion). +The code is designed with extensibility and adaptability in mind enabling the implementation of individually adapted models as well as data evaluation with custom tools. +Typical examples for advanced use-cases are implementations of custom experimental geometries not covered by other software [@eberheim2022], imaging ellipsometry, or as a full FAIR data automated analysis pipeline for SE measurements. +**PyElli** also supports recent advances in the standardization of ellipsometry data and models, addressing the need for FAIR data [@Wilkinson2016]. + +**PyElli** aims to provide a straight-forward database of predefined dispersion models for analyzing materials. +All optical models adhere closely to the literature [@Hilfiker2018]. +The software easily includes the popular public-domain database for optical constants [refractiveindex.info](https://refractiveindex.info) [@rii]. +This allows the inclusion of literature dispersions with a single line of code. +Additional dispersion relations can be either hard coded, which is more efficient, or parsed from a text-based domain-specific language into a fittable dispersion. + +**PyElli** supports multiple solving algorithms with different characteristics. +Currently, two algorithms using different formulations are available: a fast algorithm based on a 2x2 matrix formulation [@byrnes2020multilayer] and a more complex 4x4 matrix formulation [@Berreman72; @berreman4x4_doku; @berreman4x4_software]. +The 2x2 matrix algorithm divides the light into two perpendicular linearly polarized beams, which are solved separately. +One of its limitations is eliminating the possibility to include birefringent materials. +The 4x4 matrix approach fully solves Maxwell's equations. +These equations describe the complete electromagnetic field inside each layer of the sample and couple these together using the matrix formalism. +This allows finding solutions to more complex problems such as anisotropic materials, active media or magneto-optic samples. + +**PyElli** ensures fast processing through fully vectorized algorithms for multiple wavelengths and by leveraging numerical algebra libraries like [NumPy](https://numpy.org) [@harris2020array] and [SciPy](https://scipy.org) [@2020SciPy-NMeth]. +Together, these runtime advantages enable the practical use of advanced fitting algorithms such as global optimizers while maintaining reasonable evaluation times. +As a result, they enable integrated in-situ monitoring and real-time data analysis of overlayer growth. +Furthermore, the use of Python and vectorization libraries also facilitates the development of artificial intelligence-based SE data analysis. + +# Statement of need + +The importance of publishing data according to the FAIR principles is growing [@Wilkinson2016]. +Many research journals already require authors to add supporting data, and there is a growing expectation from sponsors for institutes and researchers to implement data governance. +The FAIR principles have recently been extended to apply to research software as well since reproducing data requires not only the data itself but also the software used to create it [@Barker2022]. +Producing FAIR data and using a FAIR and open analysis pipeline is especially important for SE, as the results are tightly related and dependent on the algorithms and models used for evaluation. + +An open-source toolkit has many inherent benefits over proprietary software. +For SE, optical models vary between manufacturers and translation can be difficult without comprehensive documentation. +**PyElli's** open-source nature makes optical models extendable, auditable, and fully comprehensive. +Each version of **PyElli** is associated with a DOI and a Zenodo upload, allowing for reliable referencing and reproducibility of analysis results. +It supports [NXellipsometry](https://fairmat-experimental.github.io/nexus-fairmat-proposal/9636feecb79bb32b828b1a9804269573256d7696/classes/contributed_definitions/NXellipsometry.html#nxellipsometry), a recent advancement in SE data standardization. +This standard is developed by the German consortium [FAIRmat](https://www.fair-di.eu/fairmat) within the German National Research Data Infrastructure (NFDI) and is accepted by the [NeXus International Advisory Committee (NIAC)](https://www.nexusformat.org/NIAC.html), which has been maintaining beamline standards in the [NeXus format](https://www.nexusformat.org) for over 20 years [@Konnecke2015]. +**PyElli** is also available as an [example](https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-remote-tools-hub/-/tree/develop/docker/ellips/example) and a cloud-based [analysis tool](https://nomad-lab.eu/prod/v1/staging/gui/analyze/north) in the research data management software [NOMAD](https://nomad-lab.eu/nomad-lab/) [@Scheffler2022]. + +In summary, **PyElli** aims to provide the means of more straight-forward data analysis, reproducibility, and FAIR data management within the ellipsometry community. + +# Software with similar functionalities + +Other notable Python open-source software for solving transfer-matrices is available, but tends to focus on different aspects: + +- [PyGTM](https://pygtm.readthedocs.io) [@Passler17; @Passler19] provides a non-vectorized, extensive general transfer matrix approach. It allows calculation of additional parameters, like the local strength of the electric field at any position in the multilayer stack. +- [PyLlama](https://pyllama.readthedocs.io) [@Bay2022] focuses on the simulation of liquid crystals and uses non-vectorized TMM and a scattering matrix algorithm (rigorous coupled-wave analysis, RCWA). +- [RayFlare](https://rayflare.readthedocs.io) [@Pearce2021] is a complete toolkit to simulate the physical and electrical properties of solar cells. It provides the same 2x2 algorithm[@byrnes2020multilayer] and a scattering matrix approach (S4). +- [tmm_fast](https://github.com/MLResearchAtOSRAM/tmm_fast) [@Luce22] is a vectorized variant of Byrnes' algorithm for artificial intelligence-based analysis of multilayer stacks. +- [tmmax](https://github.com/bahremsd/tmmax) [@tmmax] is a JIT-compilable version of the 2x2 matrix method, leveraging the _JAX_ toolkit. +- [PyMoosh](https://github.com/AnMoreau/PyMoosh) [@Langevin:24] is a comprehensive toolkit for computing the optical properties of multilayered structures, with a plethora of available scattering and transfer matrix algorithms. + +# Example: Building a model for an oxide layer on silicon + +This example aims to illustrate the straight forward implementation and building of an optical model in **PyElli**. +The chosen model system is a thin SiO$_2$ layer on bulk Si. +A Cauchy dispersion function describes the SiO$_2$. +Tabulated literature values for Si are loaded from the refractiveindex.info database. + +The necessary libraries are loaded before building the model: +PyElli is imported from the module `elli`. +The `ParamsHist` wrapper around the `Parameters` class from [lmfit](https://lmfit.github.io/lmfit-py/index.html) [@matt_newville_2024_12785036] is imported from `elli.fitting`. +It adds history functionality to revert any undesired model changes and to return to an earlier set of parameters. +Importing `linspace` from `numpy` enables the generation of a wavelength axis. + +```python +from numpy import linspace +import elli +from elli.fitting import ParamsHist, fit +``` + +Initially, we define the fit parameters. +The Cauchy model for SiO$_2$ is defined by the `SiO2_n0` and `SiO2_n1` parameters along with its layer thickness measured in nanometers. +Optionally, additional settings for _lmfit_ parameters like constraints or bounds might be added; refer to _lmfit's_ documentation for a list of parameter arguments or consult our verbose [basic example](https://pyelli.readthedocs.io/en/stable/auto_examples/plot_01_basic_usage.html#sphx-glr-auto-examples-plot-01-basic-usage-py). + +```python +params = ParamsHist() +params.add("SiO2_n0", value=1.452) +params.add("SiO2_n1", value=36.0) +params.add("SiO2_thickness", value=20) +``` + +Next, the Cauchy model is created using the `Cauchy` class and the defined parameters. +All undefined Cauchy coefficients are kept at their default value of zero in this particular case. +Subsequently, the `.get_mat()` method is called on the created object to automatically convert the dispersion into an isotropic material. +A list of different dispersion classes and their usage is given in the [documentation](https://pyelli.readthedocs.io/en/stable/dispersions.html). + +```python +SiO2 = elli.Cauchy( + params["SiO2_n0"], + params["SiO2_n1"], +).get_mat() +``` + +Next, we request tabulated literature values for silicon. +Therefor, we instantiate the refractiveindex.info database and query it for the material (`Si`) and author (`Aspnes`). +It is also possible to search the database to get a list of matching entries. +See the [documentation](https://pyelli.readthedocs.io/en/stable/database.html) for details. + +```python +rii_db = elli.db.RII() +Si = rii_db.get_mat("Si", "Aspnes") +``` + +All materials are now instantiated and we can build the layered structure. +The `Structure` class takes three arguments: + +- The incident half-space, which is typically air. +- The layer stack as a list of `Layer` objects. The `Layer` object is created by adding the material and the layer thickness. +- The lower half-space, which represents the substrate. + +The incident and lower half-space are modeled as infinite to terminate the calculation. +Consequently, backside scattering of the substrate cannot be introduced into the calculation. + +```python +structure = elli.Structure( + elli.AIR, + [elli.Layer(SiO2, params["SiO2_thickness"])], + Si, +) +``` + +Finally, we trigger a calculation by calling the `evaluate(...)` method of the `structure` object. +We use a `wavelengths` array from $210$ nm to $800$ nm for the calculation range and an angle of incidence of $70°$ degree. + +```python +wavelengths = linspace(210, 800, 100) +angle = 70 +result = structure.evaluate(wavelengths, angle) +``` + +The calculation is stored in the `result` variable, which is a [`Result` object](https://pyelli.readthedocs.io/en/stable/result.html). +This object can hold all input parameters and the calculation results. +Methods like `psi`, `delta`, `R`, etc., will deliver the desired output. +Alternatively, the `@fit` decorator in `elli.fitting` automatically calls a widget-based fitting GUI for Jupyter notebooks. +\autoref{fig:fit_dec_example} shows the output when used with this example model and some experimental data. + +![The ipywidgets based fitting GUI.\label{fig:fit_dec_example}](fit_decorator_example.png) + +The [examples](https://pyelli.readthedocs.io/en/stable/auto_examples/index.html) provide additional information. + +# Acknowledgements + +Financial support is provided by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation), under grant No. 398143140 (FOR 2824). + +We thank Olivier Castany and Céline Molinaro for their implementation of the Berreman formalism, Steven J. Byrnes for his 2x2 transfer-matrix-method, and Mikhail Polyanskiy for curating the refractiveindex.info database. + +# References + +