69
Computational Photonics: Frequency and Time Domain Methods Steven G. Johnson MIT Applied Mathematics

Compute Methods@Cornell

Embed Size (px)

DESCRIPTION

Require the computation of fiber

Citation preview

Page 1: Compute Methods@Cornell

Computational Photonics:Frequency and Time Domain Methods

Steven G. Johnson

MIT Applied Mathematics

Page 2: Compute Methods@Cornell

Nano-photonic media (-scale)

synthetic materials

strange waveguides

3d structures

hollow-core fibersoptical phenomena

& microcavities

[B. Norris, UMN] [Assefa & Kolodziejski, MIT]

[Mangan, Corning]

Page 3: Compute Methods@Cornell

1887 1987

Photonic Crystalsperiodic electromagnetic media

2-D

periodic intwo directions

3-D

periodic inthree directions

1-D

periodic inone direction

can have a band gap: optical “insulators”

Page 4: Compute Methods@Cornell

Electronic and Photonic Crystalsatoms in diamond structure

wavevector

elec

tron

ene

rgy

Per

iod

ic M

ediu

mB

loch

wav

es:

Ban

d D

iagr

amdielectric spheres, diamond lattice

wavevector

phot

on f

requ

ency

Page 5: Compute Methods@Cornell

Electronic & Photonic Modeling

Electronic Photonic

• strongly interacting —entanglement, Coulomb —tricky approximations

• non-interacting (or weakly), —simple approximations (finite resolution) —any desired accuracy

• lengthscale dependent (from Planck’s h)

• scale-invariant —e.g. size 10 10 (except materials may change)

Page 6: Compute Methods@Cornell

Computational Photonics Problems

• Time-domain simulation— start with current J(x,t)— run “numerical experiment” to simulate E(x, t), H(x, t)

• Frequency-domain linear response— start with harmonic current J(x, t) = e–it J(x)— solve for steady-state harmonic fields E(x), H(x)— involves solving linear equation Ax=b

• Frequency-domain eigensolver— solve for source-free harmonic eigenfields

E(x), H(x) ~ e–it — involves solving eigenequation Ax=2x

Page 7: Compute Methods@Cornell

Numerical Methods: Basis Choices

finite difference

df

dx≈

f (x + Δx) − f (x − Δx)

Δx+O(Δx 2)

discretizeunknowns

on regular grid

finite elementsin irregular “elements,”approximate unknownsby low-degree polynomial

spectral methods

+

+

+ …..

complete basis ofsmooth functions(e.g. Fourier series)

boundary-element methods

discretize only theboundaries betweenhomogeneous media

…solveintegral equation

via Green’s functions

Page 8: Compute Methods@Cornell

Numerical Methods: Basis Choicesfinite difference

discretizeunknowns

on regular grid

finite elementsin irregular “elements,”approximate unknownsby low-degree polynomial

spectral methods

+

+

+ …..

complete basis ofsmooth functions(e.g. Fourier series)

boundary-element methods

discretize only theboundaries betweenhomogeneous media

…solveintegral equation

via Green’s functions

Much easier to analyze, implement,generalize, parallelize, optimize, …

Potentially much more efficient, especially for high resolution

Page 9: Compute Methods@Cornell

Computational Photonics Problems Numerical Methods: Basis Choices

• Time-domain simulation — start with current J(x,t) — run “numerical experiment” to simulate E(x, t), H(x, t)

• Frequency-domain linear response — start with harmonic current J(x, t) = e–it J(x) — solve for steady-state harmonic fields E(x), H(x) — involves solving linear equation Ax=b

• Frequency-domain eigensolver — solve for source-free harmonic eigenfields

E(x), H(x) ~ e–it — involves solving eigenequation Ax=2x

finite difference

df

dx≈

f (x + Δx) − f (x − Δx)

Δx+O(Δx 2)

finite elementsin irregular “elements,”approximate unknownsby low-degree polynomial

spectral methods

+

++ …..

boundary-element methodsdiscretize only theboundaries betweenhomogeneous media

Page 10: Compute Methods@Cornell

FDTD Finite-Difference Time-Domain methods

Divide both space and time into discrete grids— spatial resolution ∆x— temporal resolution ∆t

Very general: arbitrary geometries, materials, nonlinearities, dispersion, sources, … — any photonics calculation, in principle

∂H

∂t= −

1

μ

r ∇× E

