Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation for kz_2d for Python interface #1047

Merged
merged 2 commits into from
Nov 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions doc/docs/Python_User_Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Simulation(object):
default_material=mp.Medium(),
m=0,
k_point=False,
special_kz=False,
kz_2d="complex",
extra_materials=[],
material_function=None,
epsilon_func=None,
Expand Down Expand Up @@ -113,9 +113,10 @@ Specifies the computational grid resolution in pixels per distance unit. Require
If `False` (the default), then the boundaries are perfect metallic (zero electric field). If a `Vector3`, then the boundaries are Bloch-periodic: the fields at one side are $\exp(i\mathbf{k}\cdot\mathbf{R})$ times the fields at the other side, separated by the lattice vector $\mathbf{R}$. A non-zero `Vector3` will produce complex fields. The `k_point` vector is specified in Cartesian coordinates in units of 2π/distance. Note: this is *different* from [MPB](https://mpb.readthedocs.io), equivalent to taking MPB's `k_points` through its function `reciprocal->cartesian`.

**`special_kz` [`boolean`]**
**`kz_2d` [`"complex"`, `"real/imag"`, or `"3d"`]**
By default, a 2d cell (i.e., `dimensions=2`) combined with a `k_point` that has a *non-zero* component in $z$ results in a 3d simulation with complex fields. However, by setting `special_kz` to `True`, Meep will use a 2d cell and real fields (if the $x$ and $y$ components of `k_point` are zero) which improves performance.
A 2d cell (i.e., `dimensions=2`) combined with a `k_point` that has a *non-zero* component in $z$ would normally result in a 3d simulation with complex fields. However, by default (`kz_2d="complex"`), Meep will use a 2d computational cell in which $k_z$ is incorporated as an additional term in Maxwell's equations, which still results in complex fields but greatly improved performance.
Setting `kz_2d="3d"` will instead use a 3d cell that is one pixel thick (with Bloch-periodic boundary conditions), which is considerably more expensive. The third possibility, `kz_2d="real/imag"`, saves an additional factor of two by storing some field components as purely real and some as purely imaginary in a "real" field, but this option requires some care to use and will be explained elsewhere in the future.

**`ensure_periodicity` [`boolean`]**
Expand Down