PyLlama: A stable and versatile Python toolkit for the electromagnetic modelling of multilayered anisotropic media

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 \times 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 study of structurally coloured materials in the living world.

[1]  Philippe Lalanne,et al.  Stable and efficient bloch-mode computational method for one-dimensional grating waveguides. , 2002, Journal of the Optical Society of America. A, Optics, image science, and vision.

[2]  M. McCall,et al.  Variation in the circularly polarized light reflection of Lomaptera (Scarabaeidae) beetles , 2016, Journal of The Royal Society Interface.

[3]  P. Yeh Optics of Liquid Crystal Displays , 2007, 2007 Conference on Lasers and Electro-Optics - Pacific Rim.

[4]  P. Alam ‘T’ , 2021, Composites Engineering: An A–Z Guide.

[5]  Jeremy J. Baumberg,et al.  Pointillist structural color in Pollia fruit , 2012, Proceedings of the National Academy of Sciences.

[6]  Tae‐il Kim,et al.  Ultra‐Adaptable and Wearable Photonic Skin Based on a Shape‐Memory, Responsive Cellulose Derivative , 2019, Advanced Functional Materials.

[7]  Pochi Yeh,et al.  Electromagnetic propagation in birefringent layered media , 1979 .

[8]  S. Teitler,et al.  Refraction in Stratified, Anisotropic Media* , 1970 .

[9]  Thomas de Quincey [C] , 2000, The Works of Thomas De Quincey, Vol. 1: Writings, 1799–1820.

[10]  K. Eidner,et al.  Light Propagation in Stratified Anisotropic Media: Orthogonality and Symmetry Properties of the 4×4 Matrix Formalisms , 1990 .

[11]  S. Stallinga Berreman 4×4 matrix method for reflective liquid crystal displays , 1999 .

[12]  D. Whittaker,et al.  Scattering-matrix treatment of patterned multilayer photonic structures , 1999 .

[13]  M. MacLachlan,et al.  Cellulose Nanocrystal Elastomers with Reversible Visible Color. , 2020, Angewandte Chemie.

[14]  J. R. Sambles,et al.  Optical excitation of surface plasmons: An introduction , 1991 .

[15]  Xiuyuan Peng,et al.  Transfer matrix method for the analysis of space-time-modulated media and systems , 2019, Physical Review B.

[16]  Peining Li,et al.  Hyperbolic phonon-polaritons in boron nitride for near-field optical imaging and focusing , 2015, Nature communications.

[17]  S. Vignolini,et al.  The angular optical response of cellulose nanocrystal films explained by the distortion of the arrested suspension upon drying. , 2019, Physical review materials.

[18]  P. Yeh,et al.  Optical Waves in Layered Media , 1988 .

[19]  M. Schubert Infrared Ellipsometry on Semiconductor Layer Structures: Phonons, Plasmons, and Polaritons , 2010 .

[20]  A. Lakhtakia,et al.  Dyakonov–Voigt surface waves , 2019, Proceedings of the Royal Society A.

[21]  D. Gray,et al.  Chiral nematic ordering of polysaccharides , 1994 .

[22]  P. Alam ‘K’ , 2021, Composites Engineering.

[23]  M. Schubert,et al.  Explicit solutions for the optical properties of arbitrary magneto-optic materials in generalized ellipsometry. , 1999, Applied optics.

[24]  Vladimir E. Dmitrienko,et al.  Optics of cholesteric liquid crystals , 1979 .

[25]  Gorjan Alagic,et al.  #p , 2019, Quantum information & computation.

[26]  P. Alam ‘G’ , 2021, Composites Engineering: An A–Z Guide.

[27]  Philippe Lalanne,et al.  RETICOLO software for grating analysis , 2021 .

[28]  R. M. Parker,et al.  Hierarchical Self-Assembly of Cellulose Nanocrystals in a Confined Geometry , 2016, ACS nano.

[29]  T. Ishihara,et al.  Quasiguided modes and optical properties of photonic crystal slabs , 2002 .

[30]  Lifeng Li Formulation and comparison of two recursive matrix algorithms for modeling layered diffraction gratings , 1996 .

[31]  D. W. Berreman,et al.  Optics in Stratified and Anisotropic Media: 4×4-Matrix Formulation , 1972 .

[32]  R. M. Parker,et al.  Visual Appearance of Chiral Nematic Cellulose‐Based Photonic Films: Angular and Polarization Independent Color Response with a Twist , 2019, Advanced materials.

[33]  H. Arwin,et al.  Pitch profile across the cuticle of the scarab beetle Cotinis mutabilis determined by analysis of Mueller matrix measurements , 2018, Royal Society Open Science.

[34]  木下 修一,et al.  Structural colors in the realm of nature , 2008 .

[35]  J. Bras,et al.  Engineered pigments based on iridescent cellulose nanocrystal films. , 2015, Carbohydrate polymers.

[36]  M. MacLachlan,et al.  Retrieving the Coassembly Pathway of Composite Cellulose Nanocrystal Photonic Films from their Angular Optical Response , 2020, Advanced materials.

[37]  Rolf Dreher,et al.  Reflection properties of distorted cholesteric liquid crystals , 1973 .

[38]  Schubert,et al.  Polarization-dependent optical parameters of arbitrarily anisotropic homogeneous layered systems. , 1996, Physical review. B, Condensed matter.

[39]  A. H. Castro Neto,et al.  Tunable Phonon Polaritons in Atomically Thin van der Waals Crystals of Boron Nitride , 2014, Science.

[40]  R. M. Parker,et al.  Printing of Responsive Photonic Cellulose Nanocrystal Microfilm Arrays , 2018, Advanced Functional Materials.

[41]  S. Teitler,et al.  4 × 4 Matrix formalisms for optics in stratified anisotropic media , 1984 .

[42]  Subdiffractional focusing and guiding of polaritonic rays in a natural hyperbolic material , 2015, Nature communications.

[43]  A. Lakhtakia,et al.  Electromagnetic Anisotropy and Bianisotropy: A Field Guide , 2019 .

[44]  Oldano Electromagnetic-wave propagation in anisotropic stratified media. , 1989, Physical review. A, General physics.

[45]  Lucio Claudio Andreani,et al.  Scattering-matrix analysis of periodically patterned multilayers with asymmetric unit cells and birefringent media , 2008 .

[46]  John Roy Sambles,et al.  Scattering matrix method for propagation of radiation in stratified media: attenuated total reflection studies of liquid crystals , 1988 .

[47]  Miss A.O. Penney (b) , 1974, The New Yale Book of Quotations.

[48]  N. Passler,et al.  Generalized 4 × 4 matrix formalism for light propagation in anisotropic stratified media: study of surface phonon polaritons in polar dielectric heterostructures: erratum , 2017, Journal of the Optical Society of America B.

[49]  Serguei P. Palto,et al.  An algorithm for solving the optical problem for stratified anisotropic media , 2001 .

[50]  Pedro E. S. Silva,et al.  Flexible and Structural Coloured Composite Films from Cellulose Nanocrystals/Hydroxypropyl Cellulose Lyotropic Suspensions , 2020 .

[51]  J. R. Sambles,et al.  Scattering-matrix approach to multilayer diffraction , 1995 .

[52]  A. Lakhtakia,et al.  The Transfer-Matrix Method in Electromagnetics and Optics , 2020, Synthesis Lectures on Electromagnetics.

[53]  P. Alam ‘A’ , 2021, Composites Engineering: An A–Z Guide.

[54]  T. Golding,et al.  Optical degeneracies in anisotropic layered media: Treatment of singularities in a 4×4 matrix formalism , 2000 .

[55]  Shanhui Fan,et al.  S4 : A free electromagnetic solver for layered periodic structures , 2012, Comput. Phys. Commun..

[56]  Qi Hong Wu,et al.  Birefringent Thin Films and Polarizing Elements , 1998 .

[57]  S. Stallinga,et al.  3D Helix Engineering in Chiral Photonic Materials , 2019, Advanced materials.

[58]  S. Chandrasekhar,et al.  Optical rotatory power of liquid crystals , 1968 .

[59]  Determination of liquid crystal refractive indices from critical angle measurements , 1978 .

[60]  Thomas A. Germer,et al.  pySCATMECH: a Python interface to the SCATMECH library of scattering codes , 2020, Optical Engineering + Applications.

[61]  Shuichi Kinoshita,et al.  Structural colors in the realm of nature , 2008 .

[62]  J. L. Fergason,et al.  Cholesteric Structure-1 Optical Properties , 1966 .

[63]  C. Oseen,et al.  The theory of liquid crystals , 1933 .

[64]  Hl. de Vries Rotatory power and other optical properties of certain liquid crystals , 1951 .

[65]  A. Lakhtakia,et al.  Observation of the Dyakonov-Tamm wave. , 2013, Physical review letters.

[66]  D. Gray,et al.  Optical properties of hydroxypropyl cellulose liquid crystals. I. Cholesteric pitch and polymer concentration , 1984 .

[67]  Todd D. Steiner,et al.  Semiconductor Nanostructures for Optoelectronic Applications , 2004 .

[68]  Pawel Pieranski,et al.  Mind the Microgap in Iridescent Cellulose Nanocrystal Films , 2017, Advanced materials.

[69]  P. Huidobro,et al.  Photonics of time-varying media , 2021, Advanced Photonics.