Repository navigation
Reconstruct in-layer E_x from the continuous D_x series on 1D TM and conical - #103
Merged
Merged
Conversation
…conical
reconstruct_field(discontinuous='continuity') sums the Fourier series of
eps E_x, which is continuous across the walls of a patterned layer, and
divides by eps at each sample (Lalanne & Jurek, J. Mod. Opt. 45, 1357,
1998). The plain Fourier sum of E_x rings at every wall at any truncation;
this is the near-field rule RETICOLO's res3 applies (champ=1).
- 1D TM: D_x = W q u needs no inverse, since V = epx^-1 W q.
- Conical: D_x = i Ky U_z + [V_21 V_22] q (a+ + a-), with the z-derivative
sign fixed by the kernel's z running into the stack.
- The engine reads eps per sample column from the raster; uniform layers
and every other component stay bit-identical to the default.
- 2D gratings, shape structures, tensor materials and merged field state
are refused by name.
The RETICOLO 1D TM and conical field goldens now match on every slot,
E_x included, to 1e-12 (measured 3.6e-14 and 6e-14), where the default
sum is 7e-2 to 1e-1 off. A label-free test checks eps E_x continuity
across every wall from both incidence sides. The default ('fourier') is
unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
solver.reconstruct_field(..., discontinuous='continuity')reconstructsE_xinside a patterned layer by summing the Fourier series ofeps E_x(continuous across every wall) and dividing byepsat each sample. This is the near-field rule of Lalanne & Jurek (J. Mod. Opt. 45, 1357, 1998). RETICOLO'sres3applies it (champ=1). The default,'fourier', is unchanged.Scope in this PR: 1D TM and conical, raster structures, through
reconstruct_field.How
field_1d):V = epx^-1 W q, soD_x = W q uwith no inverse._field_coupled):D_x = i Ky U_z + [V_21 V_22] q (a+ + a-). The z-derivative sign follows the kernel's z, which runs into the stack._continuity_rowsreadsepsat each sample column of the raster. Uniform layers are skipped.NotImplementedError).Evidence
E_xincluded, at a 1e-12 tolerance. Measured errors are 3.6e-14 and 6e-14. The default sum is 7e-2 to 1e-1 off on those slots. The existing tests for the default keep their exceptions, with the cause now explained.tests/rcwa/test_field_continuity.py(15 tests):eps E_xis continuous across every wall, from both incidence sides. Reading the wrong layer's eps breaks this by 0.75.test_canary_inductor_compiles_the_eye_write_in_order. That test fails on clean main too (torch 2.13 inductor).Docs
docs/guide/rcwa/fields.md: new section, "Normal components inside a patterned layer".tests/references/README.md: the champ=0/1 question is marked resolved.Not yet
field) door.🤖 Generated with Claude Code