morphogen.homogenization.photonic

Electromagnetic Bloch waves of three-dimensional photonic crystals, by plane waves.

In a periodic medium of permittivity ε(x) and permeability μ(x), a harmonic field without sources obeys curl(ε⁻¹ curl H) = ω² B with B = μ H and div B = 0. At the wave vector k the induction of a Bloch wave is a sum of plane waves over the reciprocal vectors G of the cell,

B(x) = Σ_G (b¹_G e¹_G + b²_G e²_G) exp(i (k + G)·x),

with two amplitudes per plane wave on the unit vectors e¹, e² normal to q = k + G ((e¹, e², q/|q|) direct): the fields are divergence-free by construction, and the gradients, which the curl ignores and which clutter the spectrum of the nodal discretizations with zero frequencies, are left out (Ho, Chan & Soukoulis 1990; Johnson & Joannopoulos 2001). The frequencies are those of the Hermitian problem

Pᴴ μ⁻¹ C ε⁻¹ C μ⁻¹ P b = ω² Pᴴ μ⁻¹ P b, C = i q ×,

P the map of the amplitudes to the plane waves. The curls are taken on the plane waves and the products by ε⁻¹ and μ⁻¹ on the grid of the cell, a pair of fast Fourier transforms apart, so that the matrices are never formed: the lowest frequencies are found by a block Davidson method (the Rayleigh-Ritz values of a subspace that the preconditioned residuals of its lowest waves extend, restarted from them and from those of the step before), from the waves of the previous wave vector; small cells are diagonalized. The preconditioner is the operator of the inverse medium, Pᴴ μ C⁻¹ ε C⁻¹ μ P with C⁻¹ = i q × / |q|² on the transverse waves (Johnson & Joannopoulos 2001): the inverse of the operator but for the projections, whatever the contrast of the phases. A uniform permeability leaves the standard problem Pᴴ C ε⁻¹ C P h = ω² μ h of the dielectric crystals. The Galerkin projection on the transverse waves is exact: the residual of an eigenvector is transverse and orthogonal to the transverse waves in the product of μ⁻¹.

The grid of the plane waves is that of the voxels, or one coarsen times coarser whose cells hold several voxels. A cell that an interface cuts then takes the tensor of Meade et al. (1993), as averaged by Johnson & Joannopoulos (2001),

ε̃⁻¹ = <ε⁻¹> n ⊗ n + <ε>⁻¹ (1 - n ⊗ n),

the harmonic mean for the field normal to the interface and the arithmetic mean along it (the effective tensor of the layers that the interface draws in the cell), n the sum of the gradients of the permittivity over the voxels of the cell. The stairs of the voxels cost the frequencies an error of first order in the size of the cells; this average brings it back to the second order: voxelize three or four times finer than the plane waves.

With relative permittivities and permeabilities the frequencies are in units of the speed of light over the unit of length (ω a / 2π c: normalized()). A cell one voxel thick is a crystal invariant along that axis: its waves in the plane are the two polarizations "tm" and "te" of scalar_band_structure() together, and those that leave the plane (a wave vector with a component along the axis) are found here only.

morphogen.homogenization.photonic.DENSE_LIMIT = 1800

Up to this number of unknowns (two per plane wave) the matrices are formed and diagonalized

morphogen.homogenization.photonic.BLOCK_VALUES = 6000000

The amplitudes of a block handled at once (bounds the memory of the transforms)

morphogen.homogenization.photonic.SUBSPACE = 5

The subspace of the Davidson method, in blocks of the waves sought, before a restart

morphogen.homogenization.photonic.smoothed_inverse(field: ndarray, coarsen: int = 1) → ndarray[source]

The inverse of an isotropic coefficient of the voxels (field: the permittivity) on a grid coarsen times coarser along each axis (the axes of one voxel are kept): 1 / field on the voxels themselves, else the tensor <1/ε> n ⊗ n + (1 - n ⊗ n) / <ε> of each cell ((3, 3) + shape; see the module). The normal n is the sum of the gradients of the field over the voxels of the cell (central differences: the normal of a plane that cuts the cell, whatever its stairs), or, where they cancel (a layer thinner than the cell, with its two faces), their principal direction; the cells that hold one value keep it.

class morphogen.homogenization.photonic.PlaneWaves(inverse_permittivity, size, inverse_permeability=1.0)[source]

Bases: object

The plane waves of a periodic cell of edges size on the grid of the inverse coefficients inverse_permittivity and inverse_permeability (arrays of the shape of the grid, or (3, 3) + shape; the permeability a number when uniform), and the Maxwell operators at a wave vector (at()).

scale

the square of the first reciprocal vector

Type:

the unit of the eigenvalues

property unknowns: int
at(wavevector) → PlaneWaves[source]

Set the wave vector: the vectors q = k + G, their norms and their transverse unit vectors e1 and e2.

stiffness(x: ndarray) → ndarray[source]

Pᴴ μ⁻¹ C ε⁻¹ C μ⁻¹ P times the amplitudes x (unknowns, or unknowns x p), in units of the square of the first reciprocal vector.

mass(x: ndarray) → ndarray[source]

Pᴴ μ⁻¹ P times the amplitudes (the identity for a uniform permeability, which the stiffness then carries).

precondition(x: ndarray) → ndarray[source]

The operator of the inverse medium, Pᴴ μ C⁻¹ ε C⁻¹ μ P, times the amplitudes: the inverse of the stiffness but for the projections on the transverse waves.

frequencies(wavevector, bands: int, *, guess=None, tol: float = 0.0001, maxiter: int = 300)[source]

The lowest bands angular frequencies at a wave vector and their amplitudes (unknowns x block; a guess for them: those of a neighbouring wave vector).

morphogen.homogenization.photonic.electromagnetic_band_structure(sample, permittivity: dict, path=('G', 'X', 'M', 'G', 'R'), *, permeability=1.0, bands: int = 8, points: int = 12, coarsen: int = 1, tol: float = 0.0001)[source]

The lowest bands frequencies of the electromagnetic Bloch waves of a periodic cell (a VoxelImage of phases) along path (corners of the Brillouin zone, points per segment; or an array of wave vectors), by plane waves (see the module): permittivity, that of each phase (a number, three principal values or a 3 x 3 tensor in the axes of the cell), and permeability (a number for the whole cell, or those of the phases likewise). coarsen: the plane waves on a grid that many times coarser than the voxels, whose cells cut by the interfaces take the averaged tensor of Meade et al. (isotropic phases). tol: the residual of the bands, in units of the square of the first reciprocal vector (the squares of the frequencies are then within about its square). Returns a BandStructure; at the centre of the zone the first two frequencies are zero (the uniform fields).