Skip to main content

Rainbow-Utils


Refraction... 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 εr and µr are 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
                          |---TransferMatrix


Docs

Ambient(e_r=1, mu_r=1, name='')

It defines properties of the ambient where the thin film and substrate is used. e_r is relative permittivity of the material; namely square root of non-magnetic, dielectric materials. e_r may take int, float or complex. mu_r is relative permeability of the material. It may take int, float or complex. Additionaly, name is 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. thickness is thickness of the material with units of meters. It may take a float. e_r is relative permittivity of the material; namely square root of non-magnetic, dielectric materials. e_r may take int, float or complex. mu_r is relative permeability of the material. It may take int, float or complex. Additionaly, name is 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_r is relative permittivity of the material; namely square root of non-magnetic, dielectric materials. e_r may take int, float or complex. mu_r is relative permeability of the material. It may take int, float or complex. Additionaly, name is name of the material. It takes string.

Stack()

It composes the materials. Thin film layers are stacked on a substrate in an ambient with Stack() 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. wavelenght is a float and units of it is meters. theta is incident angle and a float, units of it is <radians. polarisation_mode may take whether "TM" or "TE" strings.
  • render() : Computes reflectivity, transmittance and transfer matrix of the multilayer media. Don't execute it before calling Radiation()
  • reflectance : Returns rendered reflectivity parameter. Don't execute it before calling render()
  • transmittance : Returns rendered reflectivity parameter. Don't execute it before calling render()
  • TransferMatrix : Returns rendered transfer matrix parameter. Don't execute it before calling render()

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.

Metadata

Release files for rainbow-utils 2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rainbow-utils 2.0
File Size Uploaded
rainbow-utils-2.0.tar.gz 40.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for rainbow-utils 2.0
File Interpreter ABI Platform
rainbow_utils-2.0-py3-none-any.whl Python 3 none any Details

Total release size: 67.7 kB

Release files / rainbow-utils-2.0.tar.gz

Download URL rainbow-utils-2.0.tar.gz
Size 40.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b45c6169a9c9390ea9c246e432918fc02b9bff50dfe6c15cccb3e1c16861ad22
BLAKE2b-256 checksum
How to use checksums
cc62eb87edc842d819a5e52d28f578c5cd3291518538d32e49158fca8e70d6c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.7

Release files / rainbow_utils-2.0-py3-none-any.whl

Download URL rainbow_utils-2.0-py3-none-any.whl
Size 27.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
67e228912e21b505580ca4ac49564432234c79aa786e0bb05cfb2edcee1f4da6
BLAKE2b-256 checksum
How to use checksums
3d1df4a9a2a74214d48f554f7028d40db31e8483f58496ccd072999b407078f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.9.7

Release history Release notifications | RSS feed

This release

2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page