∂E

∂t=

1

ε

r ∇× H −

J

ε

dielectric function (x) = n2(x)

Page 11: Compute Methods@Cornell

(i, j) (i+1, j)

(i, j+1)

Ey

Ex

Hz

The Yee Discretization (1966)a cubic “voxel”: ∆x ∆y ∆z

Staggered grid in space: — every field component is stored on a different grid

(i, j, k) (i+1, j, k)

(i, j, k+1)

(i+1, j+1, k)

(i+1, j+1, k+1)

Ez

Ex

Ey

HyHx

Hz

Page 12: Compute Methods@Cornell

(i, j) (i+1, j)

(i, j+1)

Ey

Ex

Hz

The Yee Discretization (1966)

all derivatives become center differences…

∂H

∂t= −

1

μ∇× E ⇒ L

∂H z

∂t i+1

2, j +

1

2

= −1

μ

∂Ey

∂x−

∂Ex

∂y

⎝ ⎜

⎠ ⎟

≈ −1

μ

Ey (i +1, j +1

2) − Ey (i, j +

1

2)

Δx−

Ex (i +1

2, j +1) − Ex (i +

1

2, j)

Δy

⎜ ⎜ ⎜

⎟ ⎟ ⎟

+ O(∆x2) + O(∆y2)

Page 13: Compute Methods@Cornell

The Yee Discretization (1966)all derivatives become center differences…

including derivatives in time

∂H

∂t t= nΔt

= −1

μ∇× E

t= nΔt

≈H(n +

1

2) − H(n −

1

2)

Δt

+ O(∆t2)

Explicit time-stepping: stability requires

Δt <Δx

# dimensions

(vs. implicit time steps: invert large matrix at each step)

Page 14: Compute Methods@Cornell

FDTD Discretization Upshot

• For stability, space and time resolutions are proportional— doubling resolution in 3d requires

at least 16 = 24 times the work!

• But at least the error goes quadratically with resolution…right?…not necessarily!

Page 15: Compute Methods@Cornell

Difficulty with a grid:

representing discontinuous materials?

“staircasing”

… how does this affect accuracy?

Page 16: Compute Methods@Cornell

Field Discontinuity DegradesOrder of Accuracy

a

ETE polarization (E in plane: discontinuous)

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

a

Page 17: Compute Methods@Cornell

Sub-pixel smoothing

Can eliminate discontinuity

by “grayscaling”— assign some average

to each pixel

= discretizing a smoothed structure— that means we are changing geometry— can actually add to error

Page 18: Compute Methods@Cornell

Past sub-pixel smoothing methods can make error worse!

Three previous smoothing methods & convergence is

still only linear

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

[ Dey, 1999 ][ Kaneda, 1997 ]

[ Mohammadi, 2005]

Page 19: Compute Methods@Cornell

A Criterion for Accurate Smoothing

~ Δε E||2

− Δ(1

ε) D⊥

2 ⎡

⎣ ⎢ ⎤

⎦ ⎥ ∫1st-order errors

fromsmoothing Δ

We want the smoothing errors to be zero to 1st order— minimizes error and 2nd-order convergent!

Use a tensor

−1 −1

⎜ ⎜ ⎜

⎟ ⎟ ⎟

E||

E

(in principal axes:)

[ Meade et al., 1993 ]

Page 20: Compute Methods@Cornell

Consistently the Lowest Error

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

a

a

quadratic accuracy! quadratic!

[ Farjadpour et al., Opt. Lett. 2006 ]

Page 21: Compute Methods@Cornell

A qualitatively different case: corners

QuickTime™ and aTIFF (Uncompressed) decompressor

are needed to see this picture.

still ~lowest error, but not quadratic

zero-perturbationcriterion

not satisfieddue to E divergence

at corner— analytically,error ~ ∆x1.404

Page 22: Compute Methods@Cornell

Yes, but what can you do with FDTD?Some common tasks:

• Frequency-domain response:— put in harmonic source and wait for steady-state

• Transmission/reflection spectra:— get entire spectrum from a single simulation

(Fourier transform of impulse response)

• Eigenmodes and resonant modes:— get all modes from a single simulation

(some tricky signal processing)

Page 23: Compute Methods@Cornell

Transmission Spectra in FDTD

= 12

= 1

a

example: a 90° bend, 2d strip waveguide

transmitted power = energy flux here:

