Exploiting symmetry in Meep

From AbInitio

(Difference between revisions)
Jump to: navigation, search
Revision as of 22:25, 5 November 2005 (edit)
Stevenj (Talk | contribs)

← Previous diff
Revision as of 18:57, 7 November 2005 (edit)
Stevenj (Talk | contribs)

Next diff →
Line 1: Line 1:
{{Meep}} {{Meep}}
-{{stub}}+Meep allows you to take advantage of mirror and rotational symmetries in your problem to reduce the amount of computation and storage required for simulation. Our use of symmetry is designed to be ''transparent'': once you specify the symmetry, Meep exploits it as an internal optimization, while everything else about the simulation ''appears'' the same as if you didn't specify the symmetry. That is, when you output it still outputs the whole (non-symmetrized) cell, you can still call <code>get-field-point</code> to get the fields at ''any'' point, etcetera&mdash;internally, Meep transforms everything as necessary according to the symmetries to get whatever data is needed.
 + 
 +An important point to understand is that, when you specify a symmetry, it must be obeyed by ''both'' the structure/geometry ''and'' by the current sources (and thus the fields). In particular, the symmetry of the currents/fields will typically require you to specify ''phase factors'' associated with the symmetry operations&mdash;for example, a mirror plane can either be used for ''even'' sources/fields (phase +1) or for ''odd'' sources/fields (phase &minus;1).
 + 
 +'''Meep does not check whether the symmetry is obeyed'''. If you specify a symmetry that does not preserve your structure/sources, then the results are undefined.
 + 
 +For the ctl syntax to specify a symmetry, see the [[Meep Reference#symmetry|symmetry reference]]; there are also examples in the [[Meep tutorial#Exploiting symmetry]].
 + 
 +==Kinds of symmetries==
 + 
 +Meep supports exploiting several kinds of symmetries:
 + 
 +* Mirror planes through the origin, and normal to the <math>x</math>/<math>y</math>/<math>z</math> axes.
 +* 180&deg; rotational symmetry about the origin, around the <math>x</math>/<math>y</math>/<math>z</math> axes. This is also known as a <math>C_2</math> symmetry, in group theory. (This is different from a mirror plane: e.g. the letter "S" has <math>C_2</math> but not mirror symmetry.)
 +* 90&deg; (fourfold) rotational symmetry about the origin, around the <math>x</math>/<math>y</math>/<math>z</math> axes. This is also known as a <math>C_4</math> symmetry.
 + 
 +The first two kinds of symmetry each reduce the computational cell (internally) by a factor of two, and the third by a factor of four. If your structure has multiple symmetries, you can combine them arbitrarily. For example, your cell may have two orthogonal mirror planes (e.g. one even and one odd), or it may have four-fold rotational symmetry about the <math>z</math> axis and a mirror plane through <math>z=0</math>. Thus, in 3d you might be able to reduce your computational cell by at most a factor of eight, or a factor of four in 2d. (This is why the ctl interface lets you specify a ''list'' <code>symmetries</code> of <code>symmetry</code> objects.)
 + 
 +There are also two other kinds of symmetry you can exploit.
 + 
 +===TE/TM polarizations in 2d===
 + 
 +When you have a two-dimensional simulation with a wavevector <math>\mathbf{k}</math> (if any) lying in the plane, then the <math>xy</math> plane is itself a mirror plane. The consequence of this is that the fields can be chosen purely polarized: either '''TE polarized''' (electric field in the plane and magnetic field in the <math>z</math> direction) or '''TM polarized''' (magnetic field in the plane and electric field in the <math>z</math> direction). Meep can exploit this to save a factor of two in storage and time.
 + 
 +To exploit TE/TM symmetry, you don't have to do anything special: if your sources are only TM polarized (<code>Ez</code>/<code>Hx</code>/<code>Hy</code>), then Meep will only propagate the TM fields, and similarly for TE (<code>Hz</code>/<code>Ex</code>/<code>Ey</code>).
 + 
 +===Cylindrical symmetry===
 + 
 +If your structure has cylindrical symmetry (also known as the <math>C_{\infty\mathrm{v}}</math> group), i.e. continuous rotational symmetry around the <math>z</math> axis, then Meep can exploit this by running the simulation in cylindrical/polar coordinates.
 + 
 +To do this, you must <code>(set! dimensions CYLINDRICAL)</code> in the ctl file, and then the vectors are interpreted as <math>(r,\phi,z)</math> triplets instead of <math>(x,y,z)</math>.
 + 
 +In a cylindrical simulation, fields can be written in the form of a function of <math>(r,z)</math> multiplied by a function <math>\exp(im\phi)</math> for the &phi; dependence, where <math>m</math> is a user-specified parameter (related to the angular momentum of the field). If the computational cell includes the <math>r=0</math> origin, then <math>m</math> must be an integer to be single-valued at the origin. Otherwise, <math>m</math> can be arbitrary (this is useful e.g. for bend simulations).
 + 
 +===Translational symmetry===
 + 
 +If the structure has discrete or continuous translational symmetry in some direction, then this is handled in Meep by specifying periodic boundary conditions in that direction. Here, the fields/sources take the form of <math>\exp(i\mathbf{k}\cdot\mathbf{x})</math> multiplied by a periodic envelope, so one specifies '''Bloch-periodic''' boundary conditions with a given Bloch wavevector <math>\mathbf{k}</math>.
 + 
 +For example, to simulate the modes of a uniform waveguide (continuous translational symmetry) in the <math>x</math> direction, one would specify a structure with <code>no-size</code> in the <math>x</math> direction and a given <math>k_x</math> corresponding to the wavenumber of the desired mode. For discrete periodicity, see this [[Meep Tutorial/Band diagram, resonant modes, and transmission in a holey waveguide#Band diagram|band diagram example]].
 + 
 +==Symmetry phase factors==
 + 
 +In general, it is not sufficient to simply specify the symmetry operations that preserve the structure. When applied to the fields and sources, the symmetry operations in general transform the source/field into itself multiplied by some ''phase factor''.
 + 
 +For example, if you have a mirror plane, then the phase factor is +1 for even fields and &minus;1 for odd fields. For a 90&deg; rotation, values of +1, &minus;1, +''i'', and &minus;''i'' are typical (where the latter two correspond to "circularly polarized" fields).
 + 
 +The phase factors are ignored when applying the symmetry to the structure (e.g. to &epsilon;.)
 + 
 +Technically, the symmetry operations that preserve the structure form the symmetry group (in particular, this is a point group or, if you include translations, the space group of the structure). The phase factors specify the ''representation'' of the group that the fields/sources transform as. See also any book on group theory in physics, e.g. Inui et al., ''Group Theory and Its Applications in Physics''.
 + 
 +==Vectors and pseudovectors==
 + 
 +One subtlety that arises in specifying the symmetry of the system is that you have to transform the fields appropriately according to their vector nature. In particular, the ''electric'' fields (and currents) transform as vectors, while the ''magnetic'' fields (and currents) transforms as [[w:pseudovector|pseudovectors]]. If you don't keep these things straight, you will be endlessly confused because otherwise it will seem that every field component has a different symmetry.
 + 
 +For example, suppose we have an ''even'' (phase=+1) mirror plane through <math>x=0</math>. Then, if we look at components of the electric field individually, <math>E_y</math> and <math>E_z</math> are ''even'' while <math>E_x</math> is ''odd''. Overall, the whole field considered as a ''vector'' is still even although one of its components is not.
 + 
 +The magnetic field is less intuitive because pseudovectors are multiplied by an additional factor of &minus;1 under mirror flips (or any [[w:improper rotation|improper rotation]]). Thus, for our even <math>x=0</math> mirror plane, if we look at the components of the ''magnetic'' field individually, then <math>H_y</math> and <math>H_z</math> are ''odd'' while <math>H_x</math> is ''even''. That is, the magnetic field as a whole ''looks'' odd when the electric field is even, but the two really have the ''same'' symmetry if one realizes that they are different sorts of object (pseudovectors vs. vectors).
[[Category:Meep]] [[Category:Meep]]

Revision as of 18:57, 7 November 2005

Meep
Download
Release notes
FAQ
Meep manual
Introduction
Installation
Tutorial
Reference
C++ Tutorial
C++ Reference
Acknowledgements
License and Copyright

Meep allows you to take advantage of mirror and rotational symmetries in your problem to reduce the amount of computation and storage required for simulation. Our use of symmetry is designed to be transparent: once you specify the symmetry, Meep exploits it as an internal optimization, while everything else about the simulation appears the same as if you didn't specify the symmetry. That is, when you output it still outputs the whole (non-symmetrized) cell, you can still call get-field-point to get the fields at any point, etcetera—internally, Meep transforms everything as necessary according to the symmetries to get whatever data is needed.

An important point to understand is that, when you specify a symmetry, it must be obeyed by both the structure/geometry and by the current sources (and thus the fields). In particular, the symmetry of the currents/fields will typically require you to specify phase factors associated with the symmetry operations—for example, a mirror plane can either be used for even sources/fields (phase +1) or for odd sources/fields (phase −1).

Meep does not check whether the symmetry is obeyed. If you specify a symmetry that does not preserve your structure/sources, then the results are undefined.

For the ctl syntax to specify a symmetry, see the symmetry reference; there are also examples in the Meep tutorial#Exploiting symmetry.

Contents

Kinds of symmetries

Meep supports exploiting several kinds of symmetries:

  • Mirror planes through the origin, and normal to the x/y/z axes.
  • 180° rotational symmetry about the origin, around the x/y/z axes. This is also known as a C2 symmetry, in group theory. (This is different from a mirror plane: e.g. the letter "S" has C2 but not mirror symmetry.)
  • 90° (fourfold) rotational symmetry about the origin, around the x/y/z axes. This is also known as a C4 symmetry.

The first two kinds of symmetry each reduce the computational cell (internally) by a factor of two, and the third by a factor of four. If your structure has multiple symmetries, you can combine them arbitrarily. For example, your cell may have two orthogonal mirror planes (e.g. one even and one odd), or it may have four-fold rotational symmetry about the z axis and a mirror plane through z = 0. Thus, in 3d you might be able to reduce your computational cell by at most a factor of eight, or a factor of four in 2d. (This is why the ctl interface lets you specify a list symmetries of symmetry objects.)

There are also two other kinds of symmetry you can exploit.

TE/TM polarizations in 2d

When you have a two-dimensional simulation with a wavevector \mathbf{k} (if any) lying in the plane, then the xy plane is itself a mirror plane. The consequence of this is that the fields can be chosen purely polarized: either TE polarized (electric field in the plane and magnetic field in the z direction) or TM polarized (magnetic field in the plane and electric field in the z direction). Meep can exploit this to save a factor of two in storage and time.

To exploit TE/TM symmetry, you don't have to do anything special: if your sources are only TM polarized (Ez/Hx/Hy), then Meep will only propagate the TM fields, and similarly for TE (Hz/Ex/Ey).

Cylindrical symmetry

If your structure has cylindrical symmetry (also known as the C_{\infty\mathrm{v}} group), i.e. continuous rotational symmetry around the z axis, then Meep can exploit this by running the simulation in cylindrical/polar coordinates.

To do this, you must (set! dimensions CYLINDRICAL) in the ctl file, and then the vectors are interpreted as (r,φ,z) triplets instead of (x,y,z).

In a cylindrical simulation, fields can be written in the form of a function of (r,z) multiplied by a function exp(imφ) for the φ dependence, where m is a user-specified parameter (related to the angular momentum of the field). If the computational cell includes the r = 0 origin, then m must be an integer to be single-valued at the origin. Otherwise, m can be arbitrary (this is useful e.g. for bend simulations).

Translational symmetry

If the structure has discrete or continuous translational symmetry in some direction, then this is handled in Meep by specifying periodic boundary conditions in that direction. Here, the fields/sources take the form of \exp(i\mathbf{k}\cdot\mathbf{x}) multiplied by a periodic envelope, so one specifies Bloch-periodic boundary conditions with a given Bloch wavevector \mathbf{k}.

For example, to simulate the modes of a uniform waveguide (continuous translational symmetry) in the x direction, one would specify a structure with no-size in the x direction and a given kx corresponding to the wavenumber of the desired mode. For discrete periodicity, see this band diagram example.

Symmetry phase factors

In general, it is not sufficient to simply specify the symmetry operations that preserve the structure. When applied to the fields and sources, the symmetry operations in general transform the source/field into itself multiplied by some phase factor.

For example, if you have a mirror plane, then the phase factor is +1 for even fields and −1 for odd fields. For a 90° rotation, values of +1, −1, +i, and −i are typical (where the latter two correspond to "circularly polarized" fields).

The phase factors are ignored when applying the symmetry to the structure (e.g. to ε.)

Technically, the symmetry operations that preserve the structure form the symmetry group (in particular, this is a point group or, if you include translations, the space group of the structure). The phase factors specify the representation of the group that the fields/sources transform as. See also any book on group theory in physics, e.g. Inui et al., Group Theory and Its Applications in Physics.

Vectors and pseudovectors

One subtlety that arises in specifying the symmetry of the system is that you have to transform the fields appropriately according to their vector nature. In particular, the electric fields (and currents) transform as vectors, while the magnetic fields (and currents) transforms as pseudovectors. If you don't keep these things straight, you will be endlessly confused because otherwise it will seem that every field component has a different symmetry.

For example, suppose we have an even (phase=+1) mirror plane through x = 0. Then, if we look at components of the electric field individually, Ey and Ez are even while Ex is odd. Overall, the whole field considered as a vector is still even although one of its components is not.

The magnetic field is less intuitive because pseudovectors are multiplied by an additional factor of −1 under mirror flips (or any improper rotation). Thus, for our even x = 0 mirror plane, if we look at the components of the magnetic field individually, then Hy and Hz are odd while Hx is even. That is, the magnetic field as a whole looks odd when the electric field is even, but the two really have the same symmetry if one realizes that they are different sorts of object (pseudovectors vs. vectors).

Personal tools