You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
y_boundary='periodic': wrap-around offset should be -(ny-1)*nx, not -(nx-1)*ny #7
With the ordering index = i + j*nx (as used for Uy's k = nx diagonal and for filling epsx), the term that
connects row j = ny-1 to row j = 0 is on diagonal -(ny-1)*nx. The two are equal only for square grids.
Test: vacuum (n = 1), both boundaries periodic, k0 = 2 pi / 1.55 um, dx = dy = 50 nm: on a 40 x 40 grid the
fundamental mode has n_eff = 1.00000, on a 40 x 10 grid n_eff = 0.83124 (should be 1). With k=-(ny-1)*nx the 40 x 10
grid gives 1.00000 and the next plane-wave order 0.63294 as expected.
I found this while testing physverify, a small verification tool I'm working on, against public codes. The tests and this write-up were done with help from an AI assistant; the numbers come from actually running the code.
Activity