Page 24: Compute Methods@Cornell

Transmission Spectra in FDTD

= 12

= 1

a

Gaussian-pulsecurrent source J

P(ω) =1

2Re[Eω

* × Hω ]dx∫€

Eω = E(t)e−iωtdt∫ ≈ E(nΔt)e−iωnΔtΔtn

∑Fourier-transform the fields at each x:

Page 25: Compute Methods@Cornell

Transmission Spectra in FDTD

QuickTime™ and aYUV420 codec decompressor

are needed to see this picture.

QuickTime™ and aYUV420 codec decompressor

are needed to see this picture.

P()

P0()

transmission = P() / P0()

must always do two simulations: one for normalization

electricfield Ez:

Page 26: Compute Methods@Cornell

Reflection Spectra in FDTD

= 12

= 1

P(ω) =1

2Re[Eω

* × Hω ]dx∫

PR (ω) =1

2Re[(Eω − Eω

0 )* × (Hω − Hω0 )]dx∫

for reflection, subtract incident fields(from normalization run)

Page 27: Compute Methods@Cornell

Transmission/Reflection Spectra

= 12

= 1

a

QuickTime™ and aGraphics decompressorare needed to see this picture.

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2

T

R

1–T–R

a / 2πc = a /

Page 28: Compute Methods@Cornell

Dimensionless Units

Maxwell’s equations are scale invariant— most useful quantities are dimensionless ratios

like a / , for a characteristic lengthscale a— same ratio, same , = same solution

regardless of whether a = 1µm or 1km

Our (typical) approach: pick characteristic lengthscale a

– measure distance in units of a– measure time in units of a/c– measure in units of 2πc/a = a / – ....

Page 29: Compute Methods@Cornell

Absorbing Boundaries:

Perfectly Matched Layers

“perfect” absorber: PML Artificial absorbing materialoverlapping the computation

Theoretically reflectionless

… but PML is no longer perfectwith finite resolution,

so “gradually turn on” absorptionover finite-thickness PML

Page 30: Compute Methods@Cornell

Computational Photonics Problems Numerical Methods: Basis Choices

• Time-domain simulation — start with current J(x,t) — run “numerical experiment” to simulate E(x, t), H(x, t)

• Frequency-domain linear response — start with harmonic current J(x, t) = e–it J(x) — solve for steady-state harmonic fields E(x), H(x) — involves solving linear equation Ax=b

• Frequency-domain eigensolver — solve for source-free harmonic eigenfields

E(x), H(x) ~ e–it — involves solving eigenequation Ax=2x

finite difference

df

dx≈

f (x + Δx) − f (x − Δx)

Δx+O(Δx 2)

finite elementsin irregular “elements,”approximate unknownsby low-degree polynomial

spectral methods

+

++ …..

boundary-element methodsdiscretize only theboundaries betweenhomogeneous media

Page 31: Compute Methods@Cornell

A Maxwell Eigenproblem

r∇ ×

rE = −

1

c

∂t

r H = i

ω

c

r H

r ∇ ×

r H = ε

1

c

∂t

r E +

r J = −i

ω

r E

0

dielectric function (x) = n2(x)

First task:get rid of this mess

∇ ×

∇ ×r H =

ωc

⎛ ⎝ ⎜

⎞ ⎠ ⎟

2 r H

eigen-operator eigen-value eigen-state

∇ ⋅r H =0

+ constraint

Page 32: Compute Methods@Cornell

Electronic & Photonic Eigenproblems

∇ ×

∇ ×r H =

ωc

⎛ ⎝ ⎜

⎞ ⎠ ⎟

2 r H

Electronic Photonic

−h2

2m∇ 2 + V

⎝ ⎜

⎠ ⎟ψ = Eψ

simple linear eigenproblem(for linear materials)

nonlinear eigenproblem(V depends on e density ||2)

—many well-known computational techniques

Hermitian = real E & , … Periodicity = Bloch’s theorem…

Page 33: Compute Methods@Cornell

A 2d Model System

square lattice,period a

dielectric “atom”=12 (e.g. Si)

a

a

E

HTM

Page 34: Compute Methods@Cornell

Periodic Eigenproblemsif eigen-operator is periodic, then Bloch-Floquet theorem applies:

r H (

r x ,t)=e

ir k ⋅r x −ωt( ) r

H r k (r x )can choose:

periodic “envelope”planewave

