witwin-maxwell 0.2.0__tar.gz → 0.4.0__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 (682) hide show
  1. witwin_maxwell-0.4.0/.github/workflows/publish-witwin-maxwell.yml +450 -0
  2. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/.gitignore +16 -4
  3. witwin_maxwell-0.4.0/AGENTS.md +161 -0
  4. witwin_maxwell-0.4.0/CHANGELOG.md +72 -0
  5. witwin_maxwell-0.4.0/CLAUDE.md +161 -0
  6. witwin_maxwell-0.4.0/FEATURE_LIST.md +975 -0
  7. witwin_maxwell-0.4.0/LICENSE +13 -0
  8. witwin_maxwell-0.4.0/PKG-INFO +187 -0
  9. witwin_maxwell-0.4.0/README.md +167 -0
  10. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/hatch_build.py +3 -1
  11. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/pyproject.toml +12 -8
  12. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/scripts/build_fdtd_cuda_prebuilt.py +5 -2
  13. witwin_maxwell-0.4.0/scripts/dev/fdtd/multi_gpu/bench_joint.py +939 -0
  14. {witwin_maxwell-0.2.0/docs → witwin_maxwell-0.4.0/scripts}/dev/fdtd/native_cuda/bench_baseline.py +6 -4
  15. {witwin_maxwell-0.2.0/docs → witwin_maxwell-0.4.0/scripts}/dev/fdtd/native_cuda/snapshot_tool.py +4 -5
  16. witwin_maxwell-0.4.0/scripts/perf_cuda_graph_dispersive.py +134 -0
  17. witwin_maxwell-0.4.0/scripts/verify_cuda_binary_arches.py +73 -0
  18. witwin_maxwell-0.4.0/tests/api/adapters/tidy3d/test_port_source_mapping.py +138 -0
  19. witwin_maxwell-0.4.0/tests/api/adapters/tidy3d/test_tidy3d_adapter.py +2485 -0
  20. witwin_maxwell-0.4.0/tests/api/public/test_dependency_contract.py +22 -0
  21. witwin_maxwell-0.4.0/tests/api/public/test_guard_census.py +456 -0
  22. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/api/public/test_public_api.py +47 -13
  23. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/api/public/test_simulation_smoke.py +1 -1
  24. witwin_maxwell-0.4.0/tests/api/public/test_thin_wire_api.py +326 -0
  25. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/boundaries/boundary_physics/test_fdtd_boundary_physics.py +127 -18
  26. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/boundaries/boundary_specs/test_fdtd_boundaries.py +4 -13
  27. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/boundaries/cpml/test_fdtd_cpml.py +18 -16
  28. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/boundaries/symmetry/test_symmetry_generalization.py +15 -14
  29. witwin_maxwell-0.4.0/tests/breakdown/__init__.py +0 -0
  30. witwin_maxwell-0.4.0/tests/breakdown/_common.py +140 -0
  31. witwin_maxwell-0.4.0/tests/breakdown/test_breakdown_accumulator.py +235 -0
  32. witwin_maxwell-0.4.0/tests/breakdown/test_breakdown_compiler.py +149 -0
  33. witwin_maxwell-0.4.0/tests/breakdown/test_breakdown_energy.py +133 -0
  34. witwin_maxwell-0.4.0/tests/breakdown/test_breakdown_events.py +93 -0
  35. witwin_maxwell-0.4.0/tests/breakdown/test_breakdown_fdtd.py +186 -0
  36. witwin_maxwell-0.4.0/tests/breakdown/test_breakdown_guards.py +145 -0
  37. witwin_maxwell-0.4.0/tests/breakdown/test_breakdown_monitor.py +146 -0
  38. witwin_maxwell-0.4.0/tests/breakdown/test_breakdown_parity.py +126 -0
  39. witwin_maxwell-0.4.0/tests/breakdown/test_breakdown_state_machine.py +168 -0
  40. witwin_maxwell-0.4.0/tests/breakdown/test_component_stress.py +194 -0
  41. witwin_maxwell-0.4.0/tests/breakdown/test_smooth_breakdown_risk.py +326 -0
  42. witwin_maxwell-0.4.0/tests/core/constants/test_physical_constants.py +40 -0
  43. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/core/grid/test_autogrid.py +61 -13
  44. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/core/grid/test_gridspec_custom.py +59 -11
  45. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/core/grid/test_nonuniform_uniform_equivalence.py +11 -10
  46. witwin_maxwell-0.4.0/tests/electrostatic/__init__.py +0 -0
  47. witwin_maxwell-0.4.0/tests/electrostatic/oracles.py +47 -0
  48. witwin_maxwell-0.4.0/tests/electrostatic/test_analytic.py +146 -0
  49. witwin_maxwell-0.4.0/tests/electrostatic/test_api.py +227 -0
  50. witwin_maxwell-0.4.0/tests/electrostatic/test_capacitance.py +239 -0
  51. witwin_maxwell-0.4.0/tests/electrostatic/test_conservation.py +107 -0
  52. witwin_maxwell-0.4.0/tests/electrostatic/test_floating.py +157 -0
  53. witwin_maxwell-0.4.0/tests/electrostatic/test_gradients.py +238 -0
  54. witwin_maxwell-0.4.0/tests/electrostatic/test_initial_condition.py +338 -0
  55. witwin_maxwell-0.4.0/tests/electrostatic/test_open_boundary.py +312 -0
  56. witwin_maxwell-0.4.0/tests/electrostatic/test_tensor_eps.py +473 -0
  57. witwin_maxwell-0.4.0/tests/esd/test_esd_circuit.py +512 -0
  58. witwin_maxwell-0.4.0/tests/esd/test_esd_circuit_e2e.py +186 -0
  59. witwin_maxwell-0.4.0/tests/esd/test_esd_circuit_energy.py +229 -0
  60. witwin_maxwell-0.4.0/tests/esd/test_esd_injection.py +321 -0
  61. witwin_maxwell-0.4.0/tests/esd/test_esd_waveform.py +208 -0
  62. witwin_maxwell-0.4.0/tests/esd/test_prebias.py +193 -0
  63. witwin_maxwell-0.4.0/tests/fdtd/__init__.py +0 -0
  64. witwin_maxwell-0.4.0/tests/fdtd/cuda/__init__.py +0 -0
  65. witwin_maxwell-0.4.0/tests/fdtd/cuda/test_cuda_adjoint_native.py +174 -0
  66. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/cuda/test_cuda_common_parity.py +1 -3
  67. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/cuda/test_cuda_cpml_extension_parity.py +6 -6
  68. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/cuda/test_cuda_graph.py +2 -2
  69. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/cuda/test_cuda_magnetic_parity.py +6 -0
  70. witwin_maxwell-0.4.0/tests/fdtd/cuda/test_cuda_prebuilt_abi.py +70 -0
  71. witwin_maxwell-0.4.0/tests/fdtd/cuda/test_cuda_wire_parity.py +368 -0
  72. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/cuda/torch_reference.py +98 -40
  73. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/_gpu_burner.py +29 -0
  74. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/_nccl_adjoint_worker.py +672 -0
  75. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/_nccl_forward_worker.py +225 -0
  76. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/_nccl_rankdeath_worker.py +84 -0
  77. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/_nccl_transport_adjoint_worker.py +266 -0
  78. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/_nccl_transport_worker.py +168 -0
  79. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/conftest.py +44 -0
  80. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_adjoint_parity.py +585 -0
  81. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_adjoint_parity_cpml.py +606 -0
  82. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_adjoint_parity_stress.py +297 -0
  83. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_adjoint_replay.py +354 -0
  84. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_bench_joint_cli.py +282 -0
  85. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_bounded_standard_dispatch.py +242 -0
  86. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_capacity_cpml_stats.py +237 -0
  87. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_circuit_owner.py +283 -0
  88. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_cuda_graph_device_binding.py +164 -0
  89. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_ensemble_executor.py +260 -0
  90. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_ensemble_network_sweep.py +110 -0
  91. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_ensemble_run_many.py +250 -0
  92. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_guard_regressions.py +577 -0
  93. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_material_region_forward.py +174 -0
  94. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_monitor_merge_ownership.py +437 -0
  95. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_monitor_numerical.py +245 -0
  96. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_nccl_transport.py +772 -0
  97. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_network_owner.py +621 -0
  98. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_numerical_matrix.py +418 -0
  99. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_parallel_public_api.py +265 -0
  100. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_partition.py +282 -0
  101. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_result_persistence.py +131 -0
  102. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_review_regressions.py +240 -0
  103. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_sharded_export.py +184 -0
  104. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_sharded_persistence.py +420 -0
  105. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_solver_acceptance.py +390 -0
  106. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_step_instrument.py +143 -0
  107. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_transport.py +231 -0
  108. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_transport_adjoint.py +247 -0
  109. witwin_maxwell-0.4.0/tests/fdtd/multi_gpu/test_wire_owner.py +612 -0
  110. witwin_maxwell-0.4.0/tests/fdtd/surface_impedance/test_surface_impedance_reference.py +208 -0
  111. witwin_maxwell-0.4.0/tests/fdtd/test_cuda_graph_capture_coverage.py +226 -0
  112. witwin_maxwell-0.4.0/tests/fdtd/test_cuda_graph_complex_bloch.py +112 -0
  113. witwin_maxwell-0.4.0/tests/fdtd/test_cuda_graph_dispersive.py +91 -0
  114. witwin_maxwell-0.4.0/tests/fdtd/test_cuda_graph_nonlinear.py +89 -0
  115. witwin_maxwell-0.4.0/tests/fdtd/test_cuda_graph_tfsf.py +163 -0
  116. witwin_maxwell-0.4.0/tests/fdtd/test_cuda_graph_tfsf_slab.py +141 -0
  117. witwin_maxwell-0.4.0/tests/fdtd/test_observer_quadrature.py +68 -0
  118. witwin_maxwell-0.4.0/tests/fdtd/test_observer_time_stagger.py +245 -0
  119. witwin_maxwell-0.4.0/tests/fdtd/thin_wire/test_thin_wire_compiler.py +1024 -0
  120. witwin_maxwell-0.4.0/tests/fdtd/thin_wire/test_thin_wire_forward.py +1112 -0
  121. witwin_maxwell-0.4.0/tests/fdtd/thin_wire/test_thin_wire_lossy_forward.py +231 -0
  122. witwin_maxwell-0.4.0/tests/fdtd/thin_wire/test_thin_wire_port_binding_gpu.py +420 -0
  123. witwin_maxwell-0.4.0/tests/fdtd/thin_wire/test_thin_wire_reference.py +458 -0
  124. witwin_maxwell-0.4.0/tests/fdtd/thin_wire/test_thin_wire_rotation_acceptance.py +208 -0
  125. witwin_maxwell-0.4.0/tests/fdtd/thin_wire/test_wire_finite_conductivity.py +277 -0
  126. witwin_maxwell-0.4.0/tests/fdtd/thin_wire/test_wire_lossy_recurrence.py +295 -0
  127. witwin_maxwell-0.4.0/tests/gradients/e2e/__init__.py +0 -0
  128. witwin_maxwell-0.4.0/tests/gradients/e2e/test_fdtd_two_port_sparam_optimization.py +169 -0
  129. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/gradients/fdtd_adjoint_baselines.py +8 -125
  130. witwin_maxwell-0.4.0/tests/gradients/finite_difference_gate.py +32 -0
  131. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/gradients/test_fdtd_adjoint_bridge.py +745 -524
  132. witwin_maxwell-0.4.0/tests/gradients/test_fdtd_adjoint_materials.py +1830 -0
  133. witwin_maxwell-0.4.0/tests/gradients/test_fdtd_adjoint_p6_acceptance.py +59 -0
  134. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/gradients/test_fdtd_adjoint_rigorous.py +70 -3
  135. witwin_maxwell-0.4.0/tests/gradients/test_fdtd_circuit_adjoint.py +663 -0
  136. witwin_maxwell-0.4.0/tests/gradients/test_fdtd_cpml_psi_active_adjoint.py +155 -0
  137. witwin_maxwell-0.4.0/tests/gradients/test_fdtd_custom_source_adjoint.py +411 -0
  138. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/gradients/test_fdtd_mode_source_adjoint.py +5 -97
  139. witwin_maxwell-0.4.0/tests/gradients/test_fdtd_multisource_adjoint.py +436 -0
  140. witwin_maxwell-0.4.0/tests/gradients/test_fdtd_network_adjoint.py +502 -0
  141. witwin_maxwell-0.4.0/tests/gradients/test_fdtd_rf_lumped_adjoint.py +792 -0
  142. witwin_maxwell-0.4.0/tests/gradients/test_fdtd_thin_wire_adjoint.py +543 -0
  143. witwin_maxwell-0.4.0/tests/gradients/test_fdtd_thin_wire_conductivity_adjoint.py +172 -0
  144. witwin_maxwell-0.4.0/tests/gradients/test_fdtd_thin_wire_port_adjoint.py +514 -0
  145. witwin_maxwell-0.4.0/tests/gradients/test_fdtd_waveport_adjoint.py +174 -0
  146. witwin_maxwell-0.4.0/tests/gradients/test_rf_postprocess_adjoint.py +181 -0
  147. witwin_maxwell-0.4.0/tests/materials/__init__.py +1 -0
  148. witwin_maxwell-0.4.0/tests/materials/anisotropic/test_fdtd_full_anisotropy.py +565 -0
  149. witwin_maxwell-0.4.0/tests/materials/combinations/__init__.py +0 -0
  150. witwin_maxwell-0.4.0/tests/materials/combinations/test_aniso_pml_overlap_reflection.py +206 -0
  151. witwin_maxwell-0.4.0/tests/materials/combinations/test_bloch_dispersive_forward.py +117 -0
  152. witwin_maxwell-0.4.0/tests/materials/combinations/test_combination_matrix.py +284 -0
  153. witwin_maxwell-0.4.0/tests/materials/combinations/test_diagonal_aniso_dispersive.py +194 -0
  154. witwin_maxwell-0.4.0/tests/materials/combinations/test_lossy_anisotropic_slab.py +291 -0
  155. witwin_maxwell-0.4.0/tests/materials/combinations/test_modulated_dispersive_nonlinear.py +391 -0
  156. witwin_maxwell-0.4.0/tests/materials/combinations/test_modulated_slab_cpml.py +154 -0
  157. witwin_maxwell-0.4.0/tests/materials/combinations/test_mu_tensor_dispersion.py +205 -0
  158. witwin_maxwell-0.4.0/tests/materials/combinations/test_multi_frequency_modulation.py +189 -0
  159. witwin_maxwell-0.4.0/tests/materials/combinations/test_rotated_birefringent_dispersive_slab.py +330 -0
  160. witwin_maxwell-0.4.0/tests/materials/combinations/test_shg_dispersive_phase_matching.py +212 -0
  161. witwin_maxwell-0.4.0/tests/materials/compiler/test_curved_subpixel_convergence.py +253 -0
  162. witwin_maxwell-0.4.0/tests/materials/compiler/test_edge_native_sampling.py +156 -0
  163. witwin_maxwell-0.4.0/tests/materials/compiler/test_material_compiler.py +1070 -0
  164. witwin_maxwell-0.4.0/tests/materials/compiler/test_pec_conformal_alignment.py +212 -0
  165. witwin_maxwell-0.4.0/tests/materials/compiler/test_pec_conformal_nonuniform.py +244 -0
  166. witwin_maxwell-0.4.0/tests/materials/compiler/test_subpixel_nonuniform.py +271 -0
  167. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/materials/conductive/test_fdtd_conductive.py +39 -54
  168. witwin_maxwell-0.4.0/tests/materials/conductive/test_fdtd_magnetic_conductive.py +316 -0
  169. witwin_maxwell-0.4.0/tests/materials/dispersive/test_custom_dispersive.py +342 -0
  170. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/materials/dispersive/test_fdtd_dispersive.py +25 -19
  171. witwin_maxwell-0.4.0/tests/materials/dispersive/test_fdtd_gain.py +156 -0
  172. witwin_maxwell-0.4.0/tests/materials/dispersive/test_fdtd_sellmeier.py +142 -0
  173. witwin_maxwell-0.4.0/tests/materials/ferrite/test_ferrite_reference.py +235 -0
  174. witwin_maxwell-0.4.0/tests/materials/ferrite/test_gyromagnetic_compiler.py +265 -0
  175. witwin_maxwell-0.4.0/tests/materials/ferrite/test_gyromagnetic_ferrite.py +262 -0
  176. witwin_maxwell-0.4.0/tests/materials/ferrite/test_gyromagnetic_forward.py +751 -0
  177. witwin_maxwell-0.4.0/tests/materials/ferrite/test_gyromagnetic_general_bias.py +628 -0
  178. witwin_maxwell-0.4.0/tests/materials/modulation/test_fdtd_modulation.py +387 -0
  179. witwin_maxwell-0.4.0/tests/materials/nonlinear/test_fdtd_nonlinear.py +572 -0
  180. witwin_maxwell-0.4.0/tests/materials/perturbation/test_perturbation_medium.py +224 -0
  181. witwin_maxwell-0.4.0/tests/materials/sheet/__init__.py +1 -0
  182. witwin_maxwell-0.4.0/tests/materials/sheet/sheet_measurement.py +132 -0
  183. witwin_maxwell-0.4.0/tests/materials/sheet/test_fdtd_graphene.py +333 -0
  184. witwin_maxwell-0.4.0/tests/materials/sheet/test_fdtd_medium2d.py +143 -0
  185. witwin_maxwell-0.4.0/tests/materials/sheet/test_lossy_metal.py +156 -0
  186. witwin_maxwell-0.4.0/tests/materials/sheet/test_surface_impedance_funnel.py +248 -0
  187. witwin_maxwell-0.4.0/tests/materials/surface_impedance/test_rational_surface_impedance.py +245 -0
  188. witwin_maxwell-0.4.0/tests/materials/surface_impedance/test_surface_impedance_ade.py +103 -0
  189. witwin_maxwell-0.4.0/tests/materials/surface_impedance/test_surface_impedance_resume.py +174 -0
  190. witwin_maxwell-0.4.0/tests/materials/surface_impedance/test_surface_impedance_runtime.py +131 -0
  191. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/monitors/observers/test_fdtd_observers.py +17 -15
  192. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/postprocess/rcs/test_postprocess.py +213 -0
  193. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/postprocess/scattering/test_mode_overlap.py +5 -2
  194. witwin_maxwell-0.4.0/tests/postprocess/scattering/test_ring_resonator_s21.py +296 -0
  195. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/postprocess/scattering/test_scattering_parameters.py +164 -11
  196. witwin_maxwell-0.4.0/tests/rational/test_core.py +213 -0
  197. witwin_maxwell-0.4.0/tests/rational/test_fit.py +83 -0
  198. witwin_maxwell-0.4.0/tests/rf/antenna/test_antenna_benchmark_e2e.py +203 -0
  199. witwin_maxwell-0.4.0/tests/rf/antenna/test_antenna_data.py +406 -0
  200. witwin_maxwell-0.4.0/tests/rf/antenna/test_antenna_matching_block.py +223 -0
  201. witwin_maxwell-0.4.0/tests/rf/antenna/test_result_antenna.py +253 -0
  202. witwin_maxwell-0.4.0/tests/rf/array/test_array_codebook.py +366 -0
  203. witwin_maxwell-0.4.0/tests/rf/array/test_array_contracts.py +696 -0
  204. witwin_maxwell-0.4.0/tests/rf/array/test_array_fullwave.py +287 -0
  205. witwin_maxwell-0.4.0/tests/rf/array/test_array_mimo.py +350 -0
  206. witwin_maxwell-0.4.0/tests/rf/array/test_array_persistence.py +262 -0
  207. witwin_maxwell-0.4.0/tests/rf/array/test_array_scene_gradient.py +605 -0
  208. witwin_maxwell-0.4.0/tests/rf/array/test_array_scene_gradient_ensemble.py +591 -0
  209. witwin_maxwell-0.4.0/tests/rf/circuits/test_circuit_conservation.py +438 -0
  210. witwin_maxwell-0.4.0/tests/rf/circuits/test_circuit_contract.py +156 -0
  211. witwin_maxwell-0.4.0/tests/rf/circuits/test_circuit_graph.py +150 -0
  212. witwin_maxwell-0.4.0/tests/rf/circuits/test_circuit_hot_path_op_count.py +163 -0
  213. witwin_maxwell-0.4.0/tests/rf/circuits/test_circuit_independent_crosscheck.py +409 -0
  214. witwin_maxwell-0.4.0/tests/rf/circuits/test_fdtd_circuit_coupling.py +449 -0
  215. witwin_maxwell-0.4.0/tests/rf/circuits/test_fdtd_circuit_resume.py +204 -0
  216. witwin_maxwell-0.4.0/tests/rf/circuits/test_mna_runtime.py +630 -0
  217. witwin_maxwell-0.4.0/tests/rf/circuits/test_phase3_multiport.py +437 -0
  218. witwin_maxwell-0.4.0/tests/rf/circuits/test_phase4_batched_mna.py +70 -0
  219. witwin_maxwell-0.4.0/tests/rf/circuits/test_phase4_circuit_cuda_graph.py +239 -0
  220. witwin_maxwell-0.4.0/tests/rf/circuits/test_result_circuit_data.py +219 -0
  221. witwin_maxwell-0.4.0/tests/rf/circuits/test_spice_parser.py +238 -0
  222. witwin_maxwell-0.4.0/tests/rf/contracts/test_network_data_contract.py +169 -0
  223. witwin_maxwell-0.4.0/tests/rf/contracts/test_port_conventions.py +144 -0
  224. witwin_maxwell-0.4.0/tests/rf/contracts/test_port_geometry_contract.py +101 -0
  225. witwin_maxwell-0.4.0/tests/rf/contracts/test_public_rf_api.py +121 -0
  226. witwin_maxwell-0.4.0/tests/rf/contracts/test_wire_port_binding_api.py +92 -0
  227. witwin_maxwell-0.4.0/tests/rf/lumped/test_fdtd_lumped_port_pec_gap.py +78 -0
  228. witwin_maxwell-0.4.0/tests/rf/lumped/test_fdtd_lumped_runtime.py +413 -0
  229. witwin_maxwell-0.4.0/tests/rf/lumped/test_fdtd_port_end_to_end.py +272 -0
  230. witwin_maxwell-0.4.0/tests/rf/lumped/test_port_data_persistence.py +106 -0
  231. witwin_maxwell-0.4.0/tests/rf/lumped/test_port_source_waveform.py +39 -0
  232. witwin_maxwell-0.4.0/tests/rf/lumped/test_result_port_data.py +146 -0
  233. witwin_maxwell-0.4.0/tests/rf/lumped/test_rlc_contract.py +101 -0
  234. witwin_maxwell-0.4.0/tests/rf/lumped/test_rlc_discretization.py +123 -0
  235. witwin_maxwell-0.4.0/tests/rf/lumped/test_scene_lumped_elements.py +141 -0
  236. witwin_maxwell-0.4.0/tests/rf/lumped/test_simulation_port_excitation.py +97 -0
  237. witwin_maxwell-0.4.0/tests/rf/network/fixtures/four_port_db.s4p +6 -0
  238. witwin_maxwell-0.4.0/tests/rf/network/fixtures/one_port_ri.s1p +4 -0
  239. witwin_maxwell-0.4.0/tests/rf/network/fixtures/two_port_ma.ts +12 -0
  240. witwin_maxwell-0.4.0/tests/rf/network/test_embedded_network_persistence.py +286 -0
  241. witwin_maxwell-0.4.0/tests/rf/network/test_finalize_state_norm_detach.py +68 -0
  242. witwin_maxwell-0.4.0/tests/rf/network/test_network_algebra.py +261 -0
  243. witwin_maxwell-0.4.0/tests/rf/network/test_network_block_contract.py +247 -0
  244. witwin_maxwell-0.4.0/tests/rf/network/test_network_cascade.py +290 -0
  245. witwin_maxwell-0.4.0/tests/rf/network/test_network_cascade_crosscheck.py +193 -0
  246. witwin_maxwell-0.4.0/tests/rf/network/test_network_conservation.py +268 -0
  247. witwin_maxwell-0.4.0/tests/rf/network/test_network_coupling_op_stream.py +74 -0
  248. witwin_maxwell-0.4.0/tests/rf/network/test_network_delay.py +384 -0
  249. witwin_maxwell-0.4.0/tests/rf/network/test_network_delay_checkpoint.py +154 -0
  250. witwin_maxwell-0.4.0/tests/rf/network/test_network_delay_integration.py +293 -0
  251. witwin_maxwell-0.4.0/tests/rf/network/test_network_multiport_fdtd.py +291 -0
  252. witwin_maxwell-0.4.0/tests/rf/network/test_network_multiport_runtime.py +380 -0
  253. witwin_maxwell-0.4.0/tests/rf/network/test_network_observer_hot_path.py +246 -0
  254. witwin_maxwell-0.4.0/tests/rf/network/test_network_persistence.py +115 -0
  255. witwin_maxwell-0.4.0/tests/rf/network/test_network_physicality.py +79 -0
  256. witwin_maxwell-0.4.0/tests/rf/network/test_network_runtime.py +457 -0
  257. witwin_maxwell-0.4.0/tests/rf/network/test_network_sweep.py +374 -0
  258. witwin_maxwell-0.4.0/tests/rf/network/test_touchstone.py +246 -0
  259. witwin_maxwell-0.4.0/tests/rf/network/test_touchstone_import.py +383 -0
  260. witwin_maxwell-0.4.0/tests/rf/nonlinear/_generate_goldens.py +104 -0
  261. witwin_maxwell-0.4.0/tests/rf/nonlinear/_rectifier_fixtures.py +130 -0
  262. witwin_maxwell-0.4.0/tests/rf/nonlinear/goldens/rectifier_goldens.pt +0 -0
  263. witwin_maxwell-0.4.0/tests/rf/nonlinear/test_newton_core.py +220 -0
  264. witwin_maxwell-0.4.0/tests/rf/nonlinear/test_nonlinear_device_contract.py +151 -0
  265. witwin_maxwell-0.4.0/tests/rf/nonlinear/test_nonlinear_device_math.py +102 -0
  266. witwin_maxwell-0.4.0/tests/rf/nonlinear/test_nonlinear_transient.py +332 -0
  267. witwin_maxwell-0.4.0/tests/rf/numerics/test_port_spectral_stagger.py +93 -0
  268. witwin_maxwell-0.4.0/tests/rf/numerics/test_tem_vi_prototype.py +88 -0
  269. witwin_maxwell-0.4.0/tests/rf/performance/measure_port_overhead_s2b.py +522 -0
  270. witwin_maxwell-0.4.0/tests/rf/performance/profile_port_hot_path.py +444 -0
  271. witwin_maxwell-0.4.0/tests/rf/performance/test_no_feature_fast_path.py +23 -0
  272. witwin_maxwell-0.4.0/tests/rf/performance/test_perf_variance_gate.py +160 -0
  273. witwin_maxwell-0.4.0/tests/rf/performance/test_port_energy_diagnostics_default_off.py +99 -0
  274. witwin_maxwell-0.4.0/tests/rf/performance/test_port_hot_path_op_count.py +128 -0
  275. witwin_maxwell-0.4.0/tests/rf/power_loss/test_power_loss_data.py +454 -0
  276. witwin_maxwell-0.4.0/tests/rf/terminal/test_terminal_port_contract.py +253 -0
  277. witwin_maxwell-0.4.0/tests/rf/wave_validation/__init__.py +0 -0
  278. witwin_maxwell-0.4.0/tests/rf/wave_validation/test_asymmetric_reciprocity_power_balance.py +158 -0
  279. witwin_maxwell-0.4.0/tests/rf/wave_validation/test_coax_contour_snap.py +37 -0
  280. witwin_maxwell-0.4.0/tests/rf/wave_validation/test_interior_pec_operator.py +503 -0
  281. witwin_maxwell-0.4.0/tests/rf/wave_validation/test_matched_s11_wave_level.py +98 -0
  282. witwin_maxwell-0.4.0/tests/rf/wave_validation/test_microstrip_diffpair_wave_level.py +178 -0
  283. witwin_maxwell-0.4.0/tests/rf/wave_validation/test_open_short_match_wave_level.py +154 -0
  284. witwin_maxwell-0.4.0/tests/rf/wave_validation/test_planemonitor_waveport_passthrough.py +215 -0
  285. witwin_maxwell-0.4.0/tests/rf/wave_validation/test_rf_reference_generation.py +158 -0
  286. witwin_maxwell-0.4.0/tests/rf/wave_validation/test_rlc_resonance_wave_level.py +181 -0
  287. witwin_maxwell-0.4.0/tests/rf/wave_validation/test_te10_mode_selection.py +132 -0
  288. witwin_maxwell-0.4.0/tests/rf/wave_validation/test_transverse_operator.py +450 -0
  289. witwin_maxwell-0.4.0/tests/rf/wave_validation/test_waveguide_wave_level.py +114 -0
  290. witwin_maxwell-0.4.0/tests/rf/waveport/test_modal_port_data.py +136 -0
  291. witwin_maxwell-0.4.0/tests/rf/waveport/test_mode_tracking.py +205 -0
  292. witwin_maxwell-0.4.0/tests/rf/waveport/test_waveport_contract.py +471 -0
  293. witwin_maxwell-0.4.0/tests/rf/waveport/test_waveport_sweep.py +452 -0
  294. witwin_maxwell-0.4.0/tests/sar/test_incident_power.py +228 -0
  295. witwin_maxwell-0.4.0/tests/sar/test_mass_averaging.py +404 -0
  296. witwin_maxwell-0.4.0/tests/sar/test_mass_density.py +114 -0
  297. witwin_maxwell-0.4.0/tests/sar/test_normalization.py +123 -0
  298. witwin_maxwell-0.4.0/tests/sar/test_phantom_benchmarks.py +175 -0
  299. witwin_maxwell-0.4.0/tests/sar/test_phantom_convergence.py +122 -0
  300. witwin_maxwell-0.4.0/tests/sar/test_point_sar.py +406 -0
  301. witwin_maxwell-0.4.0/tests/sar/test_sar_combine.py +120 -0
  302. witwin_maxwell-0.4.0/tests/sar/test_sar_gradients.py +154 -0
  303. witwin_maxwell-0.4.0/tests/sar/test_sar_validation.py +85 -0
  304. witwin_maxwell-0.4.0/tests/sar/test_soft_peak.py +106 -0
  305. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/sources/definitions/test_astigmatic_gaussian_beam.py +7 -6
  306. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/sources/definitions/test_custom_uniform_sources.py +5 -1
  307. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/sources/definitions/test_sources.py +11 -16
  308. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/sources/incident/test_fdtd_incident.py +24 -2
  309. witwin_maxwell-0.4.0/tests/sources/incident/test_soft_planewave_absolute_power.py +209 -0
  310. witwin_maxwell-0.4.0/tests/sources/mode/test_fdtd_anisotropic_aperture.py +217 -0
  311. witwin_maxwell-0.4.0/tests/sources/mode/test_fdtd_bent_mode_source.py +165 -0
  312. witwin_maxwell-0.4.0/tests/sources/mode/test_fdtd_broadband_mode_source.py +178 -0
  313. witwin_maxwell-0.4.0/tests/sources/mode/test_fdtd_complex_lossy_slab_mode.py +146 -0
  314. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/sources/mode/test_fdtd_mode_source.py +1 -1
  315. witwin_maxwell-0.4.0/tests/sources/mode/test_fdtd_pec_mode_solver.py +147 -0
  316. witwin_maxwell-0.4.0/tests/sources/mode/test_fdtd_unidirectional_launch.py +175 -0
  317. witwin_maxwell-0.4.0/tests/sources/mode/test_mode_eigensolver_physics.py +279 -0
  318. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/sources/mode/test_mode_solver_gradients.py +84 -1
  319. witwin_maxwell-0.4.0/tests/sources/mode/test_mode_source_injection_physics.py +188 -0
  320. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/sources/point/test_fdtd_sources.py +8 -8
  321. witwin_maxwell-0.4.0/tests/sources/tfsf/test_fdtd_grating_pulsed_bloch.py +256 -0
  322. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/sources/tfsf/test_fdtd_grating_tfsf.py +222 -17
  323. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/sources/tfsf/test_fdtd_tfsf.py +5 -5
  324. witwin_maxwell-0.4.0/tests/support/benchmark_circuit_performance.py +564 -0
  325. witwin_maxwell-0.4.0/tests/support/benchmark_ensemble_speedup.py +239 -0
  326. witwin_maxwell-0.4.0/tests/support/benchmark_network_embedding.py +260 -0
  327. witwin_maxwell-0.4.0/tests/support/benchmark_rf_no_feature.py +843 -0
  328. witwin_maxwell-0.4.0/tests/support/benchmark_thin_wire_reverse.py +159 -0
  329. witwin_maxwell-0.4.0/tests/support/compare_no_feature_op_stream.py +475 -0
  330. witwin_maxwell-0.4.0/tests/support/network_coupling_op_stream.py +280 -0
  331. witwin_maxwell-0.4.0/tests/support/perf_variance_gate.py +185 -0
  332. witwin_maxwell-0.4.0/tests/support/port_hot_path_tally.py +88 -0
  333. witwin_maxwell-0.4.0/tests/support/test_benchmark_circuit_performance.py +66 -0
  334. witwin_maxwell-0.4.0/tests/support/test_benchmark_rf_no_feature_provenance.py +232 -0
  335. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/validation/physics/test_autogrid_physics.py +25 -10
  336. witwin_maxwell-0.4.0/tests/validation/physics/test_autogrid_subpixel_thesis.py +217 -0
  337. witwin_maxwell-0.4.0/tests/validation/physics/test_bloch_broadband_vs_cw.py +213 -0
  338. witwin_maxwell-0.4.0/tests/validation/physics/test_dispersive_metasurface_bloch.py +110 -0
  339. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/validation/physics/test_fdtd_physics_correctness.py +12 -17
  340. witwin_maxwell-0.4.0/tests/validation/physics/test_layered_exterior_huygens_validation.py +324 -0
  341. witwin_maxwell-0.4.0/tests/validation/physics/test_lossy_metal_sibc.py +161 -0
  342. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/validation/physics/test_nonuniform_grid_physics.py +7 -5
  343. witwin_maxwell-0.4.0/tests/validation/physics/test_pec_conformal.py +207 -0
  344. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/validation/physics/test_postprocess_end_to_end_validation.py +96 -20
  345. witwin_maxwell-0.4.0/tests/validation/physics/test_sibc_cylinder_convergence.py +220 -0
  346. witwin_maxwell-0.4.0/tests/validation/physics/test_sibc_orientation.py +218 -0
  347. witwin_maxwell-0.4.0/tests/validation/physics/test_sibc_staircase.py +276 -0
  348. witwin_maxwell-0.4.0/tests/validation/physics/test_sibc_zero_impact.py +124 -0
  349. witwin_maxwell-0.4.0/tests/validation/physics/test_soft_planewave_graded.py +302 -0
  350. witwin_maxwell-0.4.0/tests/validation/physics/test_surface_impedance_broadband.py +141 -0
  351. witwin_maxwell-0.4.0/tests/validation/physics/test_tfsf_nonuniform.py +335 -0
  352. witwin_maxwell-0.4.0/witwin/maxwell/__init__.py +437 -0
  353. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/adapters/gds.py +1 -1
  354. witwin_maxwell-0.4.0/witwin/maxwell/adapters/tidy3d.py +2014 -0
  355. witwin_maxwell-0.4.0/witwin/maxwell/adjoint_inputs.py +207 -0
  356. witwin_maxwell-0.4.0/witwin/maxwell/antenna.py +307 -0
  357. witwin_maxwell-0.4.0/witwin/maxwell/array.py +1599 -0
  358. witwin_maxwell-0.4.0/witwin/maxwell/array_execution.py +67 -0
  359. witwin_maxwell-0.4.0/witwin/maxwell/array_gradient.py +375 -0
  360. witwin_maxwell-0.4.0/witwin/maxwell/breakdown.py +104 -0
  361. witwin_maxwell-0.4.0/witwin/maxwell/breakdown_risk.py +310 -0
  362. witwin_maxwell-0.4.0/witwin/maxwell/breakdown_stress.py +542 -0
  363. witwin_maxwell-0.4.0/witwin/maxwell/circuit_devices.py +292 -0
  364. witwin_maxwell-0.4.0/witwin/maxwell/circuits.py +1481 -0
  365. witwin_maxwell-0.4.0/witwin/maxwell/compiler/__init__.py +104 -0
  366. witwin_maxwell-0.4.0/witwin/maxwell/compiler/array.py +369 -0
  367. witwin_maxwell-0.4.0/witwin/maxwell/compiler/breakdown.py +151 -0
  368. witwin_maxwell-0.4.0/witwin/maxwell/compiler/circuits.py +320 -0
  369. witwin_maxwell-0.4.0/witwin/maxwell/compiler/delay.py +374 -0
  370. witwin_maxwell-0.4.0/witwin/maxwell/compiler/electrostatic.py +379 -0
  371. witwin_maxwell-0.4.0/witwin/maxwell/compiler/gyromagnetic.py +356 -0
  372. witwin_maxwell-0.4.0/witwin/maxwell/compiler/lumped.py +100 -0
  373. witwin_maxwell-0.4.0/witwin/maxwell/compiler/mass_density.py +139 -0
  374. witwin_maxwell-0.4.0/witwin/maxwell/compiler/materials.py +2623 -0
  375. witwin_maxwell-0.4.0/witwin/maxwell/compiler/mna.py +1085 -0
  376. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/compiler/monitors.py +80 -4
  377. witwin_maxwell-0.4.0/witwin/maxwell/compiler/networks.py +318 -0
  378. witwin_maxwell-0.4.0/witwin/maxwell/compiler/nonlinear_devices.py +916 -0
  379. witwin_maxwell-0.4.0/witwin/maxwell/compiler/ports.py +391 -0
  380. witwin_maxwell-0.4.0/witwin/maxwell/compiler/power_loss.py +175 -0
  381. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/compiler/sources.py +12 -3
  382. witwin_maxwell-0.4.0/witwin/maxwell/compiler/structures.py +21 -0
  383. witwin_maxwell-0.4.0/witwin/maxwell/compiler/subpixel.py +107 -0
  384. witwin_maxwell-0.4.0/witwin/maxwell/compiler/surface_impedance.py +275 -0
  385. witwin_maxwell-0.4.0/witwin/maxwell/compiler/thin_wire.py +2201 -0
  386. witwin_maxwell-0.4.0/witwin/maxwell/compiler/waveports.py +435 -0
  387. witwin_maxwell-0.4.0/witwin/maxwell/compiler/wire_impedance.py +426 -0
  388. witwin_maxwell-0.4.0/witwin/maxwell/constants.py +92 -0
  389. witwin_maxwell-0.4.0/witwin/maxwell/electrostatic/__init__.py +39 -0
  390. witwin_maxwell-0.4.0/witwin/maxwell/electrostatic/api.py +224 -0
  391. witwin_maxwell-0.4.0/witwin/maxwell/electrostatic/capacitance.py +433 -0
  392. witwin_maxwell-0.4.0/witwin/maxwell/electrostatic/initial_condition.py +305 -0
  393. witwin_maxwell-0.4.0/witwin/maxwell/electrostatic/runtime.py +878 -0
  394. witwin_maxwell-0.4.0/witwin/maxwell/esd.py +854 -0
  395. witwin_maxwell-0.4.0/witwin/maxwell/execution/__init__.py +45 -0
  396. witwin_maxwell-0.4.0/witwin/maxwell/execution/capacity.py +84 -0
  397. witwin_maxwell-0.4.0/witwin/maxwell/execution/ensemble.py +187 -0
  398. witwin_maxwell-0.4.0/witwin/maxwell/execution/executor.py +230 -0
  399. witwin_maxwell-0.4.0/witwin/maxwell/execution/plan.py +55 -0
  400. witwin_maxwell-0.4.0/witwin/maxwell/execution/pool.py +182 -0
  401. witwin_maxwell-0.4.0/witwin/maxwell/execution/records.py +144 -0
  402. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdfd/adjoint/bridge.py +2 -0
  403. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdfd/solver.py +42 -7
  404. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/__init__.py +10 -0
  405. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/adjoint/__init__.py +21 -0
  406. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/adjoint/bridge.py +1481 -0
  407. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/adjoint/capabilities.py +31 -0
  408. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/adjoint/circuits.py +708 -0
  409. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/adjoint/core.py +1655 -567
  410. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/adjoint/dispatch.py +727 -0
  411. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/adjoint/native.py +2820 -0
  412. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/adjoint/profiler.py +17 -0
  413. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/adjoint/reverse_common.py +355 -0
  414. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/adjoint/seeds.py +994 -0
  415. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/boundary/cpml.py +9 -26
  416. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/checkpoint.py +573 -0
  417. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/circuits.py +1209 -0
  418. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/cuda/backend.py +1834 -627
  419. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/cuda/build.py +89 -12
  420. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/cuda/extension.cpp +2212 -0
  421. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/cuda/kernels/adjoint.cu +4681 -0
  422. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/cuda/kernels/aniso.cu +1704 -0
  423. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/cuda/kernels/boundary.cu +95 -31
  424. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/cuda/kernels/common.cu +74 -0
  425. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/cuda/kernels/common.cuh +14 -0
  426. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/cuda/kernels/dispersive.cu +782 -0
  427. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/cuda/kernels/electric.cu +3626 -0
  428. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/cuda/kernels/magnetic.cu +921 -0
  429. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/cuda/kernels/observers.cu +65 -68
  430. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/cuda/kernels/projection.cu +19 -22
  431. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/cuda/kernels/sources.cu +180 -183
  432. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/cuda/kernels/spectral.cu +69 -72
  433. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/cuda/kernels/wire.cu +493 -0
  434. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/cuda/launch.h +23 -0
  435. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/cuda/runtime/graph.py +123 -0
  436. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/cuda/tensors.h +55 -0
  437. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/delay.py +269 -0
  438. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/__init__.py +10 -0
  439. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/_shared.py +65 -0
  440. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/adjoint.py +1643 -0
  441. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/capacity.py +87 -0
  442. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/circuits.py +609 -0
  443. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/counts.py +25 -0
  444. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/frequency_counts.py +24 -0
  445. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/instrumentation.py +199 -0
  446. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/interpolation.py +35 -0
  447. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/monitor_merge.py +421 -0
  448. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/nccl_transport.py +841 -0
  449. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/networks.py +640 -0
  450. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/output.py +49 -0
  451. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/persistence.py +880 -0
  452. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/shard_engine.py +467 -0
  453. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/solver.py +1317 -0
  454. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/source_corrections.py +51 -0
  455. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/source_rebuild.py +76 -0
  456. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/sources.py +77 -0
  457. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/transport.py +532 -0
  458. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/distributed/wire.py +625 -0
  459. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/excitation/__init__.py +2 -0
  460. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/excitation/injection.py +388 -129
  461. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/excitation/modes/__init__.py +963 -0
  462. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/excitation/modes/common.py +592 -0
  463. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/excitation/modes/eigensolvers.py +310 -0
  464. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/excitation/modes/tem.py +354 -0
  465. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/excitation/modes/vector.py +1113 -0
  466. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/excitation/modes/yee.py +958 -0
  467. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/excitation/spatial.py +58 -20
  468. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/excitation/temporal.py +63 -30
  469. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/excitation/tfsf_apply.py +57 -20
  470. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/excitation/tfsf_common.py +44 -13
  471. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/excitation/tfsf_specs.py +0 -1
  472. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/excitation/tfsf_state.py +63 -8
  473. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/ferrite_reference.py +403 -0
  474. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/lumped.py +915 -0
  475. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/material_pullback.py +145 -25
  476. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/meshing/autogrid.py +48 -26
  477. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/networks.py +1264 -0
  478. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/observers.py +263 -210
  479. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/ports.py +2088 -0
  480. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/quadrature.py +233 -0
  481. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/resume.py +714 -0
  482. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/runtime/__init__.py +16 -6
  483. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/runtime/breakdown.py +521 -0
  484. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/runtime/gyromagnetic.py +469 -0
  485. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/runtime/initialization.py +42 -11
  486. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/runtime/materials.py +1769 -0
  487. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/runtime/spectral.py +89 -25
  488. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/runtime/stepping.py +2416 -0
  489. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/solver.py +49 -16
  490. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/surface_impedance_reference.py +349 -0
  491. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/thin_wire_reference.py +388 -0
  492. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/wire.py +1371 -0
  493. witwin_maxwell-0.4.0/witwin/maxwell/fdtd/wire_lossy.py +627 -0
  494. witwin_maxwell-0.4.0/witwin/maxwell/fdtd_parallel.py +699 -0
  495. witwin_maxwell-0.4.0/witwin/maxwell/geometry/__init__.py +5 -0
  496. witwin_maxwell-0.4.0/witwin/maxwell/geometry/polyslab.py +299 -0
  497. witwin_maxwell-0.4.0/witwin/maxwell/lumped.py +534 -0
  498. witwin_maxwell-0.4.0/witwin/maxwell/media.py +2395 -0
  499. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/monitors.py +365 -1
  500. witwin_maxwell-0.4.0/witwin/maxwell/network.py +1613 -0
  501. witwin_maxwell-0.4.0/witwin/maxwell/network_math.py +339 -0
  502. witwin_maxwell-0.4.0/witwin/maxwell/network_sweep.py +324 -0
  503. witwin_maxwell-0.4.0/witwin/maxwell/ports.py +932 -0
  504. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/postprocess/RCS.py +4 -3
  505. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/postprocess/__init__.py +13 -0
  506. witwin_maxwell-0.4.0/witwin/maxwell/postprocess/antenna.py +712 -0
  507. witwin_maxwell-0.4.0/witwin/maxwell/postprocess/array.py +439 -0
  508. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/postprocess/diffraction.py +4 -6
  509. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/postprocess/directivity.py +3 -2
  510. witwin_maxwell-0.4.0/witwin/maxwell/postprocess/incident_power.py +200 -0
  511. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/postprocess/modal.py +16 -8
  512. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/postprocess/nfft.py +30 -14
  513. witwin_maxwell-0.4.0/witwin/maxwell/postprocess/power_loss.py +498 -0
  514. witwin_maxwell-0.4.0/witwin/maxwell/postprocess/sar.py +371 -0
  515. witwin_maxwell-0.4.0/witwin/maxwell/postprocess/sar_averaging.py +295 -0
  516. witwin_maxwell-0.4.0/witwin/maxwell/postprocess/sar_combine.py +289 -0
  517. witwin_maxwell-0.4.0/witwin/maxwell/postprocess/scattering_parameters.py +370 -0
  518. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/postprocess/stratton_chu.py +408 -53
  519. witwin_maxwell-0.4.0/witwin/maxwell/postprocess/waveports.py +432 -0
  520. witwin_maxwell-0.4.0/witwin/maxwell/power_loss.py +451 -0
  521. witwin_maxwell-0.4.0/witwin/maxwell/rational.py +1409 -0
  522. witwin_maxwell-0.4.0/witwin/maxwell/result.py +2236 -0
  523. witwin_maxwell-0.4.0/witwin/maxwell/sar.py +524 -0
  524. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/scene.py +460 -33
  525. witwin_maxwell-0.4.0/witwin/maxwell/simulation.py +1956 -0
  526. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/sources.py +103 -45
  527. witwin_maxwell-0.4.0/witwin/maxwell/thin_wire.py +491 -0
  528. witwin_maxwell-0.4.0/witwin/maxwell/touchstone.py +918 -0
  529. witwin_maxwell-0.4.0/witwin/maxwell/waveforms.py +107 -0
  530. witwin_maxwell-0.4.0/witwin/maxwell/waveport_sweep.py +937 -0
  531. witwin_maxwell-0.2.0/.github/workflows/publish-witwin-maxwell.yml +0 -285
  532. witwin_maxwell-0.2.0/COPYING +0 -674
  533. witwin_maxwell-0.2.0/FEATURE_LIST.md +0 -358
  534. witwin_maxwell-0.2.0/PKG-INFO +0 -177
  535. witwin_maxwell-0.2.0/README.md +0 -159
  536. witwin_maxwell-0.2.0/assets/teapot.obj +0 -24238
  537. witwin_maxwell-0.2.0/benchmark/FDFD_PERFORMANCE.md +0 -13
  538. witwin_maxwell-0.2.0/benchmark/RESULTS.md +0 -60
  539. witwin_maxwell-0.2.0/benchmark/__init__.py +0 -3
  540. witwin_maxwell-0.2.0/benchmark/__main__.py +0 -5
  541. witwin_maxwell-0.2.0/benchmark/cache.py +0 -146
  542. witwin_maxwell-0.2.0/benchmark/fdfd_performance.py +0 -324
  543. witwin_maxwell-0.2.0/benchmark/metrics.py +0 -155
  544. witwin_maxwell-0.2.0/benchmark/models.py +0 -38
  545. witwin_maxwell-0.2.0/benchmark/paths.py +0 -36
  546. witwin_maxwell-0.2.0/benchmark/plotting.py +0 -449
  547. witwin_maxwell-0.2.0/benchmark/report.py +0 -141
  548. witwin_maxwell-0.2.0/benchmark/runner.py +0 -577
  549. witwin_maxwell-0.2.0/benchmark/scenes/__init__.py +0 -47
  550. witwin_maxwell-0.2.0/benchmark/scenes/_common.py +0 -76
  551. witwin_maxwell-0.2.0/benchmark/scenes/dipole/__init__.py +0 -21
  552. witwin_maxwell-0.2.0/benchmark/scenes/dipole/dipole_dielectric_box.py +0 -39
  553. witwin_maxwell-0.2.0/benchmark/scenes/dipole/dipole_dielectric_sphere.py +0 -40
  554. witwin_maxwell-0.2.0/benchmark/scenes/dipole/dipole_ey.py +0 -45
  555. witwin_maxwell-0.2.0/benchmark/scenes/dipole/dipole_offcenter.py +0 -45
  556. witwin_maxwell-0.2.0/benchmark/scenes/dipole/dipole_two_freq.py +0 -37
  557. witwin_maxwell-0.2.0/benchmark/scenes/dipole/dipole_vacuum.py +0 -48
  558. witwin_maxwell-0.2.0/benchmark/scenes/dipole/high_eps_box.py +0 -38
  559. witwin_maxwell-0.2.0/benchmark/scenes/dipole/lorentz_resonator.py +0 -45
  560. witwin_maxwell-0.2.0/benchmark/scenes/dipole/multi_dielectric.py +0 -39
  561. witwin_maxwell-0.2.0/benchmark/scenes/planewave/__init__.py +0 -13
  562. witwin_maxwell-0.2.0/benchmark/scenes/planewave/dielectric_slab.py +0 -44
  563. witwin_maxwell-0.2.0/benchmark/scenes/planewave/dielectric_sphere.py +0 -36
  564. witwin_maxwell-0.2.0/benchmark/scenes/planewave/metal_sphere.py +0 -52
  565. witwin_maxwell-0.2.0/benchmark/scenes/planewave/planewave_dielectric_sphere.py +0 -38
  566. witwin_maxwell-0.2.0/benchmark/scenes/planewave/planewave_vacuum.py +0 -37
  567. witwin_maxwell-0.2.0/benchmark/tidy3d_scene.py +0 -32
  568. witwin_maxwell-0.2.0/docs/dev/fdtd/native_cuda/kernel_mapping.md +0 -42
  569. witwin_maxwell-0.2.0/docs/dev/fdtd/native_cuda/parity_matrix.md +0 -31
  570. witwin_maxwell-0.2.0/docs/dev/fdtd/native_cuda/profiling_baseline.md +0 -173
  571. witwin_maxwell-0.2.0/docs/dev/grating-tfsf-bloch-pml-notes.md +0 -41
  572. witwin_maxwell-0.2.0/tests/api/adapters/tidy3d/test_tidy3d_adapter.py +0 -528
  573. witwin_maxwell-0.2.0/tests/assets/cube.obj +0 -15
  574. witwin_maxwell-0.2.0/tests/assets/teapot.obj +0 -599
  575. witwin_maxwell-0.2.0/tests/fdtd/cuda/test_cuda_adjoint_parity.py +0 -1275
  576. witwin_maxwell-0.2.0/tests/materials/compiler/test_material_compiler.py +0 -557
  577. witwin_maxwell-0.2.0/tests/validation/benchmark/test_benchmark_system.py +0 -591
  578. witwin_maxwell-0.2.0/tests/validation/benchmark/test_fdfd_performance.py +0 -27
  579. witwin_maxwell-0.2.0/tests/validation/physics/test_pec_conformal.py +0 -90
  580. witwin_maxwell-0.2.0/witwin/maxwell/__init__.py +0 -137
  581. witwin_maxwell-0.2.0/witwin/maxwell/adapters/tidy3d.py +0 -663
  582. witwin_maxwell-0.2.0/witwin/maxwell/adjoint_inputs.py +0 -66
  583. witwin_maxwell-0.2.0/witwin/maxwell/compiler/__init__.py +0 -11
  584. witwin_maxwell-0.2.0/witwin/maxwell/compiler/materials.py +0 -761
  585. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/__init__.py +0 -4
  586. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/adjoint/__init__.py +0 -22
  587. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/adjoint/bridge.py +0 -480
  588. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/adjoint/dispatch.py +0 -415
  589. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/adjoint/reference.py +0 -1003
  590. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/adjoint/reverse_common.py +0 -467
  591. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/adjoint/seeds.py +0 -479
  592. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/checkpoint.py +0 -175
  593. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/cuda/extension.cpp +0 -1235
  594. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/cuda/kernels/adjoint.cu +0 -3244
  595. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/cuda/kernels/common.cu +0 -63
  596. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/cuda/kernels/dispersive.cu +0 -475
  597. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/cuda/kernels/electric.cu +0 -2298
  598. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/cuda/kernels/magnetic.cu +0 -981
  599. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/cuda/launch.h +0 -16
  600. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/cuda/runtime/graph.py +0 -33
  601. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/cuda/runtime/parity.py +0 -9
  602. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/cuda/tensors.h +0 -22
  603. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/excitation/modes.py +0 -1380
  604. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/runtime/materials.py +0 -695
  605. witwin_maxwell-0.2.0/witwin/maxwell/fdtd/runtime/stepping.py +0 -1213
  606. witwin_maxwell-0.2.0/witwin/maxwell/media.py +0 -413
  607. witwin_maxwell-0.2.0/witwin/maxwell/ports.py +0 -101
  608. witwin_maxwell-0.2.0/witwin/maxwell/postprocess/scattering_parameters.py +0 -225
  609. witwin_maxwell-0.2.0/witwin/maxwell/result.py +0 -967
  610. witwin_maxwell-0.2.0/witwin/maxwell/simulation.py +0 -644
  611. {witwin_maxwell-0.2.0/docs → witwin_maxwell-0.4.0/scripts}/dev/fdtd/native_cuda/profile_scenario.py +0 -0
  612. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/TEST_LAYOUT.md +0 -0
  613. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/__init__.py +0 -0
  614. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/api/adapters/gds/test_gds_adapter.py +0 -0
  615. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/boundaries/absorbers/test_boundary_variants.py +0 -0
  616. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/boundaries/boundary_physics/test_fdtd_pec_material.py +0 -0
  617. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/conftest.py +0 -0
  618. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/core/geometry/test_mesh_geometry.py +0 -0
  619. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/core/grid/test_fdtd_coords.py +0 -0
  620. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/core/grid/test_nonuniform_placement.py +0 -0
  621. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/core/scene/test_scene.py +0 -0
  622. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdfd/test_ams.py +0 -0
  623. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdfd/test_direct_solver.py +0 -0
  624. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdfd/test_krylov.py +0 -0
  625. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdfd/test_matrix_cache.py +0 -0
  626. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdfd/test_preconditioners.py +0 -0
  627. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdfd/test_symmetric_formulation.py +0 -0
  628. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/cuda/_parity_backend.py +0 -0
  629. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/cuda/test_cuda_dispersive_parity.py +0 -0
  630. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/cuda/test_cuda_electric_boundary_parity.py +0 -0
  631. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/cuda/test_cuda_extension_load.py +0 -0
  632. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/cuda/test_cuda_sources_parity.py +0 -0
  633. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/cuda/test_cuda_spectral_observer_parity.py +0 -0
  634. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/test_cuda_graph.py +0 -0
  635. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/fdtd/test_fdtd_autoshutoff.py +0 -0
  636. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/gradients/README.md +0 -0
  637. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/gradients/__init__.py +0 -0
  638. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/gradients/test_fdfd_adjoint.py +0 -0
  639. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/materials/compiler/test_fdfd_material_support.py +0 -0
  640. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/materials/compiler/test_pec_material.py +0 -0
  641. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/materials/compiler/test_polarized_averaging.py +0 -0
  642. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/materials/compiler/test_polyslab.py +0 -0
  643. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/materials/compiler/test_subpixel_gradients.py +0 -0
  644. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/materials/compiler/test_subpixel_normals.py +0 -0
  645. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/materials/compiler/test_subpixel_spec.py +0 -0
  646. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/monitors/diffraction/test_diffraction_monitor.py +0 -0
  647. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/monitors/emission/test_dipole_emission_monitor.py +0 -0
  648. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/monitors/material/test_permittivity_monitor.py +0 -0
  649. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/monitors/time/test_fdtd_time_monitors.py +0 -0
  650. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/postprocess/directivity/test_directivity.py +0 -0
  651. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/postprocess/evaluation/test_fdtd_evaluation.py +0 -0
  652. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/sources/definitions/test_custom_source_time.py +0 -0
  653. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/sources/point/test_fdtd_source_normalization.py +0 -0
  654. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/validation/cross_solver/test_fdfd_vs_fdtd.py +0 -0
  655. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/tests/validation/physics/test_fdtd_boundary_tfsf_validation.py +0 -0
  656. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/adapters/__init__.py +0 -0
  657. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdfd/__init__.py +0 -0
  658. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdfd/adjoint/__init__.py +0 -0
  659. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdfd/ams.py +0 -0
  660. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdfd/krylov.py +0 -0
  661. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdfd/plotting.py +0 -0
  662. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdfd/postprocess.py +0 -0
  663. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/boundary/__init__.py +0 -0
  664. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/boundary/bloch.py +0 -0
  665. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/boundary/common.py +0 -0
  666. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/boundary/runtime.py +0 -0
  667. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/coords.py +0 -0
  668. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/cuda/__init__.py +0 -0
  669. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/cuda/runtime/__init__.py +0 -0
  670. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/cuda/runtime/dispatcher.py +0 -0
  671. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/dispersion.py +0 -0
  672. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/evaluation.py +0 -0
  673. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/io.py +0 -0
  674. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/meshing/__init__.py +0 -0
  675. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/plotting.py +0 -0
  676. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/postprocess.py +0 -0
  677. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/fdtd/runtime/module_cache.py +0 -0
  678. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/materials.py +0 -0
  679. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/postprocess/emission.py +0 -0
  680. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/visualization/__init__.py +0 -0
  681. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/visualization/interactive.py +0 -0
  682. {witwin_maxwell-0.2.0 → witwin_maxwell-0.4.0}/witwin/maxwell/visualization/plots.py +0 -0
@@ -0,0 +1,450 @@
1
+ name: Build and publish witwin-maxwell
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ - "codex/**"
8
+ tags:
9
+ - "witwin-maxwell-v*"
10
+ pull_request:
11
+ workflow_dispatch:
12
+
13
+ jobs:
14
+ validate_release:
15
+ name: Validate release
16
+ runs-on: ubuntu-latest
17
+ outputs:
18
+ package_dir: ${{ steps.package_dir.outputs.path }}
19
+
20
+ steps:
21
+ - name: Check out repository
22
+ uses: actions/checkout@v4
23
+
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.11"
28
+
29
+ - name: Resolve package directory
30
+ id: package_dir
31
+ shell: bash
32
+ run: |
33
+ if [ -f pyproject.toml ]; then
34
+ echo "path=." >> "$GITHUB_OUTPUT"
35
+ elif [ -f maxwell/pyproject.toml ]; then
36
+ echo "path=maxwell" >> "$GITHUB_OUTPUT"
37
+ else
38
+ echo "Unable to find pyproject.toml for the witwin-maxwell package." >&2
39
+ exit 1
40
+ fi
41
+
42
+ - name: Validate release tag and package version
43
+ if: startsWith(github.ref, 'refs/tags/witwin-maxwell-v')
44
+ shell: bash
45
+ env:
46
+ PACKAGE_DIR: ${{ steps.package_dir.outputs.path }}
47
+ RELEASE_TAG: ${{ github.ref_name }}
48
+ run: |
49
+ python - <<'PY'
50
+ import os
51
+ import re
52
+ import sys
53
+ import tomllib
54
+ from pathlib import Path
55
+
56
+ tag = os.environ["RELEASE_TAG"]
57
+ match = re.fullmatch(r"witwin-maxwell-v(?P<version>[0-9A-Za-z.+_-]+)", tag)
58
+ if match is None:
59
+ print(f"Release tag '{tag}' must match 'witwin-maxwell-v<version>'.", file=sys.stderr)
60
+ raise SystemExit(1)
61
+
62
+ expected_version = match.group("version")
63
+ pyproject_path = Path(os.environ["PACKAGE_DIR"]) / "pyproject.toml"
64
+ data = tomllib.loads(pyproject_path.read_text(encoding="utf-8"))
65
+
66
+ project = data["project"]
67
+ package_name = project["name"]
68
+ package_version = project["version"]
69
+
70
+ if package_name != "witwin-maxwell":
71
+ print(f"Expected package name 'witwin-maxwell', found '{package_name}'.", file=sys.stderr)
72
+ raise SystemExit(1)
73
+
74
+ if package_version != expected_version:
75
+ print(
76
+ f"Release tag version '{expected_version}' does not match pyproject version '{package_version}'.",
77
+ file=sys.stderr,
78
+ )
79
+ raise SystemExit(1)
80
+
81
+ print(f"Validated {package_name} {package_version} from {pyproject_path}.")
82
+ PY
83
+
84
+ build_cuda_wheels:
85
+ name: Build stable CUDA wheel / ${{ matrix.os }}
86
+ needs: validate_release
87
+ runs-on: ${{ matrix.os }}
88
+ strategy:
89
+ fail-fast: false
90
+ matrix:
91
+ os: [ubuntu-22.04, windows-2022]
92
+
93
+ steps:
94
+ - name: Check out repository
95
+ uses: actions/checkout@v4
96
+
97
+ - name: Set up Python
98
+ uses: actions/setup-python@v5
99
+ with:
100
+ python-version: "3.10"
101
+
102
+ - name: Free disk space (Linux)
103
+ if: runner.os == 'Linux'
104
+ shell: bash
105
+ run: |
106
+ echo "Disk before cleanup:"; df -h /
107
+ sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android \
108
+ /usr/local/share/boost /opt/hostedtoolcache/CodeQL \
109
+ /usr/local/share/powershell /usr/share/swift || true
110
+ sudo docker image prune --all --force || true
111
+ echo "Disk after cleanup:"; df -h /
112
+
113
+ - name: Install CUDA Toolkit
114
+ if: runner.os == 'Windows'
115
+ uses: Jimver/cuda-toolkit@v0.2.35
116
+ with:
117
+ cuda: "12.8.1"
118
+ method: local
119
+ log-file-suffix: "${{ runner.os }}-stable-abi"
120
+
121
+ - name: Set up MSVC
122
+ if: runner.os == 'Windows'
123
+ uses: ilammy/msvc-dev-cmd@v1
124
+ with:
125
+ arch: x64
126
+
127
+ - name: Export Windows CUDA_HOME
128
+ if: runner.os == 'Windows'
129
+ shell: pwsh
130
+ run: |
131
+ $cudaRoot = $env:CUDA_PATH
132
+ if (-not $cudaRoot) {
133
+ $nvcc = (Get-Command nvcc -ErrorAction Stop).Source
134
+ $cudaRoot = Split-Path (Split-Path $nvcc -Parent) -Parent
135
+ }
136
+ "CUDA_HOME=$cudaRoot" >> $env:GITHUB_ENV
137
+ "CUDA_PATH=$cudaRoot" >> $env:GITHUB_ENV
138
+ "CUDA_ROOT=$cudaRoot" >> $env:GITHUB_ENV
139
+ "CUDA_BIN_PATH=$cudaRoot" >> $env:GITHUB_ENV
140
+
141
+ - name: Show toolchain
142
+ if: runner.os == 'Windows'
143
+ shell: bash
144
+ run: |
145
+ python --version
146
+ nvcc --version
147
+ command -v cl || true
148
+
149
+ - name: Install CUDA extension build dependencies
150
+ run: |
151
+ python -m pip install --upgrade pip setuptools wheel ninja numpy
152
+ python -m pip install torch==2.10.0 --index-url https://download.pytorch.org/whl/cu128
153
+ python -m pip install build
154
+
155
+ - name: Build packaged stable FDTD CUDA extension
156
+ if: runner.os == 'Windows'
157
+ shell: bash
158
+ env:
159
+ MAX_JOBS: "2"
160
+ WITWIN_CUDA_GENCODE_ARCHES: "7.0;7.5;8.0;8.6;8.7;8.9;9.0;10.0;10.1;12.0+PTX"
161
+ PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
162
+ WITWIN_MAXWELL_FDTD_CUDA_BUILD_DIR: ${{ runner.temp }}/witwin_maxwell_fdtd_cuda/stable_abi_v1
163
+ run: |
164
+ python "$PACKAGE_DIR"/scripts/build_fdtd_cuda_prebuilt.py --verbose
165
+
166
+ - name: Build manylinux_2_28 wheel
167
+ if: runner.os == 'Linux'
168
+ uses: pypa/cibuildwheel@v3.3.0
169
+ env:
170
+ CIBW_BUILD: cp310-manylinux_x86_64
171
+ CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
172
+ CIBW_BEFORE_ALL_LINUX: >-
173
+ dnf install -y dnf-plugins-core gcc-toolset-12 &&
174
+ rpm --import https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/D42D0685.pub &&
175
+ dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64/cuda-rhel8.repo &&
176
+ dnf clean expire-cache &&
177
+ dnf install -y cuda-toolkit-12-8 &&
178
+ ln -sfn /usr/local/cuda-12.8 /usr/local/cuda &&
179
+ /usr/local/cuda/bin/nvcc --version
180
+ CIBW_ENVIRONMENT_LINUX: >-
181
+ CUDA_HOME=/usr/local/cuda
182
+ CUDA_PATH=/usr/local/cuda
183
+ CUDA_ROOT=/usr/local/cuda
184
+ CUDA_BIN_PATH=/usr/local/cuda
185
+ CUDACXX=/usr/local/cuda/bin/nvcc
186
+ CUDAHOSTCXX=/opt/rh/gcc-toolset-12/root/usr/bin/g++
187
+ PATH=/usr/local/cuda/bin:$PATH
188
+ LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
189
+ MAX_JOBS=2
190
+ WITWIN_CUDA_GENCODE_ARCHES="7.0;7.5;8.0;8.6;8.7;8.9;9.0;10.0;10.1;12.0+PTX"
191
+ CIBW_BEFORE_BUILD_LINUX: >-
192
+ pip install --upgrade pip setuptools wheel ninja numpy build &&
193
+ pip install torch==2.10.0 --index-url https://download.pytorch.org/whl/cu128 &&
194
+ python {project}/scripts/build_fdtd_cuda_prebuilt.py --verbose &&
195
+ python {project}/scripts/verify_cuda_binary_arches.py
196
+ --stem witwin_maxwell_fdtd_cuda
197
+ {project}/witwin/maxwell/fdtd/cuda/prebuilt
198
+ CIBW_REPAIR_WHEEL_COMMAND_LINUX: >-
199
+ auditwheel repair --plat manylinux_2_28_x86_64
200
+ --wheel-dir {dest_dir}
201
+ --exclude libc10.so --exclude libc10_cuda.so
202
+ --exclude libtorch.so --exclude libtorch_cpu.so
203
+ --exclude libtorch_cuda.so --exclude libtorch_python.so
204
+ --exclude libcudart.so.12 --exclude libcuda.so.1
205
+ {wheel}
206
+ with:
207
+ package-dir: ${{ needs.validate_release.outputs.package_dir }}
208
+ output-dir: ${{ needs.validate_release.outputs.package_dir }}/dist
209
+
210
+ - name: Verify compiled CUDA architectures
211
+ if: runner.os == 'Windows'
212
+ shell: bash
213
+ env:
214
+ PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
215
+ run: |
216
+ python "$PACKAGE_DIR"/scripts/verify_cuda_binary_arches.py \
217
+ --stem witwin_maxwell_fdtd_cuda \
218
+ "$PACKAGE_DIR"/witwin/maxwell/fdtd/cuda/prebuilt
219
+
220
+ - name: Build platform wheel
221
+ if: runner.os == 'Windows'
222
+ shell: bash
223
+ env:
224
+ PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
225
+ run: |
226
+ python -m build --wheel "$PACKAGE_DIR"
227
+
228
+ - name: Smoke install prebuilt wheel
229
+ shell: bash
230
+ env:
231
+ PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
232
+ WITWIN_MAXWELL_FDTD_CUDA_PREBUILT: "1"
233
+ WITWIN_MAXWELL_FDTD_CUDA_BUILD_DIR: ${{ runner.temp }}/missing_prebuilt_build_dir
234
+ run: |
235
+ python -m pip uninstall -y witwin-maxwell || true
236
+ python -m pip install --no-deps "$PACKAGE_DIR"/dist/*.whl
237
+ python - <<'PY'
238
+ import importlib.util
239
+ import os
240
+ import site
241
+ import zipfile
242
+ from pathlib import Path
243
+
244
+ wheel = next((Path(os.environ["PACKAGE_DIR"]) / "dist").glob("*.whl"))
245
+ names = zipfile.ZipFile(wheel).namelist()
246
+ native = [name for name in names if "witwin_maxwell_fdtd_cuda" in name and name.endswith((".so", ".pyd"))]
247
+ assert len(native) == 1, native
248
+ assert "/prebuilt/" in f"/{native[0]}"
249
+ assert "torch_" not in native[0]
250
+
251
+ candidates = []
252
+ for root in site.getsitepackages() + [site.getusersitepackages()]:
253
+ candidates.append(Path(root) / "witwin" / "maxwell" / "fdtd" / "cuda" / "build.py")
254
+ build_path = next((path for path in candidates if path.exists()), None)
255
+ assert build_path is not None, f"installed build.py not found in {candidates}"
256
+
257
+ spec = importlib.util.spec_from_file_location("witwin_maxwell_fdtd_cuda_build", build_path)
258
+ module = importlib.util.module_from_spec(spec)
259
+ spec.loader.exec_module(module)
260
+
261
+ path = module.prebuilt_extension_path()
262
+ assert path.exists(), f"missing packaged prebuilt extension: {path}"
263
+ assert path.parent.name == "prebuilt"
264
+ extension = module.build_extension()
265
+ print(f"Loaded packaged FDTD CUDA extension from {extension.__file__}")
266
+ PY
267
+
268
+ - name: Upload wheel artifact
269
+ uses: actions/upload-artifact@v4
270
+ with:
271
+ name: wheel-${{ matrix.os }}
272
+ path: ${{ needs.validate_release.outputs.package_dir }}/dist/*.whl
273
+ if-no-files-found: error
274
+
275
+ test_torch_compatibility:
276
+ name: Stable ABI / ${{ matrix.os }} / py${{ matrix.compatibility.python_version }} / torch${{ matrix.compatibility.torch_version }}
277
+ needs:
278
+ - validate_release
279
+ - build_cuda_wheels
280
+ runs-on: ${{ matrix.os }}
281
+ strategy:
282
+ fail-fast: false
283
+ matrix:
284
+ os: [ubuntu-22.04, windows-2022]
285
+ compatibility:
286
+ - {python_version: "3.10", torch_version: "2.10.0", cuda_index: "cu128"}
287
+ - {python_version: "3.11", torch_version: "2.10.0", cuda_index: "cu128"}
288
+ - {python_version: "3.12", torch_version: "2.10.0", cuda_index: "cu128"}
289
+ - {python_version: "3.13", torch_version: "2.10.0", cuda_index: "cu128"}
290
+ - {python_version: "3.14", torch_version: "2.10.0", cuda_index: "cu128"}
291
+ - {python_version: "3.14", torch_version: "2.11.0", cuda_index: "cu128"}
292
+ - {python_version: "3.14", torch_version: "2.12.0", cuda_index: "cu126"}
293
+ - {python_version: "3.14", torch_version: "2.13.0", cuda_index: "cu126"}
294
+
295
+ steps:
296
+ - name: Set up Python
297
+ uses: actions/setup-python@v5
298
+ with:
299
+ python-version: ${{ matrix.compatibility.python_version }}
300
+
301
+ - name: Download stable wheel
302
+ uses: actions/download-artifact@v4
303
+ with:
304
+ name: wheel-${{ matrix.os }}
305
+ path: dist
306
+
307
+ - name: Install compatibility environment
308
+ shell: bash
309
+ run: |
310
+ python -m pip install --upgrade pip
311
+ python -m pip install --no-cache-dir "torch==${{ matrix.compatibility.torch_version }}" \
312
+ --index-url "https://download.pytorch.org/whl/${{ matrix.compatibility.cuda_index }}"
313
+ python -m pip install --no-deps dist/*.whl
314
+
315
+ - name: Load the same stable binary
316
+ shell: bash
317
+ env:
318
+ EXPECTED_TORCH: ${{ matrix.compatibility.torch_version }}
319
+ WITWIN_MAXWELL_FDTD_CUDA_PREBUILT: "1"
320
+ WITWIN_MAXWELL_FDTD_CUDA_BUILD_DIR: ${{ runner.temp }}/must-not-jit-build
321
+ run: |
322
+ python - <<'PY'
323
+ import importlib.util
324
+ import os
325
+ import site
326
+ from pathlib import Path
327
+
328
+ import torch
329
+
330
+ assert torch.__version__.split("+", 1)[0] == os.environ["EXPECTED_TORCH"]
331
+ candidates = [
332
+ Path(root) / "witwin" / "maxwell" / "fdtd" / "cuda" / "build.py"
333
+ for root in site.getsitepackages() + [site.getusersitepackages()]
334
+ ]
335
+ build_path = next((path for path in candidates if path.exists()), None)
336
+ assert build_path is not None, candidates
337
+ spec = importlib.util.spec_from_file_location("witwin_maxwell_fdtd_cuda_build", build_path)
338
+ module = importlib.util.module_from_spec(spec)
339
+ spec.loader.exec_module(module)
340
+
341
+ native_path = module.prebuilt_extension_path()
342
+ assert native_path.exists(), native_path
343
+ extension = module.build_extension()
344
+ assert Path(extension.__file__).resolve() == native_path.resolve()
345
+ assert extension.update_magnetic_hx_standard is not None
346
+ print(f"Loaded {native_path.name} with torch {torch.__version__} on Python {os.sys.version.split()[0]}")
347
+ PY
348
+
349
+ build_sdist:
350
+ name: Build source distribution
351
+ needs: validate_release
352
+ runs-on: ubuntu-latest
353
+
354
+ steps:
355
+ - name: Check out repository
356
+ uses: actions/checkout@v4
357
+
358
+ - name: Set up Python
359
+ uses: actions/setup-python@v5
360
+ with:
361
+ python-version: "3.11"
362
+
363
+ - name: Build distributions
364
+ shell: bash
365
+ env:
366
+ PACKAGE_DIR: ${{ needs.validate_release.outputs.package_dir }}
367
+ run: |
368
+ python -m pip install --upgrade pip build
369
+ python -m build --sdist "$PACKAGE_DIR"
370
+
371
+ - name: Upload source distribution artifact
372
+ uses: actions/upload-artifact@v4
373
+ with:
374
+ name: sdist
375
+ path: ${{ needs.validate_release.outputs.package_dir }}/dist/*.tar.gz
376
+ if-no-files-found: error
377
+
378
+ publish:
379
+ name: Publish to PyPI
380
+ if: startsWith(github.ref, 'refs/tags/witwin-maxwell-v')
381
+ needs:
382
+ - build_cuda_wheels
383
+ - test_torch_compatibility
384
+ - build_sdist
385
+ runs-on: ubuntu-latest
386
+ permissions:
387
+ contents: read
388
+ id-token: write
389
+ environment:
390
+ name: pypi
391
+ url: https://pypi.org/project/witwin-maxwell/
392
+
393
+ steps:
394
+ - name: Download wheel artifacts
395
+ uses: actions/download-artifact@v4
396
+ with:
397
+ pattern: wheel-*
398
+ path: dist
399
+ merge-multiple: true
400
+
401
+ - name: Download source distribution artifact
402
+ uses: actions/download-artifact@v4
403
+ with:
404
+ name: sdist
405
+ path: dist
406
+
407
+ - name: Publish distributions to PyPI
408
+ uses: pypa/gh-action-pypi-publish@release/v1
409
+ with:
410
+ packages-dir: dist
411
+ skip-existing: true
412
+
413
+ create_release:
414
+ name: Create release
415
+ if: startsWith(github.ref, 'refs/tags/witwin-maxwell-v')
416
+ needs: publish
417
+ runs-on: ubuntu-latest
418
+ permissions:
419
+ contents: write
420
+
421
+ steps:
422
+ - name: Check out repository
423
+ uses: actions/checkout@v4
424
+
425
+ - name: Download wheel artifacts
426
+ uses: actions/download-artifact@v4
427
+ with:
428
+ pattern: wheel-*
429
+ path: dist
430
+ merge-multiple: true
431
+
432
+ - name: Download source distribution artifact
433
+ uses: actions/download-artifact@v4
434
+ with:
435
+ name: sdist
436
+ path: dist
437
+
438
+ - name: Create release with distribution artifacts
439
+ shell: bash
440
+ env:
441
+ GH_TOKEN: ${{ github.token }}
442
+ run: |
443
+ version="${GITHUB_REF_NAME#witwin-maxwell-v}"
444
+ notes="docs/reference/release-notes-${version}.md"
445
+ test -f "$notes"
446
+ gh release create "$GITHUB_REF_NAME" \
447
+ --verify-tag \
448
+ --title "witwin-maxwell ${version}" \
449
+ --notes-file "$notes" \
450
+ dist/*
@@ -10,6 +10,7 @@ __pycache__/
10
10
  # Distribution / packaging
11
11
  .Python
12
12
  build/
13
+ .build/
13
14
  develop-eggs/
14
15
  dist/
15
16
  downloads/
@@ -54,6 +55,7 @@ coverage.xml
54
55
  *.py.cover
55
56
  .hypothesis/
56
57
  .pytest_cache/
58
+ .pytest_tmp/
57
59
  cover/
58
60
 
59
61
  # Translations
@@ -171,12 +173,8 @@ venv.bak/
171
173
 
172
174
  # mkdocs documentation
173
175
  /site
174
- .slangtorch_cache/
175
- .*_runtime_*.slang
176
176
  witwin/maxwell/fdtd/cuda/prebuilt/*.pyd
177
177
  witwin/maxwell/fdtd/cuda/prebuilt/*.so
178
- .fdtd_runtime_*.slang
179
- .adjoint_kernels_runtime_*.slang
180
178
  *.png
181
179
  *.npy
182
180
  *.npz
@@ -231,3 +229,17 @@ __marimo__/
231
229
 
232
230
  # Streamlit
233
231
  .streamlit/secrets.toml
232
+
233
+ # Repository-local development content and build artifacts
234
+ .bench_tmp/
235
+ docs/
236
+ assets/
237
+ benchmark/
238
+
239
+ # Repository-local agent and test scratch directories
240
+ .codex_tmp/
241
+ .codex-tmp/
242
+ .test-tmp/
243
+ .tmp/
244
+ experiments/
245
+ .worktrees/
@@ -0,0 +1,161 @@
1
+ # Repository Agent Guide
2
+
3
+ This document defines the working rules for coding agents in this repository. Keep `AGENTS.md` and `CLAUDE.md` identical.
4
+
5
+ ## Core Rules
6
+
7
+ - Use the `maxwell` conda environment for all Python commands, tests, and scripts.
8
+ - Keep the codebase clean. Do not preserve legacy code, compatibility shims, or backward-support paths unless explicitly requested.
9
+ - Write all code comments and commit messages in English.
10
+ - Never add AI or agent attribution to git history. Commit messages must not contain
11
+ `Co-Authored-By` trailers naming an assistant, `Claude-Session` or similar session
12
+ links, or "generated with" banners, and the author/committer identity is always the
13
+ human owner. This applies to commits, tags, PR titles and PR bodies.
14
+ - Keep third-party commercial product, service, and solver names out of commit messages, branch names, PR titles, general development documents, comments, and feature descriptions. Describe the behavior with neutral terms such as `external reference solver`, `reference backend`, or `third-party adapter` so commercial brands do not spread through the repository or GitHub history.
15
+ - Use an exact commercial product name only where technically required for an interoperability API, adapter module, executable command, dependency declaration, legal attribution, or a narrowly scoped adapter test/document. Do not repeat that name in unrelated implementation, validation, or numerical-method changes unless the user explicitly requests it.
16
+ - Maintain `FEATURE_LIST.md` as the user-facing feature inventory. Every new user-visible feature, public API capability, or meaningful workflow addition must update that file in the same change.
17
+ - Store active development documents by type under `docs/plans/`, `docs/memory/`, `docs/assessments/`, and `docs/reference/`. Keep solver and feature areas together in each type directory; use descriptive filenames instead of extra `fdtd`, `fdfd`, or similar directory layers. Move completed or superseded development documents to the matching type under `docs/archive/`. Keep `FEATURE_LIST.md` at the repository root as the user-facing feature inventory.
18
+ - Prioritize correctness and efficiency over convenience.
19
+ - Core computation is GPU-first. Minimize GPU-CPU transfers and do not introduce new CPU fallback paths unless explicitly requested.
20
+ - PyTorch-native integration is a hard requirement. New differentiable or optimization-facing APIs must be designed as native PyTorch workflows, not thin wrappers around non-PyTorch side paths.
21
+ - The stable public architecture is `Scene + Simulation + Result`. New user-facing code must follow this model.
22
+ - `Scene` must support both direct declarative construction (`mw.Scene(...)`) and a PyTorch-native module-style scene definition that ultimately materializes into the same public `Scene` object model.
23
+ - Do not reintroduce old public convenience paths such as `Scene.set_*`, `Scene.with_*`, `mw.FDFD`, or `mw.FDTD`.
24
+ - Preserve the compile-layer naming convention: scene-facing helpers use `compile_*` names such as `Scene.compile_materials(...)`, `Scene.compile_relative_materials(...)`, and `Scene.compile_material_tensors(...)`.
25
+ - Shared core geometry constructors default to `device=None`; `Scene(...)` owns device placement and defaults to CUDA.
26
+
27
+ ## Project Overview
28
+
29
+ This repository is a PyTorch-native differentiable full-wave electromagnetic simulation framework for Maxwell's equations with two internal solver runtimes:
30
+
31
+ - `FDFD`: frequency-domain finite-difference solver using sparse linear algebra.
32
+ - `FDTD`: time-domain Yee-grid solver with native CUDA kernels, CPML support, and differentiable adjoint workflows.
33
+
34
+ The public API is declarative:
35
+
36
+ - `Scene`: physical problem definition
37
+ - `Simulation`: execution configuration and backend selection
38
+ - `Result`: fields, monitors, metadata, plotting, and persistence
39
+
40
+ For differentiable and optimization workflows, the public API must also remain PyTorch-native:
41
+
42
+ - trainable scene definitions may be implemented as `torch.nn.Module` via `SceneModule`
43
+ - module-style scenes must compile or materialize to the same `Scene` public contract
44
+ - solver entry remains `Scene -> Simulation -> Result`, even when the `Scene` is produced by a PyTorch module
45
+
46
+ Supporting first-class Maxwell scene objects include:
47
+
48
+ - `Domain`
49
+ - `GridSpec`
50
+ - `BoundarySpec`
51
+ - `BoundaryKind`
52
+ - `MaterialRegion`
53
+ - `Structure`
54
+ - `Material`
55
+ - `PointDipole`
56
+ - `PlaneWave`
57
+ - `GaussianBeam`
58
+ - `ModeSource`
59
+ - `PointMonitor`
60
+ - `PlaneMonitor`
61
+ - `FluxMonitor`
62
+ - `ModeMonitor`
63
+ - `ModePort`
64
+
65
+ The current codebase is organized as a Python package under `witwin/maxwell/`, with tests under `tests/`. Shared geometry and structure primitives are re-exported through `witwin.maxwell` but originate from the shared `witwin.core` dependency.
66
+
67
+ ## Repository Layout
68
+
69
+ - `witwin/maxwell/__init__.py`: public package exports.
70
+ - `witwin/maxwell/scene.py`: declarative scene model, domain/grid/boundary handling, `MaterialRegion`, and `SceneModule`.
71
+ - `witwin/maxwell/media.py`: public Maxwell material models, dispersion poles, and diagonal anisotropy descriptors.
72
+ - `witwin/maxwell/sources.py`: public source definitions and source-time waveforms.
73
+ - `witwin/maxwell/monitors.py`: point, plane, flux, and modal monitors.
74
+ - `witwin/maxwell/ports.py`: first-class modal port definitions.
75
+ - `witwin/maxwell/simulation.py`: public simulation entrypoint, runtime preparation, and backend dispatch.
76
+ - `witwin/maxwell/result.py`: unified simulation result container.
77
+ - `witwin/maxwell/compiler/`: scene compilers for materials, sources, ports, and monitors.
78
+ - `witwin/maxwell/fdfd/`: internal FDFD runtime and postprocessing helpers.
79
+ - `witwin/maxwell/fdtd/`: internal FDTD runtime, CPML logic, source injection, observers, and adjoint support.
80
+ - `witwin/maxwell/postprocess/`: near/far-field, directivity, RCS, scattering-parameter, and modal postprocessing.
81
+ - `witwin/maxwell/adapters/`: interoperability adapters such as Tidy3D export.
82
+ - `witwin/maxwell/visualization/`: shared visualization utilities.
83
+ - `docs/plans/`: active implementation plans and functional roadmaps.
84
+ - `docs/memory/`: current implementation notes and durable engineering context.
85
+ - `docs/assessments/`: current audits and capability assessments.
86
+ - `docs/reference/`: maintained technical reference material.
87
+ - `docs/archive/`: completed or superseded plans, assessments, design records, and status snapshots.
88
+ - `tests/`: pytest-based coverage for public API behavior, numerics, gradients, and validation workflows.
89
+
90
+ ## Working Expectations
91
+
92
+ - Prefer package-style imports from `witwin.maxwell`, typically `import witwin.maxwell as mw`.
93
+ - New public examples, tests, and scripts should look like `Scene -> Simulation -> Result`, not direct backend construction.
94
+ - Build scenes with `Domain`, `GridSpec`, `BoundarySpec`, `Structure`, `Material`, source objects, monitor objects, `ModePort`, and `MaterialRegion` as appropriate.
95
+ - Use the declarative `BoundaryKind` / `BoundarySpec` vocabulary consistently; do not introduce new raw boundary-mode strings outside validated APIs.
96
+ - Use `Scene.add_structure(...)`, `Scene.add_source(...)`, `Scene.add_monitor(...)`, `Scene.add_port(...)`, and `Scene.add_material_region(...)` for scene assembly.
97
+ - For PyTorch-native scene definitions, prefer `SceneModule` subclasses that expose `to_scene()` and return a standard `Scene`; do not create a second incompatible simulation entrypoint.
98
+ - When behavior changes in a way a user would notice, update `FEATURE_LIST.md` to keep the documented feature inventory current.
99
+ - If backend internals must be inspected, prefer `Simulation.prepare()` and then inspect `prepared.solver` rather than importing or constructing backend classes through the public path.
100
+ - Keep new implementations aligned with the current declarative 3D API and compiler/runtime split.
101
+ - If a design choice would add extra abstraction, data copies, or compatibility branches, prefer the simpler and faster path.
102
+ - When changing numerics, preserve Yee-grid consistency, PML behavior, Bloch/periodic boundary semantics, and GPU execution flow.
103
+ - Avoid adding duplicate implementations in parallel files. Update the primary module instead.
104
+
105
+ ## Running Code
106
+
107
+ Activate the environment first:
108
+
109
+ ```bash
110
+ conda activate maxwell
111
+ ```
112
+
113
+ Common commands:
114
+
115
+ ```bash
116
+ python -m pytest tests
117
+ python -m pytest tests/api/public/test_public_api.py tests/api/public/test_simulation_smoke.py
118
+ python -m pytest tests/core/scene/test_scene.py tests/materials/compiler/test_material_compiler.py
119
+ python -m pytest tests/boundaries/cpml/test_fdtd_cpml.py tests/monitors/observers/test_fdtd_observers.py
120
+ python -m pytest tests/gradients/test_fdtd_adjoint_bridge.py
121
+ python -m pytest tests/validation/benchmark/test_benchmark_system.py
122
+ python -m benchmark
123
+ python -m benchmark dipole_vacuum
124
+ python -m benchmark planewave_vacuum
125
+ ```
126
+
127
+ Benchmark / validation workflow:
128
+
129
+ - Use `python -m benchmark` as the unified Maxwell-vs-Tidy3D validation entrypoint.
130
+ - Scenario definitions live under `benchmark/scenes/`, grouped by family under directories such as `dipole/` and `planewave/`.
131
+ - Tidy3D reference caches are stored under `benchmark/cache/`.
132
+ - Generated comparison plots are stored under `benchmark/plots/`.
133
+ - Benchmark metrics are aggregated into `benchmark/RESULTS.md` and should be updated by rerunning the benchmark command after benchmark-related changes.
134
+
135
+ If you add or modify Python code, prefer validating with targeted pytest coverage first, then broader tests if needed.
136
+
137
+ ## Windows / Codex Execution Notes
138
+
139
+ - In this environment, `rg` may exist but fail with `Access is denied`. If that happens, switch immediately to PowerShell-native search with `Get-ChildItem` + `Select-String` instead of retrying `rg`.
140
+ - `conda run -n maxwell` may fail to pass stdin through to `python -` reliably in this Codex/PowerShell setup. Prefer `conda run -n maxwell python -c ...` for short snippets, or invoke the environment interpreter directly with `C:\Users\Asixa\miniconda3\envs\maxwell\python.exe`.
141
+ - Windows command-line length limits are easy to hit with `python -c` and large inline scripts. For long scripts, pass the code through an environment variable such as `PYCODE` and execute `python -c "import os; exec(os.environ['PYCODE'])"`, or use the environment interpreter with stdin if that path is reliable.
142
+ - Large single-shot `apply_patch` updates can also hit Windows path/command length limits. If a full-file replacement fails for size reasons, rewrite it in smaller patch chunks instead of retrying the same oversized patch.
143
+ - When checking whether `AGENTS.md` and `CLAUDE.md` match, do not use bare `fc` in PowerShell because it resolves to `Format-Custom`. Call `fc.exe` explicitly if you want the file-compare tool.
144
+
145
+ ## Dependencies
146
+
147
+ Primary dependencies include:
148
+
149
+ - PyTorch
150
+ - NumPy
151
+ - SciPy
152
+ - Matplotlib
153
+ - tqdm
154
+ - CuPy
155
+ - witwin
156
+
157
+ Optional dependencies:
158
+
159
+ - `tidy3d` for adapter export and benchmark cross-validation workflows
160
+
161
+ An NVIDIA GPU with CUDA is expected for core solver workflows.