Upload
others
View
4
Download
0
Embed Size (px)
Citation preview
CALCULATING PC WAVEGUIDE PROPERTIES
Mark Patterson – 2009 October 29
PROBLEM DEFINITION
We want to calculate the properties of an ideal PC waveguide mode:
Dispersion: omega(k),
Group velocity: d omega(k) / d k,
Bloch mode electric and magnetic field.
COMPUTATIONAL METHODS
FDTD PWE
Calculate eigen-frequencies ✓ ✓
Calculate group velocity - ✓
Obtain fields - ✓
Sweep over k-space - ✓
Fast - ✓
Radiation or other loss ✓ ✗
Finite Size ✓ ✗
GUI Interface ✓ ✗
✓ easy to do. - difficult. ✗ don’t try.
COMPARISON OF BAND STRUCTURES
0 0.1 0.2 0.3 0.4 0.51.2
1.4
1.6
1.8
2
2.2
2.4
2.6
2.8x 1014
Wavevector, k [2!/a]
Freq
uenc
y [H
z]
0 0.1 0.2 0.3 0.4 0.50
0.05
0.1
0.15
0.2
0.25
0.3
0.35
Wavevector [2!/a]
Freq
uenc
y [c
/a]
MPB FDTD
FDTD
Lumerical FDTD (commercial) or Radiant (see Cole).
Necessary for structures with material loss, radiation loss, or finite size.
Using Fourier techniques, frequency resolution converges linearly with simulation time. Some improvements can be made using harminv (http://ab-initio.mit.edu/wiki/index.php/Harminv).
LUMERICAL TUTORIALS
http://www.lumerical.com/fdtd_online_help/fdtd_online_help_summary.php
3D slab structure with square lattice: http://www.lumerical.com/fdtd_online_help/pc_bandstructure_3d_planar.php
2D structure with triangular lattice (supercell technique): http://www.lumerical.com/fdtd_online_help/pc_bandstructure_triangular_lattice.php
MPB
MPB: MIT Photonic Bands; uses the plane wave expansion technique.
Free (GPL) software written by Stephen Johnson and John Joannopoulos et al.
They also have an FDTD, MEEP.
Mature software: started development in 1999. Last updated in 2003.
Johnson still answers questions on the mailing list.
RESOURCES
Home page and user guide: http://ab-initio.mit.edu/wiki/index.php/MIT_Photonic_Bands
My notes and installing on Fedora: http://wiki.phy.queensu.ca/hughes/index.php/MPB
Questions: Mailing list (see home page).
Theory: Steven G. Johnson and J. D. Joannopoulos, "Block-iterative frequency-domain methods for Maxwell's equations in a planewave basis," Optics Express 8, no. 3, 173-190 (2001). doi:10.1364/OE.8.000173.
PLANE WAVE EXPANSION
Write Maxwell wave equation as an eigenvalue problem.
Expand the mode in plane waves (spatial Fourier transform) for evaluating the curls.
Use fancy matrix methods to calculate the eigen-frequencies and -vectors (field profiles).
!"!
1!r(r)
!"H(r, ")"
=#"
c
$2H(r, ")
! = minh
h†Ah
h†h
WAVEGUIDE SUPERCELL
The plane wave expansion technique models periodic media only.
For a waveguide, we use a supercell.
You cannot obtain radiation modes with this method.
UNITS
Lengths are dimensionless, usually one normalizes to the periodicity, a.
Frequencies are in units of c/a.
Wave vectors are in units of 2π/a. The band edge is at 0.5.
OVERVIEW
CTL Filempb Console
(frequency, group
velocity)
Command line
Command Line
mpbi
mpb-mpi
mpbi-mpi
HDF5 Files (Fields) MATLAB
Input Compute Output Analyse
OVERVIEW
CTL Filempb Console
(frequency, group
velocity)
Command line
Command Line
mpbi
mpb-mpi
mpbi-mpi
HDF5 Files (Fields) MATLAB
Input Compute Output Analyse
OVERVIEW
CTL Filempb Console
(frequency, group
velocity)
Command line
Command Line
mpbi
mpb-mpi
mpbi-mpi
HDF5 Files (Fields) MATLAB
Input Compute Output Analyse
OVERVIEW
CTL Filempb Console
(frequency, group
velocity)
Command line
Command Line
mpbi
mpb-mpi
mpbi-mpi
HDF5 Files (Fields) MATLAB
Input Compute Output Analyse
OVERVIEW
CTL Filempb Console
(frequency, group
velocity)
Command line
Command Line
mpbi
mpb-mpi
mpbi-mpi
HDF5 Files (Fields) MATLAB
Input Compute Output Analyse
MPB INPUT
WHAT LANGUAGE ARE WE USING?
Lisp is a very old (50 years) programming language.
Scheme is a dialect of Lisp.
GNU Guile is intended to provide a scripting and extensibility interface for libraries and programs. It is promoted by the GNU project and uses Scheme.
Libctl is an extension to Guile intended for running scientific simulations. It is written by Steven Johnson.
MPB uses Guile and Libctl to control its simulations.
E V E RY T H I N G Y O U N E E D T O K N O W A B O U T L I S P
SCHEME PRIMER
Comments begin with a semicolon:
Everything is a function:
… even creating and setting variables:
; This is a comment
(function-name value1 value2)
(define sq32 1) ; Define n and initialize value(set! sq32 (/ (sqrt 3) 2)) ; Change value
LIBCTL INPUT FILES
Usually, provide a *.ctl file to run the simulation. Think of the ctl file as a shell script, but with more parentheses.
Alternatively, mpb can be started interactively and controlled from a command prompt. You would manually type the commands from the ctl file.
Special variables are used as inputs to the simulation.
A ctl file can just run a simulation or be a complex script.
INPUT PARAMETERS
(define-param) is an alternative to (define). It allows the default value to be overridden on the command line.
Proper use of this means you can run lots of simulations with a single shared ctl file.
(define-param a 475e-9)(define-param h (/ 180e-9 a))
DESCRIBE THE SUPERCELL LATTICE
Set the geometry variable.
For a non-rectangular lattice, use basis1, basis2, basis3:
What I use for a waveguide:
(set! geometry-lattice (make lattice (size 1 1 (* 10 thickness)) (basis1 sq32 0.5) (basis2 sq32 -0.5)))
(set! geometry-lattice (make lattice (size 1 (+ (* supercell-yi sq32) (* 2 dy)) supercell-z)))
(set! geometry-lattice (make lattice (size 1 5 no-size)))
DESCRIBE THE SUPERCELL LATTICE
Set the geometry variable.
For a non-rectangular lattice, use basis1, basis2, basis3:
What I use for a waveguide:
(set! geometry-lattice (make lattice (size 1 1 (* 10 thickness)) (basis1 sq32 0.5) (basis2 sq32 -0.5)))
(set! geometry-lattice (make lattice (size 1 (+ (* supercell-yi sq32) (* 2 dy)) supercell-z)))
(set! geometry-lattice (make lattice (size 1 5 no-size)))
One of the special input variables
DESCRIBE THE SUPERCELL LATTICE
Set the geometry variable.
For a non-rectangular lattice, use basis1, basis2, basis3:
What I use for a waveguide:
(set! geometry-lattice (make lattice (size 1 1 (* 10 thickness)) (basis1 sq32 0.5) (basis2 sq32 -0.5)))
(set! geometry-lattice (make lattice (size 1 (+ (* supercell-yi sq32) (* 2 dy)) supercell-z)))
(set! geometry-lattice (make lattice (size 1 5 no-size))) Unit cell dimensions in units of the basis vectors.
One of the special input variables
DESCRIBE THE SUPERCELL LATTICE
Set the geometry variable.
For a non-rectangular lattice, use basis1, basis2, basis3:
What I use for a waveguide:
(set! geometry-lattice (make lattice (size 1 1 (* 10 thickness)) (basis1 sq32 0.5) (basis2 sq32 -0.5)))
(set! geometry-lattice (make lattice (size 1 (+ (* supercell-yi sq32) (* 2 dy)) supercell-z)))
(set! geometry-lattice (make lattice (size 1 5 no-size))) Unit cell dimensions in units of the basis vectors.
One of the special input variablesFor a 2D structure, use no-size.
DESCRIBE THE SUPERCELL LATTICE
Set the geometry variable.
For a non-rectangular lattice, use basis1, basis2, basis3:
What I use for a waveguide:
(set! geometry-lattice (make lattice (size 1 1 (* 10 thickness)) (basis1 sq32 0.5) (basis2 sq32 -0.5)))
(set! geometry-lattice (make lattice (size 1 (+ (* supercell-yi sq32) (* 2 dy)) supercell-z)))
(set! geometry-lattice (make lattice (size 1 5 no-size))) Unit cell dimensions in units of the basis vectors.
One of the special input variablesFor a 2D structure, use no-size.
DESCRIBE THE SUPERCELL LATTICE
Set the geometry variable.
For a non-rectangular lattice, use basis1, basis2, basis3:
What I use for a waveguide:
(set! geometry-lattice (make lattice (size 1 1 (* 10 thickness)) (basis1 sq32 0.5) (basis2 sq32 -0.5)))
(set! geometry-lattice (make lattice (size 1 (+ (* supercell-yi sq32) (* 2 dy)) supercell-z)))
(set! geometry-lattice (make lattice (size 1 5 no-size))) Unit cell dimensions in units of the basis vectors.
Override default Cartesian basis.
One of the special input variablesFor a 2D structure, use no-size.
DESCRIBE THE SUPERCELL LATTICE
Set the geometry variable.
For a non-rectangular lattice, use basis1, basis2, basis3:
What I use for a waveguide:
(set! geometry-lattice (make lattice (size 1 1 (* 10 thickness)) (basis1 sq32 0.5) (basis2 sq32 -0.5)))
(set! geometry-lattice (make lattice (size 1 (+ (* supercell-yi sq32) (* 2 dy)) supercell-z)))
(set! geometry-lattice (make lattice (size 1 5 no-size))) Unit cell dimensions in units of the basis vectors.
Override default Cartesian basis.
One of the special input variablesFor a 2D structure, use no-size.
DESCRIBE THE STRUCTURE
(set! geometry (list
(make block (material (make dielectric (index ind))) (size infinity infinity h) (center 0 0 0) )
(make cylinder (material air) (center 0.5 (+ (* 1 sq32) dy) 0) (radius r1) (height infinity) ) (make cylinder (material air) (center 0.5 (- (* -1 sq32) dy) 0) (radius r1) (height infinity) ) (make cylinder (material air) (center 0 (+ (* 2 sq32) dy) 0) (radius r ) (height infinity) ) (make cylinder (material air) (center 0 (- (* -2 sq32) dy) 0) (radius r ) (height infinity) )))
The structure is described by setting geometry:
Start with a block of dielectric:
And drill holes in it:
DESCRIBE THE STRUCTURE
(set! geometry (list
(make block (material (make dielectric (index ind))) (size infinity infinity h) (center 0 0 0) )
(make cylinder (material air) (center 0.5 (+ (* 1 sq32) dy) 0) (radius r1) (height infinity) ) (make cylinder (material air) (center 0.5 (- (* -1 sq32) dy) 0) (radius r1) (height infinity) ) (make cylinder (material air) (center 0 (+ (* 2 sq32) dy) 0) (radius r ) (height infinity) ) (make cylinder (material air) (center 0 (- (* -2 sq32) dy) 0) (radius r ) (height infinity) )))
The structure is described by setting geometry:
Start with a block of dielectric:
And drill holes in it:
DESCRIBE THE STRUCTURE
(set! geometry (list
(make block (material (make dielectric (index ind))) (size infinity infinity h) (center 0 0 0) )
(make cylinder (material air) (center 0.5 (+ (* 1 sq32) dy) 0) (radius r1) (height infinity) ) (make cylinder (material air) (center 0.5 (- (* -1 sq32) dy) 0) (radius r1) (height infinity) ) (make cylinder (material air) (center 0 (+ (* 2 sq32) dy) 0) (radius r ) (height infinity) ) (make cylinder (material air) (center 0 (- (* -2 sq32) dy) 0) (radius r ) (height infinity) )))
The structure is described by setting geometry:
Start with a block of dielectric:
And drill holes in it:
K-POINTS
The calculation is performed once for each Bloch wavevector specified in the k-points list variable.
(define Gamma (vector3 0 0 0))
(define K (lattice->reciprocal (vector3 0.5 0 0) ) )
(set! k-points (interpolate (- numk 2) (list Gamma K)))
Create vector3 variables for the symmetry points:
Remember, this is in reciprocal space:
Create a list of evenly sampled points.
K-POINTS
The calculation is performed once for each Bloch wavevector specified in the k-points list variable.
(define Gamma (vector3 0 0 0))
(define K (lattice->reciprocal (vector3 0.5 0 0) ) )
(set! k-points (interpolate (- numk 2) (list Gamma K)))
Create vector3 variables for the symmetry points:
Remember, this is in reciprocal space:
Create a list of evenly sampled points.
This list could have more than 2 entries.
OPTIONAL PARAMETERS
Number of grid points per lattice unit length:
Number of sub-cell points for calculating average ε:
Frequency eigensolver tolerance, a relative value:
Number of bands to solve for (you should always set this):
(set! resolution (vector3 24 24 24))
(set! mesh-size 10)
(set! tolerance 1e-8)
(set! num-bands 18)
RUN THE SIMULATION
The (run*) commands start the simulation.
It is useful to use alternate run commands to enforce a desired symmetry and e.g. suppress the TM modes.
You can have multiple (run*) commands in one file.
(run display-group-velocities fix-efield-phase output-efield)
(run-zeven) (run-yodd) (run-te)
RUN THE SIMULATION
The (run*) commands start the simulation.
It is useful to use alternate run commands to enforce a desired symmetry and e.g. suppress the TM modes.
You can have multiple (run*) commands in one file.
(run display-group-velocities fix-efield-phase output-efield)
Run command
(run-zeven) (run-yodd) (run-te)
RUN THE SIMULATION
The (run*) commands start the simulation.
It is useful to use alternate run commands to enforce a desired symmetry and e.g. suppress the TM modes.
You can have multiple (run*) commands in one file.
(run display-group-velocities fix-efield-phase output-efield)
Run command Commands to execute after solving each k-point.
(run-zeven) (run-yodd) (run-te)
RUN THE SIMULATION
The (run*) commands start the simulation.
It is useful to use alternate run commands to enforce a desired symmetry and e.g. suppress the TM modes.
You can have multiple (run*) commands in one file.
(run display-group-velocities fix-efield-phase output-efield)
Run command Commands to execute after solving each k-point.
(run-zeven) (run-yodd) (run-te)
RUN THE SIMULATION
The (run*) commands start the simulation.
It is useful to use alternate run commands to enforce a desired symmetry and e.g. suppress the TM modes.
You can have multiple (run*) commands in one file.
(run display-group-velocities fix-efield-phase output-efield)
Run command Commands to execute after solving each k-point.
(run-zeven) (run-yodd) (run-te)
INTERPRETING SYMMETRIES
ADVANCED SCRIPTING
You can do full blown scripting within the ctl file. I have examples for programatically generating device geometry and fitting the band structure to experiments by tweaking the geometry.
Libctl has support for 3-vectors 3x3 matrices, complex numbers, minimization, root finding, derivatives and integrals.
MPB can compute field energy, energy in objects, and do math with fields.
CTL BEST PRACTICE
Use (define-param) liberally and make the ctl file generic.
Always display-group-velocities.
Always output-efield.
Recycle code.
Don’t use the targeted eigensolver. It is slow and inaccurate.
RUNNING SIMULATIONS
RUNNING SIMULATIONS (COMMAND LINE)
mpb r=0.3 simulation.ctl > simulation.out
mpb-split 2 r=0.3 simulation.ctl > simulation.out
Starts 2 serial jobs, each with half of the k-points.
mpbi, mpbi-splitAssumes ε(-x) = ε*(x)Twice as fast, half the memory.No error checking!
RUNNING SIMULATIONS (COMMAND LINE)
mpb r=0.3 simulation.ctl > simulation.out
mpb-split 2 r=0.3 simulation.ctl > simulation.out
Starts 2 serial jobs, each with half of the k-points.
mpbi, mpbi-splitAssumes ε(-x) = ε*(x)Twice as fast, half the memory.No error checking!
Capture the console output.
RUNNING SIMULATIONS (COMMAND LINE)
mpb r=0.3 simulation.ctl > simulation.out
mpb-split 2 r=0.3 simulation.ctl > simulation.out
Starts 2 serial jobs, each with half of the k-points.
mpbi, mpbi-splitAssumes ε(-x) = ε*(x)Twice as fast, half the memory.No error checking!
Override a (define-param) variable. Always check this.
Capture the console output.
RUNNING SIMULATIONS (COMMAND LINE)
mpb r=0.3 simulation.ctl > simulation.out
mpb-split 2 r=0.3 simulation.ctl > simulation.out
Starts 2 serial jobs, each with half of the k-points.
mpbi, mpbi-splitAssumes ε(-x) = ε*(x)Twice as fast, half the memory.No error checking!
Override a (define-param) variable. Always check this.
Capture the console output.
RUNNING SIMULATIONS (COMMAND LINE)
mpb r=0.3 simulation.ctl > simulation.out
mpb-split 2 r=0.3 simulation.ctl > simulation.out
Starts 2 serial jobs, each with half of the k-points.
mpbi, mpbi-splitAssumes ε(-x) = ε*(x)Twice as fast, half the memory.No error checking!
Override a (define-param) variable. Always check this.
Capture the console output.
RUNNING SIMULATION IN PARALLEL
MPB is parallelized (MPI). Use mpb-mpi and mpbi-mpi.
Sometimes it crashes the node, but Cole said he’d fix it.
Running across nodes tends to be slow.
This transposes x and y.
OUTPUT
OUTPUT
Prints the frequencies and, if specified, group velocity to the console.
Saves dielectic data to epsilon.h5 file. If specified, creates files for E, D, and H field files.
e.g.: e.k05.b16.zeven.h5
Always check the epsilon.h5 file.
Delete the extra field files promptly.
HDF5 FILES
The fields are save in HDF5 files.
A data file for structured binary data.
Modern MAT files are actually HDF5 files in disguise.
Tools:Use h5utils and mpb-data on command line.Use hdf5* in MATLAB.Use PyTables in Python.
ANALYSIS
COMMAND LINE TOOLS
h5ls
Examine the structure of the data file.
mpb-data
Set-up derived fields such as converting to a rectangular grid.
h5topng
Visualize fields on slices through the volume.
H5TOPNG
Part of h5utils.
Useful for quick checks of the structure.
Read the man page.
h5topng -0x0 epsilon.h5
MATLAB TOOLBOX
See the wiki to get the source.
Provides the MPBBandstructure class for parsing console output and loading fields. Start by creating a new object based on an output file:
mpb = MPBBandstructure(file, 'zeven') ;
Some functions have implicit assumptions about a rectangular supercell.
If you used (run-zeven).
MPBBANDSTRUCTURE OBJECT
>> display(mpb) ;MPBBandstructure object: k: [5x1 double] kVect: [5x3 double] freqs: [5x18 double] vg: [5x18 double] vgVect: [5x 3x18 double] numK: 5 numBands: 18 pathroot: '/home/mark/Masters/Matlab Library/MPB/
test_data/waveguide' filename: 'waveguide.out' symmetry: 'zeven' isMPI: false interchange: [0x0 struct] vars: [1x1 struct]
PLOTTING BAND STRUCTURES
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.50
0.05
0.1
0.15
0.2
0.25
0.3
0.35
Wavevector [2!/a]
Freq
uenc
y [c
/a]
clf ;plotBands(mpb) ; % Plot all the bandsplotBands(mpb, 13, 'r') ; % Highlight the waveguide band
epsilon.h5: epsilon, x=centre+0
y
z
epsilon.h5: epsilon, x=1
y
z
epsilon.h5: epsilon, y=centre+0
x
z
epsilon.h5: epsilon, z=centre+0
xy
VISUALIZING STRUCTURESplotFields3D(mpb, 'epsilon') ;
e.k42.b13.zeven.h5: e, x=centre+0
y
z
e.k42.b13.zeven.h5: e, x=1
y
z
e.k42.b13.zeven.h5: e, y=centre+0
x
z
e.k42.b13.zeven.h5: e, z=centre+0
xy
VISUALIZING FIELDS
plotFields3D(mpb, mpb.numK, 13, 'e') ;
USING THE FIELDS
Use readField() to load epsilon and field data.
Returns a 4D (x-by-y-by-z-by-component) matrix.
Takes care of transposition for MPI runs and band interchanges.
>> epsilon = readField(mpb, 'epsilon') ;>> epsilonCentre = ...
epsilon(ceil(end/2), ceil(end/2), ceil(end/2)) ;>> disp(['The membrane has a dielectric constant of ' ...
num2str(epsilonCentre) '.']) ;The membrane has a dielectric constant of 12.0826.
USING THE FIELDS 2
Use getScale() to get the coordinates.
>> [scaleX scaleY scaleZ] = getScale(mpb) ;>> e = readField(mpb, ki, band, 'e') ;>> ey = e(:,:,:,2) ;% I could also have used ey = readField(mpb, ki, band, 'y') ;>> [maxi maxi] = max(ey(:)) ;>> [xi yi zi] = ind2sub(size(ey), maxi) ;>> disp(['The maximum value of the electric field ' ...
'y-component occurs at (x,y,z) = (' ...num2str(scaleX(xi)) ', ' num2str(scaleY(yi)) ', ' ...num2str(scaleZ(zi)) ').']) ;
The maximum value of the electric field y-component occurs at (x,y,z) = (0, 0.3997, 0).
USER DATA
It can be useful to associate data (parameters, band index) with the output file.
Add (usually by hand) to the top of the output file:
These will be automatically loaded into MATLAB:
POSTPROCESS: Set vars double a to 4.14e-7POSTPROCESS: Set vars double r to 0.286POSTPROCESS: Set vars integer band to 13
>> disp(mpb.vars)
a: 4.1400e-07 r: 0.2860 band: 13
INTERCHANGE BANDS
25 30 35 40 45 500.26
0.265
0.27
0.275
0.28
0.285
0.29
0.295
0.3
0.305
Wave vector index
Freq
uenc
y [c
/a]
25 30 35 40 45 500.26
0.265
0.27
0.275
0.28
0.285
0.29
0.295
0.3
0.305
Wave vector index
Freq
uenc
y [c
/a]
POSTPROCESS: Swap bands 7 8 indices 32 to 34
Without Swap Command With Swap Command
FLAG MPI
Did you remember that you have to transpose the fields if you use mpb-mpi?
POSTPROCESS: MPI
MISC. ADVICE
Save parameters and the band index with output files.
The POSTPROCESS lines must be at the top.
Use MPBBandstructures and inputs to later calculations.
If you are interpolating fields between k-points, be careful of the phase.
Cache the fields if you load them a lot.
QUESTIONS?