Skip to content

meep: material override key is case-sensitive, silently ignored on mismatch #163

Description

@vvahidd

Problem

sim.materials overrides match stack material names case-sensitively, so a mismatched key is silently ignored and the PDK default is used instead — no error or warning.

Repro (from nbs/meep_ybranch.ipynb)

sim.materials = {
    "si": Material(refractive_index=3.47),
    "SiO2": Material(refractive_index=1.44),   # stack layer material is lowercase 'sio2'
}

The stack's cladding/BOX layers use material name sio2 (lowercase). The "SiO2" key never matches, so the override is dropped.

Evidence

Resolved config epsilon:

  • si -> 12.0409 (= 3.47², override applied ✓)
  • sio2 -> 2.0852 (n≈1.444, PDK default) — expected 2.0736 (= 1.44²) if the "SiO2" override had applied ✗

Expected

Either match override keys case-insensitively, or emit a warning when a sim.materials key matches no stack material name.

Notes

Override resolution is in src/gsim/meep/simulation.py (_material_overrides / resolve_materials). Surfaced while investigating small S-param differences in meep_ybranch (unrelated root cause: material-resolution refactor in 0.0.16).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions