Package: rainbow-utils
Rainbow-UtilsRefraction... It is apparently the most inspiring phenomenon of the light. Rainbow appears with refraction after the rain. We can see all of the vidible spectrum. Wishing to simulate it, Rainbow-Utils was created.Rainbow-Utils is designed to simulate multi-layer thin film stacks with Transfer Matrix Method (TMM). Layers of thin film materials, ambient and substrate  with given εrand µrare simulated with Rainbow-Utils. Moreover, it is compatible with dielectric, magnetic or meta materials.Tree of The Module|----Ambient(object)------|
|                         |---__init__(e_r=1, mu_r=1, name='')
|                         |---info
|                         |---__repr__()
|
|
|----ThinLayer(object)----|
|                         |---__init__(thickness, e_r=1, mu_r=1, name='')
|                         |---info
|                         |---__repr__()
|
|
|----Substrate(object)----|
|                         |---__init__(e_r=1, mu_r=1, name='')
|                         |---info
|                         |---__repr__()
|
|
|----Stack(object)--------|
                          |---__init__()
                          |---add(arg)
                          |---stack
                          |---Radiation(wavelenght, theta=0, polarisation_mode='TM')
                          |---render()
                          |---reflectance
                          |---transmittance
                          |---TransferMatrixDocsAmbient(e_r=1, mu_r=1, name='')It defines properties of the ambient where the thin film and substrate is used.e_ris relative permittivity of the material; namely square root of non-magnetic, dielectric materials. e_r may take int, float or complex.mu_ris relative permeability of the material. It may take int, float or complex. Additionaly,nameis name of the material. It takes string.ThinLayer(thickness, e_r=1, mu_r=1, name='')ThinLayer object defines each of the thin film layers.thicknessis thickness of the material with units of meters. It may take a float.e_ris relative permittivity of the material; namely square root of non-magnetic, dielectric materials. e_r may take int, float or complex.mu_ris relative permeability of the material. It may take int, float or complex. Additionaly,nameis name of the material. It takes string.Substrate(e_r=1, mu_r=1, name='')It defines properties of the substrate where the thin film is coated.e_ris relative permittivity of the material; namely square root of non-magnetic, dielectric materials. e_r may take int, float or complex.mu_ris relative permeability of the material. It may take int, float or complex. Additionaly,nameis name of the material. It takes string.Stack()It composes the materials. Thin film layers are stacked on a substrate in an ambient withStack()object.add(arg): Adds a material layer, substrate or ambient to stack object. It may take Ambient, ThinLayer, Substrate or list of these objects Due to the recursion of the functiton, it may take list of tuple of list of materials; namely [A,(B, C, [D, E], F), G, H, I]stack: It returns list of repr of added materials.Radiation(wavelenght, theta=0, polarisation_mode='TM'): It defines wavelenght, angle and polarisation mode of the radiation.wavelenghtis a float and units of it is meters.thetais incident angle and a float, units of it is <radians.polarisation_modemay take whether "TM" or "TE" strings.render(): Computes reflectivity, transmittance and transfer matrix of the multilayer media. Don't execute it before callingRadiation()reflectance: Returns rendered reflectivity parameter. Don't execute it before callingrender()transmittance: Returns rendered reflectivity parameter. Don't execute it before callingrender()TransferMatrix: Returns rendered transfer matrix parameter. Don't execute it before callingrender()References[1] Liu, Xiaoze, "Control of Exciton Photon Coupling in Nano-structures" (2014). CUNY Academic Works.https://academicworks.cuny.edu/gc_etds/491[2] Saleh, B. E. A., & Teich, M. C. (2019). Fundamentals of
Photonics. Newark: John Wiley & Sons, Incorporated.