Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarJMue committed Oct 25, 2023
1 parent d1a9b1d commit 2f23da7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 deletions.
18 changes: 18 additions & 0 deletions paper/paper.bib
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,22 @@ @article{Luce22
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/.}
}
21 changes: 13 additions & 8 deletions paper/paper.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ tags:
- solid state physics
- transfer matrix method
authors:
- name: Marius Müller
- name: Marius J. Müller
orcid: 0009-0005-2187-0122
equal-contrib: true
affiliation: 1
- name: Florian Dobener
Expand All @@ -23,7 +24,7 @@ bibliography: paper.bib
# Summary

PyElli is an open source analysis tool for linear optical interaction of layered materials written in python.
It mainly targets spectroscopic ellipsometry, but is easily adaptable to transmission or reflection experiments.
It mainly targets spectroscopic ellipsometry, but is easily adaptable to various transmission or reflection experiments.

Spectroscopic ellipsometry (SE) is used throughout various scientific fields to determine the optical constants of layered material stacks.
To deduce actual material parameters from an SE experiment, numerical analysis needs to be performed.
Expand All @@ -44,13 +45,13 @@ It is possible to add new dispersions or use a generic formula dispersion, which
To analyse materials it is helpful to have a database of pre-defined models to use.
For this purpose, pyElli includes the popular public domain database for optical constants [refractiveindex.info](https://refractiveindex.info) [@rii], which allows users to load literature dispersions with a single line of code.

PyElli supports using mutliple solving algorithms, which allows for specialized applications.
PyElli supports using multiple solving algorithms, which allows for specialized applications.
Currently, two algorithms using different formulations are available.
The first one is a simple algorithm based on a 2x2 matrix formulation [@byrnes2020multilayer] and the second one a more complex 4x4 formulation [@Berreman72].
While the 2x2 algorithm splits the light into two perpendicular polarized beams and solves them separately, the 4x4 matrix approach solves the complete electromagnetic field, which allows solving more complex problems, e.g., anistropic materials or active media.

For fast processing pyElli's algorithms are fully vectorized for multiple wavelengths and leverage the numerical algebra libraries [NumPy](https://numpy.org) [@harris2020array] and [SciPy](https://scipy.org) [@2020SciPy-NMeth].
This allows the usage of advanced fitting algorithms, i.e., global optimizers, in reasonable evaluation times and enables embedded in-situ monitoring of overlayer growth.
This allows the usage of advanced fitting algorithms, i.e., global optimizers, in reasonable evaluation times and enables embedded in-situ monitoring of overlayer growth [@hauptmann2023].
The usage of python and vectorization libraries allows for easy adoption for artificial intelligence based analysis of SE data.

# Statement of need
Expand All @@ -75,7 +76,7 @@ In summary, we believe and hope that pyElli will further contribute to easier an
Other notable python open source software for solving transfer-matrices are available, but tend to focus on different aspects:

- [PyGTM](https://pygtm.readthedocs.io) [@Passler17; @Passler19]: Slower, but more extensive general transfer matrix approach, calculates additional parameters, like the electric field strengths in the multilayer stack.
- [PyLlama](https://pyllama.readthedocs.io): Provides transfer and scattering matrix algorithms (RCWA), better suited to simulate liquid crystals. Non vectorized.
- [PyLlama](https://pyllama.readthedocs.io) [@Bay2022]: Provides transfer and scattering matrix algorithms (RCWA), better suited to simulate liquid crystals. Non vectorized.
- [RayFlare](https://rayflare.readthedocs.io) [@Pearce2021]: Complete toolkit to simulate solar cells. Provides the same 2x2 [@byrnes2020multilayer] algorithm and a scattering matrix approach.
- Additional mentions:
- [refellips](https://refellips.readthedocs.io/en/latest/)
Expand Down Expand Up @@ -139,7 +140,7 @@ rii_db = elli.db.RII()
Si = rii_db.get_mat("Si", "Aspnes")
```

With all materials instantiated, we are able to build the layerd structure.
With all materials instantiated, we are able to build the layered structure.
The class `Structure` takes three arguments:

- The incident half-space, this is air in most cases.
Expand Down Expand Up @@ -167,15 +168,19 @@ result = structure.evaluate(wavelengths, 70)
```

The calculation is stored in the `result` variable, which is an [`Result` object](https://pyelli.readthedocs.io/en/stable/result.html).
This objects holds the calculation results and you simple can call `psi`, `delta`, 'R', etc. to get your desired output.
This objects holds all input paramters and the calculation results. You simple can call `psi`, `delta`, `R`, etc. to get your desired output.
We may also use the `@fit` decorator in `elli.fitting` to automatically show a widget-based fitting gui for jupyter notebooks.
Figure \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)
You find additional information on how this is done in our [examples](https://pyelli.readthedocs.io/en/stable/auto_examples/index.html).

# Acknowledgements

Probably sbyrnes and the original creator of the base we used.
- Steven J. Byrnes
- Olivier Castany and Céline Molinaro
- Mikhail Polyanskiy

- Forschergruppe

# References

Expand Down

0 comments on commit 2f23da7

Please sign in to comment.