Corollary 1: k is conserved, i.e. no scattering of Bloch wave

Corollary 2: given by finite unit cell,so are discrete n(k) r H r k

Page 35: Compute Methods@Cornell

A More Familiar Eigenproblem

= 12

= 1

a

find the normal modesof the waveguide:

x

H(y, t) = H k (y)ei(kx−ωt )

y

k

light cone

(all non-guided modes)

(propagation constant ka.k.a. )

band diagram / dispersion relation

Page 36: Compute Methods@Cornell

Solving the Maxwell Eigenproblem

H(x,y) ei(kx – t)€

∇+ ik( ) ×1

ε∇ + ik( ) × Hn =

ωn2

c 2Hn

∇+ ik( ) ⋅H = 0

where:

constraint:

1

Want to solve for n(k),& plot vs. “all” k for “all” n,

Finite cell discrete eigenvalues n

Limit range of k: irreducible Brillouin zone

2 Limit degrees of freedom: expand H in finite basis

3 Efficiently solve eigenproblem: iterative methods

QuickTime™ and aGraphics decompressorare needed to see this picture.

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Photonic Band Gap

TM bands

Page 37: Compute Methods@Cornell

Solving the Maxwell Eigenproblem: 11 Limit range of k: irreducible Brillouin zone

2 Limit degrees of freedom: expand H in finite basis

3 Efficiently solve eigenproblem: iterative methods

—Bloch’s theorem: solutions are periodic in k

kx

ky

first Brillouin zone= minimum |k| “primitive cell”

a

M

X

irreducible Brillouin zone: reduced by symmetry

Page 38: Compute Methods@Cornell

Solving the Maxwell Eigenproblem: 2a1 Limit range of k: irreducible Brillouin zone

2 Limit degrees of freedom: expand H in finite basis (N)

3 Efficiently solve eigenproblem: iterative methods

H =H(xt) = hmbm(xt)m=1

N

∑ solve: ˆ A H =ω2 H

Ah=ω2Bh

Aml = bmˆ A bl Bml = bm blf g = f* ⋅g∫

finite matrix problem:

Page 39: Compute Methods@Cornell

Solving the Maxwell Eigenproblem: 2b1 Limit range of k: irreducible Brillouin zone

2 Limit degrees of freedom: expand H in finite basis

3 Efficiently solve eigenproblem: iterative methods

(∇ + ik) ⋅H = 0— must satisfy constraint:

Planewave (FFT) basis

H(xt) = HGeiG⋅xt

G∑

HG ⋅ G + k( ) = 0constraint:

uniform “grid,” periodic boundaries,simple code, O(N log N)

Finite-element basisconstraint, boundary conditions:

Nédélec elements[ Nédélec, Numerische Math.

35, 315 (1980) ]

nonuniform mesh,more arbitrary boundaries,

complex code & mesh, O(N)[ figure: Peyrilloux et al.,

J. Lightwave Tech.21, 536 (2003) ]

Page 40: Compute Methods@Cornell

Solving the Maxwell Eigenproblem: 3a1 Limit range of k: irreducible Brillouin zone

2 Limit degrees of freedom: expand H in finite basis

3 Efficiently solve eigenproblem: iterative methods

Ah=ω2Bh

Faster way:— start with initial guess eigenvector h0

— iteratively improve— O(Np) storage, ~ O(Np2) time for p eigenvectors

Slow way: compute A & B, ask LAPACK for eigenvalues— requires O(N2) storage, O(N3) time

(p smallest eigenvalues)

Page 41: Compute Methods@Cornell

Solving the Maxwell Eigenproblem: 3b1 Limit range of k: irreducible Brillouin zone

2 Limit degrees of freedom: expand H in finite basis

3 Efficiently solve eigenproblem: iterative methods

Ah=ω2BhMany iterative methods:

— Arnoldi, Lanczos, Davidson, Jacobi-Davidson, …, Rayleigh-quotient minimization

Page 42: Compute Methods@Cornell

Solving the Maxwell Eigenproblem: 3c1 Limit range of k: irreducible Brillouin zone

2 Limit degrees of freedom: expand H in finite basis

3 Efficiently solve eigenproblem: iterative methods

Ah=ω2BhMany iterative methods:

— Arnoldi, Lanczos, Davidson, Jacobi-Davidson, …, Rayleigh-quotient minimization

for Hermitian matrices, smallest eigenvalue 0 minimizes:

ω02 =min

h

h' Ahh'Bh

minimize by preconditioned conjugate-gradient (or…)

“variationaltheorem”

Page 43: Compute Methods@Cornell

Band Diagram of 2d Model System(radius 0.2a rods, =12)

E

HTM

a

freq

uenc

y

(2π

c/a)

= a

/

X

M

X M irreducible Brillouin zone

r k

QuickTime™ and aGraphics decompressorare needed to see this picture.

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Photonic Band Gap

TM bands

gap forn > ~1.75:1

Page 44: Compute Methods@Cornell

The Iteration Scheme is Important(minimizing function of 104–108+ variables!)

Steepest-descent: minimize (h + f) over … repeat

02 = min

h

h' Ah

h'Bh= f (h)

Conjugate-gradient: minimize (h + d)— d is f + (stuff): conjugate to previous search dirs

Preconditioned steepest descent: minimize (h + d) — d = (approximate A-1) f ~ Newton’s method

Preconditioned conjugate-gradient: minimize (h + d)— d is (approximate A-1) [f + (stuff)]

Page 45: Compute Methods@Cornell

The Iteration Scheme is Important(minimizing function of ~40,000 variables)

QuickTime™ and aGraphics decompressorare needed to see this picture.

E E E E E E EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

Ñ

ÑÑ Ñ Ñ Ñ ÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑÑ

J

JJ

JJ

JJ

J J J J J J J JJ JJJJJJJJJJJJ

0.000001

0.00001

0.0001

0.001

0.01

0.1

1

10

100

1000

10000

100000

1000000

1 10 100 1000

# iterations

% e

rror

preconditionedconjugate-gradient no conjugate-gradient

no preconditioning

Page 46: Compute Methods@Cornell

The Boundary Conditions are Tricky

E|| is continuous

E is discontinuous

(D = E is continuous)

Any single scalar fails: (mean D) ≠ (any ) (mean E)

Use a tensor

−1 −1

⎜ ⎜ ⎜

⎟ ⎟ ⎟

E||

E

Page 47: Compute Methods@Cornell

The -averaging is ImportantQuickTime™ and aGraphics decompressorare needed to see this picture.

B B

B

B

BB

B

B

B B

BB

B

J

JJ

J

J J

JJ J

J J

J J

HH

H H H H H H HH H H H

0.01

0.1

1

10

100

10 100resolution (pixels/period)

% e

rror

backwards averaging

tensor averaging

no averaging

correct averagingchanges order of convergencefrom ∆x to ∆x2

(similar effectsin other E&M

numerics & analyses)

Page 48: Compute Methods@Cornell

Gap, Schmap?

a

freq

uenc

y

X M

QuickTime™ and aGraphics decompressorare needed to see this picture.

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

Photonic Band Gap

TM bands

But, what can we do with the gap?

Page 49: Compute Methods@Cornell

Intentional “defects” are good

3D Photonic Crystal with Defects

microcavities waveguides (“wires”)

Page 50: Compute Methods@Cornell

Intentional “defects” in 2dQuickTime™ and aGraphics decompressorare needed to see this picture.

a

QuickTime™ and aGraphics decompressorare needed to see this picture.

QuickTime™ and aGraphics decompressorare needed to see this picture.

QuickTime™ and aGraphics decompressorare needed to see this picture.

(Same computation, with supercell = many primitive cells)

Page 51: Compute Methods@Cornell

Microcavity Blues

For cavities (point defects)frequency-domain has its drawbacks:

• Best methods compute lowest- bands, but Nd supercells have Nd modes below the cavity mode — expensive

• Best methods are for Hermitian operators, but losses requires non-Hermitian

Page 52: Compute Methods@Cornell

Time-Domain Eigensolvers(finite-difference time-domain = FDTD)

Simulate Maxwell’s equations on a discrete grid,+ absorbing boundaries (leakage loss)

• Excite with broad-spectrum dipole ( ) source

Δ

Response is manysharp peaks,

one peak per modecomplex n [ Mandelshtam,

J. Chem. Phys. 107, 6756 (1997) ]

signal processing

decay rate in time gives loss

Page 53: Compute Methods@Cornell

QuickTime™ and aGraphics decompressorare needed to see this picture.

EEEEE

E

E

E

E

E

E

E

E

EE

