Whispering gallery modes
Author: I. S. Grudinin
In whispering gallery mode (WGM) resonators, which are typically spheres or disks, electromagnetic field is trapped by total internal reflections from the boundary. Modes of such resonators are distinguished by compact volume and record high quality factors (Q) in a broad range of frequencies.
Modern applications of such resonators include microwave and optical cavities for atomic clocks, cavity optomechanics, nonlinear and quantum optics. Analytical solutions for WG modes are only available for a limited number of idealized geometries, such as sphere or ellipsoid. Since resonator dimensions are typically much larger than optical wavelength, direct application of numerical 3D finite difference time domain (FDTD) or finite element methods (FEM) is not practical. It’s possible to solve the vectorial wave equation by reducing it to a two dimensional case by taking axial symmetry into account.
Such reduction leads to a system of 3 equations to be solved in a 2D “\(\rho-z\)” section of a resonator. Please refer to [OXBORROW2007] for a detailed derivation and to [GRUDININ2012] for an example of using FreeFEM to compute WGMs.
Wave equation for the WGMs
Since electric field is discontinuous on the surface of a dielectric and magnetic field is typically not, we derive our equations for the magnetic field. The electric field can be easily derived at a later stage from \(\vec{E}=\frac{i}{\omega\epsilon_0}\hat{\epsilon}^{-1}\nabla\times\vec{H}\). Following a standard procedure starting with Maxwell equations we derive a wave equation in a single-axis anisotropic medium such as an optical crystal:
Here \(k_0=\omega/c\) is the wavenumber, \(\alpha\) is the penalty term added to fight spurious FEM solutions. For anisotropic single-axis medium with \(\partial\hat{\epsilon}/\partial\phi=0\) in cylindrical system of coordinates we have:
We now assume axial symmetry of our electromagnetic fields and insert an imaginary unity in front of the \(H_{\phi}\) to allow all field components to be real numbers and also to account for the phase shift of this component \(\vec{H}(\rho,\phi,z)=\left\{H_{\rho}(\rho,z),iH_{\phi}(\rho,z),H_z(\rho,z)\right\}\times e^{im\phi}\).
We write the wave equation (73) explicitly in cylindrical coordinates, thus obtaining a set of three differential equations for the domain \(\Omega\) given by the resonator’s cross section and some space outside:
The numerical solutions of these equations and boundary conditions can be found with FreeFEM if we write the system in the weak, or integral form.
Weak formulation
In general, to obtain the integral or “weak” statements equivalent to system (74) and boundary conditions we form a scalar dot product between an arbitrary magnetic field test function \(\mathbf{H}^t=\{{H}_{\rho}^t,{H}_{\phi}^t,{H}_{z}^t\}\) and the components of our vectorial equation \(A_1,A_2,A_3\), and integrate over the resonator’s cross section domain \(\Omega\) (and its boundary for the boundary conditions):
We can reduce the order of partial derivatives in this integral by using the Green’s formula for integration by parts. For example:
Thus converting equations (74) we obtain a large expression for the weak form.
A dielectric sphere example with FreeFEM
We now compute the fundamental mode frequency for a fused silica sphere. The sphere is 36 micrometer in diameter, the refractive index is 1.46, the boundary condition is the magnetic wall (which can actually be omitted as it holds automatically).
1// Parameters
2real radius = 36; //approximate radius of the cavity
3real yb = -10, yt = -yb; //window yb=bottom and yt=top coordinates
4real xl = radius-5, xr = radius+3; //window xl=left and xr=right coordinates
5real angle = asin((yt)/radius); //angle of the sphere segment to model in radians
6int Nm = 60; //number of mesh vertices per border
7real ne = 1.46; //n_e-extraordinary refractive index (root of permittivity parallel to z-axis, epara)
8real no = 1.46; //n_o-ordinary refractive index (root of permittivity orthogonal to z-axis, eorto)
9real nm = 1; //refractive index of surrounding medium (air)
10
11int nev = 4; // number of eigen values to find
12
13int M = 213; //azimuthal mode order ~ 2Pi*n*R/lambda
14real alpha = 1; //penalty term
15
16// Mesh
17border W1l(t=0, 1){x=xl+(radius*cos(angle)-xl)*(1-t); y=yt; label=1;}
18border W1r(t=0, 1){x=xr-(xr-radius*cos(angle))*(t); y=yt; label=1;}
19border W2(t=0, 1){x=xr; y=yb+(yt-yb)*t; label=1;}
20border W3l(t=0, 1){x=xl+(radius*cos(angle)-xl)*(t); y=yb; label=1;}
21border W3r(t=0, 1){x=xr-(xr-radius*cos(angle))*(1-t); y=yb; label=1;}
22border W4(t=0, 1){x=xl; y=yt-(yt-yb)*t; label=1;}
23border S(t=0, 1){x=radius*cos((t-0.5)*2*angle); y=radius*sin((t-0.5)*2*angle); label=2;}
24mesh Th = buildmesh(W1r(Nm/4) + W1l(Nm/4) + W4(Nm) + W3l(Nm/4) + W3r(Nm/4) + W2(Nm) + S(Nm));
25plot(Th, WindowIndex=0);
26
27// Fespace
28fespace Ph(Th, P0);
29Ph reg = region;
30
31int ncav = reg(xl+1, 0); // cavity
32int nair = reg(xr-1, 0); //air
33Ph eorto = no^2*(region==ncav) + nm^2*(region==nair); //subdomains for epsilon values inside and outside the resonators
34Ph epara = ne^2*(region==ncav) + nm^2*(region==nair); //subdomains for epsilon values inside and outside the resonators
35
36//supplementary variables to store eigenvectors, defined on mesh Th with P2 elements - Largange quadratic.
37fespace Supp(Th, P2);
38Supp eHsqr;
39
40//3d vector FE space
41fespace Vh(Th, [P2, P2, P2]);
42Vh [Hr, Hphi, Hz], [vHr, vHphi, vHz]; //magnetic field components on Vh space and test functions vH
43
44// Macro
45//boundary condition macros
46macro EWall(Hr, Hphi, Hz) (
47 dy(Hr) - dx(Hz) + Hr*N.x + Hz*N.y
48 - epara*(Hz*M - dy(Hphi)*x)*N.y
49 + eorto*(Hphi - Hr*M+dx(Hphi)*x)*N.x) //
50macro MWall(Hr, Hphi, Hz) (
51 Hphi + Hz*N.x - Hr*N.y
52 + epara*(Hz*M - dy(Hphi)*x)*N.x
53 + eorto*(Hphi - Hr*M+dx(Hphi)*x)*N.y ) //
54
55// Problem
56real sigma =(M/(ne*radius))^2+2; // value of the shift (k^2), where the modes will be found
57varf b ([Hr, Hphi, Hz], [vHr, vHphi, vHz])
58 = int2d(Th)(
59 x*(Hr*vHr+Hphi*vHphi+Hz*vHz)
60 )
61 ;
62// OP = A - sigma B ; // the shifted matrix
63varf op ([Hr, Hphi, Hz], [vHr, vHphi, vHz])=
64 int2d(Th)(
65 (
66 (eorto*(vHphi*Hphi - M*(vHphi*Hr + Hphi*vHr) + M^2*vHr*Hr) + epara*M^2*vHz*Hz)/x //A/r
67 + eorto*(dx(vHphi)*(Hphi - M*Hr) + dx(Hphi)*(vHphi - M*vHr)) - epara*M*(vHz*dy(Hphi) + Hz*dy(vHphi)) //B
68 + x*(eorto*dx(vHphi)*dx(Hphi) + epara*((dx(vHz) - dy(vHr))*(dx(Hz) - dy(Hr)) + dy(vHphi)*dy(Hphi))) //C
69 )/(eorto*epara)
70 + alpha*(
71 (vHr*Hr - M*(vHphi*Hr + Hphi*vHr) + M^2*vHphi*Hphi)/x //D/r
72 + (dx(vHr) + dy(vHz))*(Hr - M*Hphi) + (vHr - M*vHphi)*(dx(Hr) + dy(Hz)) //E
73 + x*(dx(vHr) + dy(vHz))*(dx(Hr) + dy(Hz)) //F
74 )
75 -sigma*x*(vHr*Hr + vHphi*Hphi + vHz*Hz)
76 )
77 //electric wall boundary condition on the boundary of computation domain
78 +int1d(Th, 1)(
79 EWall(Hr, Hphi, Hz)*EWall(vHr, vHphi, vHz)
80 )
81 ;
82//setting sparce matrices and assigning the solver UMFPACK to solve eigenvalue problem
83matrix B = b(Vh, Vh, solver=UMFPACK);
84matrix OP = op(Vh, Vh, solver=UMFPACK);
85
86// Solve
87real[int] ev(nev); //to store the nev eigenvalue
88Vh[int] [eHr, eHphi, eHz](nev); //to store the nev eigenvector
89//calling ARPACK on sparce matrices with the assigned solver UMFPACK:
90int k = EigenValue(OP, B, sym=true, sigma=sigma, value=ev, vector=eHr, tol=1e-10, maxit=0, ncv=0);
91
92k = min(k, nev); //sometimes the number of converged eigen values
93 //can be greater than nev
94
95//file to output mode values
96ofstream f("modes.txt");
97//setting number of digits in the file output
98int nold = f.precision(11);
99
100// Plot & Save
101for (int i = 0; i < k; i++){
102 real lambda = 2*pi/sqrt(ev[i]);
103 eHsqr = (sqrt(eHr[i]^2 + eHphi[i]^2 + eHz[i]^2)); //intensity from magnetic field components
104 plot(eHsqr, WindowIndex=i, value=1, nbiso=20,LabelColors=1, aspectratio=1, cmm="Mode "+i+", lambda="+lambda+", F="+(299792.458/lambda));
105 f << "Mode "<< i << ", ka=" << sqrt(ev[i])*radius << endl;
106}