wavebit 0.0.1__tar.gz → 0.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (274) hide show
  1. wavebit-0.0.2/LICENSE +311 -0
  2. wavebit-0.0.2/LICENSE.fmmax +21 -0
  3. wavebit-0.0.2/LICENSE.meent +21 -0
  4. wavebit-0.0.2/PKG-INFO +184 -0
  5. wavebit-0.0.2/README.md +147 -0
  6. wavebit-0.0.2/pyproject.toml +169 -0
  7. wavebit-0.0.2/setup.cfg +4 -0
  8. wavebit-0.0.2/src/wavebit/__init__.py +28 -0
  9. wavebit-0.0.2/src/wavebit/_common/__init__.py +1 -0
  10. wavebit-0.0.2/src/wavebit/_common/backend.py +1866 -0
  11. wavebit-0.0.2/src/wavebit/_common/conventions.py +1808 -0
  12. wavebit-0.0.2/src/wavebit/_common/declarations.py +336 -0
  13. wavebit-0.0.2/src/wavebit/_common/enums.py +47 -0
  14. wavebit-0.0.2/src/wavebit/_common/execution.py +96 -0
  15. wavebit-0.0.2/src/wavebit/_common/geometry/__init__.py +1 -0
  16. wavebit-0.0.2/src/wavebit/_common/geometry/clipper.py +495 -0
  17. wavebit-0.0.2/src/wavebit/_common/geometry/interfaces.py +217 -0
  18. wavebit-0.0.2/src/wavebit/_common/geometry/overlap.py +688 -0
  19. wavebit-0.0.2/src/wavebit/_common/geometry/periodic.py +18 -0
  20. wavebit-0.0.2/src/wavebit/_common/geometry/polygon.py +377 -0
  21. wavebit-0.0.2/src/wavebit/_common/geometry/recipes.py +322 -0
  22. wavebit-0.0.2/src/wavebit/_common/names.py +153 -0
  23. wavebit-0.0.2/src/wavebit/_common/periodic.py +473 -0
  24. wavebit-0.0.2/src/wavebit/_common/provenance.py +98 -0
  25. wavebit-0.0.2/src/wavebit/_common/pytrees.py +70 -0
  26. wavebit-0.0.2/src/wavebit/_common/record_io.py +161 -0
  27. wavebit-0.0.2/src/wavebit/_common/validation.py +57 -0
  28. wavebit-0.0.2/src/wavebit/compat/__init__.py +1 -0
  29. wavebit-0.0.2/src/wavebit/compat/_jobs_v1.py +1170 -0
  30. wavebit-0.0.2/src/wavebit/compat/legacy.py +219 -0
  31. wavebit-0.0.2/src/wavebit/data/filmetrics/Al2O3.txt +57 -0
  32. wavebit-0.0.2/src/wavebit/data/filmetrics/Si.txt +241 -0
  33. wavebit-0.0.2/src/wavebit/data/filmetrics/Si3N4.txt +234 -0
  34. wavebit-0.0.2/src/wavebit/data/filmetrics/SiO2.txt +280 -0
  35. wavebit-0.0.2/src/wavebit/errors.py +38 -0
  36. wavebit-0.0.2/src/wavebit/fdtd/__init__.py +14 -0
  37. wavebit-0.0.2/src/wavebit/fdtd/_api.py +225 -0
  38. wavebit-0.0.2/src/wavebit/fdtd/_assemble.py +996 -0
  39. wavebit-0.0.2/src/wavebit/fdtd/_decay.py +315 -0
  40. wavebit-0.0.2/src/wavebit/fdtd/_execution.py +262 -0
  41. wavebit-0.0.2/src/wavebit/fdtd/_kernel/__init__.py +18 -0
  42. wavebit-0.0.2/src/wavebit/fdtd/_kernel/constitutive.py +104 -0
  43. wavebit-0.0.2/src/wavebit/fdtd/_kernel/constitutive_absorber.py +70 -0
  44. wavebit-0.0.2/src/wavebit/fdtd/_kernel/cpml.py +187 -0
  45. wavebit-0.0.2/src/wavebit/fdtd/_kernel/curl.py +81 -0
  46. wavebit-0.0.2/src/wavebit/fdtd/_kernel/faces.py +227 -0
  47. wavebit-0.0.2/src/wavebit/fdtd/_kernel/grid.py +92 -0
  48. wavebit-0.0.2/src/wavebit/fdtd/_kernel/masks.py +105 -0
  49. wavebit-0.0.2/src/wavebit/fdtd/_kernel/observe.py +677 -0
  50. wavebit-0.0.2/src/wavebit/fdtd/_kernel/poles.py +102 -0
  51. wavebit-0.0.2/src/wavebit/fdtd/_kernel/sources.py +547 -0
  52. wavebit-0.0.2/src/wavebit/fdtd/_kernel/stencil.py +98 -0
  53. wavebit-0.0.2/src/wavebit/fdtd/_kernel/step.py +151 -0
  54. wavebit-0.0.2/src/wavebit/fdtd/_legacy.py +414 -0
  55. wavebit-0.0.2/src/wavebit/fdtd/_legacy_boundaries.py +599 -0
  56. wavebit-0.0.2/src/wavebit/fdtd/_legacy_geometry.py +1599 -0
  57. wavebit-0.0.2/src/wavebit/fdtd/_legacy_monitors.py +375 -0
  58. wavebit-0.0.2/src/wavebit/fdtd/_legacy_sources.py +621 -0
  59. wavebit-0.0.2/src/wavebit/fdtd/_lower_public.py +225 -0
  60. wavebit-0.0.2/src/wavebit/fdtd/_periodic/__init__.py +1 -0
  61. wavebit-0.0.2/src/wavebit/fdtd/_periodic/adapter.py +214 -0
  62. wavebit-0.0.2/src/wavebit/fdtd/_periodic/api.py +109 -0
  63. wavebit-0.0.2/src/wavebit/fdtd/_periodic/frequency_monitor.py +100 -0
  64. wavebit-0.0.2/src/wavebit/fdtd/_periodic/grid.py +491 -0
  65. wavebit-0.0.2/src/wavebit/fdtd/_periodic/legacy.py +2802 -0
  66. wavebit-0.0.2/src/wavebit/fdtd/_periodic/plotting.py +162 -0
  67. wavebit-0.0.2/src/wavebit/fdtd/_periodic/probes.py +249 -0
  68. wavebit-0.0.2/src/wavebit/fdtd/_periodic/runtime.py +381 -0
  69. wavebit-0.0.2/src/wavebit/fdtd/_periodic/scene.py +2116 -0
  70. wavebit-0.0.2/src/wavebit/fdtd/_post.py +722 -0
  71. wavebit-0.0.2/src/wavebit/fdtd/_prepare/__init__.py +12 -0
  72. wavebit-0.0.2/src/wavebit/fdtd/_prepare/checks.py +2863 -0
  73. wavebit-0.0.2/src/wavebit/fdtd/_prepare/coefficients.py +597 -0
  74. wavebit-0.0.2/src/wavebit/fdtd/_prepare/conductive_film.py +269 -0
  75. wavebit-0.0.2/src/wavebit/fdtd/_prepare/conductive_stack.py +358 -0
  76. wavebit-0.0.2/src/wavebit/fdtd/_prepare/constitutive.py +430 -0
  77. wavebit-0.0.2/src/wavebit/fdtd/_prepare/constitutive_absorber.py +254 -0
  78. wavebit-0.0.2/src/wavebit/fdtd/_prepare/cpml.py +347 -0
  79. wavebit-0.0.2/src/wavebit/fdtd/_prepare/debye_film.py +265 -0
  80. wavebit-0.0.2/src/wavebit/fdtd/_prepare/debye_resolution.py +161 -0
  81. wavebit-0.0.2/src/wavebit/fdtd/_prepare/debye_stack.py +438 -0
  82. wavebit-0.0.2/src/wavebit/fdtd/_prepare/debye_sum_film.py +349 -0
  83. wavebit-0.0.2/src/wavebit/fdtd/_prepare/debye_sum_resolution.py +168 -0
  84. wavebit-0.0.2/src/wavebit/fdtd/_prepare/fields.py +79 -0
  85. wavebit-0.0.2/src/wavebit/fdtd/_prepare/grazing.py +1005 -0
  86. wavebit-0.0.2/src/wavebit/fdtd/_prepare/hybrid_film.py +441 -0
  87. wavebit-0.0.2/src/wavebit/fdtd/_prepare/hybrid_resolution.py +227 -0
  88. wavebit-0.0.2/src/wavebit/fdtd/_prepare/junction.py +521 -0
  89. wavebit-0.0.2/src/wavebit/fdtd/_prepare/layer_return.py +251 -0
  90. wavebit-0.0.2/src/wavebit/fdtd/_prepare/monitors.py +637 -0
  91. wavebit-0.0.2/src/wavebit/fdtd/_prepare/occupancy.py +171 -0
  92. wavebit-0.0.2/src/wavebit/fdtd/_prepare/oscillator_stack.py +378 -0
  93. wavebit-0.0.2/src/wavebit/fdtd/_prepare/oscillator_sum_film.py +320 -0
  94. wavebit-0.0.2/src/wavebit/fdtd/_prepare/oscillator_sum_resolution.py +209 -0
  95. wavebit-0.0.2/src/wavebit/fdtd/_prepare/params.py +576 -0
  96. wavebit-0.0.2/src/wavebit/fdtd/_prepare/plan.py +545 -0
  97. wavebit-0.0.2/src/wavebit/fdtd/_prepare/report.py +327 -0
  98. wavebit-0.0.2/src/wavebit/fdtd/_prepare/shape_ranges.py +849 -0
  99. wavebit-0.0.2/src/wavebit/fdtd/_prepare/single_pole_film.py +290 -0
  100. wavebit-0.0.2/src/wavebit/fdtd/_prepare/single_pole_resolution.py +171 -0
  101. wavebit-0.0.2/src/wavebit/fdtd/_prepare/sources.py +766 -0
  102. wavebit-0.0.2/src/wavebit/fdtd/_prepare/stars.py +489 -0
  103. wavebit-0.0.2/src/wavebit/fdtd/_prepare/stencil.py +1214 -0
  104. wavebit-0.0.2/src/wavebit/fdtd/_prepare/triplet.py +158 -0
  105. wavebit-0.0.2/src/wavebit/fdtd/_prepare/two_debye_film.py +357 -0
  106. wavebit-0.0.2/src/wavebit/fdtd/_prepare/two_debye_resolution.py +162 -0
  107. wavebit-0.0.2/src/wavebit/fdtd/_radiation.py +184 -0
  108. wavebit-0.0.2/src/wavebit/fdtd/_runtime.py +836 -0
  109. wavebit-0.0.2/src/wavebit/fdtd/_scene.py +331 -0
  110. wavebit-0.0.2/src/wavebit/fdtd/_shapes/__init__.py +110 -0
  111. wavebit-0.0.2/src/wavebit/fdtd/_shapes/_bodies.py +2096 -0
  112. wavebit-0.0.2/src/wavebit/fdtd/_shapes/_cut.py +761 -0
  113. wavebit-0.0.2/src/wavebit/fdtd/_shapes/_exact.py +508 -0
  114. wavebit-0.0.2/src/wavebit/fdtd/_shapes/_occupancy.py +198 -0
  115. wavebit-0.0.2/src/wavebit/fdtd/_spelling.py +134 -0
  116. wavebit-0.0.2/src/wavebit/fdtd/_structure.py +7 -0
  117. wavebit-0.0.2/src/wavebit/fdtd/_testing.py +70 -0
  118. wavebit-0.0.2/src/wavebit/fdtd/boundaries.py +80 -0
  119. wavebit-0.0.2/src/wavebit/fdtd/diagnostics.py +146 -0
  120. wavebit-0.0.2/src/wavebit/fdtd/geometry.py +62 -0
  121. wavebit-0.0.2/src/wavebit/fdtd/monitors.py +71 -0
  122. wavebit-0.0.2/src/wavebit/fdtd/numerics.py +50 -0
  123. wavebit-0.0.2/src/wavebit/fdtd/problem.py +47 -0
  124. wavebit-0.0.2/src/wavebit/fdtd/result.py +195 -0
  125. wavebit-0.0.2/src/wavebit/fdtd/results.py +358 -0
  126. wavebit-0.0.2/src/wavebit/fdtd/sources.py +70 -0
  127. wavebit-0.0.2/src/wavebit/jobs.py +227 -0
  128. wavebit-0.0.2/src/wavebit/lattice.py +883 -0
  129. wavebit-0.0.2/src/wavebit/manifest.py +886 -0
  130. wavebit-0.0.2/src/wavebit/materials/__init__.py +5 -0
  131. wavebit-0.0.2/src/wavebit/materials/_lower.py +41 -0
  132. wavebit-0.0.2/src/wavebit/materials/catalog.py +83 -0
  133. wavebit-0.0.2/src/wavebit/materials/models.py +282 -0
  134. wavebit-0.0.2/src/wavebit/materials/response.py +410 -0
  135. wavebit-0.0.2/src/wavebit/materials/tabulated.py +224 -0
  136. wavebit-0.0.2/src/wavebit/materials/tensors.py +75 -0
  137. wavebit-0.0.2/src/wavebit/materials/time_domain.py +556 -0
  138. wavebit-0.0.2/src/wavebit/observations/__init__.py +4 -0
  139. wavebit-0.0.2/src/wavebit/observations/_field_access.py +29 -0
  140. wavebit-0.0.2/src/wavebit/observations/_jax.py +15 -0
  141. wavebit-0.0.2/src/wavebit/observations/contracts.py +146 -0
  142. wavebit-0.0.2/src/wavebit/observations/diffraction.py +336 -0
  143. wavebit-0.0.2/src/wavebit/observations/fields.py +48 -0
  144. wavebit-0.0.2/src/wavebit/observations/power.py +97 -0
  145. wavebit-0.0.2/src/wavebit/rcwa/__init__.py +10 -0
  146. wavebit-0.0.2/src/wavebit/rcwa/_adapt.py +312 -0
  147. wavebit-0.0.2/src/wavebit/rcwa/_backends/__init__.py +6 -0
  148. wavebit-0.0.2/src/wavebit/rcwa/_backends/jax_backend.py +877 -0
  149. wavebit-0.0.2/src/wavebit/rcwa/_backends/numpy_backend.py +69 -0
  150. wavebit-0.0.2/src/wavebit/rcwa/_backends/torch_backend.py +131 -0
  151. wavebit-0.0.2/src/wavebit/rcwa/_engine/__init__.py +1 -0
  152. wavebit-0.0.2/src/wavebit/rcwa/_engine/anisotropy.py +420 -0
  153. wavebit-0.0.2/src/wavebit/rcwa/_engine/boundary.py +1228 -0
  154. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/__init__.py +347 -0
  155. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/affine_cell.py +266 -0
  156. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/affine_profile.py +177 -0
  157. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/cartesian_pair.py +517 -0
  158. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/cartesian_pair_corner_galerkin.py +192 -0
  159. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/cartesian_pair_galerkin.py +389 -0
  160. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/cartesian_pair_gap.py +303 -0
  161. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/cartesian_pair_gap_autodiff.py +407 -0
  162. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/cartesian_pair_normal_frame.py +279 -0
  163. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/cartesian_pair_opening.py +626 -0
  164. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/cartesian_pair_polynomial_galerkin.py +132 -0
  165. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/cartesian_pair_quadratic.py +373 -0
  166. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/cartesian_pair_seam_galerkin.py +632 -0
  167. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/cartesian_pair_transmission_galerkin.py +98 -0
  168. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/cartesian_rectangle.py +442 -0
  169. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/continuous_flux.py +442 -0
  170. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/equilibrated_flux.py +72 -0
  171. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/galerkin_error.py +282 -0
  172. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/material_grading.py +111 -0
  173. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/material_sector.py +54 -0
  174. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_balanced_response.py +29 -0
  175. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_complete_solve.py +66 -0
  176. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_complex_exponential.py +50 -0
  177. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_complex_precision.py +68 -0
  178. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_contact_energy.py +103 -0
  179. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_contact_energy_precision.py +79 -0
  180. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_contact_fourier.py +28 -0
  181. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_contact_normal_mean.py +107 -0
  182. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_contact_normal_precision.py +112 -0
  183. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_contact_precision.py +242 -0
  184. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_contact_quadrature.py +142 -0
  185. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_contact_refinement.py +33 -0
  186. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_contact_retained.py +82 -0
  187. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_corner_assembly.py +126 -0
  188. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_corner_common_precision.py +135 -0
  189. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_corner_contact.py +227 -0
  190. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_corner_coordinates.py +105 -0
  191. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_corner_fields.py +257 -0
  192. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_corner_partition.py +233 -0
  193. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_corner_positive.py +154 -0
  194. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_corner_precision.py +136 -0
  195. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_corner_prefactors.py +85 -0
  196. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_corner_quadrature.py +90 -0
  197. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_extended_precision.py +170 -0
  198. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_junction_partition.py +231 -0
  199. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_junction_quadrature.py +115 -0
  200. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_junction_thin_partition.py +122 -0
  201. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_junction_transport.py +61 -0
  202. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_oscillatory_coefficients.py +40 -0
  203. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_oscillatory_fields.py +193 -0
  204. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_oscillatory_polynomials.py +93 -0
  205. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_oscillatory_radial.py +157 -0
  206. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_oscillatory_scalar.py +164 -0
  207. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_positive_energy_precision.py +38 -0
  208. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_positive_fields.py +100 -0
  209. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_positive_precision.py +113 -0
  210. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_positive_refinement.py +120 -0
  211. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_radial_fields.py +68 -0
  212. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_radial_powers.py +58 -0
  213. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_residual_arithmetic.py +218 -0
  214. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_symmetric_mesh.py +95 -0
  215. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_transmission_common_precision.py +113 -0
  216. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_transmission_extended_precision.py +178 -0
  217. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_transmission_fields.py +114 -0
  218. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_transmission_mode_precision.py +87 -0
  219. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/pair_transmission_modes.py +120 -0
  220. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/partitioned_gap.py +266 -0
  221. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/periodic_rectangle_galerkin.py +125 -0
  222. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/periodic_seam_galerkin.py +332 -0
  223. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/periodic_seam_trace.py +262 -0
  224. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/polynomial_body.py +124 -0
  225. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/polynomial_pair_trace.py +190 -0
  226. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/projected_pair_contact.py +136 -0
  227. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/projected_pair_positive.py +88 -0
  228. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/real_trace_coupling.py +380 -0
  229. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/thin_gap.py +225 -0
  230. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/triangle_exponential_precision.py +47 -0
  231. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/triangle_moments.py +111 -0
  232. wavebit-0.0.2/src/wavebit/rcwa/_engine/conforming/triangle_polynomials.py +84 -0
  233. wavebit-0.0.2/src/wavebit/rcwa/_engine/engine.py +6201 -0
  234. wavebit-0.0.2/src/wavebit/rcwa/_engine/enums.py +462 -0
  235. wavebit-0.0.2/src/wavebit/rcwa/_engine/factorization.py +2910 -0
  236. wavebit-0.0.2/src/wavebit/rcwa/_engine/field_result.py +430 -0
  237. wavebit-0.0.2/src/wavebit/rcwa/_engine/fields.py +942 -0
  238. wavebit-0.0.2/src/wavebit/rcwa/_engine/geometry.py +219 -0
  239. wavebit-0.0.2/src/wavebit/rcwa/_engine/illumination.py +671 -0
  240. wavebit-0.0.2/src/wavebit/rcwa/_engine/modal_gradient.py +820 -0
  241. wavebit-0.0.2/src/wavebit/rcwa/_engine/normal_methods.py +1139 -0
  242. wavebit-0.0.2/src/wavebit/rcwa/_engine/parametric.py +2904 -0
  243. wavebit-0.0.2/src/wavebit/rcwa/_engine/passive_nvf.py +64 -0
  244. wavebit-0.0.2/src/wavebit/rcwa/_engine/rectilinear.py +145 -0
  245. wavebit-0.0.2/src/wavebit/rcwa/_engine/scattering.py +1222 -0
  246. wavebit-0.0.2/src/wavebit/rcwa/_engine/solve_1d.py +1532 -0
  247. wavebit-0.0.2/src/wavebit/rcwa/_engine/solve_2d.py +1045 -0
  248. wavebit-0.0.2/src/wavebit/rcwa/_engine/solve_2d_first_order.py +1238 -0
  249. wavebit-0.0.2/src/wavebit/rcwa/_engine/source_expansion.py +187 -0
  250. wavebit-0.0.2/src/wavebit/rcwa/_engine/sources.py +168 -0
  251. wavebit-0.0.2/src/wavebit/rcwa/_engine/tensor_li.py +178 -0
  252. wavebit-0.0.2/src/wavebit/rcwa/_engine/tensor_shapes.py +524 -0
  253. wavebit-0.0.2/src/wavebit/rcwa/_factory.py +60 -0
  254. wavebit-0.0.2/src/wavebit/rcwa/_lifecycle.py +299 -0
  255. wavebit-0.0.2/src/wavebit/rcwa/experimental/__init__.py +18 -0
  256. wavebit-0.0.2/src/wavebit/rcwa/numerics.py +50 -0
  257. wavebit-0.0.2/src/wavebit/rcwa/operators.py +156 -0
  258. wavebit-0.0.2/src/wavebit/rcwa/plotting.py +540 -0
  259. wavebit-0.0.2/src/wavebit/rcwa/problem.py +240 -0
  260. wavebit-0.0.2/src/wavebit/rcwa/results.py +297 -0
  261. wavebit-0.0.2/src/wavebit/rcwa/sources.py +112 -0
  262. wavebit-0.0.2/src/wavebit/records.py +263 -0
  263. wavebit-0.0.2/src/wavebit/units.py +50 -0
  264. wavebit-0.0.2/src/wavebit.egg-info/PKG-INFO +184 -0
  265. wavebit-0.0.2/src/wavebit.egg-info/SOURCES.txt +266 -0
  266. wavebit-0.0.2/src/wavebit.egg-info/dependency_links.txt +1 -0
  267. wavebit-0.0.2/src/wavebit.egg-info/requires.txt +27 -0
  268. wavebit-0.0.2/src/wavebit.egg-info/top_level.txt +1 -0
  269. wavebit-0.0.1/.gitignore +0 -3
  270. wavebit-0.0.1/PKG-INFO +0 -21
  271. wavebit-0.0.1/README.md +0 -7
  272. wavebit-0.0.1/publish.yml.example +0 -33
  273. wavebit-0.0.1/pyproject.toml +0 -21
  274. wavebit-0.0.1/src/wavebit/__init__.py +0 -7
