Photonics Research Group Home
Ghent University
 IMEC
intern

 

Contents: Table of Contents   Back: Example 2 Up: Tutorial Forward: Example 4   Index: Index

1.4 Example 3 : a 2D grating

Now ready for the real world? We'll build a 2D-grating!

figs/example3

 
from rodis import *
import math

PI = math.pi

set_alpha(0.0)
set_delta(0.0)
set_psi(PI/4)
set_dzeta(PI/2)
set_lambda(1.0)
set_Nx(3)
set_Ny(3)

#- make materials -#
Air         = Material(1.0)
GaAs        = Material(3.52)

#- make grating   -#

fullA   = Slab(Air(3.))
fullG   = Slab(GaAs(3.))
someG   = Slab(Air(0.5)+ GaAs(2.0) +Air(0.5))
halfG   = Slab(Air(1.)+ GaAs(1.) +Air(1.))

bottom  = Section(fullG(3.))
first   = Section(halfG(1.) + fullG(1.) + halfG(1.))
second  = Section(fullA(0.5) + halfG(0.5) + someG(1.) +\
                  halfG(0.5) + fullA(0.5))
third   = Section(fullA(1.) + halfG(1.) + fullA(1.))
top     = Section(fullA(3.))

device  = Stack( top(3) + third(0.5) + second(0.5) +\
                 first(0.5) + bottom(3))

device.calc()

print device.diffr_eff().R(0,-1)
print device.diffr_eff().T(2,1)
print device.field().R_TM(0.1)
print device.field().R_TE(0,1)
print device.field().R(0,1)

There is just one new term introduced during the building: Section() will collect some slabs, making it a 2D planar structure. Those are again put in a Stack to build a real 3D device.

dzeta is the angle between the X-axis and the Y-axis. In our case this is PI/2. We could have written PI = 3.1415 , but since we ar not real nerds knowing pi that well we use the mathematical library (import math) and ask for pi (math.pi).

Now, some words about the incident beam. Since Alpha is zero, the incidence plane is not defined, resulting in undeterminated delta (so actually we could drop that set_delta() line). A pseudo incidence plane is defined along the x-axis. A psi = 0 will set a TM polarisation, ( H // y-axis) psi = pi/2 will set a TE polarisation ( E // y-axis).



This document was generated by Lieven Vanholme on June, 10 2003 using texi2html.