photonic_sim

Logo

Simulations of optical waves in multilayered media in 1D

View the Project on GitHub sopapado/photonic_sim

photonic_sim

The photonic_sim package is a collection of python methods for simulating propagation of fields in multilayered structures. With photonic_sim you can calculate the electric and magnetic field of optical waves in arbitrary 1D photonic structures with arbitrary angle of incidence. The simulator assumes non-magnetic materials in current-free spaces.

It can be useful for simulating:

Description of method

The code is collecting all the boundary-condition related equations for electric and magnetic fields from every interface set by the user. Then it solves the system and manipulates the data in order to provide the field distribution along the structure for a given wavelength as well as transmission, reflection and loss spectrum for a given spectral region.

Getting started

Let’s start with an example. Assuming that we want to simulate a multilayer structure consisting of three layers with different refractive indices sitting in air as shown in the image (n: refractive index). We assume also that the optical field is p-polarized and has an incident angle of 0 degrees.

To set the geometric and optical parameters we use the following code:


import photonic_sim.photonic_sim as ps

lamda = 500e-9
theta = 0
pol = 'p'
ns = [1, 1.5, 1.2, 1.5, 1]
ds = [200e-9, 125e-9, 250e-9, 125e-9, 200e-9]

As you see the air parts of the structure are treated as additional layers in our geometry. This means that you can assume that you enter or exit the structure with any kind of material you want. Note that there is no reflection at the end and at the start of the structure. We are all set for our first calculation. We will use the amp_distribution function.


amps, xs, thetai = ps.amp_distribution(lamda, ns, ds,pol, theta, linit = 0, amp_init = 1, x0 = 0, y0 = 0):

(for now I do not comment on linit, amp_init, x0 and y0 variables )

This function solves our mathematical problem and gives us:

[… work in progress ]