ExamplesMeep Examples

MPB Square Rods

Compute photonic band structure for a square lattice of dielectric rods

MPB Square Lattice Band Structure

This example computes the photonic band structure for a square lattice of dielectric (GaAs) rods in air using MPB (MIT Photonic Bands).

Overview

Photonic crystals with square lattices are fundamental structures for:

  • Band gap engineering: Designing photonic band gaps
  • Waveguide modes: Defect-based waveguides
  • Slow light: Group velocity reduction
  • Filters: Wavelength-selective devices

Parameters

ParameterValueDescription
r0.2Rod radius (in lattice units)
eps11.56Dielectric constant (GaAs)
resolution32Grid resolution
num_bands8Number of bands to compute
k_interp4K-point interpolation

K-Point Path

The simulation follows the standard Brillouin zone path:

  • Γ (0, 0) → X (0.5, 0) → M (0.5, 0.5) → Γ (0, 0)

Code Structure

from meep import mpb

# Square lattice
geometry_lattice = mp.Lattice(size=mp.Vector3(1, 1))

# GaAs rod
GaAs = mp.Medium(epsilon=11.56)
geometry = [mp.Cylinder(r=0.2, material=GaAs)]

# K-point path: Γ → X → M → Γ
k_points = mp.interpolate(k_interp, [Gamma, X, M, Gamma])

ms = mpb.ModeSolver(
    geometry_lattice=geometry_lattice,
    geometry=geometry,
    k_points=k_points,
    resolution=32,
    num_bands=8,
)

# Compute TE and TM bands
ms.run_te()
ms.run_tm()

Results

The simulation produces:

  • TE band structure: Electric field in-plane
  • TM band structure: Magnetic field in-plane
  • Band gaps: Frequency ranges with no propagating modes

On this page