EEEEEEEEEEEEEEEEEEEEEEEEE0

50

100

150

200

250

300

350

400

450

0 0.5 1 1.5 2 2.5 3 3.5 4

Signal Processing is Tricky

complex n

?

signal processing

QuickTime™ and aGraphics decompressorare needed to see this picture.

EE

E

E

E

E

E

E

EEEE

E

E

E

E

E

EEEEE

EEEEEEEEEEE

EEEEEEEEEE

EEEEEEEEEEEEEEEEEEEEEE

EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

0 1 2 3 4 5 6 7 8 9 10

Decaying signal (t) Lorentzian peak ()

FFT

a common approach: least-squares fit of spectrum

fit to:

A

(ω −ω0)2 + Γ 2

Page 54: Compute Methods@Cornell

QuickTime™ and aGraphics decompressorare needed to see this picture.

E E E E E

E

E E E E E0

5000

10000

15000

20000

25000

30000

35000

40000

0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3 1.4 1.5

Fits and UncertaintyQuickTime™ and aGraphics decompressorare needed to see this picture.

EE

E

E

E

E

E

E

E

EEE

E

E

E

E

E

E

E

EEE

E

E

E

E

E

E

E

EEE

E

E

E

E

E

E

E

EEE

E

E

E

E

E

E

EEEE

E

E

E

E

E

E

EEEEE

E

E

E

E

E

EEEEE

E

E

E

E

E

EEEEE

E

E

E

E

E

EEEEE

E

E

E

E

E

EEEEE

E

E

E

E

E

EEEEE

E

E

E

E

E

EEEEE

E

E

E

E

E

EEEEE

E

E

E

E

EEEEEEE

E

E

E

EEEEEEE

E

E

E

EEEEEEE

E

E

E

EEEEEEE

E

E

E

EEEEEEE

E

E

E

EEEEEEE

E

E

EEEE

-1

-0.8

-0.6

-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

0 1 2 3 4 5 6 7 8 9 10

Portion of decaying signal (t) Unresolved Lorentzian peak ()

actual

signalportion

problem: have to run long enough to completely decay

There is a better way, which gets complex to > 10 digits

Page 55: Compute Methods@Cornell

Unreliability of Fitting Process

= 1+0.033i

= 1.03+0.025i

sum of two peaks

Resolving two overlapping peaks isnear-impossible 6-parameter nonlinear fit

(too many local minima to converge reliably)

Sum of two Lorentzian peaks ()

There is a better way, which gets

complex for both peaksto > 10 digits

Page 56: Compute Methods@Cornell

Quantum-inspired signal processing (NMR spectroscopy):

Filter-Diagonalization Method (FDM)[ Mandelshtam, J. Chem. Phys. 107, 6756 (1997) ]

Given time series yn, write:

yn = y(nΔt) = ake−iωk nΔt

k

…find complex amplitudes ak & frequencies k

by a simple linear-algebra problem!

Idea: pretend y(t) is autocorrelation of a quantum system:

ˆ H ψ = ih∂

∂tψ

say:

yn = ψ (0) ψ (nΔt) = ψ (0) ˆ U n ψ (0)

time-∆t evolution-operator:

ˆ U = e−i ˆ H Δt / h

Page 57: Compute Methods@Cornell

Filter-Diagonalization Method (FDM)[ Mandelshtam, J. Chem. Phys. 107, 6756 (1997) ]

yn = ψ (0) ψ (nΔt) = ψ (0) ˆ U n ψ (0)

ˆ U = e−i ˆ H Δt / h

We want to diagonalize U: eigenvalues of U are ei∆t

…expand U in basis of |(n∆t)>:

Um,n = ψ (mΔt) ˆ U ψ (nΔt) = ψ (0) ˆ U m ˆ U ˆ U n ψ (0) = ym +n +1

Umn given by yn’s — just diagonalize known matrix!

Page 58: Compute Methods@Cornell

Filter-Diagonalization Summary[ Mandelshtam, J. Chem. Phys. 107, 6756 (1997) ]

Umn given by yn’s — just diagonalize known matrix!

A few omitted steps: —Generalized eigenvalue problem (basis not orthogonal) —Filter yn’s (Fourier transform):

small bandwidth = smaller matrix (less singular)

• resolves many peaks at once • # peaks not known a priori • resolve overlapping peaks • resolution >> Fourier uncertainty

Page 59: Compute Methods@Cornell