wavebit-0.0.2/LICENSE ADDED
@@ -0,0 +1,311 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2026 FieldAlgo
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
191
+
192
+ ---
193
+ This software is derived from 'meent' (https://github.com/kc-ml2/meent),
194
+ Copyright (c) 2022 ML2, originally licensed under the MIT License.
195
+ The MIT License requires that its copyright notice and permission notice
196
+ be retained; both are reproduced in full in the file LICENSE.meent.
197
+
198
+ ---
199
+ This software also contains code ported from 'fmmax'
200
+ (https://github.com/facebookresearch/fmmax), Copyright (c) 2023 Meta Research,
201
+ licensed under the MIT License: the eigendecomposition gradient in
202
+ src/wavebit/_common/backend.py is a port of `_eig_bwd` from that project's
203
+ src/fmmax/utils.py. The MIT License requires that its copyright notice and
204
+ permission notice be retained; both are reproduced in full in the file
205
+ LICENSE.fmmax.
206
+
207
+ fmmax's maintained fork (https://github.com/invrs-io/fmmax) carries the same
208
+ function in src/fmmax/eig.py and re-states its copyright as 'Copyright: 2025
209
+ invrs.io LLC', under the same MIT terms. Which of the two the port was taken
210
+ from is not recorded, so both notices are stated here. LICENSE.fmmax itself is
211
+ kept as the verbatim upstream text and nothing else, so that licence scanners
212
+ identify it as MIT -- a note appended there is 29% of MIT's short body and
213
+ drops the file below the match threshold GitHub's `licensee` uses.
214
+
215
+ ---
216
+ The Li-rule Fourier factorization of rasters in
217
+ src/wavebit/rcwa/_engine/factorization.py was rewritten on 2026-09-25 from
218
+ L. Li's published factorization rules (J. Opt. Soc. Am. A 13, 1870 (1996);
219
+ 14, 2758 (1997)): li_conv_matrices, li_conv_matrices_integrated and the
220
+ helpers written with them, the bodies of fourier2d_piecewise_constant,
221
+ fourier2d_pointwise and fourier2d_integrated, and the Li parts of
222
+ to_conv_mat_raster_sampled and to_conv_mat_raster_integrated. The implementer
223
+ of that rewrite did not consult RETICOLO's or meent's source or the bodies of
224
+ the functions it replaced. compression_indices and compress_cell were then
225
+ reimplemented by an implementer working from a written specification of what
226
+ they return, in a copy of this repository without its history or the earlier
227
+ bodies; the specification's author had seen the earlier functions and
228
+ RETICOLO's ret2li. The other Li factorizations run on the rewrite as well:
229
+ the Cartesian shape path (src/wavebit/rcwa/_engine/rectilinear.py) through
230
+ fourier2d_integrated, and the tensor path's row transform
231
+ (src/wavebit/rcwa/_engine/tensor_li.py, added 2026-09-24), which called the
232
+ earlier helpers directly until it was moved onto the rewritten series. That
233
+ move, and _row_dft, which restates the documented rule of _normalized_row_fft
234
+ (a JAX workaround added beside _fourier2d_grid on 2026-09-24 and deleted with
235
+ it), were written by an implementer working from written specifications whose
236
+ authors had seen the earlier bodies. The rewritten code still calls helpers
237
+ kept from before it, written in this repository in August 2026:
238
+ _pixel_correction, _half_pixel_phase and _inverse_axes. It also calls
239
+ _circulant_index, which came with the 2026-08-03 single-source port of
240
+ meent's dfs2d and was rewritten from its definition on 2026-09-26 by an
241
+ implementer who had not read the earlier body. The commit messages of those
242
+ dates, and of later changes, record how.
243
+
244
+ The rewritten builders' default nesting ('fixed') corresponds to the
245
+ default, parm.res1.li = 1, of 'RETICOLO', the grating software of J.P.
246
+ Hugonin and P. Lalanne (Institut d'Optique/CNRS): J.P. Hugonin and P.
247
+ Lalanne, "RETICOLO software for grating analysis", Institut d'Optique,
248
+ Orsay, France (2005), arXiv:2101.00901. Their 'symmetric' nesting
249
+ corresponds to RETICOLO's parm.res1.li = 0.
250
+
251
+ Earlier versions of those functions remain in this repository's history, with
252
+ the helpers deleted alongside them (_fourier2d_grid, _fourier1d_integrated,
253
+ _wrap and _circulant_gather); that history includes meent's own, from 2022.
254
+ The Fourier builders descend from meent's dfs2d and cfs2d, written in July
255
+ 2024 with reference to the MATLAB source of RETICOLO V9, following its
256
+ ret2li (in retcouche.m), retf.m and rettoeplitz.m; compression_indices and
257
+ compress_cell were split from meent's cell_compression (2022). meent's code
258
+ names RETICOLO elsewhere in that history too: fft_piecewise_constant was
259
+ marked "reference: reticolo" from 2023-02 to 2024-06, and a commented-out
260
+ dfs2d_debug in meent/on_numpy/emsolver/fourier_analysis.py, added on
261
+ 2024-07-19, is described as "algorithm from reticolo", as it still is in
262
+ meent's own repository (commit bae2802). Checked on 2026-09-25 against
263
+ RETICOLO's Zenodo records and the packages themselves: retcouche.m, retf.m
264
+ and rettoeplitz.m are byte-identical in V9
265
+ (https://zenodo.org/records/4419063, 2021), in its revision V9a
266
+ (https://zenodo.org/records/5905381, 2022) and in V10
267
+ (https://doi.org/10.5281/zenodo.14631951, January 2025). The V9 and V9a
268
+ records declare no licence; the V10 record states CC BY 4.0. No package
269
+ carries a licence file or licence text in its source. Each package's
270
+ documentation states "copyright (c) 2005 Institut d'Optique/CNRS" and
271
+ requires that publications and reports cite the reference above; V10's also
272
+ calls RETICOLO a freeware. The V10 record also names itself a new version
273
+ of V9 (isNewVersionOf 10.5281/zenodo.4419063).
274
+
275
+ Those earlier versions, and the meent code named above, are used under the
276
+ Creative Commons Attribution 4.0 International licence (CC BY 4.0) that the
277
+ V10 record states. They were modified: written in Python, first in meent
278
+ (https://github.com/kc-ml2/meent) and then in this repository, with
279
+ reference to RETICOLO's MATLAB source, and the earlier versions have since
280
+ been replaced by the rewrite described above. Attribution:
281
+
282
+ RETICOLO, by J.P. Hugonin and P. Lalanne
283
+ copyright (c) 2005 Institut d'Optique/CNRS
284
+ Material: https://doi.org/10.5281/zenodo.14631951
285
+ Citation: arXiv:2101.00901
286
+ Licence: CC BY 4.0, https://creativecommons.org/licenses/by/4.0/
287
+
288
+ Section 5 of that licence (Disclaimer of Warranties and Limitation of
289
+ Liability) applies to that material. RETICOLO itself is not part of this
290
+ software; the comparisons in tests/references/ call a separately installed
291
+ copy, and one bridge script, tests/references/interface/reti_aniso.m, lays
292
+ out its calls after RETICOLO's example exemple_V9_0D_anisotrope.m.
293
+ tests/references/README.md records the check.
294
+
295
+ ---
296
+ From 2022-09-20 to 2026-08-03 this repository's history carried scattering-
297
+ matrix helpers whose file header states that "many codes for scattering
298
+ matrix method are from" the 'Rigorous-Coupled-Wave-Analysis' package of
299
+ Nathan Zhao (Stanford University),
300
+ https://github.com/zhaonat/Rigorous-Coupled-Wave-Analysis, reached through
301
+ the fork https://github.com/yonghakim/zhaonat-rcwa: meent/integ/smm_util.py
302
+ and meent/integ/scattering_method.py, later fieldwave/on_numpy/,
303
+ on_jax/ and on_torch/emsolver/smm_util.py and scattering_method.py. That
304
+ package is licensed under the MIT License; its LICENSE file carries the MIT
305
+ text under a template copyright line ("Copyright (c) 2018 The Python
306
+ Packaging Authority"), checked on 2026-10-14. The MIT License requires that
307
+ its copyright notice and permission notice be retained, so this notice
308
+ records the origin for the history that still contains those files. They
309
+ were deleted on 2026-08-03 (commit 244cb819, "delete the triplicated
310
+ transfer/convolution/scattering modules") and nothing in the current tree
311
+ derives from them.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Meta Research
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 ML2
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
wavebit-0.0.2/PKG-INFO ADDED
@@ -0,0 +1,184 @@
1
+ Metadata-Version: 2.4
2
+ Name: wavebit
3
+ Version: 0.0.2
4
+ Summary: Differentiable electromagnetic simulation with RCWA and FDTD
5
+ Author-email: FieldAlgo <dev@fieldalgo.com>
6
+ License-Expression: Apache-2.0 AND MIT
7
+ Project-URL: Homepage, https://github.com/fieldalgo/wavebit
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Requires-Python: >=3.12
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ License-File: LICENSE.fmmax
13
+ License-File: LICENSE.meent
14
+ Requires-Dist: numpy>=2.5.1
15
+ Requires-Dist: scipy>=1.18
16
+ Requires-Dist: array-api-compat>=1.15
17
+ Provides-Extra: jax
18
+ Requires-Dist: jax>=0.11; extra == "jax"
19
+ Requires-Dist: jaxlib>=0.11; extra == "jax"
20
+ Requires-Dist: optax>=0.2; extra == "jax"
21
+ Requires-Dist: tqdm>=4.67; extra == "jax"
22
+ Provides-Extra: pytorch
23
+ Requires-Dist: torch>=2.13; extra == "pytorch"
24
+ Requires-Dist: tqdm>=4.67; extra == "pytorch"
25
+ Provides-Extra: docs
26
+ Requires-Dist: sphinx>=9.1; extra == "docs"
27
+ Requires-Dist: pydata-sphinx-theme>=0.21; extra == "docs"
28
+ Requires-Dist: myst-parser>=5.1; extra == "docs"
29
+ Requires-Dist: sphinx-design>=0.7; extra == "docs"
30
+ Requires-Dist: sphinx-external-toc>=1.1; extra == "docs"
31
+ Requires-Dist: sphinxcontrib-mermaid>=2.1; extra == "docs"
32
+ Provides-Extra: contour
33
+ Requires-Dist: contourpy>=1.3; extra == "contour"
34
+ Provides-Extra: plot
35
+ Requires-Dist: matplotlib>=3.10.1; extra == "plot"
36
+ Dynamic: license-file
37
+
38
+ <p align="center">
39
+ <picture>
40
+ <source media="(prefers-color-scheme: dark)" srcset="assets/branding/wavebit_logo_dark.svg">
41
+ <img src="assets/branding/wavebit_logo.svg" width="45%" alt="Wavebit">
42
+ </picture>
43
+ </p>
44
+
45
+ # Wavebit
46
+
47
+ [![tests](https://github.com/fieldalgo/wavebit/actions/workflows/tests.yml/badge.svg)](https://github.com/fieldalgo/wavebit/actions/workflows/tests.yml)
48
+ [![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)
49
+ [![python](https://img.shields.io/badge/python-3.12%2B-blue.svg)](https://www.python.org/)
50
+
51
+ **Differentiable electromagnetic simulation: RCWA and FDTD behind one API, on NumPy, JAX and PyTorch.**
52
+
53
+ Wavebit computes how light scatters from periodic nanostructures (RCWA) and how fields evolve in
54
+ time (FDTD). It differentiates through the RCWA calculation, so the model that predicts a device's
55
+ response is the model that optimizes it.
56
+
57
+ * **Two solvers, one lifecycle.** `rcwa` and `fdtd` share `check` → `prepare` → `run`, the same
58
+ materials, explicit length units, radian angles, and fields in V/m and A/m.
59
+ * **One implementation of the physics** on three array backends. Cross-backend agreement is part of
60
+ the test suite, not a promise.
61
+ * **Gradients where you need them.** Wavelength, materials, layer thicknesses and raster
62
+ permittivities differentiate on JAX and PyTorch; shape dimensions on PyTorch. The full table is in
63
+ the [differentiation guide](docs/guide/common/autodiff.md#rcwa-which-inputs-differentiate-on-which-backend).
64
+ * **Checked against the outside world.** RETICOLO, fmmax and S4 for RCWA; Meep for FDTD; the Li (1997)
65
+ crossed-grating benchmark. The numbers and how they were taken: [validation](docs/validation/index.md).
66
+
67
+ **Status: 0.0.2, alpha.** RCWA is the mature path. FDTD runs on CPU in double precision; its geometry,
68
+ material and derivative support is reported by `check` for each problem. The API may change before
69
+ 1.0. An experimental RCWA solver for metal contacts is opt-in and has its own, narrower scope; read
70
+ [method selection](docs/guide/rcwa/nvf-method-selection.md) before enabling it.
71
+
72
+ ## Install
73
+
74
+ Python 3.12 or newer.
75
+
76
+ ```shell
77
+ pip install wavebit # NumPy backend
78
+ pip install 'wavebit[jax]' # or 'wavebit[pytorch]', or 'wavebit[jax,pytorch]' — differentiation backends
79
+ ```
80
+
81
+ From a source checkout, for development:
82
+
83
+ ```shell
84
+ git clone https://github.com/fieldalgo/wavebit.git && cd wavebit
85
+ pip install -e '.[jax,docs]' # editable, with the documentation toolchain
86
+ ```
87
+
88
+ `environment.yml` builds the full development environment, including what the studies need. The
89
+ version floors in [`pyproject.toml`](pyproject.toml) are the versions the suite is verified against;
90
+ each is commented with the reason it sits where it does.
91
+
92
+ ## Quickstart
93
+
94
+ A binary grating on glass under normal incidence, on the NumPy backend:
95
+
96
+ ```python
97
+ import numpy as np
98
+ from wavebit import Material, Units, rcwa
99
+
100
+ problem = rcwa.Problem(
101
+ units=Units(length="nm"),
102
+ stack=rcwa.Stack(
103
+ period=(700., 700.),
104
+ bottom=Material(epsilon=2.25),
105
+ layers=(rcwa.Layer(thickness=300., epsilon=np.array([[1., 1., 12.25, 12.25]])),),
106
+ ),
107
+ excitation=rcwa.Excitation(wavelength=900., sources=(rcwa.PlaneWave(polarization="s"),)),
108
+ )
109
+ numerics = rcwa.Numerics(orders=(10, 0))
110
+ result = rcwa.run(problem, numerics=numerics)
111
+ print(float(result.R.sum()), float(result.T.sum()))
112
+ print(result.transmission.order(0, 0).efficiency)
113
+ ```
114
+
115
+ Diffraction arrays keep `(wavelength, order_v, order_u)` axes even for a single wavelength. `R` and
116
+ `T` are efficiencies; absolute port power and its integration measure are recorded separately.
117
+
118
+ To differentiate, prepare once and run with live leaves. JAX double precision is enabled by you,
119
+ never by importing Wavebit:
120
+
121
+ ```python
122
+ import jax, jax.numpy as jnp
123
+ jax.config.update("jax_enable_x64", True)
124
+
125
+ prepared = rcwa.prepare(problem, numerics=numerics, backend="jax")
126
+
127
+ def transmitted(thickness):
128
+ layer = problem.stack.layers[0].replace(thickness=thickness)
129
+ live = problem.replace(stack=problem.stack.replace(layers=(layer,)))
130
+ return jnp.sum(prepared.run(live).T)
131
+
132
+ gradient = jax.grad(transmitted)(jnp.asarray(300.))
133
+ ```
134
+
135
+ The FDTD entry point works the same way; [`examples/fdtd/pulse_slab.py`](examples/fdtd/pulse_slab.py)
136
+ is the first thing to run. The conventions both solvers follow — relative permittivity,
137
+ `exp(-iωt)` phasors, bottom-to-top layers, centered cells, explicit units — are listed once in the
138
+ [documentation home](docs/index.md#seven-conventions-to-check) and defined normatively in
139
+ [`docs/reference/common/conventions.md`](docs/reference/common/conventions.md).
140
+
141
+ ## Documentation
142
+
143
+ The prose is split by who is reading, the way NumPy's manual is:
144
+
145
+ | | For a reader who |
146
+ | --- | --- |
147
+ | [`docs/guide/`](docs/guide) | needs the contract for one keyword: the manual |
148
+ | [`docs/reference/`](docs/reference) | needs a signature or a guarantee |
149
+ | [`docs/design/`](docs/design), [`docs/development/`](docs/development) | is questioning a default, and wants what was measured to decide it |
150
+ | [`docs/validation/`](docs/validation) | wants the evidence behind a claim |
151
+ | [`tutorials/`](tutorials) | has not used the API yet: start with the [RCWA](tutorials/rcwa/00-unified-lifecycle.ipynb) or [FDTD](tutorials/fdtd/00-unified-lifecycle.ipynb) notebook |
152
+ | [`examples/`](examples) | wants it applied to a problem |
153
+ | [`studies/`](studies) | wants the raw measurement behind a number in `docs/` |
154
+
155
+ The same pages build as a site (`pip install -e '.[docs]'`, then
156
+ `sphinx-build -b html docs docs/_build/html`); a hosted copy is coming. Every link in `docs/` is a
157
+ relative link to a real file, and a test checks that every path a page cites exists.
158
+ `python -m wavebit.manifest` prints every option, refusal and constraint as one JSON document for
159
+ programs that need to know without reading the source
160
+ ([capability manifest](docs/reference/common/capability-manifest.md)).
161
+
162
+ ## Contributing
163
+
164
+ Bug reports, questions and pull requests are welcome. [CONTRIBUTING.md](CONTRIBUTING.md) opens
165
+ with the rule for where a new file belongs, and explains how changes are reviewed and landed.
166
+
167
+ ## Citation
168
+
169
+ ```bibtex
170
+ @software{wavebit,
171
+ title = {Wavebit: Differentiable Electromagnetic Simulation Suite},
172
+ author = {Kim, Yongha},
173
+ year = {2026},
174
+ url = {https://github.com/fieldalgo/wavebit},
175
+ }
176
+ ```
177
+
178
+ ## License
179
+
180
+ Apache-2.0. [LICENSE](LICENSE) also carries the third-party notices this project owes.
181
+
182
+ ## Contact
183
+
184
+ [dev@fieldalgo.com](mailto:dev@fieldalgo.com)