Skip to content

docs(learn): materials, light, multiple-waves and fields chapters in the current API - #126

Merged
yonghakim merged 5 commits into
mainfrom
docs/learn-fundamentals-rewrite
Oct 30, 2026
Merged

yonghakim merged 5 commits into
mainfrom
docs/learn-fundamentals-rewrite

Conversation

@yonghakim

@yonghakim yonghakim commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Rebased on main after #123 landed.

What

Course chapters 7 (materials), 8 (incident light), 9 (multiple waves and sources) and 14 (fields), English and Korean, now teach the current rcwa API instead of the retired wavebit.compat constructor:

  • rcwa.Problem / Stack / Layer / Region, Material(epsilon=...) in every material slot, Circle(radius=...), Numerics(orders=...)
  • rcwa.Excitation(sources=(...)) with PlaneWave, IncidentOrders(weights=...), GaussianBeam and ElectricDipole
  • Outputs(fields=True), result.field(x=, y=, z=), result.boundary_fields(side=, x=, y=, part=), power from result.outputs in W, H in A/m

Passages with no current equivalent sit in earlier-interface admonitions (rule in docs/README.md): psi=/chi= keywords, pure 1D tetm, formal complex-theta R/T, the order map's per-order R/T, after-solve boundary_power(region), incidence='s'/'p' field variants, and the earlier Z0*H power formula. The text outside each block gives the current way, where one exists (an (a_s, a_p) pair, 's'/'p' at phi=0, two runs for s and p).

The page-level Historical API notices are gone from the four chapters, and the course note in index.md / overview.md no longer lists them. The polarization widget's readout shows ψ/χ in degrees instead of the retired keywords.

Outputs

Every rewritten example was run. No recorded value changed. The only changed printed lines are the array shapes in chapter 14, which now include the leading wavelength axis the current result has (e.g. (3, 1, 1, 6) → (1, 3, 1, 1, 6)). The text also needed three corrections for the current API: TabulatedMaterial and from_refractive_index take wavelength_unit=, a MaterialResponse from .at() is wrapped in Material(...), and a table keeps its own wavelength unit.

Checks

  • python -m sphinx -W -b html -D wavebit_bilingual=1 passes for English and for -D language=ko
  • tests/api/test_docs_contract.py: 166 passed
  • tools/docs/learning/check_site.py was run on the built site

Not in this PR

Figures 7-1, 9-1 and 14-2 still carry earlier labels. Each chapter has a note or caption naming the current equivalents; the SVGs need redrawing.

🤖 Generated with Claude Code

yonghakim and others added 5 commits October 30, 2026 01:18
Chapter 7, English and Korean, now builds every example with rcwa.Problem,
Stack/Layer/Region, Material(epsilon=...), Circle(radius=...) and
Numerics(orders=...). The page-level Historical API notice is gone; a note
names the current equivalents of the earlier labels in Figure 7-1.

The current API needs three corrections to the text: TabulatedMaterial and
from_refractive_index take wavelength_unit=, a MaterialResponse from .at() is
wrapped in Material(epsilon=..., mu=...) before use, and a table keeps its own
wavelength unit while the solver converts to the problem's Units. Every
rewritten block was run; the printed outputs are unchanged (film example
0.357473 / 0.016308).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chapter 8, English and Korean, now uses rcwa.PlaneWave(side=, theta=, phi=,
kx=, ky=, polarization=), Layer(epsilon=array[y, x]) for the grating and
result.reflection.k_parallel (already in inverse length units). psi/chi are
taught as angles converted to an (a_s, a_p) pair, and TE/TM as 's'/'p' at
phi=0. The psi=/chi= keywords, the pure 1D tetm declaration and the formal
complex-theta R/T sit in earlier-interface blocks. The polarization widget
shows the angles in degrees instead of the retired keywords.

Every rewritten block was run; the printed outputs are unchanged
(kx 0.00677139, R 0.215748, T 0.784252).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chapter 9, English and Korean, replaces the side-keyed excitation={...} maps
with source tuples, the order map with rcwa.IncidentOrders(weights=...), and
reads power from result.outputs['top'|'bottom']; the Gaussian beam and
electric dipole use the current constructors and result.field(...). The
psi/chi angles, the order map's per-order R/T and the after-solve
boundary_power(region) sit in earlier-interface blocks. A note names the
current equivalents of the earlier labels in Figure 9-1.

Every rewritten block was run; the printed outputs are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chapter 14, English and Korean, reads fields with Outputs(fields=True),
result.field(x=, y=, z=) and result.boundary_fields(side=, x=, y=, part=).
Public H is in A/m, so the magnetic-units and power-density sections now say
so, and power is read from result.outputs in W. The pure s/p variants
(incidence='s'/'p'), the pure 1D TM magnetic input and the earlier Z0*H
result.power formula sit in earlier-interface blocks.

Every rewritten block was run. No recorded value changed; the printed array
shapes gain the leading wavelength axis the current result carries, e.g.
(3, 1, 1, 6) -> (1, 3, 1, 1, 6). Figure 14-2 still draws Z0*H without the
wavelength axis, and its caption says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tructor

Every fundamentals chapter now teaches the current API; the index and
overview notes, English and Korean, point at the earlier-interface boxes
instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@yonghakim
yonghakim force-pushed the docs/learn-fundamentals-rewrite branch from 390c9af to 8df0d65 Compare October 29, 2026 16:20
@yonghakim
yonghakim marked this pull request as ready for review October 29, 2026 16:20
@yonghakim
yonghakim merged commit 295ea38 into main Oct 30, 2026
65 checks passed
@yonghakim
yonghakim deleted the docs/learn-fundamentals-rewrite branch October 30, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant