Repository navigation
docs: the interfaces supercell gap is the cell-dependent kernel radius and grid - #254
Merged
Merged
Conversation
…nd grid Add `--part cause` to studies/rcwa/supercell_normal_field. Under shape_normal_method='interfaces' a supercell of four identical TiO2 pillars still differs from the primitive cell by 3.7e-7 in T at M = 3. Two inputs of the boundary-integral normal field are read off the cell, not the structure: the kernel radius R (half the longest diagonal of the reduced cell) and the sample grid (shape_nvf_grid_size per side of the cell). The part solves each cell with neither, one or both of the other cell's inputs at M = 3 and 4, by wrapping integrated_normal._sparse_fields and boundary.normal_projector_coeffs for the duration of a solve, and compares the projector coefficients each solve builds at the primitive orders. It asserts that each wrapper ran once per solve and that the closure arms agree below 1e-12 in T, zero-order amplitude and coefficients. Checks: ruff; two cheap arms reproduce the investigation (grid alone at M = 3: dT +1.5727e-8, dphase -1.359e-6). The full run and its record follow in the next commit. No solver source changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKzHy8heBBfVfYe8dKvUdR
…d grid Record the run of `--part cause` and write its result into known limits §10 (English and Korean), with a cross-reference from §1c, the boundary guide's supercell paragraph and the studies index row. Under shape_normal_method='interfaces' the boundary-integral field reads two inputs off the cell rather than the structure: the kernel radius R, half the longest diagonal of the reduced cell (303.109 nm primitive, 630.971 nm for the (4*a1, a2) supercell), and the sample grid, which is shape_nvf_grid_size per side of the cell. Given both of the supercell's inputs, the primitive cell reproduces the supercell to 1.3e-14 in T, 9e-14 in the zero-order amplitude and 6e-17 in the projector coefficients at M = 3 and 4; the reverse closure holds to 5.6e-14, 3.5e-13 and 3e-17. R carries 95.8% (M = 3) and 96.4% (M = 4) of the T difference and nearly all of the phase; the grid carries the rest. The two add to 2e-11 in T. Status stays open: whether R should be a length of the structure is a design question this change does not decide. Measured 2026-11-24, Linux x86_64, Intel Xeon 2.30 GHz, four logical cores, Python 3.12.3, NumPy 2.5.5, SciPy 1.18.1; about 41 minutes. Checks: ruff; tests/api docs contract, text encoding and study tests (293 passed, 4 skipped; 5 test_study_bootstrap failures from a missing mpmath in this local environment, also failing on main); quick profile 17 passed; sphinx -W English and Korean builds from an empty directory; the new tables checked at 1200 px for wrapping in both languages. Not run locally: the full regression (CI). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKzHy8heBBfVfYe8dKvUdR
Independent review of the previous two commits found wording that went beyond the measurement; correct it in English and Korean together. - The study runs the primitive cell with neither, one or both of the supercell's inputs and the supercell with the primitive R only; say so instead of "each cell with ... the other cell's inputs", in §10, the study docstring and the studies index row. - The grid's share is not shown to act "mostly through the constant term": state what was printed (coefficients up to 5.5e-7, constant terms 4.3e-7). - A structure-based kernel radius would remove the radius part (about 96% in T), not make the field independent of the description: the grid part remains. - "The two add, to 2e-11" read as a sum; say the interaction is at most 2e-11 in T. - Name the two hosts (2.10 GHz; the --part cause runs at 2.30 GHz), define grid / 4 by axis (1024 along a2, 256 along a1) and the three coefficient arrays, and use 사영자 for projector as the rest of the Korean page does. - Study docstring runtime: about 40 minutes (the logged arms sum to 41 minutes); _difference docstring matches what it computes. No change to printed output or the record. Checks: ruff; docs contract, text encoding and study record tests (264 passed, 1 skipped); sphinx -W English and Korean from an empty directory; both new tables render one line per row at 1200 px. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RKzHy8heBBfVfYe8dKvUdR
yonghakim
marked this pull request as ready for review
November 24, 2026 17:34
yonghakim
enabled auto-merge (rebase)
November 24, 2026 17:34
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.
Why
#250 traced the default NVF's supercell/primitive gap to the closed-form normal field. It left one gap untraced: under
shape_normal_method='interfaces', a supercell of four identical TiO2 pillars still differs from the primitive cell by 3.7e-7 in T and 6.1e-4 rad in phase at M = 3. This PR traces that gap and writes the cause down.The cause
The boundary-integral field (known limits §1c) reads two inputs off the cell rather than the structure:
src/wavebit/rcwa/_engine/integrated_normal.py). It is 303.109 nm for the primitive hexagonal cell and 630.971 nm for the(4*a1, a2)supercell, whose reduced basis is(4*a1 + 2*a2, a2). The wider kernel moves the projector coefficients by up to 1.1e-2.shape_nvf_grid_sizeper side of the cell (boundary.py), so the supercell takes 256 samples per primitive period alonga1instead of 1024.R carries 96% of the T difference and nearly all of the phase difference; the grid carries the rest. The two parts add: their interaction is at most 2e-11 in T. Once both inputs are matched, nothing else differs between the cells.
Evidence (committed study)
The new
--part causeofstudies/rcwa/supercell_normal_field/runs these arms:It forces the inputs by wrapping
integrated_normal._sparse_fieldsandboundary.normal_projector_coeffsfor the duration of a solve. It asserts that each wrapper ran exactly once per solve and that the closure arms agree below 1e-12.At M = 3 (M = 4 in the record):
The closures hold at M = 3 and M = 4:
What changes
studies/rcwa/supercell_normal_field/: the--part causecode, and its run appended to the record log. The run took about 41 minutes on four cores at 2.30 GHz (Python 3.12.3, NumPy 2.5.5).docs/validation/rcwa/normal-field-known-limits.md§10: a new paragraph, "Under'interfaces'", with the tables above. "What to do" and "Status" now name the cause. Whether R should be a length of the structure rather than of the cell is left open as a design question. Changing it would alter every'interfaces'answer at the truncation level.docs/guide/rcwa/boundary-modeling.md: one clause in the supercell paragraph.studies/README.md: the study's row.docs/locales/ko/GLOSSARY.md(사영자 for projector, as the rest of the page uses).There are no solver source changes. The third commit applies fixes from an independent review of the first two.
Checks
ruff check studies/: clean.tests/api: docs contract, text encoding and study record tests, 264 passed, 1 skipped.tools/run_verification.py --profile quick: 17 passed.sphinx -W -D wavebit_bilingual=1, English and Korean, from empty output directories: exit 0.test_study_bootstrap.pyhas 5 local failures from a missingmpmathin this environment; they fail on main too.05b3251).Generated by Claude Code