diff --git a/docs/guide/rcwa/wall-resolution.md b/docs/guide/rcwa/wall-resolution.md index 395fbd99..9da51cab 100644 --- a/docs/guide/rcwa/wall-resolution.md +++ b/docs/guide/rcwa/wall-resolution.md @@ -21,6 +21,7 @@ The default is `None`: the cell's own coordinates, and every solve bit for bit a - **Against finite-element fields.** Seven layers of axis-aligned rectangles and twelve of one circle or ellipse at normal incidence; and eighteen metal cases and three dielectric ones beyond it: oblique incidence (p and s, theta 20 and 40 deg), five propagating orders, a glass substrate, two patterned layers, and for a circle a non-square cell, and an ellipse at oblique incidence. On those twenty-one, at order 12, `R` and `T` are within 0.41% of the references and the near field is 0.02 to 0.10 of the default solve's error, against criteria written before measuring ([the measurements](../../validation/rcwa/wall-resolution.md)). On eight of those cases the references themselves move by 0.1 to 0.4% between their two mesh levels, and the comparison is only as tight as that. - **Against other codes without the stretch.** On dielectric blocks the unstretched Li solve, run in RETICOLO to order 30, agrees with it to that solve's own uncertainty. On metals the unstretched Li solve -- RETICOLO's and Wavebit's alike -- has not settled by order 40; that slowness is what the stretch removes. - **What no one has.** No other implementation of the stretched or the matched solve was found to compare with at the same truncation. +- **Spurious modes.** A strong stretch is reported in the literature to add spurious layer modes. None were found at slopes down to 0.005 and orders 4 to 16. In a uniform medium every computed mode is a plane wave. At the slope 0.02 a patterned layer has no more growing roots than the default solve, and in a lossless layer those roots come in conjugate pairs that carry no net power. Turning the exceptional-point handling off moves `R` and `T` by at most 7.7e-11 ({ref}`the measurement `). - **How to use it.** Compare two orders before relying on a value, as with any solve. ## What the value is @@ -85,4 +86,5 @@ The matrices are the size they are without the stretch. Each half-space takes an - **Just above a Rayleigh wavelength.** On a dielectric block of period 400 nm at 405 nm the stretched solve's `R` read 0.02 at order 8 and 0.31 from order 12 on, where it settled; the unstretched solve was slow there too (0.15, 0.27, 0.30 at orders 8, 12, 16). Just below, at 395 nm, the stretched solve was settled from order 8. Do not read a low order near a Rayleigh wavelength. - **A weak metal's `R` and `T`.** On a circle of permittivity -5+1j the matched solve's `R` is 1.2% above the reference's at order 12, where the field is ten times closer than the default solve's; a block of the same material was within 0.6%. If only the efficiencies of a dielectric or weakly metallic structure are wanted, the unstretched solve is the checked one. +- **An `ExceptionalPointWarning` at an isolated wavelength.** In sweeps of 138 wavelengths the stretched solve warned at three points, from its stretched air half-spaces, where the default solve did not. There the answer was the same to the bit with the handling off and lay on the curve through the neighbouring wavelengths. Check such a point against its neighbours or a second order before discarding it. - **Many walls.** Each piece between two walls gets the same share of the stretched cell. A structure with many walls along an axis leaves each piece few harmonics, and that case was not measured. diff --git a/docs/locales/ko/pages/guide/rcwa/wall-resolution.md b/docs/locales/ko/pages/guide/rcwa/wall-resolution.md index b7e1c22c..b0b16258 100644 --- a/docs/locales/ko/pages/guide/rcwa/wall-resolution.md +++ b/docs/locales/ko/pages/guide/rcwa/wall-resolution.md @@ -21,6 +21,7 @@ result = rcwa.run(problem, numerics=rcwa.Numerics(orders=(12, 12), factorization - **유한요소 필드와 견줌.** 수직 입사에서 축에 나란한 사각형으로 된 일곱 층과 원이나 타원 하나로 된 열두 층을 견주었습니다. 그 밖에서 금속 열여덟 경우와 유전체 세 경우를 견주었습니다. 비스듬한 입사(p와 s, theta 20도와 40도), 진행하는 차수 다섯, 유리 기판, 패턴 층 둘, 원은 정사각이 아닌 셀, 그리고 비스듬한 입사의 타원입니다. 이 스물한 경우에서 차수 12의 `R`과 `T`는 기준 해와 0.41% 안이고, 근접장 오차는 기본 계산 오차의 0.02–0.10배입니다. 기준은 재기 전에 적었습니다([측정](../../validation/rcwa/wall-resolution.md)). 그중 여덟 경우는 기준 해 자체가 두 메시 단계 사이에서 0.1–0.4% 움직이므로, 그 경우의 비교는 그만큼만 촘촘합니다. - **늘리지 않은 다른 코드와 견줌.** 유전체 블록에서는 RETICOLO로 차수 30까지 돌린 늘림 없는 Li 계산이 그 계산 자신의 불확실성 안에서 맞습니다. 금속에서는 늘림 없는 Li 계산이 RETICOLO에서나 wavebit에서나 똑같이 차수 40에서도 수렴하지 않습니다. 늘린 좌표가 없애는 것이 그 느림입니다. - **아무도 없는 것.** 늘린 계산이나 맞춘 좌표 계산을 같은 차수에서 견줄 다른 구현은 찾지 못했습니다. +- **가짜 모드.** 문헌은 센 늘림이 가짜 층 모드를 더한다고 보고합니다. 기울기 0.005까지, 차수 4에서 16까지에서는 찾지 못했습니다. 균일 매질에서 계산한 모드는 모두 평면파입니다. 기울기 0.02에서 패턴 층의 자라는 근은 기본 계산보다 많지 않고, 손실 없는 층에서 그런 근은 알짜 전력을 나르지 않는 켤레 쌍으로 나옵니다. 예외점 처리를 꺼도 `R`과 `T`는 많아야 7.7e-11 움직입니다({ref}`측정 `). - **쓰는 방법.** 어느 계산에서나 그렇듯, 값을 믿기 전에 두 차수를 비교합니다. ## 값의 뜻 @@ -85,4 +86,5 @@ numerics = rcwa.Numerics(orders=(12, 12), factorization='li', wall_resolution=0. - **Rayleigh 파장 바로 위.** 주기 400 nm의 유전체 블록에서 405 nm일 때, 늘린 계산의 `R`은 차수 8에서 0.02였고 차수 12부터 0.31로 자리 잡았습니다. 늘리지 않은 계산도 거기서는 느렸습니다(차수 8, 12, 16에서 0.15, 0.27, 0.30). 바로 아래인 395 nm에서는 늘린 계산이 차수 8부터 자리 잡았습니다. Rayleigh 파장 근처에서는 낮은 차수의 값을 읽지 않습니다. - **약한 금속의 `R`과 `T`.** 유전율 -5+1j인 원에서 맞춘 좌표의 `R`은 차수 12에서 기준 해보다 1.2% 높습니다. 같은 차수에서 필드는 기본 계산보다 열 배 가깝습니다. 같은 재료의 블록은 0.6% 이내였습니다. 유전체나 약한 금속 구조의 효율만 필요하면, 확인된 쪽은 늘리지 않은 계산입니다. +- **한 파장에서만 나는 `ExceptionalPointWarning`.** 138개 파장의 훑기에서 늘린 계산은 세 점에서 경고했습니다. 경고는 늘린 공기 반공간에서 났고, 기본 계산은 그 점들에서 경고하지 않았습니다. 그 점에서 처리를 꺼도 답이 비트까지 같았고, 이웃 파장을 지나는 곡선 위에 있었습니다. 그런 점은 버리기 전에 이웃 파장이나 다른 차수와 견줍니다. - **벽이 많은 경우.** 두 벽 사이의 조각은 늘린 셀을 똑같이 나눠 갖습니다. 한 축에 벽이 많은 구조는 조각마다 고조파가 적게 돌아가며, 그 경우는 측정하지 않았습니다. diff --git a/docs/locales/ko/pages/validation/rcwa/wall-resolution.md b/docs/locales/ko/pages/validation/rcwa/wall-resolution.md index 37f4d358..ea547582 100644 --- a/docs/locales/ko/pages/validation/rcwa/wall-resolution.md +++ b/docs/locales/ko/pages/validation/rcwa/wall-resolution.md @@ -222,6 +222,39 @@ fmmax 1.7.1(MIT)로 유전체 장면 다섯을 풀었습니다. theta 20도의 - **처음 세운 비교는 입력 때문에 기준을 충족하지 못했습니다.** 경계 화소에서 두 유전율을 넓이 비율로 섞은 화소 격자를 fmmax에 주었습니다. fmmax는 받은 배열의 역수에서 역유전율 계수를 만드는데, 넓이로 섞은 유전율의 역수는 그 화소의 `1/eps`를 잘못 나타냅니다(반쯤 찬 화소에서 0.075 대 0.54). 그래서 fmmax의 `R`이 격자의 역수에 비례해 움직였고(theta 20도 p의 원, 800항에서 400–3200화소 사이 3.0e-4), 맞춘 계산은 여덟 줄 가운데 일곱에서 그 값과 0.44–1.10% 떨어졌습니다. 대신 화소 안의 `1/eps` 평균을 주면 같은 격자들에서 fmmax의 `R`이 4e-7 안으로 고정됩니다. - 정확한 계수와의 비교는 처음 결과를 본 뒤에 했으므로, 재기 전에 적은 기준은 충족 안 됨으로 기록합니다. +(wall-resolution-spurious)= +## 센 늘림: 가짜 층 모드와 예외점 처리 + +문헌은 센 늘림이 차수를 올리면 물러나는 가짜 층 모드를 더한다고 보고합니다. 계산기는 바꾸지 않고 돌렸고, 층마다의 고유값 `w = q**2`는 감싼 함수로 읽었습니다. 장면은 400 nm 셀, 900 nm의 일곱 층입니다. + +- 200 nm 블록과 반지름 100 nm 원. +- 유전율 12.25 또는 -20+1.5j. +- 수직 입사와 20도. + +장면마다 차수 4에서 16, 기울기 `G` 0.1에서 0.005로 풀었고, 같은 차수의 기본 계산으로도 풀었습니다. 기준은 재기 전에 적었습니다. 처음 결과를 본 뒤 더한 읽기는 그렇다고 적었습니다. + +- **균일 매질: 정확한 답이 있는 곳.** 늘린 좌표에서 균일 매질의 모드는 평면파 `w = kx**2 + ky**2 - eps`입니다. 유전율 1, 2.25, 12.25의 늘린 균일 매질을 일곱 좌표계 모두에서 이것과 견주었습니다. + - 어느 차수, 어느 기울기에서도 스펙트럼의 어느 부분에 계산값이 평면파보다 많은 적은 없었습니다. + - `|w| <= 50`(900 nm에서 150 nm 층을 지나며 필드가 남는 모드) 안의 가장 큰 상대 오차는 차수 8에서 3–5%, 12에서 4e-4, 16에서 3e-6이었습니다. 기울기와는 거의 무관했습니다. + - 처음 적은 기준은 차수 `N/2`의 평면파까지 1e-3이었습니다. 이 기준은 모든 차수에서 맞지 않습니다. 예를 들어 차수 8, `G` 0.02에서 98개 중 64개입니다. 이것은 높은 차수의 평면파가 덜 정확하게 계산된 것입니다. 가짜 모드라면 더해졌을 여분의 값은 없었습니다. 이 둘을 가르는 두 읽기(개수와 대역)는 처음 결과를 본 뒤 더했습니다. +- **패턴 층.** + - `G` 0.02에서 `|w| <= 50` 안의 `Im w > 0` 근이 같은 차수의 기본 계산보다 많은 층은 없었습니다. 그런 근은 수동 층에서 `z`를 따라 자랍니다. `G` 0.01과 0.005에서는 일흔 번의 비교 가운데 넷에서 하나에서 넷이 더 많았습니다. + - 손실 없는 층에서는 늘렸든 아니든 그런 근마다 켤레도 근이었습니다. 알짜 전력을 나르지 않는 복소 모드 쌍입니다. `1 - R - T`는 0에서 8e-13 안에 있었습니다. + - 금속 층에서는 흡수가 양수였습니다. + - 금속 층의 가장 덜 감쇠하는 모드 열 개는 늘렸을 때 더 빨리 수렴했습니다. 차수 12에서 16으로 갈 때 블록은 `G` 0.02에서 10개 중 10개가 1e-2까지 맞았고, Li는 2개였습니다. 원은 `G` 0.02에서 8개, 0.01에서 10개였고, NVF는 6개였습니다. +- **예외점 처리.** + - {ref}`수직 입사 밖의 유한요소 표 `를 위해 잰 30개 장면(슬래브와 블록 포함)에서, 차수 8, 12, 16의 `exceptional_points='rebuild'`와 `'off'`는 `R`과 `T`가 6.7e-16까지 같았습니다. 기준은 1e-9였습니다. 90번의 계산 가운데 두 번 한 쌍을 다시 지었습니다. + - 아래 훑기에서 늘린 계산이 쌍이나 묶음을 다시 지은 69개 점에서는 둘이 7.7e-11까지 같았습니다. +- **파장 훑기.** 20도, p의 세 경우를 훑었습니다: 금속 블록, 금속 원, 유전체 블록. 각각 550에서 1100 nm까지 4 nm 간격으로, `G` 0.02의 차수 8과 12, 그리고 차수 12의 기본 계산으로 풀었습니다. + - 거절은 없었습니다. + - 이웃 여섯 점을 지나는 이차 맞춤에서 1e-3 넘게 벗어난 점은 모두 기본 계산과 다른 차수의 훑기에도 있었습니다. 562–622 nm와 710–762 nm의 날카로운 도파 공명이 그렇습니다. + - 간격은 2 nm로 계획했습니다. 4 nm보다 좁은 구조는 놓쳤을 수 있습니다. +- **답을 바꾸지 않은 경고 셋.** 늘린 계산은 훑기의 세 점에서 `ExceptionalPointWarning`("a 2D layer holds three or more modes of one defective eigenvalue cluster ... that no rebuild takes exactly")을 냈습니다. 기본 계산은 그 점들에서 경고하지 않았습니다. + - 세 점은 두 블록의 846 nm(차수 8)와 유전체 블록의 654 nm(차수 12)입니다. + - 경고는 패턴 층이 아니라 늘린 공기 반공간에서 났습니다. + - 그 점에서 처리를 꺼도 `R`이 비트까지 같았습니다. 0.5 nm 앞뒤 계산(서로 3e-4에서 4e-3 차이)을 지나는 직선에서 7e-6 안에 있었고, 다른 차수와의 차이는 이웃 파장에서의 차이와 같은 크기였습니다. + - 묶음의 정확한 원인은 좇지 않았습니다. + ## 측정하지 않은 것 - phi가 0이 아닌 기준 해. 원과 타원은 셀 가운데가 아닌 도형의 기준 해. 타원은 둘째 각, 기판, 두 층의 기준 해. 기판 위의 둘째 기준 해. 위 약함 여덟 줄의 더 고운 유한요소 단계. @@ -229,4 +262,4 @@ fmmax 1.7.1(MIT)로 유전체 장면 다섯을 풀었습니다. theta 20도의 - 한 축에 벽이 둘보다 많은 층을 기준 해와 견준 것. 고르지 않게 놓인 벽 넷을 지나는 균일 슬래브는 `R`이 1e-5까지 맞습니다. - 일곱 기준 해 가운데 다섯의 둘째 메시 단계. - 단정밀도. `jax.jit`, `jax.vmap`, 미분은 거절합니다. -- 예외점 처리와의 상호작용. 문헌은 센 늘림이 차수를 올리면 물러나는 가짜 층 모드를 더한다고 보고하는데, 여기서는 찾아보지 않았습니다. +- 기울기 0.005 아래나 차수 16 위의 가짜 모드. 4 nm보다 좁은 파장 구조. 위 경고 셋의 원인. diff --git a/docs/validation/rcwa/wall-resolution.md b/docs/validation/rcwa/wall-resolution.md index bae54351..8daadcb8 100644 --- a/docs/validation/rcwa/wall-resolution.md +++ b/docs/validation/rcwa/wall-resolution.md @@ -222,6 +222,39 @@ fmmax 1.7.1 (MIT) solved five dielectric scenes -- a circle at theta 20 deg (p, - **The comparison as first set up did not meet its criterion, because of its input.** It gave fmmax a pixel grid whose boundary pixels mixed the two permittivities by area. fmmax forms the inverse-permittivity coefficients from the reciprocal of the array it is given, and the reciprocal of an area-weighted permittivity misstates `1/eps` on those pixels (0.075 against 0.54 at half fill). Its `R` then moved as one over the grid -- by 3.0e-4 from 400 to 3200 pixels on the circle at theta 20 deg, p, at 800 terms -- and the matched solve was 0.44 to 1.10% from it in seven of eight rows. Giving fmmax the pixels' mean of `1/eps` instead holds its `R` within 4e-7 over the same grids. - The exact-coefficient comparison was made after that first result was seen, so the criterion written before measuring is recorded as not met. +(wall-resolution-spurious)= +## Strong stretches: spurious layer modes and the exceptional-point handling + +A strong stretch is reported in the literature to add spurious layer modes that move away as the order rises. The solver was run unchanged, with each layer's eigenvalues `w = q**2` read through a wrapper. The scenes were seven layers in the 400 nm cell at 900 nm: + +- a 200 nm box and a circle of radius 100 nm; +- permittivity 12.25 or -20+1.5j; +- normal incidence and 20 deg. + +Each scene was solved at orders 4 to 16 and slopes `G` from 0.1 to 0.005, and by the default solve at the same orders. The criteria were written before measuring. Where a reading was added after the first results, it says so. + +- **Uniform media, where the answer is exact.** In the stretched coordinates a uniform medium's modes are the plane waves, `w = kx**2 + ky**2 - eps`. The stretched uniform media of permittivity 1, 2.25 and 12.25, on all seven coordinate systems, were compared with them. + - No part of the spectrum held more computed values than plane waves, at any order or slope. + - Within `|w| <= 50` -- the modes that still carry a field across a 150 nm layer at 900 nm -- the largest relative error was 3 to 5% at order 8, 4e-4 at order 12 and 3e-6 at order 16, nearly the same at every slope. + - The criterion written first asked for 1e-3 up to the plane wave of order `N/2`. It is not met at any order, for example 64 of 98 values at order 8 and `G` 0.02. Those are high-order plane waves computed less accurately; the extra values a spurious mode would add were not found. The two readings that separate these, the count and the band, were added after the first results. +- **Patterned layers.** + - At `G` 0.02, no layer had more roots with `Im w > 0` within `|w| <= 50` than the default solve at the same order. Such a root grows along `z` in a passive layer. At `G` 0.01 and 0.005, four of the seventy comparisons had one to four more. + - In the lossless layers every such root, stretched or not, had its conjugate among the roots: a complex-mode pair, which carries no net power. `1 - R - T` stayed within 8e-13 of zero. + - In the metal layers the absorption was positive. + - The ten least-attenuated modes of a metal layer converged faster with the stretch. From order 12 to 16, 10 of 10 agreed to 1e-2 at `G` 0.02 on the box, against 2 of 10 for Li. On the circle it was 8 at `G` 0.02 and 10 at 0.01, against 6 for NVF. +- **The exceptional-point handling.** + - On the 30 scenes measured for {ref}`the finite-element table beyond normal incidence ` (its slabs and blocks included), at orders 8, 12 and 16, `exceptional_points='rebuild'` and `'off'` gave the same `R` and `T` to 6.7e-16. The criterion was 1e-9. A pair was rebuilt in two of the 90 solves. + - On the 69 points of the sweeps below where the stretched solve rebuilt a pair or a cluster, the two agreed to 7.7e-11. +- **Wavelength sweeps.** Three cases at 20 deg, p: the metal box, the metal circle and the dielectric box. Each ran from 550 to 1100 nm every 4 nm, at `G` 0.02 at orders 8 and 12, and by the default solve at order 12. + - Nothing was refused. + - No point departed by more than 1e-3 from a quadratic fit through its six neighbours unless the default solve and the other order's sweep showed it too, as the sharp guided resonances at 562 to 622 nm and 710 to 762 nm do. + - The step was planned at 2 nm. A feature narrower than about 4 nm can have been missed. +- **Three warnings that did not change the answer.** The stretched solve raised `ExceptionalPointWarning` ("a 2D layer holds three or more modes of one defective eigenvalue cluster ... that no rebuild takes exactly") at three points of the sweeps. The default solve raised none on them. + - The three points were 846 nm on both boxes at order 8, and 654 nm on the dielectric box at order 12. + - The warnings came from the stretched air half-spaces, not the patterned layer. + - At each point `R` was the same to the bit with the handling off. It lay within 7e-6 of the line through the solves 0.5 nm either side, which differ from each other by 3e-4 to 4e-3. It differed from the other order's value by what the neighbouring wavelengths differ by. + - The cluster's exact cause was not traced. + ## Not measured - A reference at phi other than 0; for circles and ellipses, a reference with a shape away from the cell's centre; for the ellipse, a second angle, a substrate or two layers; a second reference on a substrate. A finer finite-element level for the eight weak rows above. @@ -229,4 +262,4 @@ fmmax 1.7.1 (MIT) solved five dielectric scenes -- a circle at theta 20 deg (p, - Layers with more than two walls along an axis against a reference. A uniform slab through four unevenly placed walls reads the right `R` to 1e-5. - A second mesh level for five of the seven references. - Single precision; `jax.jit`, `jax.vmap` and gradients, which are refused. -- The interaction with the exceptional-point handling: a strong stretch is reported in the literature to add spurious layer modes that move away as the order rises, and none was looked for. +- Spurious modes at slopes below 0.005 or orders above 16; wavelength features narrower than about 4 nm; the cause of the three warnings above.