Repository navigation
Conversation
…oynting-flux power
…oup_delay_and_dispersion
…zation in AnisotropicRCWA
…ky in IsotropicRCWA
…n AnisotropicTransferMatrix
…ossy flux in AnisotropicRCWA
… and clarify SimpleJoint
… plateaus, and LC solve_bvp
…t passivity/swap symmetry
…in AnisotropicTransferMatrix
…0_known interpolation, and uniform RCWA kx shift
…re references in README
…ion before Development
…d fix RCWA/overlap/input edge cases
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.
Summary
This PR resolves 24 runtime, physics/math, API, and script bugs across
EMpyand updates dependency floors for modern NumPy/SciPy/Matplotlib compatibility.Dependencies
pyproject.toml/uv.lock(numpy>=2.1,scipy>=1.13,matplotlib>=3.8.4).Runtime & Python 3 Compatibility Fixes
devices.py/FMM.py: FixEtalon,SWG, andFMM1d/FMM2druntime crashes; fixFMMMode1dy.plot,FMMMode2d.TEfrac_old, andFMMMode2d.plot.utils.py/geometries.py: Convert 1D refractive index arrays to scalars where expected; use integer division for slice indices; inferGenericDevicedimension fromT; repairfind_peaksindexing and Python 3 sorting; support Python 3sliceindexing onMultilayer; guardLiquidCrystalCell(nlayers < 3), short-circuitvoltage == 0, and raise a clearImportErrorifscikits.bvp1lgis missing.FD.py/FMM.py: FixFDMode.overlapgrid alignment andFMMMode2d.overlapsignature.RCWA.py: FixIsotropicRCWAill-conditionedkxperturbation and missingraise.scripts/FDTD.py/examples/ex_modesolver_2.py: Fix monitor formatting, shell spacing, integer array parsing,overlap_fdystep, andEMpy.utils.CrossSectiontypo.Physics, Mathematical & Algorithmic Fixes
AnisotropicTransferMatrix.solve(transfer_matrix.py): Add analytical isotropic root fast-path and physics-based forward/backward root classification (fixing TIR double-root noise), compute all 4 eigenmodes via SVD nullspace for non-degenerate anisotropic layers, and computeRandTvia exactFMM.py: Checkslices[-1].boundary.xrightinstead ofxleftincreaTeThSeSh; transpose fields passed tointerp2inFMMMode2d.get_fields_for_FDTD; allocate complexDeltainFMMshootingandFMMshootingTM.RCWA.py: Handle evanescent/negative-discriminant roots cleanly indispersion_relation_ordinaryanddispersion_relation_extraordinary(includingC[1] != 0), alignphidocstring withxz-planeK, and support isotropic/x-uniaxialAnisotropicMaterialend layers inAnisotropicRCWA.SymmetricDoubleGrating(utils.py): Place ridges with symmetric spacer width(1 - f1 - f2) / 2instead of zero gap.rix2losses(utils.py): Align absorption sign (alpha = -4 * pi * imag(n) / wl) with EMpy'sn = nr - 1j * kconvention.SVFDModeSolver(FD.py): Map'S'/'A'magnetic-field boundary symmetry signs separately forExvsEy/scalar, matchingVFDModeSolver.API & State-Mutation Fixes
transfer_matrix.py: Support scalarwlsvianp.atleast_1din bothIsotropicTransferMatrixandAnisotropicTransferMatrix.materials.py/scattering.py: EvaluateEpsilonTensorepsilon_tensor_knownacross multi-wavelength arrays and remove mutable default arguments.devices.py: Avoid in-place mutation ofself.Kandself.linT_TCRR.solveandT_CTCRR.solve.scattering.py: Normalizestackinput shapes, validatecurrentsScatteringKottlerinputs withValueError, support 1D/2DdS, and guardR == 0self-terms.Verification
pytest -q: 46 passed (including new unit tests for Fresnel/TIR energy conservation, birefringent mode coupling, dispersion relations, double-grating Fourier quadrature,SVFDModeSolversymmetry, and loss round-trips).black,flake8,pyflakes, andmypy: all pass cleanly.