Do try this at home

Bloch-mode eigensolver: http://ab-initio.mit.edu/mpb/

Filter-diagonalization: http://ab-initio.mit.edu/harminv/

Photonic-crystal tutorials (+ THIS TALK): http://ab-initio.mit.edu/

/photons/tutorial/

FDTD simulation: http://ab-initio.mit.edu/meep/

Page 60: Compute Methods@Cornell

Meep (FDTD) MPB (Eigensolver)

Free/open-sourcesoftware (GNU)

• band diagrams, group velocitiesperturbation theory, …

• Arbitrary periodic (x) —anisotropic, magneto-optic, …(lossless, linear materials)

• Arbitrary (x) — including dispersive, loss/gain, and nonlinear [(2) and (3)]

• Arbitrary J(x,t)

• PML/periodic/metal bound.

• 1d/2d/3d/cylindrical

• 1d/2d/3d

• fully scriptable interface

• built-in multivariate optimization,integration, root-finding, …• MPI parallelism

• exploit mirror symmetries

• power spectra • eigenmodes

• field output (standard HDF5 format)

Page 61: Compute Methods@Cornell

Unix Philosophycombine small, well-designed tools, via files

Input text file MPB/Meep standard formats (text + HDF5)

Visualization / Analysissoftware

(Matlab, Mayavi [vtk],command-line tools, …)

Disadvantage:— have to learn several programs

Advantages:— flexibility— batch processing, shell scripting— ease of development

Page 62: Compute Methods@Cornell

Unix Philosophycombine small, well-designed tools, via files

Input text file MPB/Meep standard formats (text + HDF5)

Visualization / Analysissoftware

(Matlab, Mayavi [vtk],command-line tools, …)

GNU Guile scripting interpreter(Scheme language)

Embed a full scripting language:— parameter sweeps— complex parameterized geometries— optimization, integration, etc.— programmable J(x, t), etc.— … Turing complete

Page 63: Compute Methods@Cornell

A Simple Example (MPB)

= 12

= 1

a

find the normal modes n(k) of the waveguide:

x

H(y, t) = H k (y)ei(kx−ωt )

y

Need to specify: • computational cell size/resolution • geometry, i.e. (y) • what k values • how many modes (n = 1, 2, … ?)

Page 64: Compute Methods@Cornell

A File Format Made of Parentheses

= 12

= 1

a

x

y

Need to specify: • computational cell size/resolution(set! geometry-lattice (make lattice (size no-size 10 no-size)(set! resolution 32)

• geometry, i.e. (y) • what k values • how many modes (n = 1, 2, … ?)

10 (320 pixels)

1 pixel

Page 65: Compute Methods@Cornell

A File Format Made of Parentheses

= 12

= 1

a

x

y

Need to specify: • computational cell size/resolution • geometry, i.e. (y)(set! geometry (list (make block (size infinity 1 infinity) (center 0 0 0) (material (make dielectric (epsilon 12))))))

• what k values • how many modes (n = 1, 2, … ?)

(choose units of a)

Page 66: Compute Methods@Cornell

A File Format Made of Parentheses

= 12

= 1

a

x

y

Need to specify: • computational cell size/resolution • geometry, i.e. (y) • what k values(set! k-points (interpolate 10 (list (vector3 0 0 0) (vector3 2 0 0))))

• how many modes (n = 1, 2, … ?)

(units of 2π/a)

(built-in function)

Page 67: Compute Methods@Cornell

A File Format Made of Parentheses

= 12

= 1

a

x

y

Need to specify: • computational cell size/resolution • geometry, i.e. (y) • what k values • how many modes (n = 1, 2, … ?) (set! num-bands 5)

…Then run:(run)

or only TM polarization:(run-tm)

or only TM, even modes:(run-tm-yeven)

Page 68: Compute Methods@Cornell

Simple Example (MPB) Results

= 12

= 1

a

find the normal modes n(k) of the waveguide:

x

y

red = evenblue = odd

Page 69: Compute Methods@Cornell

Do try this at home

Bloch-mode eigensolver: http://ab-initio.mit.edu/mpb/

Filter-diagonalization: http://ab-initio.mit.edu/harminv/

Photonic-crystal tutorials (+ THIS TALK): http://ab-initio.mit.edu/

/photons/tutorial/

FDTD simulation: http://ab-initio.mit.edu/meep/